From 3135e80085b285bdcafd667076188a3eb51d32f8 Mon Sep 17 00:00:00 2001 From: QQ Date: Sun, 22 Nov 2026 19:40:33 +0800 Subject: [PATCH] feat: drop reading view, keep chat enhancements and approval-shortcut settings - remove reader tab, text-transform service and official reader slots - keep a chat-only Better Chat settings section for approval shortcut recording - rebuild lib/client.js (1.47MB -> ~53KB) --- lib/client.js | 52559 +------------------------------ lib/client.js.map | 2 +- src/client/SettingsSection.tsx | 17 +- src/client/index.tsx | 19 +- src/client/settings.tsx | 2 +- 5 files changed, 112 insertions(+), 52487 deletions(-) diff --git a/lib/client.js b/lib/client.js index 7552fef..0af8e18 100644 --- a/lib/client.js +++ b/lib/client.js @@ -4,20 +4,8 @@ window.__ModuleLoader__.load({ var module = { exports: {} }; var exports = module.exports; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); - // \0rolldown/runtime.js - var __defProp = Object.defineProperty; - var __exportAll = (all, flags) => { - let target = Object.setPrototypeOf({}, null); - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" }); - return flags & 2 ? target : Object.preventExtensions(target); - }; let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store"); let react = require("react"); - let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives"); let react_jsx_runtime = require("react/jsx-runtime"); // src/client/chat/bindings.ts /** 「始终允许」的默认键帽;单列出来,展开时不会沾上 `null` 带来的可选键。 */ @@ -857,52213 +845,6 @@ window.__ModuleLoader__.load({ childCtx.effect(() => installStoreUpdateButtons(document, () => childCtx.remote), "dsh-better-chat: store update buttons"); } }; - // node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js - /** - * The `dsh-resource://file/…` address grammar: how a file is named across the - * Sidebar and the resource model, built and parsed without touching a - * filesystem. - * @module - */ - /** The scheme and type every file address opens with. */ - const FILE_ADDRESS_PREFIX = "dsh-resource://file/"; - /** Component-encode one id or path segment, keeping `:` literal for drive letters. */ - function encodeSegment$1(segment) { - return encodeURIComponent(segment).replace(/%3A/gi, ":"); - } - /** Encode a `/`-separated path segment by segment. */ - function encodePath$1(path) { - return path.split("/").map(encodeSegment$1).join("/"); - } - /** - * Build the address of a file read through one Session. - * @param sessionId - the Session whose Host workspace resolves the path. - * @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped. - * @returns the `dsh-resource://file/session//` address. - */ - function sessionFileAddress(sessionId, path) { - const normalized = path.replace(/\\/g, "/").replace(/^(?:\.\/)+/, ""); - return `${FILE_ADDRESS_PREFIX}session/${encodeSegment$1(sessionId)}/${encodePath$1(normalized)}`; - } - /** - * Browser-safe Workspace path and display helpers. - * @module @deepseek-ai/dsh-util-workspace-path - */ - /** Whether a path uses a Windows drive or UNC prefix. */ - function isWindowsStylePath(value) { - return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\"); - } - /** - * Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC. - * @param path - the path to classify. - * @returns `true` for an absolute path; `false` for a Workspace-relative one. - */ - function isAbsoluteWorkspacePath$1(path) { - return path.startsWith("/") || isWindowsStylePath(path); - } - /** - * Resolve a Workspace-relative path into the Host-facing spelling used by path operations. - * @param cwd - Session Workspace root, when known. - * @param path - Absolute or Workspace-relative path. - * @returns an absolute path when a Workspace root is available, otherwise the original path. - */ - function resolveWorkspacePath(cwd, path) { - if (isAbsoluteWorkspacePath$1(path)) return path; - if (cwd === void 0 || cwd === "") return path; - const separator = isWindowsStylePath(cwd) && cwd.includes("\\") ? "\\" : "/"; - return `${cwd.replace(/[/\\]+$/, "")}${separator}${path.replace(/^[/\\]+/, "")}`; - } - /** - * Abbreviate a POSIX home directory for display. - * @param path - Absolute or already-short display path. - * @param home - Host account home; absent skips abbreviation. - * @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`. - */ - function abbreviateHomePath(path, home) { - if (home === void 0 || home === "") return path; - if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path; - const root = home.replace(/\/+$/, ""); - if (root === "" || root === "/") return path; - if (path.replace(/\/+$/, "") === root) return "~"; - if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`; - return path; - } - /** - * The address for a path as a caller holds it: a relative path, or an absolute - * path inside the Session's workspace, becomes a `session`-scoped address; an - * absolute path outside it, or one whose workspace root is unknown, keeps its - * absolute path in that Session's address. - * @param sessionId - the Session the path is read in. - * @param cwd - that Session's workspace root, when known. - * @param path - absolute or workspace-relative path, in either separator spelling. - * @returns the `dsh-resource://file/…` address. - */ - function fileAddressFor$1(sessionId, cwd, path) { - const normalized = path.replace(/\\/g, "/"); - if (!isAbsoluteWorkspacePath$1(normalized)) return sessionFileAddress(sessionId, normalized); - const root = cwd === void 0 ? "" : cwd.replace(/\\/g, "/").replace(/\/+$/, ""); - if (root !== "" && normalized === root) return sessionFileAddress(sessionId, ""); - if (root !== "" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1)); - return sessionFileAddress(sessionId, normalized); - } - // src/client/rewind-cut.ts - function asRecord$1(value) { - return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0; - } - function safeSeq(value) { - return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0; - } - /** The command payload of a `command` chat node, when it is structurally readable. */ - function commandOf(node) { - if (node.kind !== "command") return void 0; - return asRecord$1(node.data); - } - /** - * The engine names an executed rewind command node can carry. The plugin - * registers its command as `rewind-plugin` (`ENGINE_COMMANDS = new - * Set(['rewind-plugin', 'rewind'])` in dsh-rewind-plugin's - * `src/client/hidden.ts`), and that is the name the client projection actually - * publishes — the session log's `command/run.name` is not what the Reader sees. - * `rewind` stays accepted because older logs and the bili-side proxy record the - * shorter spelling. - */ - const REWIND_COMMANDS = /* @__PURE__ */ new Set(["rewind-plugin", "rewind"]); - /** True when a command payload is the rewind engine command, in either spelling. */ - function isRewindCommand(command) { - return typeof command.name === "string" && REWIND_COMMANDS.has(command.name); - } - /** - * The render POSITION a row is anchored at: the view node's `anchorSeq`, else - * its payload seq. - * - * This is deliberately NOT integer-only. The host anchors synthetic rows at - * fractional offsets off a real seq (`CHAT_SYNTHETIC_SEQ_OFFSETS` in the - * official ChatView: `turn-process` at `controlAnchorSeq - 0.1`, `turn-tail` at - * `seq + 0.1`, an interrupted assistant step at `seq - 0.9`). An integer-only - * read made those rows invisible to the cut, so the last `turn-process` of a - * withdrawn turn survived on its own. Log seqs (marker, target) stay integer: - * see `safeSeq`. - */ - function anchorSeqOf(node) { - const raw = node.anchorSeq ?? asRecord$1(node.data)?.seq; - return typeof raw === "number" && Number.isFinite(raw) && raw >= 0 ? raw : void 0; - } - /** - * Extract the rewind target seq from a `/rewind` command's structured `args` - * (e.g. `@5 chat`, `preview @5 both`). Locale-independent: it never parses the - * host's human outcome copy. - */ - function rewindTargetOfArgs(args) { - if (typeof args !== "string") return void 0; - const match = args.match(/@(\d+)/); - return match === null ? void 0 : Number(match[1]); - } - /** True for the internal candidate-list probe (`/rewind __candidates`). */ - function isCandidateCommand(command) { - return typeof command.args === "string" && command.args.includes("__candidates"); - } - /** True for an impact preview (`/rewind preview @5 both`). */ - function isPreviewCommand(command) { - return typeof command.args === "string" && command.args.includes("preview"); - } - /** - * Merge overlapping or touching shadow ranges. - * - * Spans are kept SEPARATE unless they genuinely overlap: collapsing every cut - * to `[min target, max marker]` would hide a still-on-surface gap of new traffic - * between an earlier marker and a later target. - */ - function coalesceCutSpans(spans) { - if (spans.length < 2) return [...spans]; - const sorted = [...spans].sort((left, right) => left.start - right.start || left.end - right.end); - const merged = []; - for (const span of sorted) { - const last = merged.at(-1); - if (last !== void 0 && span.start <= last.end) { - if (span.end > last.end) last.end = span.end; - continue; - } - merged.push({ - start: span.start, - end: span.end - }); - } - return merged; - } - /** - * True when a row anchored at `seq` falls inside one of the cut spans. - * - * A cut runs from the target seq through the marker's own log seq, inclusive - * (`target <= anchorSeq && anchorSeq <= marker`), the same comparison - * `dsh-rewind-plugin`'s `RewindVisibilityBuilder` uses. The upper bound stops - * at the marker. Extending it to the next integer hides the following turn's - * process row, which the host anchors at `startSeq - 0.1` and therefore in - * `[marker, marker + 1)`. Fractional anchors inside the closed range still - * match: `anchorSeqOf` keeps them. A process or tail row parked outside the - * range is handled by `summaryTurns`, not by widening the cut. Spans stay - * disjoint, so new traffic between two rewinds survives. - */ - function cutContains(cuts, seq) { - let low = 0; - let high = cuts.length - 1; - let found = -1; - while (low <= high) { - const middle = low + high >> 1; - const cut = cuts[middle]; - if (cut === void 0) return false; - if (seq < cut.start) high = middle - 1; - else { - found = middle; - low = middle + 1; - } - } - const span = found < 0 ? void 0 : cuts[found]; - return span !== void 0 && seq <= span.end; - } - /** The turn id a node belongs to (absent outside a turn). */ - function turnIdOf(node) { - const turn = asRecord$1(asRecord$1(node.location)?.turn); - if (turn === void 0 || !Object.hasOwn(turn, "turn")) return void 0; - return turn.turn; - } - /** - * Node kinds that SUMMARIZE a turn instead of carrying its content, so the host - * anchors them at the turn's edges rather than at an event inside it. - */ - const TURN_SUMMARY_KINDS = /* @__PURE__ */ new Set(["turn-process", "turn-tail"]); - /** - * True for a rewind command row the transcript should not keep. - * - * Probes (`preview`, `__candidates`) exist only to feed the popover. An - * executed rewind — success plus a marker seq — is the command that performed - * the cut, and the plugin hides that row even when its anchor sits outside - * the numeric range. A failed or still-running command stays visible. - */ - function commandHidden(node) { - const command = commandOf(node); - if (command === void 0 || !isRewindCommand(command)) return false; - if (isPreviewCommand(command) || isCandidateCommand(command)) return true; - const outcome = asRecord$1(command.outcome); - return outcome?.kind === "success" && safeSeq(outcome.sourceEventSeq) !== void 0; - } - /** True when the row's own anchor falls in a cut, or the row is a rewind command to hide. */ - function anchorWithdrawn(node, cuts) { - if (commandHidden(node)) return true; - const seq = anchorSeqOf(node); - return seq !== void 0 && cutContains(cuts, seq); - } - /** - * Turns whose process and tail rows must leave. - * - * The host opens a turn before its user message is logged and anchors - * `turn-process` at `controlAnchorSeq - 0.1`, below the first withdrawn - * event, and `turn-tail` at `turn.end.seq + 0.1`, which can sit past the - * marker. Containment therefore misses those two rows, and the transcript - * kept announcing `执行过程 / 本轮已停止,已生成的内容仍保留。` - * - * A summary leaves only when every content row of its turn is already - * withdrawn — the same rule as the plugin's `deriveTurnProcess`. One content - * row before the target (a mid-turn steering rewind) keeps the summary and - * that earlier message. A turn with no content rows is left alone. - */ - function summaryTurns(chat, cuts) { - const stays = /* @__PURE__ */ new Map(); - for (const key of chat.order) { - const node = chat.nodes.get(key); - if (node === void 0 || TURN_SUMMARY_KINDS.has(node.kind ?? "")) continue; - const id = turnIdOf(node); - if (id === void 0) continue; - const visible = node.visibility !== "hidden" && !anchorWithdrawn(node, cuts); - stays.set(id, (stays.get(id) ?? false) || visible); - } - const withdrawn = /* @__PURE__ */ new Set(); - for (const [id, visible] of stays) if (!visible) withdrawn.add(id); - return withdrawn; - } - /** True when this row is a summary of a turn whose content is fully withdrawn. */ - function summaryWithdrawn(node, summaries) { - if (!TURN_SUMMARY_KINDS.has(node.kind ?? "")) return false; - const id = turnIdOf(node); - return id !== void 0 && summaries.has(id); - } - /** - * The shadow ranges a session's executed rewinds produced, newest state last. - * An executed rewind cuts `[target, marker]` — the target itself is included, - * because a rewind restores the state *before* that message was sent (its text - * goes back to the composer). - */ - function rewindCutSpans(chat) { - if (chat === void 0) return []; - const spans = []; - for (const key of chat.order) { - const node = chat.nodes.get(key); - if (node === void 0) continue; - const command = commandOf(node); - if (command === void 0 || !isRewindCommand(command)) continue; - if (isPreviewCommand(command) || isCandidateCommand(command)) continue; - const outcome = asRecord$1(command.outcome); - if (outcome?.kind !== "success") continue; - const marker = safeSeq(outcome.sourceEventSeq); - if (marker === void 0) continue; - const target = rewindTargetOfArgs(command.args); - if (target === void 0 || target > marker) continue; - spans.push({ - start: target, - end: marker - }); - } - return coalesceCutSpans(spans); - } - /** - * The chat keys the Reader should render, in snapshot order: withdrawn rows and - * rows the host itself marked hidden are dropped, everything else keeps its - * position. Returns the snapshot's own `order` array when nothing is filtered, - * so React selectors see a stable reference. - */ - function visibleChatKeys(chat) { - const cuts = rewindCutSpans(chat); - const summaries = summaryTurns(chat, cuts); - const visible = []; - for (const key of chat.order) { - const node = chat.nodes.get(key); - if (node === void 0) continue; - if (node.visibility === "hidden") continue; - if (anchorWithdrawn(node, cuts) || summaryWithdrawn(node, summaries)) continue; - visible.push(key); - } - return visible.length === chat.order.length ? chat.order : visible; - } - /** - * A comparable signal for the visible row set, built for - * `useSyncExternalStore`-style subscription: the host re-runs a chat selector - * on every publish and compares the RESULT by `Object.is`, and a rewind - * publishes an in-place upsert of an existing command row. The snapshot's - * `order` array and node store are therefore both reference-stable across a - * rewind, so a selector on them never re-renders; a string does change exactly - * when the visible set does. Never return the array itself from a selector — - * a fresh array fails the `Object.is` check on every publish. - */ - function visibleChatSignature(chat) { - return visibleChatKeys(chat).join("\0"); - } - // src/client/tool-activity.ts - /** - * callId of a tool-call chat node. Drafts for a call whose node was cut must - * not be reintroduced after `group.keys` has already dropped that node. - */ - function toolCallId(node) { - const callId = node.data?.root?.callId; - return typeof callId === "string" && callId.length > 0 ? callId : void 0; - } - /** callIds whose tool-call node sits inside a rewind cut. */ - function cutToolCallIds(order, get, spans) { - const ids = /* @__PURE__ */ new Set(); - for (const key of order) { - const node = get(key); - if (node?.kind !== "tool-call") continue; - const seq = anchorSeqOf(node); - if (seq === void 0 || !cutContains(spans, seq)) continue; - const callId = toolCallId(node); - if (callId !== void 0) ids.add(callId); - } - return ids; - } - /** - * Public Step data includes tool-only model output before a chat node exists. - * - * `sourceOrder` is the unfiltered chat order. Drafts that belong to a cut step, - * or to a call whose tool-call node was cut, are not put back. A draft that - * still has no tool-call node, on a step outside the cut, stays — that is the - * in-flight call the host has not published a node for yet. - */ - function readerFlow(group, turn, get, sourceOrder) { - const flow = []; - const calls = /* @__PURE__ */ new Map(); - const assistantOrder = /* @__PURE__ */ new Map(); - const spans = sourceOrder === void 0 ? [] : rewindCutSpans({ - order: sourceOrder, - nodes: { get } - }); - const cutCalls = spans.length === 0 || sourceOrder === void 0 ? void 0 : cutToolCallIds(sourceOrder, get, spans); - for (const key of group.keys) { - const node = get(key); - if (!node || node.visibility === "hidden") continue; - const step = node.location.kind === "step" ? node.location.step.step : 0; - if (node.kind === "tool-call") { - const block = node.data.root; - calls.set(block.callId, { - kind: "tool", - key: `reader-tool:${block.callId}`, - callId: block.callId, - step, - block, - order: node.anchorSeq - }); - } else { - flow.push({ - kind: "node", - key, - nodeKey: key, - order: node.anchorSeq - }); - if (node.kind === "assistant-step") assistantOrder.set(step, node.anchorSeq); - } - } - for (const step of turn?.steps ?? []) { - const data = step.data.get("assistant-step"); - const stepSeq = step.start?.seq; - const stepCut = typeof stepSeq === "number" && spans.length > 0 && cutContains(spans, stepSeq); - let index = 0; - for (const draft of data?.blocks ?? []) { - if (draft.kind !== "tool-call" || !draft.callId) continue; - const previous = calls.get(draft.callId); - if (!previous && (stepCut || cutCalls?.has(draft.callId) === true)) continue; - calls.set(draft.callId, previous ? { - ...previous, - draft - } : { - kind: "tool", - key: `reader-tool:${draft.callId}`, - callId: draft.callId, - step: step.step, - draft, - order: (assistantOrder.get(step.step) ?? step.start?.seq ?? 0) + .01 + index++ / 1e4 - }); - } - } - flow.push(...calls.values()); - return flow.sort((left, right) => left.order - right.order); - } - function objectValue(value) { - return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null; - } - function stringValue(record, ...keys) { - for (const key of keys) if (typeof record?.[key] === "string" && record[key]) return record[key]; - } - /** Read only top-level JSON string values, including an unfinished final string. - * This never executes input or mistakes escaped/nested content for a path field. */ - function parseInputFields(raw) { - try { - return { - kind: "complete", - fields: objectValue(JSON.parse(raw)) ?? {} - }; - } catch {} - const fields = Object.create(null); - const prefix = raw.slice(0, 262144); - let depth = 0; - let key; - for (let index = 0; index < prefix.length; index++) { - const char = prefix[index]; - if (char === "{" || char === "[") { - depth++; - continue; - } - if (char === "}" || char === "]") { - depth--; - continue; - } - if (char !== "\"") continue; - const start = index; - let closed = false; - for (index++; index < prefix.length; index++) { - if (prefix[index] === "\\") { - index++; - continue; - } - if (prefix[index] === "\"") { - closed = true; - break; - } - } - if (depth !== 1) continue; - const token = prefix.slice(start, closed ? index + 1 : prefix.length); - let value; - try { - value = JSON.parse(token); - } catch { - if (closed) continue; - let body = token.slice(1); - const unicode = /(?= 0 && body[end] === "\\"; end--) slashes++; - if (slashes % 2) body = body.slice(0, -1); - try { - value = JSON.parse(`"${body}"`); - } catch { - continue; - } - } - if (closed && /^\s*:/.test(prefix.slice(index + 1))) key = value; - else if (key !== void 0) { - fields[key] = value; - key = void 0; - } - } - return { - kind: "partial", - fields - }; - } - function inputFields(raw) { - return parseInputFields(raw).fields; - } - /** Name and raw arguments of any call block, whether it has landed or is pending. */ - function toolIdentity(entry) { - const block = entry.block; - return { - name: block ? "kind" in block ? block.call?.name ?? entry.draft?.name ?? "工具调用" : block.name : entry.draft?.name ?? "工具调用", - raw: block ? "kind" in block ? block.call?.argsRaw ?? entry.draft?.argsRaw ?? "" : "argsRaw" in block ? block.argsRaw : entry.draft?.argsRaw ?? "" : entry.draft?.argsRaw ?? "" - }; - } - /** Name and raw arguments of any call block, whether it has landed or is pending. */ - function childIdentity(block) { - if (!block || !("kind" in block)) return { - name: block?.name, - raw: block && "argsRaw" in block ? block.argsRaw : "" - }; - return { - name: block.call?.name, - raw: block.call?.argsRaw ?? "" - }; - } - function executionFacts(block) { - if (!block || !("kind" in block)) return {}; - const meta = objectValue(block.meta); - const code = meta?.exitCode ?? meta?.exit_code; - const text = block.content.length === 1 && block.content[0]?.type === "text" ? block.content[0].text : ""; - const exit = /\n\[exit code: (\d+)\]$/.exec(text); - const signal = /\n\[killed by signal: ([^\]\n]+)\]$/.exec(text); - const parsedCode = exit?.[1] === void 0 ? void 0 : Number(exit[1]); - return { - exitCode: typeof code === "number" && Number.isFinite(code) ? code : parsedCode, - signal: stringValue(meta, "signal") ?? signal?.[1] - }; - } - /** Line counts of one text side; a trailing newline does not start a line. */ - function lineCount(text) { - if (text === null) return 0; - const body = text.endsWith("\n") ? text.slice(0, -1) : text; - return body === "" ? 0 : body.split("\n").length; - } - /** Argument fields that carry the text a call is about to write. */ - const NEW_TEXT_FIELDS = [ - "content", - "new_string", - "new_str", - "newText", - "file_text" - ]; - /** Argument fields that carry the text a call is about to replace. */ - const OLD_TEXT_FIELDS = [ - "old_string", - "old_str", - "oldText" - ]; - /** Argument fields that name the file a mutation call targets. */ - const PATH_FIELDS = [ - "file_path", - "path", - "filePath" - ]; - function firstString(source, fields) { - if (!source) return null; - for (const field of fields) { - const value = source[field]; - if (typeof value === "string" && value !== "") return value; - } - return null; - } - const MUTATION_TOOLS = /* @__PURE__ */ new Set([ - "write", - "edit", - "str_replace_editor" - ]); - function callDiffHunks(block, args, name) { - const nested = block && "kind" in block && Array.isArray(block.subCalls) ? block.subCalls.flatMap((child) => { - try { - return callDiffHunks(child, inputFields(childIdentity(child).raw), childIdentity(child).name); - } catch { - return []; - } - }) : []; - if (block && "kind" in block) { - const diffs = objectValue(block.meta)?.diffs; - if (Array.isArray(diffs) && diffs.length > 0) { - const hunks = []; - for (const raw of diffs) { - const entry = objectValue(raw); - if (!entry) continue; - const oldText = typeof entry.oldText === "string" ? entry.oldText : null; - const newText = typeof entry.newText === "string" ? entry.newText : ""; - if (!lineCount(newText) && !lineCount(oldText)) continue; - hunks.push({ - path: firstString(entry, PATH_FIELDS) ?? "", - oldText, - newText - }); - } - if (hunks.length) return [...hunks, ...nested]; - } - } - if (!name || !MUTATION_TOOLS.has(name)) return nested; - const path = firstString(args, PATH_FIELDS); - if (!path) return nested; - const oldText = firstString(args, OLD_TEXT_FIELDS); - const newText = firstString(args, NEW_TEXT_FIELDS) ?? ""; - if (!lineCount(newText) && !lineCount(oldText)) return nested; - return [{ - path, - oldText, - newText - }, ...nested]; - } - /** Added/removed line counts for one call, or null when there is nothing to show. */ - function diffTotals$1(block, args, name) { - const hunks = callDiffHunks(block, args, name); - if (!hunks.length) return null; - return diffLineTotals(hunks); - } - /** Counts the lines on each side, under the same rule the official block uses. */ - function diffLineTotals(hunks) { - return hunks.reduce((total, hunk) => ({ - added: total.added + lineCount(hunk.newText), - removed: total.removed + lineCount(hunk.oldText) - }), { - added: 0, - removed: 0 - }); - } - /** Every changed file across a folded run of steps, in the order they ran. */ - function foldDiffHunks(steps) { - const hunks = []; - for (const step of steps) { - if (step.kind !== "tool" || !step.entry) continue; - const model = activitySummary(step.entry); - hunks.push(...callDiffHunks(step.entry.block, model.args, model.name)); - } - return hunks; - } - function activityPhase(entry, turnClosed = false) { - if (!entry.block) return turnClosed ? "interrupted" : "preparing"; - if (!("kind" in entry.block)) return turnClosed ? "interrupted" : entry.block.phase === "preparing" ? "preparing" : "running"; - if (entry.block.error?.code === "ABORTED" || entry.block.error?.code === "interrupted") return "interrupted"; - const facts = executionFacts(entry.block); - if (entry.block.isError || facts.signal || facts.exitCode !== void 0 && facts.exitCode !== 0 || entry.block.subCalls.some((block) => activityPhase({ block }, turnClosed) === "failed")) return "failed"; - if (facts.exitCode === 0) return "succeeded"; - return "returned"; - } - /** - * First-seen time for calls the host has not stamped yet. A draft that - * precedes a landed call carries no timestamp, so without this memory the - * running clock would restart at zero on every remount — e.g. switching to - * another conversation and back while the call is still preparing. Keyed by - * call id, dropped when the call leaves the running phases. - */ - const clockFirstSeen = /* @__PURE__ */ new Map(); - const CLOCK_FIRST_SEEN_LIMIT = 512; - /** - * Session-stamped start of a call, or null while only a draft exists. - * A settled result carries `callTime`, the paired tool/call event's time; a - * still-running call head stamps the same instant in its own `time` field. - */ - function callStartTime(entry) { - const block = entry.block; - if (!block) return null; - return "kind" in block ? block.callTime : block.time; - } - /** - * The instant a still-running call's elapsed clock counts from. The stamped - * time wins so a remounted view keeps counting from the real start; an - * un-stamped draft falls back to when this view first saw that call id, which - * survives remounts for the same reason. - */ - function runningClockBase(callId, block, now = Date.now()) { - const stamped = callStartTime({ block }); - if (stamped != null) return stamped; - const seen = clockFirstSeen.get(callId); - if (seen !== void 0) return seen; - if (clockFirstSeen.size >= CLOCK_FIRST_SEEN_LIMIT) clockFirstSeen.delete(clockFirstSeen.keys().next().value); - clockFirstSeen.set(callId, now); - return now; - } - /** Forget a call's first-seen time once its clock is no longer live. */ - function forgetCallClock(callId) { - clockFirstSeen.delete(callId); - } - function activitySummary(entry) { - const { name, raw } = toolIdentity(entry); - const parsed = parseInputFields(raw); - const args = parsed.fields; - const target = stringValue(args, "file_path", "path", "filename", "filePath"); - const command = stringValue(args, "command", "cmd", "script"); - const description = stringValue(args, "description"); - const file = target?.split(/[/\\]/).at(-1); - const category = /^(write|edit|apply_patch|patch|str_replace_editor)$/.test(name) ? "write" : /^(read|read_file)$/.test(name) ? "read" : /^(bash|shell|terminal|terminal_send|exec_command|pwsh)$/.test(name) ? "terminal" : /^(grep|glob|find|search)$/.test(name) ? "search" : /^(web_search|web_fetch|web_open)$/.test(name) ? "web" : /^(run_code|execute_code|code_interpreter|python|node|eval|repl)$/.test(name) ? "code" : "other"; - const title = category === "write" ? `${name === "write" ? "写入" : "修改"}${file ? ` ${file}` : name === "apply_patch" ? "代码补丁" : "文件"}` : category === "read" ? `读取${file ? ` ${file}` : "文件"}` : category === "terminal" ? description || "运行命令" : category === "search" ? name === "glob" ? "查找文件" : "搜索内容" : category === "web" ? name === "web_search" ? "搜索网页" : "读取网页" : category === "code" ? description || "运行代码" : name; - return { - name, - raw, - args, - argsState: parsed.kind, - category, - title, - target: target ?? command ?? stringValue(args, "query", "pattern", "url"), - command, - cwd: stringValue(args, "workdir", "cwd"), - content: stringValue(args, "content", "new_string", "newText", "file_text") - }; - } - function preparingLabel(name) { - return /^(write|edit|apply_patch)$/.test(name) ? "正在生成文件内容" : /^(bash|shell|exec_command|pwsh)$/.test(name) ? "正在准备命令" : "正在准备工具输入"; - } - // src/client/deliverables.ts - /** Extract standard filename without directory components. */ - function basename(path) { - const normalized = path.replace(/[/\\]+$/, ""); - const at = Math.max(normalized.lastIndexOf("/"), normalized.lastIndexOf("\\")); - return at === -1 ? normalized : normalized.slice(at + 1); - } - /** Extract parent directory of a path (or '.' if top-level). */ - function dirname(path) { - const normalized = path.replace(/[/\\]+$/, ""); - const at = Math.max(normalized.lastIndexOf("/"), normalized.lastIndexOf("\\")); - if (at === 0 || at === 2 && /^[A-Za-z]:/.test(normalized)) return normalized.slice(0, at + 1); - return at === -1 ? "." : normalized.slice(0, at) || "."; - } - /** - * The produced-files chip row waits for turn close. Live writes still - * accumulate, but the row must not interrupt an in-progress process. - */ - function showDeliverablesRow(status, paths) { - return status === "closed" && paths.length > 0; - } - /** - * Extract all unique file paths produced/modified in one turn. - * Respects official deliverables data when available, and falls back to - * inspecting successful write/edit tool invocations in the turn flow. - */ - function getTurnDeliverables(turn, flow) { - const paths = []; - const seen = /* @__PURE__ */ new Set(); - const deliverables = (turn?.data)?.get("deliverables"); - if (deliverables?.produced && Array.isArray(deliverables.produced)) { - for (const item of deliverables.produced) if (typeof item?.path === "string" && item.path.trim().length > 0) { - const clean = item.path.trim(); - if (!seen.has(clean)) { - seen.add(clean); - paths.push(clean); - } - } - } - if (paths.length > 0) return paths; - if (flow) for (const item of flow) { - if (item.kind !== "tool" || !item.block) continue; - if ("isError" in item.block && item.block.isError) continue; - const { name, raw } = toolIdentity(item); - const toolName = name !== "工具调用" ? name : item.block.name || item.block.call?.name; - const toolRaw = raw || item.block.argsRaw || item.block.call?.argsRaw || ""; - if (toolName === "write" || toolName === "edit" || toolName === "apply_patch") { - const target = stringValue(inputFields(toolRaw), "file_path", "path", "filename", "filePath"); - if (target && !seen.has(target)) { - seen.add(target); - paths.push(target); - } - } else if (toolName === "str_replace_editor") { - const args = inputFields(toolRaw); - const cmd = stringValue(args, "command"); - if (cmd === "create" || cmd === "str_replace" || cmd === "insert") { - const target = stringValue(args, "path"); - if (target && !seen.has(target)) { - seen.add(target); - paths.push(target); - } - } - } - } - return paths; - } - /** The single produced path whose basename is exactly value, or undefined. */ - function onlyPathWithBasename(paths, value) { - const matches = paths.filter((path) => basename(path) === value); - return matches.length === 1 ? matches[0] : void 0; - } - /** - * File-mention resolver: converts inline-code tokens matching produced paths - * into clickable file references that open the corresponding file on the host. - */ - function createProducedFileMentions(paths, openFile) { - return { resolve(value) { - if (!value || value.includes("\n")) return void 0; - const clean = value.trim(); - const path = paths.includes(clean) ? clean : onlyPathWithBasename(paths, clean); - if (path === void 0) return void 0; - return { - open: () => { - openFile(path); - }, - label: `打开 ${path}`, - title: path - }; - } }; - } - // src/workspace-path.ts - /** Absolute paths accepted by both POSIX and Windows hosts. */ - function isAbsoluteWorkspacePath(path) { - return /^(?:\/|[A-Za-z]:[/\\]|\\\\)/.test(path); - } - // src/client/styles.ts - const plugin = "dsh-better-display"; - const styles$1 = /* @__PURE__ */ new Map(); - /** Retain injected CSS across host cleanup and restore it before Reader paints. */ - function ensureStyles() { - if (typeof document === "undefined") return; - const live = /* @__PURE__ */ new Set(); - for (const tag of document.querySelectorAll(`style[data-plugin="${plugin}"][data-plugin-css]`)) { - const id = tag.dataset.pluginCss; - if (id === void 0) continue; - styles$1.set(id, tag.textContent ?? ""); - live.add(id); - } - for (const [id, text] of styles$1) { - if (live.has(id)) continue; - const tag = document.createElement("style"); - tag.dataset.plugin = plugin; - tag.dataset.pluginCss = id; - tag.textContent = text; - document.head.appendChild(tag); - } - } - // src/client/mcp-app.ts - /** - * Core pure functions for SEP-1865 / MCP Apps integration. - * Free of CSS module imports so it can be cleanly tested in Node test environments. - */ - function getHostTheme() { - if (typeof document === "undefined") return "light"; - if (document.body?.hasAttribute("data-ds-dark-theme")) return "dark"; - const colorScheme = document.documentElement?.style.colorScheme; - if (colorScheme === "dark" || colorScheme === "light") return colorScheme; - const dataTheme = document.documentElement?.getAttribute("data-theme") || document.body?.getAttribute("data-theme"); - if (dataTheme === "dark" || dataTheme === "light") return dataTheme; - if (document.body?.classList.contains("dark") || document.documentElement?.classList.contains("dark")) return "dark"; - return typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"; - } - function getCssTokens(theme) { - const isDark = theme === "dark"; - return { - "--background": isDark ? "#0f172a" : "#ffffff", - "--card": isDark ? "#1e293b" : "#f8fafc", - "--foreground": isDark ? "#f8fafc" : "#0f172a", - "--muted-foreground": isDark ? "#94a3b8" : "#64748b", - "--primary": "#2563eb", - "--primary-foreground": "#ffffff", - "--border": isDark ? "#334155" : "#e2e8f0", - "--hover": isDark ? "rgba(148, 163, 184, 0.15)" : "rgba(148, 163, 184, 0.12)" - }; - } - /** - * Extracts a title from the HTML document's tag. - */ - function extractHtmlTitle(html) { - return /<title[^>]*>([^<]+)<\/title>/i.exec(html)?.[1]?.trim(); - } - /** - * Normalizes user/model generated HTML to ensure a valid HTML5 structure - * and embeds a dynamic theme listener so dark/light mode switches take effect immediately. - */ - function ensureHtmlDocument(rawHtml, initialTheme = "light") { - const isDark = initialTheme === "dark"; - const trimmed = rawHtml.trim(); - const themeScript = `<script> -(function() { - function applyTheme(theme) { - if (!theme) return; - document.documentElement.setAttribute('data-theme', theme); - document.documentElement.style.colorScheme = theme; - if (theme === 'dark') { - document.documentElement.classList.add('dark'); - if (document.body) document.body.classList.add('dark'); - } else { - document.documentElement.classList.remove('dark'); - if (document.body) document.body.classList.remove('dark'); - } - } - applyTheme(${JSON.stringify(initialTheme)}); - - // Precise content-bottom measurement to avoid scrollHeight latching to iframe outer height - function reportHeight() { - var body = document.body; - if (!body) return; - var children = body.children; - var maxBottom = 0; - for (var i = 0; i < children.length; i++) { - var el = children[i]; - if (el.tagName === 'SCRIPT' || el.tagName === 'STYLE' || el.tagName === 'LINK') continue; - var style = window.getComputedStyle(el); - if (style.display === 'none' || style.position === 'fixed') continue; - var marginBottom = parseFloat(style.marginBottom) || 0; - var bottom = el.offsetTop + el.offsetHeight + marginBottom; - if (bottom > maxBottom) maxBottom = bottom; - } - var bodyStyle = window.getComputedStyle(body); - var bodyPaddingBottom = parseFloat(bodyStyle.paddingBottom) || 0; - var h = maxBottom > 0 ? Math.ceil(maxBottom + bodyPaddingBottom) : body.scrollHeight; - if (h > 40) { - window.parent.postMessage({ - jsonrpc: '2.0', - method: 'ui/resize', - params: { height: h } - }, '*'); - } - } - - if (typeof ResizeObserver !== 'undefined') { - var ro = new ResizeObserver(function() { - reportHeight(); - }); - if (document.body) { - ro.observe(document.body); - } else { - document.addEventListener('DOMContentLoaded', function() { - if (document.body) ro.observe(document.body); - }); - } - } - - window.addEventListener('load', reportHeight); - setTimeout(reportHeight, 50); - setTimeout(reportHeight, 250); - setTimeout(reportHeight, 600); - - window.addEventListener('message', function(e) { - var msg = e.data; - if (!msg || typeof msg !== 'object') return; - var theme = (msg.params && msg.params.theme) || (msg.result && msg.result.hostContext && msg.result.hostContext.theme); - if (theme) applyTheme(theme); - }); -})(); -<\/script>`; - if (/^<!DOCTYPE/i.test(trimmed) || /<html[\s>]/i.test(trimmed)) { - if (/<head[\s>]/i.test(trimmed)) return trimmed.replace(/<head([^>]*)>/i, `<head$1>\n ${themeScript}`); - return trimmed; - } - return `<!DOCTYPE html> -<html lang="zh-CN" data-theme="${initialTheme}" class="${isDark ? "dark" : ""}"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - ${themeScript} - <style> - :root { - --background: #ffffff; - --card: #f8fafc; - --border: #e2e8f0; - --foreground: #0f172a; - --muted-foreground: #64748b; - --primary: #2563eb; - --primary-foreground: #ffffff; - } - :root[data-theme='dark'], html.dark { - --background: #0f172a; - --card: #1e293b; - --border: #334155; - --foreground: #f8fafc; - --muted-foreground: #94a3b8; - } - @media (prefers-color-scheme: dark) { - :root:not([data-theme='light']) { - --background: #0f172a; - --card: #1e293b; - --border: #334155; - --foreground: #f8fafc; - --muted-foreground: #94a3b8; - } - } - * { box-sizing: border-box; margin: 0; padding: 0; } - body { - background: transparent; - color: var(--foreground); - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; - padding: 12px; - } - </style> -</head> -<body class="${isDark ? "dark" : ""}"> -${trimmed} -</body> -</html>`; - } - /** - * Determines whether a markdown code block represents an MCP App. - */ - function isMcpAppCodeBlock(lang, meta, value) { - const l = (lang ?? "").toLowerCase().trim(); - const m = (meta ?? "").toLowerCase().trim(); - if (l === "mcp-app" || l === "mcpapp" || l === "mcp-ui" || l === "mcp" || l.startsWith("mcp-app:") || l === "html:mcp-app" || l === "html:mcp") return true; - if (m.includes("mcp-app") || m.includes("mcpapp") || m.includes("sep-1865") || m.includes("mcp-ui")) return true; - if (l === "html" && (value.includes("ui/submit") || value.includes("ui/initialize") || value.includes("SEP-1865") || value.includes("mcp-app"))) return true; - return false; - } - /** - * Extracts a title from code block meta or HTML content. - */ - function extractMcpAppTitle(meta, value) { - if (meta) { - const titleMatch = /title=["']([^"']+)["']/i.exec(meta) || /title=([^\s]+)/i.exec(meta); - if (titleMatch?.[1]) return titleMatch[1]; - } - const htmlTitle = extractHtmlTitle(value); - if (htmlTitle) return htmlTitle; - } - /** - * Extracts an explicit height budget from code block meta (e.g. height=600 or height="500px"). - */ - function extractMcpAppHeight(meta) { - if (!meta) return void 0; - const match = /height=["']?(\d+)(?:px)?["']?/i.exec(meta); - if (match?.[1]) { - const n = parseInt(match[1], 10); - if (Number.isFinite(n) && n >= 100 && n <= 3e3) return n; - } - } - /** - * Formats a user-submitted MCP App event into a concise, natural language conversational prompt. - * Avoids raw multiline JSON and excessive whitespace. - */ - function formatReceiptPrompt(params, title) { - if (typeof params.choice === "string") { - const desc = typeof params.desc === "string" ? `(${params.desc})` : ""; - return `我在${title ? `「${title}」` : "组件"}中选择了:${params.choice}${desc}。请根据我的选择继续。`; - } - if (typeof params.selectedVariant === "string") { - const score = typeof params.score === "number" ? `,得分:${params.score}` : ""; - return `我在方案评测中选择了:${params.selectedVariant}${score}。请根据该方案继续分析。`; - } - if (typeof params.action === "string") { - const payloadStr = params.payload ? typeof params.payload === "string" ? params.payload : JSON.stringify(params.payload) : ""; - return `[${title ?? "组件操作"}] 已完成 ${params.action}${payloadStr ? `: ${payloadStr}` : ""}`; - } - const keys = Object.keys(params); - if (keys.length === 1 && typeof params[keys[0]] === "string") return `[${title ?? "组件回执"}] ${keys[0]}: ${params[keys[0]]}`; - return `[${title ?? "组件回执"}] ${JSON.stringify(params)}`; - } - /** - * DOM fallback for composer fill: types into the Lexical contenteditable - * surface (`[data-composer-input]`) via execCommand insertText so the editor - * adopts the change as a genuine user edit. Returns true when accepted. - */ - function fillComposerDom(text, doc) { - const d = doc ?? (typeof document !== "undefined" ? document : void 0); - if (!d) return false; - try { - const surfaces = Array.from(d.querySelectorAll("[data-composer-input]")); - const target = surfaces.find((el) => el.getAttribute("contenteditable") === "true") ?? surfaces[0]; - if (!target) return false; - target.focus(); - if (typeof d.execCommand === "function") try { - if (d.execCommand("insertText", false, text)) return true; - } catch {} - const selection = d.getSelection?.(); - if (selection) { - selection.selectAllChildren(target); - if (typeof d.execCommand === "function") try { - if (d.execCommand("insertText", false, text)) return true; - } catch {} - } - } catch {} - return false; - } - // \0dshx-css-module:src/client/McpAppFrame.module.css.mjs - const css$7 = ".YE487q_card{border:1px solid var(--dsw-alias-border-l2,#00000014);background:var(--dsw-alias-bg-module-platform,transparent);border-radius:14px;margin:16px 0;transition:border-color .2s cubic-bezier(.22,1,.36,1),box-shadow .2s cubic-bezier(.22,1,.36,1);position:relative;overflow:hidden}.YE487q_card:hover{border-color:var(--dsw-alias-border-l1,#00000029);box-shadow:0 2px 10px -2px #0000000a}.YE487q_header{border-bottom:1px solid var(--dsw-alias-border-l2,#0000000f);background:var(--dsw-alias-interactive-bg-hover,#00000004);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;height:36px;padding:0 14px;display:flex}.YE487q_titleArea{align-items:center;gap:7px;min-width:0;display:flex}.YE487q_icon{color:var(--dsw-alias-label-tertiary,#94a3b8);flex-shrink:0;justify-content:center;align-items:center;display:flex}.YE487q_title{color:var(--dsw-alias-label-secondary,#64748b);letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;overflow:hidden}.YE487q_actions{align-items:center;gap:4px;display:flex}.YE487q_iconBtn{width:24px;height:24px;color:var(--dsw-alias-label-tertiary,#94a3b8);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;transition:all .15s;display:inline-flex}.YE487q_iconBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000f);color:var(--dsw-alias-label-primary,#0f172a)}.YE487q_iconBtn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#2563eb);outline-offset:1px}.YE487q_iframeWrapper{background:0 0;width:100%;transition:height .25s cubic-bezier(.22,1,.36,1);position:relative}.YE487q_iframe{background:0 0;border:none;width:100%;height:100%;display:block}.YE487q_receipt{background:var(--dsw-alias-interactive-bg-hover,#22c55e0d);border-top:1px solid var(--dsw-alias-border-l2,#0000000f);color:var(--dsw-alias-label-primary,#0f172a);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;padding:8px 14px;font-size:12px;line-height:18px;animation:.2s cubic-bezier(.22,1,.36,1) YE487q_slideUp;display:flex}.YE487q_receiptPrompt{color:var(--dsw-alias-label-secondary,#64748b);background:var(--dsw-alias-bg-base,#00000008);border:1px solid var(--dsw-alias-border-l2,#0000000f);-webkit-user-select:text;user-select:text;cursor:text;overflow-wrap:anywhere;border-radius:6px;flex:100%;padding:6px 10px;font-size:12px;line-height:18px}@keyframes YE487q_slideUp{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.YE487q_receiptSummary{color:var(--dsw-alias-state-business-primary,#16a34a);text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:6px;font-weight:500;display:flex;overflow:hidden}.YE487q_receiptHint{align-items:center;gap:6px;display:flex}.YE487q_sendKbd{color:var(--dsw-alias-label-tertiary,#94a3b8);background:var(--dsw-alias-bg-base,#0000000a);border:1px solid var(--dsw-alias-border-l2,#00000014);cursor:pointer;border-radius:5px;align-items:center;gap:4px;padding:2px 8px;font-family:inherit;font-size:11px;transition:all .15s;display:inline-flex}.YE487q_sendKbd:hover{background:var(--dsw-alias-interactive-bg-hover,#00000014);color:var(--dsw-alias-label-primary,#0f172a)}.YE487q_sendKbd:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#2563eb);outline-offset:1px}.YE487q_streamingPlaceholder{border:1px dashed var(--dsw-alias-border-l2,#0000001f);background:var(--dsw-alias-interactive-bg-hover,#00000004);color:var(--dsw-alias-label-secondary,#64748b);border-radius:14px;align-items:center;gap:10px;margin:16px 0;padding:16px 18px;font-size:13px;display:flex}.YE487q_pulseDot{background:var(--dsw-alias-state-business-primary,#2563eb);border-radius:50%;width:7px;height:7px;animation:1.5s ease-in-out infinite YE487q_pulse}@keyframes YE487q_pulse{0%,to{opacity:.35;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}"; - const tagId$7 = "dsh-better-chat/McpAppFrame.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$7; - tag.textContent = css$7; - document.head.appendChild(tag); - } - var McpAppFrame_module_css_default = { - "actions": "YE487q_actions", - "card": "YE487q_card", - "header": "YE487q_header", - "icon": "YE487q_icon", - "iconBtn": "YE487q_iconBtn", - "iframe": "YE487q_iframe", - "iframeWrapper": "YE487q_iframeWrapper", - "pulse": "YE487q_pulse", - "pulseDot": "YE487q_pulseDot", - "receipt": "YE487q_receipt", - "receiptHint": "YE487q_receiptHint", - "receiptPrompt": "YE487q_receiptPrompt", - "receiptSummary": "YE487q_receiptSummary", - "sendKbd": "YE487q_sendKbd", - "slideUp": "YE487q_slideUp", - "streamingPlaceholder": "YE487q_streamingPlaceholder", - "title": "YE487q_title", - "titleArea": "YE487q_titleArea" - }; - // src/client/McpAppFrame.tsx - const ComposerFillContext = (0, react.createContext)(void 0); - function useComposerFill() { - return (0, react.useContext)(ComposerFillContext); - } - const McpAppFrame = (0, react.memo)(function McpAppFrame({ html, title: initialTitle, initialHeight = 240, fillComposer: fillComposerProp }) { - const fillComposerFromContext = useComposerFill(); - const writeComposer = (0, react.useMemo)(() => fillComposerProp ?? fillComposerFromContext ?? fillComposerDom, [fillComposerProp, fillComposerFromContext]); - const iframeRef = (0, react.useRef)(null); - const lastParamsRef = (0, react.useRef)({}); - const [height, setHeight] = (0, react.useState)(() => Math.max(60, Math.min(2400, initialHeight))); - const [receipt, setReceipt] = (0, react.useState)(null); - const [lastPrompt, setLastPrompt] = (0, react.useState)(null); - const [reloadNonce, setReloadNonce] = (0, react.useState)(0); - const frameId = (0, react.useId)(); - const title = (0, react.useMemo)(() => { - return initialTitle || extractHtmlTitle(html) || "交互式 MCP App"; - }, [initialTitle, html]); - const [initialTheme] = (0, react.useState)(getHostTheme); - const preparedHtml = (0, react.useMemo)(() => ensureHtmlDocument(html, initialTheme), [html, initialTheme]); - const fillComposer = (0, react.useCallback)((params) => { - const prompt = formatReceiptPrompt(params, title); - setLastPrompt(prompt); - try { - if (writeComposer(prompt)) return true; - try { - navigator.clipboard?.writeText(prompt); - } catch {} - } catch {} - return false; - }, [title, writeComposer]); - const handleUserSubmit = (0, react.useCallback)((params) => { - lastParamsRef.current = params; - let summary; - if (typeof params.choice === "string") { - const desc = typeof params.desc === "string" ? ` (${params.desc})` : ""; - summary = `选择: ${params.choice}${desc}`; - } else if (typeof params.action === "string") summary = `操作: ${params.action}${params.payload ? ` (${JSON.stringify(params.payload)})` : ""}`; - else if (typeof params.selectedVariant === "string") summary = `方案: ${params.selectedVariant}`; - else summary = JSON.stringify(params); - setReceipt(summary); - fillComposer(params); - }, [fillComposer]); - (0, react.useEffect)(() => { - const handleMessage = (event) => { - const iframe = iframeRef.current; - if (!iframe || event.source !== iframe.contentWindow) return; - const data = event.data; - if (!data || typeof data !== "object") return; - const currentTheme = getHostTheme(); - const cssTokens = getCssTokens(currentTheme); - if (data.method === "ui/initialize") { - const response = { - jsonrpc: "2.0", - id: data.id, - result: { - protocolVersion: "2026-01-26", - hostContext: { - theme: currentTheme, - locale: "zh-CN", - styles: { variables: cssTokens } - } - } - }; - iframe.contentWindow?.postMessage(response, "*"); - return; - } - if (data.method === "ui/ready" || data.method === "ui/notifications/initialized") return; - if (data.method === "ui/resize" && data.params?.height) { - const h = Number(data.params.height); - if (Number.isFinite(h) && h > 0) setHeight(Math.max(60, Math.min(2400, Math.round(h)))); - return; - } - if (data.method === "ui/submit" || data.method === "ui/update-model-context") { - const params = data.params || {}; - handleUserSubmit(params); - return; - } - }; - window.addEventListener("message", handleMessage); - const broadcastTheme = () => { - const newTheme = getHostTheme(); - const tokens = getCssTokens(newTheme); - iframeRef.current?.contentWindow?.postMessage({ - jsonrpc: "2.0", - method: "ui/notifications/host-context-changed", - params: { - theme: newTheme, - styles: { variables: tokens } - } - }, "*"); - }; - let observer = null; - if (typeof MutationObserver !== "undefined" && typeof document !== "undefined") { - observer = new MutationObserver(broadcastTheme); - if (document.body) observer.observe(document.body, { - attributes: true, - attributeFilter: [ - "data-ds-dark-theme", - "class", - "style", - "data-theme" - ] - }); - if (document.documentElement) observer.observe(document.documentElement, { - attributes: true, - attributeFilter: [ - "data-theme", - "class", - "style" - ] - }); - } - const media = typeof window !== "undefined" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null; - media?.addEventListener?.("change", broadcastTheme); - return () => { - window.removeEventListener("message", handleMessage); - observer?.disconnect(); - media?.removeEventListener?.("change", broadcastTheme); - }; - }, [handleUserSubmit]); - const handleFrameLoad = (0, react.useCallback)(() => { - const iframe = iframeRef.current; - if (!iframe) return; - const currentTheme = getHostTheme(); - const cssTokens = getCssTokens(currentTheme); - iframe.contentWindow?.postMessage({ - jsonrpc: "2.0", - method: "ui/initialize", - params: { - theme: currentTheme, - locale: "zh-CN", - styles: { variables: cssTokens } - } - }, "*"); - }, []); - const handleReload = (0, react.useCallback)(() => { - setReloadNonce((n) => n + 1); - setReceipt(null); - }, []); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: McpAppFrame_module_css_default.card, - "data-mcp-app-card": true, - "data-testid": "mcp-app-card", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: McpAppFrame_module_css_default.header, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: McpAppFrame_module_css_default.titleArea, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: McpAppFrame_module_css_default.icon, - "aria-hidden": "true", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - width: "13", - height: "13", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "2", - strokeLinecap: "round", - strokeLinejoin: "round", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", { - width: "18", - height: "18", - x: "3", - y: "3", - rx: "2" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 9h18" }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9 21V9" }) - ] - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: McpAppFrame_module_css_default.title, - title, - children: title - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: McpAppFrame_module_css_default.actions, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: McpAppFrame_module_css_default.iconBtn, - onClick: handleReload, - title: "重置组件状态", - "aria-label": "重置组件状态", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - width: "13", - height: "13", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "2", - strokeLinecap: "round", - strokeLinejoin: "round", - "aria-hidden": "true", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 3v5h5" }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16 16h5v5" }) - ] - }) - }) - })] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: McpAppFrame_module_css_default.iframeWrapper, - style: { height: `${height}px` }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", { - ref: iframeRef, - className: McpAppFrame_module_css_default.iframe, - title, - srcDoc: preparedHtml, - sandbox: "allow-scripts allow-forms", - referrerPolicy: "no-referrer", - onLoad: handleFrameLoad - }, `${frameId}-${reloadNonce}`) - }), - receipt && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: McpAppFrame_module_css_default.receipt, - "data-testid": "mcp-app-receipt", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: McpAppFrame_module_css_default.receiptSummary, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - width: "13", - height: "13", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "2.5", - strokeLinecap: "round", - strokeLinejoin: "round", - "aria-hidden": "true", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["已就绪:", receipt] })] - }), - lastPrompt && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: McpAppFrame_module_css_default.receiptPrompt, - title: lastPrompt, - children: lastPrompt - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: McpAppFrame_module_css_default.receiptHint, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: McpAppFrame_module_css_default.sendKbd, - title: "把这条结果重新填入输入框,然后回车发送", - onClick: () => { - fillComposer(lastParamsRef.current); - }, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "填入输入框" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", { children: "↵" })] - }) - }) - ] - }) - ] - }); - }); - /** - * Markdown code-fence mount point: picks the session composer writer from - * React context (provided by Blocks) without changing the markdown - * pipeline's signatures. - */ - function McpAppCodeBlock({ html, title, initialHeight }) { - const fillComposer = useComposerFill(); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(McpAppFrame, { - html, - title, - initialHeight, - fillComposer - }); - } - function StreamingMcpAppPlaceholder({ title }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: McpAppFrame_module_css_default.streamingPlaceholder, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: McpAppFrame_module_css_default.pulseDot, - "aria-hidden": "true" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [ - "正在生成交互组件", - title ? `(${title})` : "", - "..." - ] })] - }); - } - // src/client/message-chrome.ts - /** Local clock and run-duration labels for reader message chrome. */ - function pad2(n) { - return String(n).padStart(2, "0"); - } - /** - * Elapsed wall time, matching official Chat `duration.minutes` / `duration.seconds`. - * @param ms - Elapsed milliseconds (negatives clamp to zero). - */ - function formatRunDuration(ms) { - const total = Math.max(0, Math.floor(ms / 1e3)); - const minutes = Math.floor(total / 60); - const seconds = total % 60; - return minutes > 0 ? `${minutes}分${pad2(seconds)}秒` : `${seconds}秒`; - } - /** - * Settled-turn duration pill, matching official `message.ranFor`. - * @param ms - Elapsed milliseconds. - */ - function formatRanFor(ms) { - return `用时 ${formatRunDuration(ms)}`; - } - /** - * Compact local timestamp. Same calendar day → `HH:mm`; earlier this year → - * `M月D日 HH:mm`; other years → `YYYY年M月D日 HH:mm`. - * @param time - Unix epoch ms from the source session event. - * @param now - Reference instant for the day/year cut. - */ - function formatMessageClock(time, now = Date.now()) { - const d = new Date(time); - const n = new Date(now); - const clock = `${pad2(d.getHours())}:${pad2(d.getMinutes())}`; - if (d.getFullYear() === n.getFullYear() && d.getMonth() === n.getMonth() && d.getDate() === n.getDate()) return clock; - if (d.getFullYear() === n.getFullYear()) return `${d.getMonth() + 1}月${d.getDate()}日 ${clock}`; - return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日 ${clock}`; - } - // src/client/primitive-labels.ts - const markdownLabels = { - code: { - copyLabel: "复制", - copiedLabel: "已复制" - }, - footnotes: "脚注" - }; - const readBlockLabels = { - codeLabel: "代码", - wrapLabel: "自动换行", - unwrapLabel: "不换行", - window: (shown, total) => `显示 ${shown} / ${total} 行`, - copy: "复制", - copied: "已复制", - collapseAria: "收起文件内容", - expandAria: (hidden) => `展开其余 ${hidden} 行`, - collapse: "收起", - expand: (hidden) => `展开其余 ${hidden} 行` - }; - const terminalBlockLabels = { - commandLine: (line) => `命令第 ${line} 行`, - signal: (signal) => `信号 ${signal}`, - exitCode: (code) => `退出码 ${code}`, - noExitCode: "无退出码", - running: "执行中", - failed: "失败", - done: "已完成", - copy: "复制", - copied: "已复制", - noOutput: "没有输出", - collapseAria: "收起命令输出", - collapse: "收起", - expandAria: (hidden) => `展开其余 ${hidden} 行`, - expand: (hidden) => `展开其余 ${hidden} 行` - }; - const diffBlockLabels = { - codeLabel: "代码", - wrapLabel: "自动换行", - unwrapLabel: "不换行", - copy: "复制", - copied: "已复制", - collapseAria: "收起差异", - collapse: "收起", - expandAria: (hidden) => `展开其余 ${hidden} 行`, - expand: (hidden) => `展开其余 ${hidden} 行` - }; - const searchBlockLabels = { - pathsSummary: (shown, total, truncated) => `${shown} / ${total} 个路径${truncated ? "(结果已截断)" : ""}`, - matchesSummary: (shown, total, files, truncated) => `${shown} / ${total} 处匹配 · ${files} 个文件${truncated ? "(结果已截断)" : ""}`, - copy: "复制", - copied: "已复制", - noResults: "没有结果", - collapseAria: "收起搜索结果", - collapse: "收起", - expandAria: (hidden) => `展开其余 ${hidden} 行`, - expand: (hidden) => `展开其余 ${hidden} 行` - }; - const webBlockLabels = { - noResults: "没有结果", - sourcesTruncated: "来源已截断", - http: "HTTP", - contentTruncated: "内容已截断", - markdown: markdownLabels - }; - const jsonTreeLabels = { - copyValue: "复制值", - copyJson: "复制 JSON", - copyPath: "复制路径", - copyPrettyJson: "复制格式化 JSON", - copyCompactJson: "复制紧凑 JSON", - copied: "已复制", - copyFailed: "复制失败", - collapseNode: "收起节点", - expandNode: "展开节点", - copyButtonTitle: (action) => action - }; - const truncatedJsonLabel = (total) => `内容过长,已截断(共 ${total} 个字符)`; - // src/client/stream-buffer.ts - /** Presentation only. The original session string remains the source of truth. */ - const STREAM_TIMING = { - catchUpMs: 520, - maxQueuedMs: 600, - finishMs: 96, - revealMs: 350, - minimumRate: 260, - /** Weight of the newest arrival sample in the smoothed source rate. */ - rateWeight: .35, - /** A longer gap is a pause between runs, not a slow model: keep the estimate. */ - rateGapMs: 250 - }; - const graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" }); - function atOrAfter(values, target) { - let low = 0; - let high = values.length - 1; - while (low < high) { - const middle = low + high >>> 1; - if (values[middle] < target) low = middle + 1; - else high = middle; - } - return low; - } - var StreamBuffer = class { - target; - visible; - revision = 0; - boundaries = [0]; - arrivals = []; - lastAt = null; - credit = 0; - finishAt = null; - rateEwma = 0; - lastArrival = null; - constructor(initial = "") { - this.target = initial; - this.visible = initial; - this.segment(0); - } - get pending() { - return this.visible.length < this.target.length; - } - segment(from) { - const index = atOrAfter(this.boundaries, from); - this.boundaries.length = index; - for (const part of graphemes.segment(this.target.slice(from))) this.boundaries.push(from + part.index); - if (this.boundaries.at(-1) !== this.target.length) this.boundaries.push(this.target.length); - } - /** Non-append updates, cancellations and hidden/reduced views never replay. */ - update(text, now, options = {}) { - if (options.immediate || !text.startsWith(this.target)) { - if (text !== this.target) this.revision++; - this.target = text; - this.flush(); - this.boundaries = [0]; - this.segment(0); - return; - } - if (text !== this.target) { - const wasPending = this.pending; - const grew = text.length - this.target.length; - const from = this.boundaries.at(-2) ?? 0; - this.observe(grew, now); - this.target = text; - this.segment(from); - this.arrivals.push({ - end: text.length, - at: now - }); - if (!wasPending) { - this.lastAt = now; - this.credit = 0; - } - } - if (options.finished && this.finishAt === null) this.finishAt = now + STREAM_TIMING.finishMs; - if (!options.finished) this.finishAt = null; - if (this.target.length - this.visible.length > 8192) { - this.revision++; - this.flush(); - } - } - /** Smoothed source rate, so one jittery transport chunk cannot set the pace. */ - observe(grew, now) { - const previous = this.lastArrival; - this.lastArrival = now; - if (previous === null || grew <= 0) return; - const elapsed = now - previous; - if (elapsed <= 0 || elapsed > STREAM_TIMING.rateGapMs) return; - const sample = grew * 1e3 / elapsed; - this.rateEwma = this.rateEwma === 0 ? sample : this.rateEwma * (1 - STREAM_TIMING.rateWeight) + sample * STREAM_TIMING.rateWeight; - } - flush() { - this.visible = this.target; - this.arrivals = []; - this.credit = 0; - this.lastAt = null; - this.lastArrival = null; - this.finishAt = null; - } - advance(now) { - if (!this.pending) return false; - const before = this.visible.length; - const index = atOrAfter(this.boundaries, before); - const remaining = this.boundaries.length - index - 1; - const delta = Math.max(0, now - (this.lastAt ?? now)); - this.lastAt = now; - const windowMs = this.finishAt === null ? STREAM_TIMING.catchUpMs : Math.max(16, Math.min(STREAM_TIMING.catchUpMs, this.finishAt - now)); - const rate = Math.max(STREAM_TIMING.minimumRate, this.rateEwma + remaining * 1e3 / windowMs); - this.credit += rate * delta / 1e3; - const count = Math.floor(this.credit); - this.credit -= count; - let end = this.boundaries[Math.min(this.boundaries.length - 1, index + count)]; - for (const item of this.arrivals) { - if (now - item.at < STREAM_TIMING.maxQueuedMs) break; - end = Math.max(end, this.boundaries[atOrAfter(this.boundaries, item.end)]); - } - if (this.finishAt !== null && now >= this.finishAt) end = this.target.length; - if (end && /[\uD800-\uDBFF]/.test(this.target[end - 1]) && this.finishAt === null) end--; - end = Math.max(before, end); - this.visible = this.target.slice(0, end); - this.arrivals = this.arrivals.filter((item) => item.end > end); - if (!this.pending) { - this.credit = 0; - this.lastAt = null; - } - return end !== before; - } - }; - // src/client/word-timeline.ts - /** Motion parameters from the public transitions.dev streaming-text recipe. */ - const WORD_MOTION = { - duration: 350, - gap: 60, - blur: 1, - easing: "cubic-bezier(0.22, 1, 0.36, 1)", - maxDelay: 240, - /** Floor for the per-word cadence once a batch is compressed. */ - minGap: 3, - /** One paint's words should land inside this window, however many arrive. */ - batchMs: 90 - }; - const segmenter = new Intl.Segmenter(void 0, { granularity: "word" }); - const closingPunctuation = /^[\p{Pe}\p{Pf},.!?:;,。!?、;:%‰…·]+$/u; - const openingPunctuation = /^[\p{Ps}\p{Pi}]+$/u; - /** Source-offset identity survives reparsing, frozen blocks, and final formatting. */ - var WordTimeline = class { - generation = 0; - hasLiveText = false; - source = null; - enabled = false; - revision = 0; - floor = 0; - lastBirth = -1e400; - births = []; - begin(source, enabled, revision, now) { - if (this.source === source && this.enabled === enabled && this.revision === revision) return; - if (revision !== this.revision || this.source !== null && !source.startsWith(this.source) || !enabled) { - this.births.length = 0; - this.lastBirth = -1e400; - this.generation++; - this.floor = source.length; - } else if (this.source === null) this.floor = source.length; - else { - const from = this.source.length; - const added = source.slice(from); - let arriving = 0; - for (const part of segmenter.segment(added)) if (part.segment.trim()) arriving++; - const gap = arriving > 1 ? Math.max(WORD_MOTION.minGap, Math.min(WORD_MOTION.gap, WORD_MOTION.batchMs / arriving)) : WORD_MOTION.gap; - for (const part of segmenter.segment(added)) { - let born = Number.isFinite(this.lastBirth) ? this.lastBirth : null; - if (part.segment.trim()) { - born = Math.min(now + WORD_MOTION.batchMs, Math.max(now, this.lastBirth + gap)); - this.lastBirth = born; - } - const end = from + part.index + part.segment.length; - const previous = this.births.at(-1); - if (previous && previous.born === born) previous.end = end; - else this.births.push({ - end, - born - }); - } - } - this.source = source; - this.enabled = enabled; - this.revision = revision; - this.hasLiveText = enabled && this.births.length > 0; - } - bornAt(offset) { - if (!this.enabled || offset < this.floor || this.births.length === 0) return null; - let low = 0; - let high = this.births.length - 1; - while (low < high) { - const middle = low + high >>> 1; - if (this.births[middle].end <= offset) low = middle + 1; - else high = middle; - } - return this.births[low].born; - } - words(value, offset) { - const prefixLength = Math.min(value.length, Math.max(0, this.floor - offset)); - const prefix = prefixLength > 0 ? [{ - key: offset, - text: value.slice(0, prefixLength), - born: null - }] : []; - const parts = []; - for (const segment of segmenter.segment(value.slice(prefixLength))) { - const part = { - index: prefixLength + segment.index, - segment: segment.segment - }; - const previous = parts.at(-1); - if (previous?.segment.trim() && (closingPunctuation.test(part.segment) || openingPunctuation.test(previous.segment))) previous.segment += part.segment; - else parts.push({ - index: part.index, - segment: part.segment - }); - } - return prefix.concat(parts.map((part) => { - const key = offset + part.index; - return { - key, - text: part.segment, - born: this.bornAt(key) - }; - })); - } - }; - // src/client/streaming.tsx - const StreamMotionContext = (0, react.createContext)({ - enabled: false, - activatedAt: 0 - }); - function useStreamingText(source, streaming, options) { - const { enabled, activatedAt, paused = false, resumed = false } = (0, react.useContext)(StreamMotionContext); - const fresh = resumed || (options.startedAt ?? 0) >= activatedAt; - const buffer = (0, react.useRef)(); - if (!buffer.current) buffer.current = new StreamBuffer(enabled && (streaming || resumed) && fresh ? "" : source); - const [display, setDisplay] = (0, react.useState)(() => ({ - text: buffer.current.visible, - revision: 0 - })); - const [finalizing, setFinalizing] = (0, react.useState)(streaming); - const frame = (0, react.useRef)(0); - const immediate = !enabled || options.interrupted || options.selected; - const publish = () => { - const current = buffer.current; - setDisplay((previous) => previous.text === current.visible && previous.revision === current.revision ? previous : { - text: current.visible, - revision: current.revision - }); - }; - const handoff = (0, react.useRef)(resumed); - const presentationClock = (0, react.useRef)(performance.now()); - (0, react.useLayoutEffect)(() => { - cancelAnimationFrame(frame.current); - const current = buffer.current; - if (paused && !immediate && !document.hidden) { - current.update(source, performance.now(), { - immediate: false, - finished: !streaming - }); - publish(); - return; - } - let previous = performance.now(); - current.update(source, handoff.current ? presentationClock.current : previous, { - immediate: immediate || document.hidden, - finished: !streaming && !resumed - }); - publish(); - const tick = (now) => { - presentationClock.current += Math.min(32, Math.max(0, now - previous)); - previous = now; - if (document.hidden) current.flush(); - else current.advance(handoff.current ? presentationClock.current : now); - publish(); - if (current.pending) frame.current = requestAnimationFrame(tick); - else handoff.current = false; - }; - if (current.pending) frame.current = requestAnimationFrame(tick); - return () => cancelAnimationFrame(frame.current); - }, [ - source, - streaming, - immediate, - paused, - resumed - ]); - (0, react.useEffect)(() => { - const hidden = () => { - if (!document.hidden) return; - cancelAnimationFrame(frame.current); - buffer.current.flush(); - publish(); - setFinalizing(false); - }; - document.addEventListener("visibilitychange", hidden); - return () => document.removeEventListener("visibilitychange", hidden); - }, []); - const pending = display.text !== source; - (0, react.useEffect)(() => { - if (streaming || pending) { - setFinalizing(true); - return; - } - if (immediate || document.hidden) { - setFinalizing(false); - return; - } - const timer = setTimeout(() => setFinalizing(false), WORD_MOTION.duration + WORD_MOTION.maxDelay); - return () => clearTimeout(timer); - }, [ - streaming, - pending, - immediate - ]); - return { - text: immediate ? source : display.text, - pending: !immediate && pending, - revision: display.revision, - formatStreaming: streaming || !immediate && (pending || finalizing), - reveal: enabled && !options.interrupted && !options.selected - }; - } - // src/client/markdown/incremental.ts - /** - * Trailing blocks kept unstable. Appended text reshapes at most the last - * block; the second-to-last is retained as safety margin so a freeze decision - * never has to reason about the parse frontier. - */ - const UNSTABLE_TAIL_BLOCKS = 2; - /** - * A block's render key: its absolute source start offset. A position-less - * node (a grammar is free to omit positions) falls back to a negative - * list-index key — unique within one update's tail, which is the only place - * the fallback can occur: freezing requires the cut block's position, so a - * position-less parse keeps every block in the tail (real grammars always - * stamp positions and never take this path). - */ - function blockKey(node, base, index) { - const offset = node.position?.start.offset; - return offset === void 0 ? -(index + 1) : base + offset; - } - /** - * Append-only incremental parser over a caller-supplied grammar. One instance - * accumulates one streaming document; non-append input resets it. - */ - var IncrementalMarkdownParser = class { - parse; - prevText = ""; - tailStart = 0; - frozen = []; - generation = 0; - cached = null; - /** @param parse - Grammar shared with whatever renders the blocks, so boundaries agree. */ - constructor(parse) { - this.parse = parse; - } - /** - * Fold the current accumulated text and return the frozen/tail split. - * Idempotent for identical input (the previous result is returned as-is), - * so callers may invoke it from render paths that re-execute. - * @param text - The full accumulated markdown source. - * @returns Frozen and tail blocks with stream-stable render keys. - */ - update(text) { - if (this.cached !== null && text === this.prevText) return this.cached; - if (!text.startsWith(this.prevText)) { - this.prevText = ""; - this.tailStart = 0; - this.frozen = []; - this.generation += 1; - } - this.prevText = text; - const base = this.tailStart; - const blocks = this.parse(text.slice(base)).children; - let firstUnstable = Math.max(0, blocks.length - UNSTABLE_TAIL_BLOCKS); - if (firstUnstable > 0) { - const cutEnd = blocks[firstUnstable - 1]?.position?.end.offset; - if (cutEnd === void 0) firstUnstable = 0; - else { - for (const node of blocks.slice(0, firstUnstable)) this.frozen.push({ - node, - key: blockKey(node, base, this.frozen.length) - }); - this.tailStart = base + cutEnd; - } - } - const tail = blocks.slice(firstUnstable).map((node, index) => ({ - node, - key: blockKey(node, base, index) - })); - this.cached = { - frozen: [...this.frozen], - tail, - generation: this.generation - }; - return this.cached; - } - }; - // node_modules/mdast-util-to-string/lib/index.js - /** - * @typedef {import('mdast').Nodes} Nodes - * - * @typedef Options - * Configuration (optional). - * @property {boolean | null | undefined} [includeImageAlt=true] - * Whether to use `alt` for `image`s (default: `true`). - * @property {boolean | null | undefined} [includeHtml=true] - * Whether to use `value` of HTML (default: `true`). - */ - /** @type {Options} */ - const emptyOptions = {}; - /** - * Get the text content of a node or list of nodes. - * - * Prefers the node’s plain-text fields, otherwise serializes its children, - * and if the given value is an array, serialize the nodes in it. - * - * @param {unknown} [value] - * Thing to serialize, typically `Node`. - * @param {Options | null | undefined} [options] - * Configuration (optional). - * @returns {string} - * Serialized `value`. - */ - function toString(value, options) { - const settings = options || emptyOptions; - return one(value, typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true, typeof settings.includeHtml === "boolean" ? settings.includeHtml : true); - } - /** - * One node or several nodes. - * - * @param {unknown} value - * Thing to serialize. - * @param {boolean} includeImageAlt - * Include image `alt`s. - * @param {boolean} includeHtml - * Include HTML. - * @returns {string} - * Serialized node. - */ - function one(value, includeImageAlt, includeHtml) { - if (node(value)) { - if ("value" in value) return value.type === "html" && !includeHtml ? "" : value.value; - if (includeImageAlt && "alt" in value && value.alt) return value.alt; - if ("children" in value) return all(value.children, includeImageAlt, includeHtml); - } - if (Array.isArray(value)) return all(value, includeImageAlt, includeHtml); - return ""; - } - /** - * Serialize a list of nodes. - * - * @param {Array<unknown>} values - * Thing to serialize. - * @param {boolean} includeImageAlt - * Include image `alt`s. - * @param {boolean} includeHtml - * Include HTML. - * @returns {string} - * Serialized nodes. - */ - function all(values, includeImageAlt, includeHtml) { - /** @type {Array<string>} */ - const result = []; - let index = -1; - while (++index < values.length) result[index] = one(values[index], includeImageAlt, includeHtml); - return result.join(""); - } - /** - * Check if `value` looks like a node. - * - * @param {unknown} value - * Thing. - * @returns {value is Nodes} - * Whether `value` is a node. - */ - function node(value) { - return Boolean(value && typeof value === "object"); - } - // node_modules/character-entities/index.js - /** - * Map of named character references. - * - * @type {Record<string, string>} - */ - const characterEntities = { - AElig: "Æ", - AMP: "&", - Aacute: "Á", - Abreve: "Ă", - Acirc: "Â", - Acy: "А", - Afr: "𝔄", - Agrave: "À", - Alpha: "Α", - Amacr: "Ā", - And: "⩓", - Aogon: "Ą", - Aopf: "𝔸", - ApplyFunction: "⁡", - Aring: "Å", - Ascr: "𝒜", - Assign: "≔", - Atilde: "Ã", - Auml: "Ä", - Backslash: "∖", - Barv: "⫧", - Barwed: "⌆", - Bcy: "Б", - Because: "∵", - Bernoullis: "ℬ", - Beta: "Β", - Bfr: "𝔅", - Bopf: "𝔹", - Breve: "˘", - Bscr: "ℬ", - Bumpeq: "≎", - CHcy: "Ч", - COPY: "©", - Cacute: "Ć", - Cap: "⋒", - CapitalDifferentialD: "ⅅ", - Cayleys: "ℭ", - Ccaron: "Č", - Ccedil: "Ç", - Ccirc: "Ĉ", - Cconint: "∰", - Cdot: "Ċ", - Cedilla: "¸", - CenterDot: "·", - Cfr: "ℭ", - Chi: "Χ", - CircleDot: "⊙", - CircleMinus: "⊖", - CirclePlus: "⊕", - CircleTimes: "⊗", - ClockwiseContourIntegral: "∲", - CloseCurlyDoubleQuote: "”", - CloseCurlyQuote: "’", - Colon: "∷", - Colone: "⩴", - Congruent: "≡", - Conint: "∯", - ContourIntegral: "∮", - Copf: "ℂ", - Coproduct: "∐", - CounterClockwiseContourIntegral: "∳", - Cross: "⨯", - Cscr: "𝒞", - Cup: "⋓", - CupCap: "≍", - DD: "ⅅ", - DDotrahd: "⤑", - DJcy: "Ђ", - DScy: "Ѕ", - DZcy: "Џ", - Dagger: "‡", - Darr: "↡", - Dashv: "⫤", - Dcaron: "Ď", - Dcy: "Д", - Del: "∇", - Delta: "Δ", - Dfr: "𝔇", - DiacriticalAcute: "´", - DiacriticalDot: "˙", - DiacriticalDoubleAcute: "˝", - DiacriticalGrave: "`", - DiacriticalTilde: "˜", - Diamond: "⋄", - DifferentialD: "ⅆ", - Dopf: "𝔻", - Dot: "¨", - DotDot: "⃜", - DotEqual: "≐", - DoubleContourIntegral: "∯", - DoubleDot: "¨", - DoubleDownArrow: "⇓", - DoubleLeftArrow: "⇐", - DoubleLeftRightArrow: "⇔", - DoubleLeftTee: "⫤", - DoubleLongLeftArrow: "⟸", - DoubleLongLeftRightArrow: "⟺", - DoubleLongRightArrow: "⟹", - DoubleRightArrow: "⇒", - DoubleRightTee: "⊨", - DoubleUpArrow: "⇑", - DoubleUpDownArrow: "⇕", - DoubleVerticalBar: "∥", - DownArrow: "↓", - DownArrowBar: "⤓", - DownArrowUpArrow: "⇵", - DownBreve: "̑", - DownLeftRightVector: "⥐", - DownLeftTeeVector: "⥞", - DownLeftVector: "↽", - DownLeftVectorBar: "⥖", - DownRightTeeVector: "⥟", - DownRightVector: "⇁", - DownRightVectorBar: "⥗", - DownTee: "⊤", - DownTeeArrow: "↧", - Downarrow: "⇓", - Dscr: "𝒟", - Dstrok: "Đ", - ENG: "Ŋ", - ETH: "Ð", - Eacute: "É", - Ecaron: "Ě", - Ecirc: "Ê", - Ecy: "Э", - Edot: "Ė", - Efr: "𝔈", - Egrave: "È", - Element: "∈", - Emacr: "Ē", - EmptySmallSquare: "◻", - EmptyVerySmallSquare: "▫", - Eogon: "Ę", - Eopf: "𝔼", - Epsilon: "Ε", - Equal: "⩵", - EqualTilde: "≂", - Equilibrium: "⇌", - Escr: "ℰ", - Esim: "⩳", - Eta: "Η", - Euml: "Ë", - Exists: "∃", - ExponentialE: "ⅇ", - Fcy: "Ф", - Ffr: "𝔉", - FilledSmallSquare: "◼", - FilledVerySmallSquare: "▪", - Fopf: "𝔽", - ForAll: "∀", - Fouriertrf: "ℱ", - Fscr: "ℱ", - GJcy: "Ѓ", - GT: ">", - Gamma: "Γ", - Gammad: "Ϝ", - Gbreve: "Ğ", - Gcedil: "Ģ", - Gcirc: "Ĝ", - Gcy: "Г", - Gdot: "Ġ", - Gfr: "𝔊", - Gg: "⋙", - Gopf: "𝔾", - GreaterEqual: "≥", - GreaterEqualLess: "⋛", - GreaterFullEqual: "≧", - GreaterGreater: "⪢", - GreaterLess: "≷", - GreaterSlantEqual: "⩾", - GreaterTilde: "≳", - Gscr: "𝒢", - Gt: "≫", - HARDcy: "Ъ", - Hacek: "ˇ", - Hat: "^", - Hcirc: "Ĥ", - Hfr: "ℌ", - HilbertSpace: "ℋ", - Hopf: "ℍ", - HorizontalLine: "─", - Hscr: "ℋ", - Hstrok: "Ħ", - HumpDownHump: "≎", - HumpEqual: "≏", - IEcy: "Е", - IJlig: "IJ", - IOcy: "Ё", - Iacute: "Í", - Icirc: "Î", - Icy: "И", - Idot: "İ", - Ifr: "ℑ", - Igrave: "Ì", - Im: "ℑ", - Imacr: "Ī", - ImaginaryI: "ⅈ", - Implies: "⇒", - Int: "∬", - Integral: "∫", - Intersection: "⋂", - InvisibleComma: "⁣", - InvisibleTimes: "⁢", - Iogon: "Į", - Iopf: "𝕀", - Iota: "Ι", - Iscr: "ℐ", - Itilde: "Ĩ", - Iukcy: "І", - Iuml: "Ï", - Jcirc: "Ĵ", - Jcy: "Й", - Jfr: "𝔍", - Jopf: "𝕁", - Jscr: "𝒥", - Jsercy: "Ј", - Jukcy: "Є", - KHcy: "Х", - KJcy: "Ќ", - Kappa: "Κ", - Kcedil: "Ķ", - Kcy: "К", - Kfr: "𝔎", - Kopf: "𝕂", - Kscr: "𝒦", - LJcy: "Љ", - LT: "<", - Lacute: "Ĺ", - Lambda: "Λ", - Lang: "⟪", - Laplacetrf: "ℒ", - Larr: "↞", - Lcaron: "Ľ", - Lcedil: "Ļ", - Lcy: "Л", - LeftAngleBracket: "⟨", - LeftArrow: "←", - LeftArrowBar: "⇤", - LeftArrowRightArrow: "⇆", - LeftCeiling: "⌈", - LeftDoubleBracket: "⟦", - LeftDownTeeVector: "⥡", - LeftDownVector: "⇃", - LeftDownVectorBar: "⥙", - LeftFloor: "⌊", - LeftRightArrow: "↔", - LeftRightVector: "⥎", - LeftTee: "⊣", - LeftTeeArrow: "↤", - LeftTeeVector: "⥚", - LeftTriangle: "⊲", - LeftTriangleBar: "⧏", - LeftTriangleEqual: "⊴", - LeftUpDownVector: "⥑", - LeftUpTeeVector: "⥠", - LeftUpVector: "↿", - LeftUpVectorBar: "⥘", - LeftVector: "↼", - LeftVectorBar: "⥒", - Leftarrow: "⇐", - Leftrightarrow: "⇔", - LessEqualGreater: "⋚", - LessFullEqual: "≦", - LessGreater: "≶", - LessLess: "⪡", - LessSlantEqual: "⩽", - LessTilde: "≲", - Lfr: "𝔏", - Ll: "⋘", - Lleftarrow: "⇚", - Lmidot: "Ŀ", - LongLeftArrow: "⟵", - LongLeftRightArrow: "⟷", - LongRightArrow: "⟶", - Longleftarrow: "⟸", - Longleftrightarrow: "⟺", - Longrightarrow: "⟹", - Lopf: "𝕃", - LowerLeftArrow: "↙", - LowerRightArrow: "↘", - Lscr: "ℒ", - Lsh: "↰", - Lstrok: "Ł", - Lt: "≪", - Map: "⤅", - Mcy: "М", - MediumSpace: " ", - Mellintrf: "ℳ", - Mfr: "𝔐", - MinusPlus: "∓", - Mopf: "𝕄", - Mscr: "ℳ", - Mu: "Μ", - NJcy: "Њ", - Nacute: "Ń", - Ncaron: "Ň", - Ncedil: "Ņ", - Ncy: "Н", - NegativeMediumSpace: "​", - NegativeThickSpace: "​", - NegativeThinSpace: "​", - NegativeVeryThinSpace: "​", - NestedGreaterGreater: "≫", - NestedLessLess: "≪", - NewLine: "\n", - Nfr: "𝔑", - NoBreak: "⁠", - NonBreakingSpace: "\xA0", - Nopf: "ℕ", - Not: "⫬", - NotCongruent: "≢", - NotCupCap: "≭", - NotDoubleVerticalBar: "∦", - NotElement: "∉", - NotEqual: "≠", - NotEqualTilde: "≂̸", - NotExists: "∄", - NotGreater: "≯", - NotGreaterEqual: "≱", - NotGreaterFullEqual: "≧̸", - NotGreaterGreater: "≫̸", - NotGreaterLess: "≹", - NotGreaterSlantEqual: "⩾̸", - NotGreaterTilde: "≵", - NotHumpDownHump: "≎̸", - NotHumpEqual: "≏̸", - NotLeftTriangle: "⋪", - NotLeftTriangleBar: "⧏̸", - NotLeftTriangleEqual: "⋬", - NotLess: "≮", - NotLessEqual: "≰", - NotLessGreater: "≸", - NotLessLess: "≪̸", - NotLessSlantEqual: "⩽̸", - NotLessTilde: "≴", - NotNestedGreaterGreater: "⪢̸", - NotNestedLessLess: "⪡̸", - NotPrecedes: "⊀", - NotPrecedesEqual: "⪯̸", - NotPrecedesSlantEqual: "⋠", - NotReverseElement: "∌", - NotRightTriangle: "⋫", - NotRightTriangleBar: "⧐̸", - NotRightTriangleEqual: "⋭", - NotSquareSubset: "⊏̸", - NotSquareSubsetEqual: "⋢", - NotSquareSuperset: "⊐̸", - NotSquareSupersetEqual: "⋣", - NotSubset: "⊂⃒", - NotSubsetEqual: "⊈", - NotSucceeds: "⊁", - NotSucceedsEqual: "⪰̸", - NotSucceedsSlantEqual: "⋡", - NotSucceedsTilde: "≿̸", - NotSuperset: "⊃⃒", - NotSupersetEqual: "⊉", - NotTilde: "≁", - NotTildeEqual: "≄", - NotTildeFullEqual: "≇", - NotTildeTilde: "≉", - NotVerticalBar: "∤", - Nscr: "𝒩", - Ntilde: "Ñ", - Nu: "Ν", - OElig: "Œ", - Oacute: "Ó", - Ocirc: "Ô", - Ocy: "О", - Odblac: "Ő", - Ofr: "𝔒", - Ograve: "Ò", - Omacr: "Ō", - Omega: "Ω", - Omicron: "Ο", - Oopf: "𝕆", - OpenCurlyDoubleQuote: "“", - OpenCurlyQuote: "‘", - Or: "⩔", - Oscr: "𝒪", - Oslash: "Ø", - Otilde: "Õ", - Otimes: "⨷", - Ouml: "Ö", - OverBar: "‾", - OverBrace: "⏞", - OverBracket: "⎴", - OverParenthesis: "⏜", - PartialD: "∂", - Pcy: "П", - Pfr: "𝔓", - Phi: "Φ", - Pi: "Π", - PlusMinus: "±", - Poincareplane: "ℌ", - Popf: "ℙ", - Pr: "⪻", - Precedes: "≺", - PrecedesEqual: "⪯", - PrecedesSlantEqual: "≼", - PrecedesTilde: "≾", - Prime: "″", - Product: "∏", - Proportion: "∷", - Proportional: "∝", - Pscr: "𝒫", - Psi: "Ψ", - QUOT: "\"", - Qfr: "𝔔", - Qopf: "ℚ", - Qscr: "𝒬", - RBarr: "⤐", - REG: "®", - Racute: "Ŕ", - Rang: "⟫", - Rarr: "↠", - Rarrtl: "⤖", - Rcaron: "Ř", - Rcedil: "Ŗ", - Rcy: "Р", - Re: "ℜ", - ReverseElement: "∋", - ReverseEquilibrium: "⇋", - ReverseUpEquilibrium: "⥯", - Rfr: "ℜ", - Rho: "Ρ", - RightAngleBracket: "⟩", - RightArrow: "→", - RightArrowBar: "⇥", - RightArrowLeftArrow: "⇄", - RightCeiling: "⌉", - RightDoubleBracket: "⟧", - RightDownTeeVector: "⥝", - RightDownVector: "⇂", - RightDownVectorBar: "⥕", - RightFloor: "⌋", - RightTee: "⊢", - RightTeeArrow: "↦", - RightTeeVector: "⥛", - RightTriangle: "⊳", - RightTriangleBar: "⧐", - RightTriangleEqual: "⊵", - RightUpDownVector: "⥏", - RightUpTeeVector: "⥜", - RightUpVector: "↾", - RightUpVectorBar: "⥔", - RightVector: "⇀", - RightVectorBar: "⥓", - Rightarrow: "⇒", - Ropf: "ℝ", - RoundImplies: "⥰", - Rrightarrow: "⇛", - Rscr: "ℛ", - Rsh: "↱", - RuleDelayed: "⧴", - SHCHcy: "Щ", - SHcy: "Ш", - SOFTcy: "Ь", - Sacute: "Ś", - Sc: "⪼", - Scaron: "Š", - Scedil: "Ş", - Scirc: "Ŝ", - Scy: "С", - Sfr: "𝔖", - ShortDownArrow: "↓", - ShortLeftArrow: "←", - ShortRightArrow: "→", - ShortUpArrow: "↑", - Sigma: "Σ", - SmallCircle: "∘", - Sopf: "𝕊", - Sqrt: "√", - Square: "□", - SquareIntersection: "⊓", - SquareSubset: "⊏", - SquareSubsetEqual: "⊑", - SquareSuperset: "⊐", - SquareSupersetEqual: "⊒", - SquareUnion: "⊔", - Sscr: "𝒮", - Star: "⋆", - Sub: "⋐", - Subset: "⋐", - SubsetEqual: "⊆", - Succeeds: "≻", - SucceedsEqual: "⪰", - SucceedsSlantEqual: "≽", - SucceedsTilde: "≿", - SuchThat: "∋", - Sum: "∑", - Sup: "⋑", - Superset: "⊃", - SupersetEqual: "⊇", - Supset: "⋑", - THORN: "Þ", - TRADE: "™", - TSHcy: "Ћ", - TScy: "Ц", - Tab: " ", - Tau: "Τ", - Tcaron: "Ť", - Tcedil: "Ţ", - Tcy: "Т", - Tfr: "𝔗", - Therefore: "∴", - Theta: "Θ", - ThickSpace: "  ", - ThinSpace: " ", - Tilde: "∼", - TildeEqual: "≃", - TildeFullEqual: "≅", - TildeTilde: "≈", - Topf: "𝕋", - TripleDot: "⃛", - Tscr: "𝒯", - Tstrok: "Ŧ", - Uacute: "Ú", - Uarr: "↟", - Uarrocir: "⥉", - Ubrcy: "Ў", - Ubreve: "Ŭ", - Ucirc: "Û", - Ucy: "У", - Udblac: "Ű", - Ufr: "𝔘", - Ugrave: "Ù", - Umacr: "Ū", - UnderBar: "_", - UnderBrace: "⏟", - UnderBracket: "⎵", - UnderParenthesis: "⏝", - Union: "⋃", - UnionPlus: "⊎", - Uogon: "Ų", - Uopf: "𝕌", - UpArrow: "↑", - UpArrowBar: "⤒", - UpArrowDownArrow: "⇅", - UpDownArrow: "↕", - UpEquilibrium: "⥮", - UpTee: "⊥", - UpTeeArrow: "↥", - Uparrow: "⇑", - Updownarrow: "⇕", - UpperLeftArrow: "↖", - UpperRightArrow: "↗", - Upsi: "ϒ", - Upsilon: "Υ", - Uring: "Ů", - Uscr: "𝒰", - Utilde: "Ũ", - Uuml: "Ü", - VDash: "⊫", - Vbar: "⫫", - Vcy: "В", - Vdash: "⊩", - Vdashl: "⫦", - Vee: "⋁", - Verbar: "‖", - Vert: "‖", - VerticalBar: "∣", - VerticalLine: "|", - VerticalSeparator: "❘", - VerticalTilde: "≀", - VeryThinSpace: " ", - Vfr: "𝔙", - Vopf: "𝕍", - Vscr: "𝒱", - Vvdash: "⊪", - Wcirc: "Ŵ", - Wedge: "⋀", - Wfr: "𝔚", - Wopf: "𝕎", - Wscr: "𝒲", - Xfr: "𝔛", - Xi: "Ξ", - Xopf: "𝕏", - Xscr: "𝒳", - YAcy: "Я", - YIcy: "Ї", - YUcy: "Ю", - Yacute: "Ý", - Ycirc: "Ŷ", - Ycy: "Ы", - Yfr: "𝔜", - Yopf: "𝕐", - Yscr: "𝒴", - Yuml: "Ÿ", - ZHcy: "Ж", - Zacute: "Ź", - Zcaron: "Ž", - Zcy: "З", - Zdot: "Ż", - ZeroWidthSpace: "​", - Zeta: "Ζ", - Zfr: "ℨ", - Zopf: "ℤ", - Zscr: "𝒵", - aacute: "á", - abreve: "ă", - ac: "∾", - acE: "∾̳", - acd: "∿", - acirc: "â", - acute: "´", - acy: "а", - aelig: "æ", - af: "⁡", - afr: "𝔞", - agrave: "à", - alefsym: "ℵ", - aleph: "ℵ", - alpha: "α", - amacr: "ā", - amalg: "⨿", - amp: "&", - and: "∧", - andand: "⩕", - andd: "⩜", - andslope: "⩘", - andv: "⩚", - ang: "∠", - ange: "⦤", - angle: "∠", - angmsd: "∡", - angmsdaa: "⦨", - angmsdab: "⦩", - angmsdac: "⦪", - angmsdad: "⦫", - angmsdae: "⦬", - angmsdaf: "⦭", - angmsdag: "⦮", - angmsdah: "⦯", - angrt: "∟", - angrtvb: "⊾", - angrtvbd: "⦝", - angsph: "∢", - angst: "Å", - angzarr: "⍼", - aogon: "ą", - aopf: "𝕒", - ap: "≈", - apE: "⩰", - apacir: "⩯", - ape: "≊", - apid: "≋", - apos: "'", - approx: "≈", - approxeq: "≊", - aring: "å", - ascr: "𝒶", - ast: "*", - asymp: "≈", - asympeq: "≍", - atilde: "ã", - auml: "ä", - awconint: "∳", - awint: "⨑", - bNot: "⫭", - backcong: "≌", - backepsilon: "϶", - backprime: "‵", - backsim: "∽", - backsimeq: "⋍", - barvee: "⊽", - barwed: "⌅", - barwedge: "⌅", - bbrk: "⎵", - bbrktbrk: "⎶", - bcong: "≌", - bcy: "б", - bdquo: "„", - becaus: "∵", - because: "∵", - bemptyv: "⦰", - bepsi: "϶", - bernou: "ℬ", - beta: "β", - beth: "ℶ", - between: "≬", - bfr: "𝔟", - bigcap: "⋂", - bigcirc: "◯", - bigcup: "⋃", - bigodot: "⨀", - bigoplus: "⨁", - bigotimes: "⨂", - bigsqcup: "⨆", - bigstar: "★", - bigtriangledown: "▽", - bigtriangleup: "△", - biguplus: "⨄", - bigvee: "⋁", - bigwedge: "⋀", - bkarow: "⤍", - blacklozenge: "⧫", - blacksquare: "▪", - blacktriangle: "▴", - blacktriangledown: "▾", - blacktriangleleft: "◂", - blacktriangleright: "▸", - blank: "␣", - blk12: "▒", - blk14: "░", - blk34: "▓", - block: "█", - bne: "=⃥", - bnequiv: "≡⃥", - bnot: "⌐", - bopf: "𝕓", - bot: "⊥", - bottom: "⊥", - bowtie: "⋈", - boxDL: "╗", - boxDR: "╔", - boxDl: "╖", - boxDr: "╓", - boxH: "═", - boxHD: "╦", - boxHU: "╩", - boxHd: "╤", - boxHu: "╧", - boxUL: "╝", - boxUR: "╚", - boxUl: "╜", - boxUr: "╙", - boxV: "║", - boxVH: "╬", - boxVL: "╣", - boxVR: "╠", - boxVh: "╫", - boxVl: "╢", - boxVr: "╟", - boxbox: "⧉", - boxdL: "╕", - boxdR: "╒", - boxdl: "┐", - boxdr: "┌", - boxh: "─", - boxhD: "╥", - boxhU: "╨", - boxhd: "┬", - boxhu: "┴", - boxminus: "⊟", - boxplus: "⊞", - boxtimes: "⊠", - boxuL: "╛", - boxuR: "╘", - boxul: "┘", - boxur: "└", - boxv: "│", - boxvH: "╪", - boxvL: "╡", - boxvR: "╞", - boxvh: "┼", - boxvl: "┤", - boxvr: "├", - bprime: "‵", - breve: "˘", - brvbar: "¦", - bscr: "𝒷", - bsemi: "⁏", - bsim: "∽", - bsime: "⋍", - bsol: "\\", - bsolb: "⧅", - bsolhsub: "⟈", - bull: "•", - bullet: "•", - bump: "≎", - bumpE: "⪮", - bumpe: "≏", - bumpeq: "≏", - cacute: "ć", - cap: "∩", - capand: "⩄", - capbrcup: "⩉", - capcap: "⩋", - capcup: "⩇", - capdot: "⩀", - caps: "∩︀", - caret: "⁁", - caron: "ˇ", - ccaps: "⩍", - ccaron: "č", - ccedil: "ç", - ccirc: "ĉ", - ccups: "⩌", - ccupssm: "⩐", - cdot: "ċ", - cedil: "¸", - cemptyv: "⦲", - cent: "¢", - centerdot: "·", - cfr: "𝔠", - chcy: "ч", - check: "✓", - checkmark: "✓", - chi: "χ", - cir: "○", - cirE: "⧃", - circ: "ˆ", - circeq: "≗", - circlearrowleft: "↺", - circlearrowright: "↻", - circledR: "®", - circledS: "Ⓢ", - circledast: "⊛", - circledcirc: "⊚", - circleddash: "⊝", - cire: "≗", - cirfnint: "⨐", - cirmid: "⫯", - cirscir: "⧂", - clubs: "♣", - clubsuit: "♣", - colon: ":", - colone: "≔", - coloneq: "≔", - comma: ",", - commat: "@", - comp: "∁", - compfn: "∘", - complement: "∁", - complexes: "ℂ", - cong: "≅", - congdot: "⩭", - conint: "∮", - copf: "𝕔", - coprod: "∐", - copy: "©", - copysr: "℗", - crarr: "↵", - cross: "✗", - cscr: "𝒸", - csub: "⫏", - csube: "⫑", - csup: "⫐", - csupe: "⫒", - ctdot: "⋯", - cudarrl: "⤸", - cudarrr: "⤵", - cuepr: "⋞", - cuesc: "⋟", - cularr: "↶", - cularrp: "⤽", - cup: "∪", - cupbrcap: "⩈", - cupcap: "⩆", - cupcup: "⩊", - cupdot: "⊍", - cupor: "⩅", - cups: "∪︀", - curarr: "↷", - curarrm: "⤼", - curlyeqprec: "⋞", - curlyeqsucc: "⋟", - curlyvee: "⋎", - curlywedge: "⋏", - curren: "¤", - curvearrowleft: "↶", - curvearrowright: "↷", - cuvee: "⋎", - cuwed: "⋏", - cwconint: "∲", - cwint: "∱", - cylcty: "⌭", - dArr: "⇓", - dHar: "⥥", - dagger: "†", - daleth: "ℸ", - darr: "↓", - dash: "‐", - dashv: "⊣", - dbkarow: "⤏", - dblac: "˝", - dcaron: "ď", - dcy: "д", - dd: "ⅆ", - ddagger: "‡", - ddarr: "⇊", - ddotseq: "⩷", - deg: "°", - delta: "δ", - demptyv: "⦱", - dfisht: "⥿", - dfr: "𝔡", - dharl: "⇃", - dharr: "⇂", - diam: "⋄", - diamond: "⋄", - diamondsuit: "♦", - diams: "♦", - die: "¨", - digamma: "ϝ", - disin: "⋲", - div: "÷", - divide: "÷", - divideontimes: "⋇", - divonx: "⋇", - djcy: "ђ", - dlcorn: "⌞", - dlcrop: "⌍", - dollar: "$", - dopf: "𝕕", - dot: "˙", - doteq: "≐", - doteqdot: "≑", - dotminus: "∸", - dotplus: "∔", - dotsquare: "⊡", - doublebarwedge: "⌆", - downarrow: "↓", - downdownarrows: "⇊", - downharpoonleft: "⇃", - downharpoonright: "⇂", - drbkarow: "⤐", - drcorn: "⌟", - drcrop: "⌌", - dscr: "𝒹", - dscy: "ѕ", - dsol: "⧶", - dstrok: "đ", - dtdot: "⋱", - dtri: "▿", - dtrif: "▾", - duarr: "⇵", - duhar: "⥯", - dwangle: "⦦", - dzcy: "џ", - dzigrarr: "⟿", - eDDot: "⩷", - eDot: "≑", - eacute: "é", - easter: "⩮", - ecaron: "ě", - ecir: "≖", - ecirc: "ê", - ecolon: "≕", - ecy: "э", - edot: "ė", - ee: "ⅇ", - efDot: "≒", - efr: "𝔢", - eg: "⪚", - egrave: "è", - egs: "⪖", - egsdot: "⪘", - el: "⪙", - elinters: "⏧", - ell: "ℓ", - els: "⪕", - elsdot: "⪗", - emacr: "ē", - empty: "∅", - emptyset: "∅", - emptyv: "∅", - emsp13: " ", - emsp14: " ", - emsp: " ", - eng: "ŋ", - ensp: " ", - eogon: "ę", - eopf: "𝕖", - epar: "⋕", - eparsl: "⧣", - eplus: "⩱", - epsi: "ε", - epsilon: "ε", - epsiv: "ϵ", - eqcirc: "≖", - eqcolon: "≕", - eqsim: "≂", - eqslantgtr: "⪖", - eqslantless: "⪕", - equals: "=", - equest: "≟", - equiv: "≡", - equivDD: "⩸", - eqvparsl: "⧥", - erDot: "≓", - erarr: "⥱", - escr: "ℯ", - esdot: "≐", - esim: "≂", - eta: "η", - eth: "ð", - euml: "ë", - euro: "€", - excl: "!", - exist: "∃", - expectation: "ℰ", - exponentiale: "ⅇ", - fallingdotseq: "≒", - fcy: "ф", - female: "♀", - ffilig: "ffi", - fflig: "ff", - ffllig: "ffl", - ffr: "𝔣", - filig: "fi", - fjlig: "fj", - flat: "♭", - fllig: "fl", - fltns: "▱", - fnof: "ƒ", - fopf: "𝕗", - forall: "∀", - fork: "⋔", - forkv: "⫙", - fpartint: "⨍", - frac12: "½", - frac13: "⅓", - frac14: "¼", - frac15: "⅕", - frac16: "⅙", - frac18: "⅛", - frac23: "⅔", - frac25: "⅖", - frac34: "¾", - frac35: "⅗", - frac38: "⅜", - frac45: "⅘", - frac56: "⅚", - frac58: "⅝", - frac78: "⅞", - frasl: "⁄", - frown: "⌢", - fscr: "𝒻", - gE: "≧", - gEl: "⪌", - gacute: "ǵ", - gamma: "γ", - gammad: "ϝ", - gap: "⪆", - gbreve: "ğ", - gcirc: "ĝ", - gcy: "г", - gdot: "ġ", - ge: "≥", - gel: "⋛", - geq: "≥", - geqq: "≧", - geqslant: "⩾", - ges: "⩾", - gescc: "⪩", - gesdot: "⪀", - gesdoto: "⪂", - gesdotol: "⪄", - gesl: "⋛︀", - gesles: "⪔", - gfr: "𝔤", - gg: "≫", - ggg: "⋙", - gimel: "ℷ", - gjcy: "ѓ", - gl: "≷", - glE: "⪒", - gla: "⪥", - glj: "⪤", - gnE: "≩", - gnap: "⪊", - gnapprox: "⪊", - gne: "⪈", - gneq: "⪈", - gneqq: "≩", - gnsim: "⋧", - gopf: "𝕘", - grave: "`", - gscr: "ℊ", - gsim: "≳", - gsime: "⪎", - gsiml: "⪐", - gt: ">", - gtcc: "⪧", - gtcir: "⩺", - gtdot: "⋗", - gtlPar: "⦕", - gtquest: "⩼", - gtrapprox: "⪆", - gtrarr: "⥸", - gtrdot: "⋗", - gtreqless: "⋛", - gtreqqless: "⪌", - gtrless: "≷", - gtrsim: "≳", - gvertneqq: "≩︀", - gvnE: "≩︀", - hArr: "⇔", - hairsp: " ", - half: "½", - hamilt: "ℋ", - hardcy: "ъ", - harr: "↔", - harrcir: "⥈", - harrw: "↭", - hbar: "ℏ", - hcirc: "ĥ", - hearts: "♥", - heartsuit: "♥", - hellip: "…", - hercon: "⊹", - hfr: "𝔥", - hksearow: "⤥", - hkswarow: "⤦", - hoarr: "⇿", - homtht: "∻", - hookleftarrow: "↩", - hookrightarrow: "↪", - hopf: "𝕙", - horbar: "―", - hscr: "𝒽", - hslash: "ℏ", - hstrok: "ħ", - hybull: "⁃", - hyphen: "‐", - iacute: "í", - ic: "⁣", - icirc: "î", - icy: "и", - iecy: "е", - iexcl: "¡", - iff: "⇔", - ifr: "𝔦", - igrave: "ì", - ii: "ⅈ", - iiiint: "⨌", - iiint: "∭", - iinfin: "⧜", - iiota: "℩", - ijlig: "ij", - imacr: "ī", - image: "ℑ", - imagline: "ℐ", - imagpart: "ℑ", - imath: "ı", - imof: "⊷", - imped: "Ƶ", - in: "∈", - incare: "℅", - infin: "∞", - infintie: "⧝", - inodot: "ı", - int: "∫", - intcal: "⊺", - integers: "ℤ", - intercal: "⊺", - intlarhk: "⨗", - intprod: "⨼", - iocy: "ё", - iogon: "į", - iopf: "𝕚", - iota: "ι", - iprod: "⨼", - iquest: "¿", - iscr: "𝒾", - isin: "∈", - isinE: "⋹", - isindot: "⋵", - isins: "⋴", - isinsv: "⋳", - isinv: "∈", - it: "⁢", - itilde: "ĩ", - iukcy: "і", - iuml: "ï", - jcirc: "ĵ", - jcy: "й", - jfr: "𝔧", - jmath: "ȷ", - jopf: "𝕛", - jscr: "𝒿", - jsercy: "ј", - jukcy: "є", - kappa: "κ", - kappav: "ϰ", - kcedil: "ķ", - kcy: "к", - kfr: "𝔨", - kgreen: "ĸ", - khcy: "х", - kjcy: "ќ", - kopf: "𝕜", - kscr: "𝓀", - lAarr: "⇚", - lArr: "⇐", - lAtail: "⤛", - lBarr: "⤎", - lE: "≦", - lEg: "⪋", - lHar: "⥢", - lacute: "ĺ", - laemptyv: "⦴", - lagran: "ℒ", - lambda: "λ", - lang: "⟨", - langd: "⦑", - langle: "⟨", - lap: "⪅", - laquo: "«", - larr: "←", - larrb: "⇤", - larrbfs: "⤟", - larrfs: "⤝", - larrhk: "↩", - larrlp: "↫", - larrpl: "⤹", - larrsim: "⥳", - larrtl: "↢", - lat: "⪫", - latail: "⤙", - late: "⪭", - lates: "⪭︀", - lbarr: "⤌", - lbbrk: "❲", - lbrace: "{", - lbrack: "[", - lbrke: "⦋", - lbrksld: "⦏", - lbrkslu: "⦍", - lcaron: "ľ", - lcedil: "ļ", - lceil: "⌈", - lcub: "{", - lcy: "л", - ldca: "⤶", - ldquo: "“", - ldquor: "„", - ldrdhar: "⥧", - ldrushar: "⥋", - ldsh: "↲", - le: "≤", - leftarrow: "←", - leftarrowtail: "↢", - leftharpoondown: "↽", - leftharpoonup: "↼", - leftleftarrows: "⇇", - leftrightarrow: "↔", - leftrightarrows: "⇆", - leftrightharpoons: "⇋", - leftrightsquigarrow: "↭", - leftthreetimes: "⋋", - leg: "⋚", - leq: "≤", - leqq: "≦", - leqslant: "⩽", - les: "⩽", - lescc: "⪨", - lesdot: "⩿", - lesdoto: "⪁", - lesdotor: "⪃", - lesg: "⋚︀", - lesges: "⪓", - lessapprox: "⪅", - lessdot: "⋖", - lesseqgtr: "⋚", - lesseqqgtr: "⪋", - lessgtr: "≶", - lesssim: "≲", - lfisht: "⥼", - lfloor: "⌊", - lfr: "𝔩", - lg: "≶", - lgE: "⪑", - lhard: "↽", - lharu: "↼", - lharul: "⥪", - lhblk: "▄", - ljcy: "љ", - ll: "≪", - llarr: "⇇", - llcorner: "⌞", - llhard: "⥫", - lltri: "◺", - lmidot: "ŀ", - lmoust: "⎰", - lmoustache: "⎰", - lnE: "≨", - lnap: "⪉", - lnapprox: "⪉", - lne: "⪇", - lneq: "⪇", - lneqq: "≨", - lnsim: "⋦", - loang: "⟬", - loarr: "⇽", - lobrk: "⟦", - longleftarrow: "⟵", - longleftrightarrow: "⟷", - longmapsto: "⟼", - longrightarrow: "⟶", - looparrowleft: "↫", - looparrowright: "↬", - lopar: "⦅", - lopf: "𝕝", - loplus: "⨭", - lotimes: "⨴", - lowast: "∗", - lowbar: "_", - loz: "◊", - lozenge: "◊", - lozf: "⧫", - lpar: "(", - lparlt: "⦓", - lrarr: "⇆", - lrcorner: "⌟", - lrhar: "⇋", - lrhard: "⥭", - lrm: "‎", - lrtri: "⊿", - lsaquo: "‹", - lscr: "𝓁", - lsh: "↰", - lsim: "≲", - lsime: "⪍", - lsimg: "⪏", - lsqb: "[", - lsquo: "‘", - lsquor: "‚", - lstrok: "ł", - lt: "<", - ltcc: "⪦", - ltcir: "⩹", - ltdot: "⋖", - lthree: "⋋", - ltimes: "⋉", - ltlarr: "⥶", - ltquest: "⩻", - ltrPar: "⦖", - ltri: "◃", - ltrie: "⊴", - ltrif: "◂", - lurdshar: "⥊", - luruhar: "⥦", - lvertneqq: "≨︀", - lvnE: "≨︀", - mDDot: "∺", - macr: "¯", - male: "♂", - malt: "✠", - maltese: "✠", - map: "↦", - mapsto: "↦", - mapstodown: "↧", - mapstoleft: "↤", - mapstoup: "↥", - marker: "▮", - mcomma: "⨩", - mcy: "м", - mdash: "—", - measuredangle: "∡", - mfr: "𝔪", - mho: "℧", - micro: "µ", - mid: "∣", - midast: "*", - midcir: "⫰", - middot: "·", - minus: "−", - minusb: "⊟", - minusd: "∸", - minusdu: "⨪", - mlcp: "⫛", - mldr: "…", - mnplus: "∓", - models: "⊧", - mopf: "𝕞", - mp: "∓", - mscr: "𝓂", - mstpos: "∾", - mu: "μ", - multimap: "⊸", - mumap: "⊸", - nGg: "⋙̸", - nGt: "≫⃒", - nGtv: "≫̸", - nLeftarrow: "⇍", - nLeftrightarrow: "⇎", - nLl: "⋘̸", - nLt: "≪⃒", - nLtv: "≪̸", - nRightarrow: "⇏", - nVDash: "⊯", - nVdash: "⊮", - nabla: "∇", - nacute: "ń", - nang: "∠⃒", - nap: "≉", - napE: "⩰̸", - napid: "≋̸", - napos: "ʼn", - napprox: "≉", - natur: "♮", - natural: "♮", - naturals: "ℕ", - nbsp: "\xA0", - nbump: "≎̸", - nbumpe: "≏̸", - ncap: "⩃", - ncaron: "ň", - ncedil: "ņ", - ncong: "≇", - ncongdot: "⩭̸", - ncup: "⩂", - ncy: "н", - ndash: "–", - ne: "≠", - neArr: "⇗", - nearhk: "⤤", - nearr: "↗", - nearrow: "↗", - nedot: "≐̸", - nequiv: "≢", - nesear: "⤨", - nesim: "≂̸", - nexist: "∄", - nexists: "∄", - nfr: "𝔫", - ngE: "≧̸", - nge: "≱", - ngeq: "≱", - ngeqq: "≧̸", - ngeqslant: "⩾̸", - nges: "⩾̸", - ngsim: "≵", - ngt: "≯", - ngtr: "≯", - nhArr: "⇎", - nharr: "↮", - nhpar: "⫲", - ni: "∋", - nis: "⋼", - nisd: "⋺", - niv: "∋", - njcy: "њ", - nlArr: "⇍", - nlE: "≦̸", - nlarr: "↚", - nldr: "‥", - nle: "≰", - nleftarrow: "↚", - nleftrightarrow: "↮", - nleq: "≰", - nleqq: "≦̸", - nleqslant: "⩽̸", - nles: "⩽̸", - nless: "≮", - nlsim: "≴", - nlt: "≮", - nltri: "⋪", - nltrie: "⋬", - nmid: "∤", - nopf: "𝕟", - not: "¬", - notin: "∉", - notinE: "⋹̸", - notindot: "⋵̸", - notinva: "∉", - notinvb: "⋷", - notinvc: "⋶", - notni: "∌", - notniva: "∌", - notnivb: "⋾", - notnivc: "⋽", - npar: "∦", - nparallel: "∦", - nparsl: "⫽⃥", - npart: "∂̸", - npolint: "⨔", - npr: "⊀", - nprcue: "⋠", - npre: "⪯̸", - nprec: "⊀", - npreceq: "⪯̸", - nrArr: "⇏", - nrarr: "↛", - nrarrc: "⤳̸", - nrarrw: "↝̸", - nrightarrow: "↛", - nrtri: "⋫", - nrtrie: "⋭", - nsc: "⊁", - nsccue: "⋡", - nsce: "⪰̸", - nscr: "𝓃", - nshortmid: "∤", - nshortparallel: "∦", - nsim: "≁", - nsime: "≄", - nsimeq: "≄", - nsmid: "∤", - nspar: "∦", - nsqsube: "⋢", - nsqsupe: "⋣", - nsub: "⊄", - nsubE: "⫅̸", - nsube: "⊈", - nsubset: "⊂⃒", - nsubseteq: "⊈", - nsubseteqq: "⫅̸", - nsucc: "⊁", - nsucceq: "⪰̸", - nsup: "⊅", - nsupE: "⫆̸", - nsupe: "⊉", - nsupset: "⊃⃒", - nsupseteq: "⊉", - nsupseteqq: "⫆̸", - ntgl: "≹", - ntilde: "ñ", - ntlg: "≸", - ntriangleleft: "⋪", - ntrianglelefteq: "⋬", - ntriangleright: "⋫", - ntrianglerighteq: "⋭", - nu: "ν", - num: "#", - numero: "№", - numsp: " ", - nvDash: "⊭", - nvHarr: "⤄", - nvap: "≍⃒", - nvdash: "⊬", - nvge: "≥⃒", - nvgt: ">⃒", - nvinfin: "⧞", - nvlArr: "⤂", - nvle: "≤⃒", - nvlt: "<⃒", - nvltrie: "⊴⃒", - nvrArr: "⤃", - nvrtrie: "⊵⃒", - nvsim: "∼⃒", - nwArr: "⇖", - nwarhk: "⤣", - nwarr: "↖", - nwarrow: "↖", - nwnear: "⤧", - oS: "Ⓢ", - oacute: "ó", - oast: "⊛", - ocir: "⊚", - ocirc: "ô", - ocy: "о", - odash: "⊝", - odblac: "ő", - odiv: "⨸", - odot: "⊙", - odsold: "⦼", - oelig: "œ", - ofcir: "⦿", - ofr: "𝔬", - ogon: "˛", - ograve: "ò", - ogt: "⧁", - ohbar: "⦵", - ohm: "Ω", - oint: "∮", - olarr: "↺", - olcir: "⦾", - olcross: "⦻", - oline: "‾", - olt: "⧀", - omacr: "ō", - omega: "ω", - omicron: "ο", - omid: "⦶", - ominus: "⊖", - oopf: "𝕠", - opar: "⦷", - operp: "⦹", - oplus: "⊕", - or: "∨", - orarr: "↻", - ord: "⩝", - order: "ℴ", - orderof: "ℴ", - ordf: "ª", - ordm: "º", - origof: "⊶", - oror: "⩖", - orslope: "⩗", - orv: "⩛", - oscr: "ℴ", - oslash: "ø", - osol: "⊘", - otilde: "õ", - otimes: "⊗", - otimesas: "⨶", - ouml: "ö", - ovbar: "⌽", - par: "∥", - para: "¶", - parallel: "∥", - parsim: "⫳", - parsl: "⫽", - part: "∂", - pcy: "п", - percnt: "%", - period: ".", - permil: "‰", - perp: "⊥", - pertenk: "‱", - pfr: "𝔭", - phi: "φ", - phiv: "ϕ", - phmmat: "ℳ", - phone: "☎", - pi: "π", - pitchfork: "⋔", - piv: "ϖ", - planck: "ℏ", - planckh: "ℎ", - plankv: "ℏ", - plus: "+", - plusacir: "⨣", - plusb: "⊞", - pluscir: "⨢", - plusdo: "∔", - plusdu: "⨥", - pluse: "⩲", - plusmn: "±", - plussim: "⨦", - plustwo: "⨧", - pm: "±", - pointint: "⨕", - popf: "𝕡", - pound: "£", - pr: "≺", - prE: "⪳", - prap: "⪷", - prcue: "≼", - pre: "⪯", - prec: "≺", - precapprox: "⪷", - preccurlyeq: "≼", - preceq: "⪯", - precnapprox: "⪹", - precneqq: "⪵", - precnsim: "⋨", - precsim: "≾", - prime: "′", - primes: "ℙ", - prnE: "⪵", - prnap: "⪹", - prnsim: "⋨", - prod: "∏", - profalar: "⌮", - profline: "⌒", - profsurf: "⌓", - prop: "∝", - propto: "∝", - prsim: "≾", - prurel: "⊰", - pscr: "𝓅", - psi: "ψ", - puncsp: " ", - qfr: "𝔮", - qint: "⨌", - qopf: "𝕢", - qprime: "⁗", - qscr: "𝓆", - quaternions: "ℍ", - quatint: "⨖", - quest: "?", - questeq: "≟", - quot: "\"", - rAarr: "⇛", - rArr: "⇒", - rAtail: "⤜", - rBarr: "⤏", - rHar: "⥤", - race: "∽̱", - racute: "ŕ", - radic: "√", - raemptyv: "⦳", - rang: "⟩", - rangd: "⦒", - range: "⦥", - rangle: "⟩", - raquo: "»", - rarr: "→", - rarrap: "⥵", - rarrb: "⇥", - rarrbfs: "⤠", - rarrc: "⤳", - rarrfs: "⤞", - rarrhk: "↪", - rarrlp: "↬", - rarrpl: "⥅", - rarrsim: "⥴", - rarrtl: "↣", - rarrw: "↝", - ratail: "⤚", - ratio: "∶", - rationals: "ℚ", - rbarr: "⤍", - rbbrk: "❳", - rbrace: "}", - rbrack: "]", - rbrke: "⦌", - rbrksld: "⦎", - rbrkslu: "⦐", - rcaron: "ř", - rcedil: "ŗ", - rceil: "⌉", - rcub: "}", - rcy: "р", - rdca: "⤷", - rdldhar: "⥩", - rdquo: "”", - rdquor: "”", - rdsh: "↳", - real: "ℜ", - realine: "ℛ", - realpart: "ℜ", - reals: "ℝ", - rect: "▭", - reg: "®", - rfisht: "⥽", - rfloor: "⌋", - rfr: "𝔯", - rhard: "⇁", - rharu: "⇀", - rharul: "⥬", - rho: "ρ", - rhov: "ϱ", - rightarrow: "→", - rightarrowtail: "↣", - rightharpoondown: "⇁", - rightharpoonup: "⇀", - rightleftarrows: "⇄", - rightleftharpoons: "⇌", - rightrightarrows: "⇉", - rightsquigarrow: "↝", - rightthreetimes: "⋌", - ring: "˚", - risingdotseq: "≓", - rlarr: "⇄", - rlhar: "⇌", - rlm: "‏", - rmoust: "⎱", - rmoustache: "⎱", - rnmid: "⫮", - roang: "⟭", - roarr: "⇾", - robrk: "⟧", - ropar: "⦆", - ropf: "𝕣", - roplus: "⨮", - rotimes: "⨵", - rpar: ")", - rpargt: "⦔", - rppolint: "⨒", - rrarr: "⇉", - rsaquo: "›", - rscr: "𝓇", - rsh: "↱", - rsqb: "]", - rsquo: "’", - rsquor: "’", - rthree: "⋌", - rtimes: "⋊", - rtri: "▹", - rtrie: "⊵", - rtrif: "▸", - rtriltri: "⧎", - ruluhar: "⥨", - rx: "℞", - sacute: "ś", - sbquo: "‚", - sc: "≻", - scE: "⪴", - scap: "⪸", - scaron: "š", - sccue: "≽", - sce: "⪰", - scedil: "ş", - scirc: "ŝ", - scnE: "⪶", - scnap: "⪺", - scnsim: "⋩", - scpolint: "⨓", - scsim: "≿", - scy: "с", - sdot: "⋅", - sdotb: "⊡", - sdote: "⩦", - seArr: "⇘", - searhk: "⤥", - searr: "↘", - searrow: "↘", - sect: "§", - semi: ";", - seswar: "⤩", - setminus: "∖", - setmn: "∖", - sext: "✶", - sfr: "𝔰", - sfrown: "⌢", - sharp: "♯", - shchcy: "щ", - shcy: "ш", - shortmid: "∣", - shortparallel: "∥", - shy: "­", - sigma: "σ", - sigmaf: "ς", - sigmav: "ς", - sim: "∼", - simdot: "⩪", - sime: "≃", - simeq: "≃", - simg: "⪞", - simgE: "⪠", - siml: "⪝", - simlE: "⪟", - simne: "≆", - simplus: "⨤", - simrarr: "⥲", - slarr: "←", - smallsetminus: "∖", - smashp: "⨳", - smeparsl: "⧤", - smid: "∣", - smile: "⌣", - smt: "⪪", - smte: "⪬", - smtes: "⪬︀", - softcy: "ь", - sol: "/", - solb: "⧄", - solbar: "⌿", - sopf: "𝕤", - spades: "♠", - spadesuit: "♠", - spar: "∥", - sqcap: "⊓", - sqcaps: "⊓︀", - sqcup: "⊔", - sqcups: "⊔︀", - sqsub: "⊏", - sqsube: "⊑", - sqsubset: "⊏", - sqsubseteq: "⊑", - sqsup: "⊐", - sqsupe: "⊒", - sqsupset: "⊐", - sqsupseteq: "⊒", - squ: "□", - square: "□", - squarf: "▪", - squf: "▪", - srarr: "→", - sscr: "𝓈", - ssetmn: "∖", - ssmile: "⌣", - sstarf: "⋆", - star: "☆", - starf: "★", - straightepsilon: "ϵ", - straightphi: "ϕ", - strns: "¯", - sub: "⊂", - subE: "⫅", - subdot: "⪽", - sube: "⊆", - subedot: "⫃", - submult: "⫁", - subnE: "⫋", - subne: "⊊", - subplus: "⪿", - subrarr: "⥹", - subset: "⊂", - subseteq: "⊆", - subseteqq: "⫅", - subsetneq: "⊊", - subsetneqq: "⫋", - subsim: "⫇", - subsub: "⫕", - subsup: "⫓", - succ: "≻", - succapprox: "⪸", - succcurlyeq: "≽", - succeq: "⪰", - succnapprox: "⪺", - succneqq: "⪶", - succnsim: "⋩", - succsim: "≿", - sum: "∑", - sung: "♪", - sup1: "¹", - sup2: "²", - sup3: "³", - sup: "⊃", - supE: "⫆", - supdot: "⪾", - supdsub: "⫘", - supe: "⊇", - supedot: "⫄", - suphsol: "⟉", - suphsub: "⫗", - suplarr: "⥻", - supmult: "⫂", - supnE: "⫌", - supne: "⊋", - supplus: "⫀", - supset: "⊃", - supseteq: "⊇", - supseteqq: "⫆", - supsetneq: "⊋", - supsetneqq: "⫌", - supsim: "⫈", - supsub: "⫔", - supsup: "⫖", - swArr: "⇙", - swarhk: "⤦", - swarr: "↙", - swarrow: "↙", - swnwar: "⤪", - szlig: "ß", - target: "⌖", - tau: "τ", - tbrk: "⎴", - tcaron: "ť", - tcedil: "ţ", - tcy: "т", - tdot: "⃛", - telrec: "⌕", - tfr: "𝔱", - there4: "∴", - therefore: "∴", - theta: "θ", - thetasym: "ϑ", - thetav: "ϑ", - thickapprox: "≈", - thicksim: "∼", - thinsp: " ", - thkap: "≈", - thksim: "∼", - thorn: "þ", - tilde: "˜", - times: "×", - timesb: "⊠", - timesbar: "⨱", - timesd: "⨰", - tint: "∭", - toea: "⤨", - top: "⊤", - topbot: "⌶", - topcir: "⫱", - topf: "𝕥", - topfork: "⫚", - tosa: "⤩", - tprime: "‴", - trade: "™", - triangle: "▵", - triangledown: "▿", - triangleleft: "◃", - trianglelefteq: "⊴", - triangleq: "≜", - triangleright: "▹", - trianglerighteq: "⊵", - tridot: "◬", - trie: "≜", - triminus: "⨺", - triplus: "⨹", - trisb: "⧍", - tritime: "⨻", - trpezium: "⏢", - tscr: "𝓉", - tscy: "ц", - tshcy: "ћ", - tstrok: "ŧ", - twixt: "≬", - twoheadleftarrow: "↞", - twoheadrightarrow: "↠", - uArr: "⇑", - uHar: "⥣", - uacute: "ú", - uarr: "↑", - ubrcy: "ў", - ubreve: "ŭ", - ucirc: "û", - ucy: "у", - udarr: "⇅", - udblac: "ű", - udhar: "⥮", - ufisht: "⥾", - ufr: "𝔲", - ugrave: "ù", - uharl: "↿", - uharr: "↾", - uhblk: "▀", - ulcorn: "⌜", - ulcorner: "⌜", - ulcrop: "⌏", - ultri: "◸", - umacr: "ū", - uml: "¨", - uogon: "ų", - uopf: "𝕦", - uparrow: "↑", - updownarrow: "↕", - upharpoonleft: "↿", - upharpoonright: "↾", - uplus: "⊎", - upsi: "υ", - upsih: "ϒ", - upsilon: "υ", - upuparrows: "⇈", - urcorn: "⌝", - urcorner: "⌝", - urcrop: "⌎", - uring: "ů", - urtri: "◹", - uscr: "𝓊", - utdot: "⋰", - utilde: "ũ", - utri: "▵", - utrif: "▴", - uuarr: "⇈", - uuml: "ü", - uwangle: "⦧", - vArr: "⇕", - vBar: "⫨", - vBarv: "⫩", - vDash: "⊨", - vangrt: "⦜", - varepsilon: "ϵ", - varkappa: "ϰ", - varnothing: "∅", - varphi: "ϕ", - varpi: "ϖ", - varpropto: "∝", - varr: "↕", - varrho: "ϱ", - varsigma: "ς", - varsubsetneq: "⊊︀", - varsubsetneqq: "⫋︀", - varsupsetneq: "⊋︀", - varsupsetneqq: "⫌︀", - vartheta: "ϑ", - vartriangleleft: "⊲", - vartriangleright: "⊳", - vcy: "в", - vdash: "⊢", - vee: "∨", - veebar: "⊻", - veeeq: "≚", - vellip: "⋮", - verbar: "|", - vert: "|", - vfr: "𝔳", - vltri: "⊲", - vnsub: "⊂⃒", - vnsup: "⊃⃒", - vopf: "𝕧", - vprop: "∝", - vrtri: "⊳", - vscr: "𝓋", - vsubnE: "⫋︀", - vsubne: "⊊︀", - vsupnE: "⫌︀", - vsupne: "⊋︀", - vzigzag: "⦚", - wcirc: "ŵ", - wedbar: "⩟", - wedge: "∧", - wedgeq: "≙", - weierp: "℘", - wfr: "𝔴", - wopf: "𝕨", - wp: "℘", - wr: "≀", - wreath: "≀", - wscr: "𝓌", - xcap: "⋂", - xcirc: "◯", - xcup: "⋃", - xdtri: "▽", - xfr: "𝔵", - xhArr: "⟺", - xharr: "⟷", - xi: "ξ", - xlArr: "⟸", - xlarr: "⟵", - xmap: "⟼", - xnis: "⋻", - xodot: "⨀", - xopf: "𝕩", - xoplus: "⨁", - xotime: "⨂", - xrArr: "⟹", - xrarr: "⟶", - xscr: "𝓍", - xsqcup: "⨆", - xuplus: "⨄", - xutri: "△", - xvee: "⋁", - xwedge: "⋀", - yacute: "ý", - yacy: "я", - ycirc: "ŷ", - ycy: "ы", - yen: "¥", - yfr: "𝔶", - yicy: "ї", - yopf: "𝕪", - yscr: "𝓎", - yucy: "ю", - yuml: "ÿ", - zacute: "ź", - zcaron: "ž", - zcy: "з", - zdot: "ż", - zeetrf: "ℨ", - zeta: "ζ", - zfr: "𝔷", - zhcy: "ж", - zigrarr: "⇝", - zopf: "𝕫", - zscr: "𝓏", - zwj: "‍", - zwnj: "‌" - }; - // node_modules/decode-named-character-reference/index.js - const own$1 = {}.hasOwnProperty; - /** - * Decode a single character reference (without the `&` or `;`). - * You probably only need this when you’re building parsers yourself that follow - * different rules compared to HTML. - * This is optimized to be tiny in browsers. - * - * @param {string} value - * `notin` (named), `#123` (deci), `#x123` (hexa). - * @returns {string|false} - * Decoded reference. - */ - function decodeNamedCharacterReference(value) { - return own$1.call(characterEntities, value) ? characterEntities[value] : false; - } - // node_modules/micromark-util-chunked/index.js - /** - * Like `Array#splice`, but smarter for giant arrays. - * - * `Array#splice` takes all items to be inserted as individual argument which - * causes a stack overflow in V8 when trying to insert 100k items for instance. - * - * Otherwise, this does not return the removed items, and takes `items` as an - * array instead of rest parameters. - * - * @template {unknown} T - * Item type. - * @param {Array<T>} list - * List to operate on. - * @param {number} start - * Index to remove/insert at (can be negative). - * @param {number} remove - * Number of items to remove. - * @param {Array<T>} items - * Items to inject into `list`. - * @returns {undefined} - * Nothing. - */ - function splice(list, start, remove, items) { - const end = list.length; - let chunkStart = 0; - /** @type {Array<unknown>} */ - let parameters; - if (start < 0) start = -start > end ? 0 : end + start; - else start = start > end ? end : start; - remove = remove > 0 ? remove : 0; - if (items.length < 1e4) { - parameters = Array.from(items); - parameters.unshift(start, remove); - list.splice(...parameters); - } else { - if (remove) list.splice(start, remove); - while (chunkStart < items.length) { - parameters = items.slice(chunkStart, chunkStart + 1e4); - parameters.unshift(start, 0); - list.splice(...parameters); - chunkStart += 1e4; - start += 1e4; - } - } - } - /** - * Append `items` (an array) at the end of `list` (another array). - * When `list` was empty, returns `items` instead. - * - * This prevents a potentially expensive operation when `list` is empty, - * and adds items in batches to prevent V8 from hanging. - * - * @template {unknown} T - * Item type. - * @param {Array<T>} list - * List to operate on. - * @param {Array<T>} items - * Items to add to `list`. - * @returns {Array<T>} - * Either `list` or `items`. - */ - function push(list, items) { - if (list.length > 0) { - splice(list, list.length, 0, items); - return list; - } - return items; - } - // node_modules/micromark-util-combine-extensions/index.js - /** - * @import { - * Extension, - * Handles, - * HtmlExtension, - * NormalizedExtension - * } from 'micromark-util-types' - */ - const hasOwnProperty = {}.hasOwnProperty; - /** - * Combine multiple syntax extensions into one. - * - * @param {ReadonlyArray<Extension>} extensions - * List of syntax extensions. - * @returns {NormalizedExtension} - * A single combined extension. - */ - function combineExtensions(extensions) { - /** @type {NormalizedExtension} */ - const all = {}; - let index = -1; - while (++index < extensions.length) syntaxExtension(all, extensions[index]); - return all; - } - /** - * Merge `extension` into `all`. - * - * @param {NormalizedExtension} all - * Extension to merge into. - * @param {Extension} extension - * Extension to merge. - * @returns {undefined} - * Nothing. - */ - function syntaxExtension(all, extension) { - /** @type {keyof Extension} */ - let hook; - for (hook in extension) { - /** @type {Record<string, unknown>} */ - const left = (hasOwnProperty.call(all, hook) ? all[hook] : void 0) || (all[hook] = {}); - /** @type {Record<string, unknown> | undefined} */ - const right = extension[hook]; - /** @type {string} */ - let code; - if (right) for (code in right) { - if (!hasOwnProperty.call(left, code)) left[code] = []; - const value = right[code]; - constructs(left[code], Array.isArray(value) ? value : value ? [value] : []); - } - } - } - /** - * Merge `list` into `existing` (both lists of constructs). - * Mutates `existing`. - * - * @param {Array<unknown>} existing - * List of constructs to merge into. - * @param {Array<unknown>} list - * List of constructs to merge. - * @returns {undefined} - * Nothing. - */ - function constructs(existing, list) { - let index = -1; - /** @type {Array<unknown>} */ - const before = []; - while (++index < list.length) (list[index].add === "after" ? existing : before).push(list[index]); - splice(existing, 0, 0, before); - } - // node_modules/micromark-util-decode-numeric-character-reference/index.js - /** - * Turn the number (in string form as either hexa- or plain decimal) coming from - * a numeric character reference into a character. - * - * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes - * non-characters and control characters safe. - * - * @param {string} value - * Value to decode. - * @param {number} base - * Numeric base. - * @returns {string} - * Character. - */ - function decodeNumericCharacterReference(value, base) { - const code = Number.parseInt(value, base); - if (code < 9 || code === 11 || code > 13 && code < 32 || code > 126 && code < 160 || code > 55295 && code < 57344 || code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || code > 1114111) return "�"; - return String.fromCodePoint(code); - } - // node_modules/micromark-util-normalize-identifier/index.js - /** - * Normalize an identifier (as found in references, definitions). - * - * Collapses markdown whitespace, trim, and then lower- and uppercase. - * - * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their - * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different - * uppercase character (U+0398 (`Θ`)). - * So, to get a canonical form, we perform both lower- and uppercase. - * - * Using uppercase last makes sure keys will never interact with default - * prototypal values (such as `constructor`): nothing in the prototype of - * `Object` is uppercase. - * - * @param {string} value - * Identifier to normalize. - * @returns {string} - * Normalized identifier. - */ - function normalizeIdentifier(value) { - return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); - } - // node_modules/micromark-util-character/index.js - /** - * @import {Code} from 'micromark-util-types' - */ - /** - * Check whether the character code represents an ASCII alpha (`a` through `z`, - * case insensitive). - * - * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. - * - * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) - * to U+005A (`Z`). - * - * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) - * to U+007A (`z`). - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiAlpha = regexCheck(/[A-Za-z]/); - /** - * Check whether the character code represents an ASCII alphanumeric (`a` - * through `z`, case insensitive, or `0` through `9`). - * - * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha - * (see `asciiAlpha`). - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); - /** - * Check whether the character code represents an ASCII atext. - * - * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in - * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), - * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F - * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E - * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE - * (`{`) to U+007E TILDE (`~`). - * - * See: - * **\[RFC5322]**: - * [Internet Message Format](https://tools.ietf.org/html/rfc5322). - * P. Resnick. - * IETF. - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); - /** - * Check whether a character code is an ASCII control character. - * - * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL) - * to U+001F (US), or U+007F (DEL). - * - * @param {Code} code - * Code. - * @returns {boolean} - * Whether it matches. - */ - function asciiControl(code) { - return code !== null && (code < 32 || code === 127); - } - /** - * Check whether the character code represents an ASCII digit (`0` through `9`). - * - * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to - * U+0039 (`9`). - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiDigit = regexCheck(/\d/); - /** - * Check whether the character code represents an ASCII hex digit (`a` through - * `f`, case insensitive, or `0` through `9`). - * - * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex - * digit, or an ASCII lower hex digit. - * - * An **ASCII upper hex digit** is a character in the inclusive range U+0041 - * (`A`) to U+0046 (`F`). - * - * An **ASCII lower hex digit** is a character in the inclusive range U+0061 - * (`a`) to U+0066 (`f`). - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiHexDigit = regexCheck(/[\dA-Fa-f]/); - /** - * Check whether the character code represents ASCII punctuation. - * - * An **ASCII punctuation** is a character in the inclusive ranges U+0021 - * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT - * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT - * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). - * - * @param code - * Code. - * @returns {boolean} - * Whether it matches. - */ - const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); - /** - * Check whether a character code is a markdown line ending. - * - * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN - * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR). - * - * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE - * RETURN (CR) are replaced by these virtual characters depending on whether - * they occurred together. - * - * @param {Code} code - * Code. - * @returns {boolean} - * Whether it matches. - */ - function markdownLineEnding(code) { - return code !== null && code < -2; - } - /** - * Check whether a character code is a markdown line ending (see - * `markdownLineEnding`) or markdown space (see `markdownSpace`). - * - * @param {Code} code - * Code. - * @returns {boolean} - * Whether it matches. - */ - function markdownLineEndingOrSpace(code) { - return code !== null && (code < 0 || code === 32); - } - /** - * Check whether a character code is a markdown space. - * - * A **markdown space** is the concrete character U+0020 SPACE (SP) and the - * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT). - * - * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is - * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL - * SPACE (VS) characters, depending on the column at which the tab occurred. - * - * @param {Code} code - * Code. - * @returns {boolean} - * Whether it matches. - */ - function markdownSpace(code) { - return code === -2 || code === -1 || code === 32; - } - /** - * Check whether the character code represents Unicode punctuation. - * - * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, - * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` - * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` - * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII - * punctuation (see `asciiPunctuation`). - * - * See: - * **\[UNICODE]**: - * [The Unicode Standard](https://www.unicode.org/versions/). - * Unicode Consortium. - * - * @param code - * Code. - * @returns - * Whether it matches. - */ - const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u); - /** - * Check whether the character code represents Unicode whitespace. - * - * Note that this does handle micromark specific markdown whitespace characters. - * See `markdownLineEndingOrSpace` to check that. - * - * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, - * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), - * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). - * - * See: - * **\[UNICODE]**: - * [The Unicode Standard](https://www.unicode.org/versions/). - * Unicode Consortium. - * - * @param code - * Code. - * @returns - * Whether it matches. - */ - const unicodeWhitespace = regexCheck(/\s/); - /** - * Create a code check from a regex. - * - * @param {RegExp} regex - * Expression. - * @returns {(code: Code) => boolean} - * Check. - */ - function regexCheck(regex) { - return check; - /** - * Check whether a code matches the bound regex. - * - * @param {Code} code - * Character code. - * @returns {boolean} - * Whether the character code matches the bound regex. - */ - function check(code) { - return code !== null && code > -1 && regex.test(String.fromCharCode(code)); - } - } - // node_modules/micromark-util-sanitize-uri/index.js - /** - * Normalize a URL. - * - * Encode unsafe characters with percent-encoding, skipping already encoded - * sequences. - * - * @param {string} value - * URI to normalize. - * @returns {string} - * Normalized URI. - */ - function normalizeUri(value) { - /** @type {Array<string>} */ - const result = []; - let index = -1; - let start = 0; - let skip = 0; - while (++index < value.length) { - const code = value.charCodeAt(index); - /** @type {string} */ - let replace = ""; - if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) skip = 2; - else if (code < 128) { - if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) replace = String.fromCharCode(code); - } else if (code > 55295 && code < 57344) { - const next = value.charCodeAt(index + 1); - if (code < 56320 && next > 56319 && next < 57344) { - replace = String.fromCharCode(code, next); - skip = 1; - } else replace = "�"; - } else replace = String.fromCharCode(code); - if (replace) { - result.push(value.slice(start, index), encodeURIComponent(replace)); - start = index + skip + 1; - replace = ""; - } - if (skip) { - index += skip; - skip = 0; - } - } - return result.join("") + value.slice(start); - } - // node_modules/micromark-factory-space/index.js - /** - * @import {Effects, State, TokenType} from 'micromark-util-types' - */ - /** - * Parse spaces and tabs. - * - * There is no `nok` parameter: - * - * * spaces in markdown are often optional, in which case this factory can be - * used and `ok` will be switched to whether spaces were found or not - * * one line ending or space can be detected with `markdownSpace(code)` right - * before using `factorySpace` - * - * ###### Examples - * - * Where `␉` represents a tab (plus how much it expands) and `␠` represents a - * single space. - * - * ```markdown - * ␉ - * ␠␠␠␠ - * ␉␠ - * ``` - * - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @param {TokenType} type - * Type of the whole whitespace. - * @param {number | undefined} [max=Infinity] - * Max (exclusive). - * @returns {State} - * Start state. - */ - function factorySpace(effects, ok, type, max) { - const limit = max ? max - 1 : 1e400; - let size = 0; - return start; - /** @type {State} */ - function start(code) { - if (markdownSpace(code)) { - effects.enter(type); - return prefix(code); - } - return ok(code); - } - /** @type {State} */ - function prefix(code) { - if (markdownSpace(code) && size++ < limit) { - effects.consume(code); - return prefix; - } - effects.exit(type); - return ok(code); - } - } - /** - * Parse spaces and tabs, with a required minimum and maximum, matching - * `markdown-rs`’s `space_or_tab_min_max`. - * - * Unlike `factorySpace`, this can fail: `nok` is used when fewer than - * `min` spaces or tabs are found. - * - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @param {State} nok - * State switched to when unsuccessful. - * @param {TokenType} type - * Type of the whole whitespace. - * @param {number} min - * Minimum allowed characters (inclusive). - * @param {number} max - * Maximum allowed characters (inclusive). - * @returns {State} - * Start state. - */ - function factorySpaceMinMax(effects, ok, nok, type, min, max) { - let size = 0; - return start; - /** @type {State} */ - function start(code) { - if (max > 0 && markdownSpace(code)) { - effects.enter(type); - return prefix(code); - } - return after(code); - } - /** @type {State} */ - function prefix(code) { - if (markdownSpace(code) && size < max) { - effects.consume(code); - size++; - return prefix; - } - effects.exit(type); - return after(code); - } - /** @type {State} */ - function after(code) { - return size >= min ? ok(code) : nok(code); - } - } - // node_modules/micromark/lib/initialize/content.js - /** - * @import { - * InitialConstruct, - * Initializer, - * State, - * TokenizeContext, - * Token - * } from 'micromark-util-types' - */ - /** @type {InitialConstruct} */ - const content$1 = { tokenize: initializeContent }; - /** - * @this {TokenizeContext} - * Context. - * @type {Initializer} - * Content. - */ - function initializeContent(effects) { - const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial); - /** @type {Token} */ - let previous; - return contentStart; - /** @type {State} */ - function afterContentStartConstruct(code) { - if (code === null) { - effects.consume(code); - return; - } - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, contentStart, "linePrefix"); - } - /** @type {State} */ - function paragraphInitial(code) { - effects.enter("paragraph"); - return lineStart(code); - } - /** @type {State} */ - function lineStart(code) { - const token = effects.enter("chunkText", { - contentType: "text", - previous - }); - if (previous) previous.next = token; - previous = token; - return data(code); - } - /** @type {State} */ - function data(code) { - if (code === null) { - effects.exit("chunkText"); - effects.exit("paragraph"); - effects.consume(code); - return; - } - if (markdownLineEnding(code)) { - effects.consume(code); - effects.exit("chunkText"); - return lineStart; - } - effects.consume(code); - return data; - } - } - // node_modules/micromark-util-edit-map/index.js - /** - * @import {Event} from 'micromark-util-types' - */ - /** - * @typedef {[number, number, Array<Event>]} Change - * @typedef {[number, number, number]} Jump - */ - /** - * Tracks a bunch of edits. - * - * Port of `edit_map.rs` from `markdown-rs`: - * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>. - * - * Deal with several changes in events, batching them together. - * - * Preferably, changes should be kept to a minimum. - * Sometimes, it’s needed to change the list of events, because parsing can be - * messy, and it helps to expose a cleaner interface of events to the compiler - * and other users. - * It can also help to merge many adjacent similar events. - * And, in other cases, it’s needed to parse subcontent: pass some events - * through another tokenizer and inject the result. - */ - var EditMap$1 = class { - /** - * Create a new edit map. - * - * @returns - * New instance. - */ - constructor() { - /** - * Changes by index, so `add` does not need to scan `map` (which is - * quadratic for documents with many edits at different places). - * - * @type {Map<number, Change>} - */ - this.index = /* @__PURE__ */ new Map(); - /** - * Record of changes. - * - * @type {Array<Change>} - */ - this.map = []; - } - /** - * Create an edit: a remove and/or add at a certain place. - * - * @param {number} index - * Index at which to apply the edit. - * @param {number} remove - * Count of items to remove at the index. - * @param {Array<Event>} add - * Items to add at the index. - * @returns {undefined} - * Nothing. - */ - add(index, remove, add) { - addImplementation$1(this, index, remove, add, false); - } - /** - * Create an edit: but insert `add` before existing additions, instead of - * after them. - * - * @param {number} index - * Index at which to apply the edit. - * @param {number} remove - * Count of items to remove at the index. - * @param {Array<Event>} add - * Items to add at the index. - * @returns {undefined} - * Nothing. - */ - addBefore(index, remove, add) { - addImplementation$1(this, index, remove, add, true); - } - /** - * Done, change the events. - * - * @param {Array<Event>} events - * List of events to apply the edits to. - * @returns {undefined} - * Nothing. - */ - consume(events) { - this.map.sort(function(a, b) { - return a[0] - b[0]; - }); - if (this.map.length === 0) return; - let index = this.map.length; - /** @type {Array<Array<Event>>} */ - const vecs = []; - while (index > 0) { - index -= 1; - vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]); - events.length = this.map[index][0]; - } - vecs.push(events.slice()); - events.length = 0; - let slice = vecs.pop(); - while (slice) { - for (const element of slice) events.push(element); - slice = vecs.pop(); - } - this.map.length = 0; - this.index.clear(); - } - }; - /** - * Create an edit. - * - * @param {EditMap} editMap - * Edit map to apply to. - * @param {number} at - * Index at which to apply the edit. - * @param {number} remove - * Count of items to remove at the index. - * @param {Array<Event>} add - * Items to add at the index. - * @param {boolean} before - * Insert `add` before existing additions at `at`, instead of after them. - * @returns {undefined} - * Nothing. - */ - function addImplementation$1(editMap, at, remove, add, before) { - if (remove === 0 && add.length === 0) return; - const existing = editMap.index.get(at); - if (existing) { - existing[1] += remove; - if (before) { - add.push(...existing[2]); - existing[2] = add; - } else existing[2].push(...add); - return; - } - /** @type {Change} */ - const change = [ - at, - remove, - add - ]; - editMap.map.push(change); - editMap.index.set(at, change); - } - // node_modules/micromark/lib/initialize/document.js - /** - * @import { - * Construct, - * ContainerState, - * InitialConstruct, - * Initializer, - * Point, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** - * @typedef {[Construct, ContainerState]} StackItem - * Construct and its state. - */ - /** @type {InitialConstruct} */ - const document$2 = { tokenize: initializeDocument }; - /** @type {Construct} */ - const containerConstruct = { tokenize: tokenizeContainer }; - /** - * @this {TokenizeContext} - * Self. - * @type {Initializer} - * Initializer. - */ - function initializeDocument(effects) { - const self = this; - /** @type {Array<StackItem>} */ - const stack = []; - let continued = 0; - /** @type {TokenizeContext | undefined} */ - let childFlow; - /** @type {Token | undefined} */ - let childToken; - /** @type {number} */ - let lineStartOffset; - return start; - /** @type {State} */ - function start(code) { - if (continued < stack.length) { - const item = stack[continued]; - self.containerState = item[1]; - return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code); - } - return checkNewContainers(code); - } - /** @type {State} */ - function documentContinue(code) { - continued++; - if (self.containerState._closeFlow) { - self.containerState._closeFlow = void 0; - if (childFlow) closeFlow(); - const indexBeforeExits = self.events.length; - let indexBeforeFlow = indexBeforeExits; - /** @type {Point | undefined} */ - let point; - while (indexBeforeFlow--) if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { - point = self.events[indexBeforeFlow][1].end; - break; - } - exitContainers(continued); - let index = indexBeforeExits; - while (index < self.events.length) { - self.events[index][1].end = { ...point }; - index++; - } - const editMap = new EditMap$1(); - editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); - editMap.add(indexBeforeExits, index - indexBeforeExits, []); - editMap.consume(self.events); - return checkNewContainers(code); - } - return start(code); - } - /** @type {State} */ - function checkNewContainers(code) { - if (continued === stack.length) { - if (!childFlow) return documentContinued(code); - if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) return flowStart(code); - self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack); - } - self.containerState = {}; - return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code); - } - /** @type {State} */ - function thereIsANewContainer(code) { - if (childFlow) closeFlow(); - exitContainers(continued); - return documentContinued(code); - } - /** @type {State} */ - function thereIsNoNewContainer(code) { - self.parser.lazy[self.now().line] = continued !== stack.length; - lineStartOffset = self.now().offset; - return flowStart(code); - } - /** @type {State} */ - function documentContinued(code) { - self.containerState = {}; - return effects.attempt(containerConstruct, containerContinue, flowStart)(code); - } - /** @type {State} */ - function containerContinue(code) { - continued++; - stack.push([self.currentConstruct, self.containerState]); - return documentContinued(code); - } - /** @type {State} */ - function flowStart(code) { - if (code === null) { - if (childFlow) closeFlow(); - exitContainers(0); - effects.consume(code); - return; - } - childFlow = childFlow || self.parser.flow(self.now()); - effects.enter("chunkFlow", { - _tokenizer: childFlow, - contentType: "flow", - previous: childToken - }); - return flowContinue(code); - } - /** @type {State} */ - function flowContinue(code) { - if (code === null) { - writeToChild(effects.exit("chunkFlow"), true); - exitContainers(0); - effects.consume(code); - return; - } - if (markdownLineEnding(code)) { - effects.consume(code); - writeToChild(effects.exit("chunkFlow")); - continued = 0; - self.interrupt = void 0; - return start; - } - effects.consume(code); - return flowContinue; - } - /** - * @param {Token} token - * Token. - * @param {boolean | undefined} [endOfFile] - * Whether the token is at the end of the file (default: `false`). - * @returns {undefined} - * Nothing. - */ - function writeToChild(token, endOfFile) { - const stream = self.sliceStream(token); - if (endOfFile) stream.push(null); - token.previous = childToken; - if (childToken) childToken.next = token; - childToken = token; - childFlow.defineSkip(token.start); - childFlow.write(stream); - if (self.parser.lazy[token.start.line]) { - let index = childFlow.events.length; - while (index--) if (childFlow.events[index][1].start.offset < lineStartOffset && (!childFlow.events[index][1].end || childFlow.events[index][1].end.offset > lineStartOffset)) return; - const indexBeforeExits = self.events.length; - let indexBeforeFlow = indexBeforeExits; - /** @type {boolean | undefined} */ - let seen; - /** @type {Point | undefined} */ - let point; - while (indexBeforeFlow--) if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { - if (seen) { - point = self.events[indexBeforeFlow][1].end; - break; - } - seen = true; - } - exitContainers(continued); - index = indexBeforeExits; - while (index < self.events.length) { - self.events[index][1].end = { ...point }; - index++; - } - const editMap = new EditMap$1(); - editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); - editMap.add(indexBeforeExits, index - indexBeforeExits, []); - editMap.consume(self.events); - } - } - /** - * @param {number} size - * Size. - * @returns {undefined} - * Nothing. - */ - function exitContainers(size) { - let index = stack.length; - while (index-- > size) { - const entry = stack[index]; - self.containerState = entry[1]; - entry[0].exit.call(self, effects); - } - stack.length = size; - } - function closeFlow() { - childFlow.write([null]); - childToken = void 0; - childFlow = void 0; - self.containerState._closeFlow = void 0; - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - * Tokenizer. - */ - function tokenizeContainer(effects, ok, nok) { - return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4); - } - // node_modules/micromark-util-classify-character/index.js - /** - * @import {Code} from 'micromark-util-types' - */ - /** - * Classify whether a code represents whitespace, punctuation, or something - * else. - * - * Used for attention (emphasis, strong), whose sequences can open or close - * based on the class of surrounding characters. - * - * > 👉 **Note**: eof (`null`) is seen as whitespace. - * - * @param {Code} code - * Code. - * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined} - * Group. - */ - function classifyCharacter(code) { - if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1; - if (unicodePunctuation(code)) return 2; - } - // node_modules/micromark-util-resolve-all/index.js - /** - * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types' - */ - /** - * Call all `resolveAll`s. - * - * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs - * List of constructs, optionally with `resolveAll`s. - * @param {Array<Event>} events - * List of events. - * @param {TokenizeContext} context - * Context used by `tokenize`. - * @returns {Array<Event>} - * Changed events. - */ - function resolveAll(constructs, events, context) { - /** @type {Array<Resolver>} */ - const called = []; - let index = -1; - while (++index < constructs.length) { - const resolve = constructs[index].resolveAll; - if (resolve && !called.includes(resolve)) { - events = resolve(events, context); - called.push(resolve); - } - } - return events; - } - // node_modules/micromark-core-commonmark/lib/attention.js - /** - * @import { - * Code, - * Construct, - * Event, - * Point, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const attention = { - name: "attention", - resolveAll: resolveAllAttention, - tokenize: tokenizeAttention - }; - /** - * Take all events and resolve attention to emphasis or strong. - * - * @type {Resolver} - */ - function resolveAllAttention(events, context) { - let index = -1; - /** @type {Array<Event>} */ - let nextEvents; - while (++index < events.length) if (events[index][0] === "enter" && events[index][1].type === "attentionSequence" && events[index][1]._close) { - let open = index; - while (open--) if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) { - if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) continue; - const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1; - const start = { ...events[open][1].end }; - const end = { ...events[index][1].start }; - movePoint(start, -use); - movePoint(end, use); - const openingSequence = { - type: use > 1 ? "strongSequence" : "emphasisSequence", - start, - end: { ...events[open][1].end } - }; - const closingSequence = { - type: use > 1 ? "strongSequence" : "emphasisSequence", - start: { ...events[index][1].start }, - end - }; - const text = { - type: use > 1 ? "strongText" : "emphasisText", - start: { ...events[open][1].end }, - end: { ...events[index][1].start } - }; - const group = { - type: use > 1 ? "strong" : "emphasis", - start: { ...openingSequence.start }, - end: { ...closingSequence.end } - }; - events[open][1].end = { ...openingSequence.start }; - events[index][1].start = { ...closingSequence.end }; - nextEvents = []; - if (events[open][1].end.offset - events[open][1].start.offset) nextEvents = push(nextEvents, [[ - "enter", - events[open][1], - context - ], [ - "exit", - events[open][1], - context - ]]); - nextEvents = push(nextEvents, [ - [ - "enter", - group, - context - ], - [ - "enter", - openingSequence, - context - ], - [ - "exit", - openingSequence, - context - ], - [ - "enter", - text, - context - ] - ]); - nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context)); - nextEvents = push(nextEvents, [ - [ - "exit", - text, - context - ], - [ - "enter", - closingSequence, - context - ], - [ - "exit", - closingSequence, - context - ], - [ - "exit", - group, - context - ] - ]); - /** @type {number} */ - let offset = 0; - if (events[index][1].end.offset - events[index][1].start.offset) { - offset = 2; - nextEvents = push(nextEvents, [[ - "enter", - events[index][1], - context - ], [ - "exit", - events[index][1], - context - ]]); - } - splice(events, open - 1, index - open + 3, nextEvents); - index = open + nextEvents.length - offset - 2; - break; - } - } - index = -1; - while (++index < events.length) if (events[index][1].type === "attentionSequence") events[index][1].type = "data"; - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeAttention(effects, ok) { - const attentionMarkers = this.parser.constructs.attentionMarkers.null; - const previous = this.previous; - const before = classifyCharacter(previous); - /** @type {NonNullable<Code>} */ - let marker; - return start; - /** - * Before a sequence. - * - * ```markdown - * > | ** - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - marker = code; - effects.enter("attentionSequence"); - return inside(code); - } - /** - * In a sequence. - * - * ```markdown - * > | ** - * ^^ - * ``` - * - * @type {State} - */ - function inside(code) { - if (code === marker) { - effects.consume(code); - return inside; - } - const token = effects.exit("attentionSequence"); - const after = classifyCharacter(code); - const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95; - const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95; - token._open = Boolean(marker === 42 ? open : open && (before || !close)); - token._close = Boolean(marker === 42 ? close : close && (after || !open)); - return ok(code); - } - } - /** - * Move a point a bit. - * - * Note: `move` only works inside lines! It’s not possible to move past other - * chunks (replacement characters, tabs, or line endings). - * - * @param {Point} point - * Point. - * @param {number} offset - * Amount to move. - * @returns {undefined} - * Nothing. - */ - function movePoint(point, offset) { - point.column += offset; - point.offset += offset; - point._bufferIndex += offset; - } - // node_modules/micromark-core-commonmark/lib/autolink.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const autolink = { - name: "autolink", - tokenize: tokenizeAutolink - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeAutolink(effects, ok, nok) { - let size = 0; - return start; - /** - * Start of an autolink. - * - * ```markdown - * > | a<https://example.com>b - * ^ - * > | a<user@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("autolink"); - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.enter("autolinkProtocol"); - return open; - } - /** - * After `<`, at protocol or atext. - * - * ```markdown - * > | a<https://example.com>b - * ^ - * > | a<user@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (asciiAlpha(code)) { - effects.consume(code); - return schemeOrEmailAtext; - } - if (code === 64) return nok(code); - return emailAtext(code); - } - /** - * At second byte of protocol or atext. - * - * ```markdown - * > | a<https://example.com>b - * ^ - * > | a<user@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function schemeOrEmailAtext(code) { - if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) { - size = 1; - return schemeInsideOrEmailAtext(code); - } - return emailAtext(code); - } - /** - * In ambiguous protocol or atext. - * - * ```markdown - * > | a<https://example.com>b - * ^ - * > | a<user@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function schemeInsideOrEmailAtext(code) { - if (code === 58) { - effects.consume(code); - size = 0; - return urlInside; - } - if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) { - effects.consume(code); - return schemeInsideOrEmailAtext; - } - size = 0; - return emailAtext(code); - } - /** - * After protocol, in URL. - * - * ```markdown - * > | a<https://example.com>b - * ^ - * ``` - * - * @type {State} - */ - function urlInside(code) { - if (code === 62) { - effects.exit("autolinkProtocol"); - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.exit("autolink"); - return ok; - } - if (code === null || code === 32 || code === 60 || asciiControl(code)) return nok(code); - effects.consume(code); - return urlInside; - } - /** - * In email atext. - * - * ```markdown - * > | a<user.name@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function emailAtext(code) { - if (code === 64) { - effects.consume(code); - return emailAtSignOrDot; - } - if (asciiAtext(code)) { - effects.consume(code); - return emailAtext; - } - return nok(code); - } - /** - * In label, after at-sign or dot. - * - * ```markdown - * > | a<user.name@example.com>b - * ^ ^ - * ``` - * - * @type {State} - */ - function emailAtSignOrDot(code) { - return asciiAlphanumeric(code) ? emailLabel(code) : nok(code); - } - /** - * In label, where `.` and `>` are allowed. - * - * ```markdown - * > | a<user.name@example.com>b - * ^ - * ``` - * - * @type {State} - */ - function emailLabel(code) { - if (code === 46) { - effects.consume(code); - size = 0; - return emailAtSignOrDot; - } - if (code === 62) { - effects.exit("autolinkProtocol").type = "autolinkEmail"; - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.exit("autolink"); - return ok; - } - return emailValue(code); - } - /** - * In label, where `.` and `>` are *not* allowed. - * - * Though, this is also used in `emailLabel` to parse other values. - * - * ```markdown - * > | a<user.name@ex-ample.com>b - * ^ - * ``` - * - * @type {State} - */ - function emailValue(code) { - if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { - const next = code === 45 ? emailValue : emailLabel; - effects.consume(code); - return next; - } - return nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/blank-line.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const blankLine = { - partial: true, - tokenize: tokenizeBlankLine - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeBlankLine(effects, ok, nok) { - return start; - /** - * Start of blank line. - * - * > 👉 **Note**: `␠` represents a space character. - * - * ```markdown - * > | ␠␠␊ - * ^ - * > | ␊ - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - return markdownSpace(code) ? factorySpace(effects, after, "linePrefix")(code) : after(code); - } - /** - * At eof/eol, after optional whitespace. - * - * > 👉 **Note**: `␠` represents a space character. - * - * ```markdown - * > | ␠␠␊ - * ^ - * > | ␊ - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - return code === null || markdownLineEnding(code) ? ok(code) : nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/block-quote.js - /** - * @import { - * Construct, - * Exiter, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const blockQuote = { - continuation: { tokenize: tokenizeBlockQuoteContinuation }, - exit: exit$1, - name: "blockQuote", - tokenize: tokenizeBlockQuoteStart - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeBlockQuoteStart(effects, ok, nok) { - const self = this; - return start; - /** - * Start of block quote. - * - * ```markdown - * > | > a - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - if (code === 62) { - const state = self.containerState; - if (!state.open) { - effects.enter("blockQuote", { _container: true }); - state.open = true; - } - effects.enter("blockQuotePrefix"); - effects.enter("blockQuoteMarker"); - effects.consume(code); - effects.exit("blockQuoteMarker"); - return after; - } - return nok(code); - } - /** - * After `>`, before optional whitespace. - * - * ```markdown - * > | > a - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - if (markdownSpace(code)) { - effects.enter("blockQuotePrefixWhitespace"); - effects.consume(code); - effects.exit("blockQuotePrefixWhitespace"); - effects.exit("blockQuotePrefix"); - return ok; - } - effects.exit("blockQuotePrefix"); - return ok(code); - } - } - /** - * Start of block quote continuation. - * - * ```markdown - * | > a - * > | > b - * ^ - * ``` - * - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeBlockQuoteContinuation(effects, ok, nok) { - const self = this; - return contStart; - /** - * Start of block quote continuation. - * - * Also used to parse the first block quote opening. - * - * ```markdown - * | > a - * > | > b - * ^ - * ``` - * - * @type {State} - */ - function contStart(code) { - if (markdownSpace(code)) return factorySpace(effects, contBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code); - return contBefore(code); - } - /** - * At `>`, after optional whitespace. - * - * Also used to parse the first block quote opening. - * - * ```markdown - * | > a - * > | > b - * ^ - * ``` - * - * @type {State} - */ - function contBefore(code) { - return effects.attempt(blockQuote, ok, nok)(code); - } - } - /** @type {Exiter} */ - function exit$1(effects) { - effects.exit("blockQuote"); - } - // node_modules/micromark-core-commonmark/lib/character-escape.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const characterEscape = { - name: "characterEscape", - tokenize: tokenizeCharacterEscape - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCharacterEscape(effects, ok, nok) { - return start; - /** - * Start of character escape. - * - * ```markdown - * > | a\*b - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("characterEscape"); - effects.enter("escapeMarker"); - effects.consume(code); - effects.exit("escapeMarker"); - return inside; - } - /** - * After `\`, at punctuation. - * - * ```markdown - * > | a\*b - * ^ - * ``` - * - * @type {State} - */ - function inside(code) { - if (asciiPunctuation(code)) { - effects.enter("characterEscapeValue"); - effects.consume(code); - effects.exit("characterEscapeValue"); - effects.exit("characterEscape"); - return ok; - } - return nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/character-reference.js - /** - * @import { - * Code, - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const characterReference = { - name: "characterReference", - tokenize: tokenizeCharacterReference - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCharacterReference(effects, ok, nok) { - const self = this; - let size = 0; - /** @type {number} */ - let max; - /** @type {(code: Code) => boolean} */ - let test; - return start; - /** - * Start of character reference. - * - * ```markdown - * > | a&b - * ^ - * > | a{b - * ^ - * > | a b - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("characterReference"); - effects.enter("characterReferenceMarker"); - effects.consume(code); - effects.exit("characterReferenceMarker"); - return open; - } - /** - * After `&`, at `#` for numeric references or alphanumeric for named - * references. - * - * ```markdown - * > | a&b - * ^ - * > | a{b - * ^ - * > | a b - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (code === 35) { - effects.enter("characterReferenceMarkerNumeric"); - effects.consume(code); - effects.exit("characterReferenceMarkerNumeric"); - return numeric; - } - effects.enter("characterReferenceValue"); - max = 31; - test = asciiAlphanumeric; - return value(code); - } - /** - * After `#`, at `x` for hexadecimals or digit for decimals. - * - * ```markdown - * > | a{b - * ^ - * > | a b - * ^ - * ``` - * - * @type {State} - */ - function numeric(code) { - if (code === 88 || code === 120) { - effects.enter("characterReferenceMarkerHexadecimal"); - effects.consume(code); - effects.exit("characterReferenceMarkerHexadecimal"); - effects.enter("characterReferenceValue"); - max = 6; - test = asciiHexDigit; - return value; - } - effects.enter("characterReferenceValue"); - max = 7; - test = asciiDigit; - return value(code); - } - /** - * After markers (`&#x`, `&#`, or `&`), in value, before `;`. - * - * The character reference kind defines what and how many characters are - * allowed. - * - * ```markdown - * > | a&b - * ^^^ - * > | a{b - * ^^^ - * > | a b - * ^ - * ``` - * - * @type {State} - */ - function value(code) { - if (code === 59 && size) { - const token = effects.exit("characterReferenceValue"); - if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) return nok(code); - effects.enter("characterReferenceMarker"); - effects.consume(code); - effects.exit("characterReferenceMarker"); - effects.exit("characterReference"); - return ok; - } - if (test(code) && size++ < max) { - effects.consume(code); - return value; - } - return nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js - /** @type {Construct} */ - const nonLazyContinuation$2 = { - partial: true, - tokenize: tokenizeNonLazyContinuation$2 - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeNonLazyContinuation$2(effects, ok, nok) { - const self = this; - return start; - /** - * At eol, before continuation. - * - * ```markdown - * > | * ```js - * ^ - * | b - * ``` - * - * @type {State} - */ - function start(code) { - if (code === null) return nok(code); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return after; - } - /** - * A continuation. - * - * ```markdown - * | * ```js - * > | b - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - return self.parser.lazy[self.now().line] ? nok(code) : ok(code); - } - } - // node_modules/micromark-core-commonmark/lib/code-fenced.js - /** - * @import { - * Code, - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const codeFenced = { - concrete: true, - name: "codeFenced", - tokenize: tokenizeCodeFenced - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCodeFenced(effects, ok, nok) { - const self = this; - /** @type {Construct} */ - const closeStart = { - partial: true, - tokenize: tokenizeCloseStart - }; - let initialPrefix = 0; - let sizeOpen = 0; - /** @type {NonNullable<Code>} */ - let marker; - return start; - /** - * Start of code. - * - * ```markdown - * > | ~~~js - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function start(code) { - return beforeSequenceOpen(code); - } - /** - * In opening fence, after prefix, at sequence. - * - * ```markdown - * > | ~~~js - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function beforeSequenceOpen(code) { - const tail = self.events[self.events.length - 1]; - initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; - marker = code; - effects.enter("codeFenced"); - effects.enter("codeFencedFence"); - effects.enter("codeFencedFenceSequence"); - return sequenceOpen(code); - } - /** - * In opening fence sequence. - * - * ```markdown - * > | ~~~js - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function sequenceOpen(code) { - if (code === marker) { - sizeOpen++; - effects.consume(code); - return sequenceOpen; - } - if (sizeOpen < 3) return nok(code); - effects.exit("codeFencedFenceSequence"); - return markdownSpace(code) ? factorySpace(effects, infoBefore, "whitespace")(code) : infoBefore(code); - } - /** - * In opening fence, after the sequence (and optional whitespace), before info. - * - * ```markdown - * > | ~~~js - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function infoBefore(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFencedFence"); - return self.interrupt ? ok(code) : effects.check(nonLazyContinuation$2, atNonLazyBreak, after)(code); - } - effects.enter("codeFencedFenceInfo"); - effects.enter("chunkString", { contentType: "string" }); - return info(code); - } - /** - * In info. - * - * ```markdown - * > | ~~~js - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function info(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceInfo"); - return infoBefore(code); - } - if (markdownSpace(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceInfo"); - return factorySpace(effects, metaBefore, "whitespace")(code); - } - if (code === 96 && code === marker) return nok(code); - effects.consume(code); - return info; - } - /** - * In opening fence, after info and whitespace, before meta. - * - * ```markdown - * > | ~~~js eval - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function metaBefore(code) { - if (code === null || markdownLineEnding(code)) return infoBefore(code); - effects.enter("codeFencedFenceMeta"); - effects.enter("chunkString", { contentType: "string" }); - return meta(code); - } - /** - * In meta. - * - * ```markdown - * > | ~~~js eval - * ^ - * | alert(1) - * | ~~~ - * ``` - * - * @type {State} - */ - function meta(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceMeta"); - return infoBefore(code); - } - if (code === 96 && code === marker) return nok(code); - effects.consume(code); - return meta; - } - /** - * At eol/eof in code, before a non-lazy closing fence or content. - * - * ```markdown - * > | ~~~js - * ^ - * > | alert(1) - * ^ - * | ~~~ - * ``` - * - * @type {State} - */ - function atNonLazyBreak(code) { - return effects.attempt(closeStart, after, contentBefore)(code); - } - /** - * Before code content, not a closing fence, at eol. - * - * ```markdown - * | ~~~js - * > | alert(1) - * ^ - * | ~~~ - * ``` - * - * @type {State} - */ - function contentBefore(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return contentStart; - } - /** - * Before code content, not a closing fence. - * - * ```markdown - * | ~~~js - * > | alert(1) - * ^ - * | ~~~ - * ``` - * - * @type {State} - */ - function contentStart(code) { - return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, "linePrefix", initialPrefix + 1)(code) : beforeContentChunk(code); - } - /** - * Before code content, after optional prefix. - * - * ```markdown - * | ~~~js - * > | alert(1) - * ^ - * | ~~~ - * ``` - * - * @type {State} - */ - function beforeContentChunk(code) { - if (code === null || markdownLineEnding(code)) return effects.check(nonLazyContinuation$2, atNonLazyBreak, after)(code); - effects.enter("codeFlowValue"); - return contentChunk(code); - } - /** - * In code content. - * - * ```markdown - * | ~~~js - * > | alert(1) - * ^^^^^^^^ - * | ~~~ - * ``` - * - * @type {State} - */ - function contentChunk(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFlowValue"); - return beforeContentChunk(code); - } - effects.consume(code); - return contentChunk; - } - /** - * After code. - * - * ```markdown - * | ~~~js - * | alert(1) - * > | ~~~ - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - effects.exit("codeFenced"); - return ok(code); - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCloseStart(effects, ok, nok) { - let size = 0; - return startBefore; - /** - * - * - * @type {State} - */ - function startBefore(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return start; - } - /** - * Before closing fence, at optional whitespace. - * - * ```markdown - * | ~~~js - * | alert(1) - * > | ~~~ - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("codeFencedFence"); - return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code) : beforeSequenceClose(code); - } - /** - * In closing fence, after optional whitespace, at sequence. - * - * ```markdown - * | ~~~js - * | alert(1) - * > | ~~~ - * ^ - * ``` - * - * @type {State} - */ - function beforeSequenceClose(code) { - if (code === marker) { - effects.enter("codeFencedFenceSequence"); - return sequenceClose(code); - } - return nok(code); - } - /** - * In closing fence sequence. - * - * ```markdown - * | ~~~js - * | alert(1) - * > | ~~~ - * ^ - * ``` - * - * @type {State} - */ - function sequenceClose(code) { - if (code === marker) { - size++; - effects.consume(code); - return sequenceClose; - } - if (size >= sizeOpen) { - effects.exit("codeFencedFenceSequence"); - return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, "whitespace")(code) : sequenceCloseAfter(code); - } - return nok(code); - } - /** - * After closing fence sequence, after optional whitespace. - * - * ```markdown - * | ~~~js - * | alert(1) - * > | ~~~ - * ^ - * ``` - * - * @type {State} - */ - function sequenceCloseAfter(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFencedFence"); - return ok(code); - } - return nok(code); - } - } - } - // node_modules/micromark-core-commonmark/lib/code-indented.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const codeIndented = { - name: "codeIndented", - tokenize: tokenizeCodeIndented - }; - /** @type {Construct} */ - const furtherStart = { - partial: true, - tokenize: tokenizeFurtherStart - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCodeIndented(effects, ok, nok) { - return start; - /** - * Start of code (indented). - * - * > **Parsing note**: it is not needed to check if this first line is a - * > filled line (that it has a non-whitespace character), because blank lines - * > are parsed already, so we never run into that. - * - * ```markdown - * > | aaa - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("codeIndented"); - return factorySpaceMinMax(effects, atBreak, nok, "linePrefix", 4, 4)(code); - } - /** - * At a break. - * - * ```markdown - * > | aaa - * ^ ^ - * ``` - * - * @type {State} - */ - function atBreak(code) { - if (code === null) return after(code); - if (markdownLineEnding(code)) return effects.attempt(furtherStart, atBreak, after)(code); - effects.enter("codeFlowValue"); - return inside(code); - } - /** - * In code content. - * - * ```markdown - * > | aaa - * ^^^^ - * ``` - * - * @type {State} - */ - function inside(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFlowValue"); - return atBreak(code); - } - effects.consume(code); - return inside; - } - /** @type {State} */ - function after(code) { - effects.exit("codeIndented"); - return ok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeFurtherStart(effects, ok, nok) { - const self = this; - return furtherStart; - /** - * At eol, trying to parse another indent. - * - * ```markdown - * > | aaa - * ^ - * | bbb - * ``` - * - * @type {State} - */ - function furtherStart(code) { - if (self.parser.lazy[self.now().line]) return nok(code); - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return furtherStart; - } - return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, "linePrefix", 4, 4)(code); - } - /** - * After not enough of a prefix. - * - * A following line ending is another (potentially blank) line to try, - * anything else means this isn’t a continuation. - * - * ```markdown - * > | aaa - * - * | bbb - * ``` - * - * @type {State} - */ - function onNotEnoughPrefix(code) { - return markdownLineEnding(code) ? furtherStart(code) : nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/code-text.js - /** - * @import { - * Construct, - * Previous, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const codeText = { - name: "codeText", - previous: previous$2, - resolve: resolveCodeText, - tokenize: tokenizeCodeText - }; - /** @type {Resolver} */ - function resolveCodeText(events) { - let tailExitIndex = events.length - 4; - let headEnterIndex = 3; - /** @type {number} */ - let index; - /** @type {number | undefined} */ - let enter; - if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { - index = headEnterIndex; - while (++index < tailExitIndex) if (events[index][1].type === "codeTextData") { - events[headEnterIndex][1].type = "codeTextPadding"; - events[tailExitIndex][1].type = "codeTextPadding"; - headEnterIndex += 2; - tailExitIndex -= 2; - break; - } - } - index = headEnterIndex - 1; - tailExitIndex++; - while (++index <= tailExitIndex) if (enter === void 0) { - if (index !== tailExitIndex && events[index][1].type !== "lineEnding") enter = index; - } else if (index === tailExitIndex || events[index][1].type === "lineEnding") { - events[enter][1].type = "codeTextData"; - if (index !== enter + 2) { - events[enter][1].end = events[index - 1][1].end; - events.splice(enter + 2, index - enter - 2); - tailExitIndex -= index - enter - 2; - index = enter + 2; - } - enter = void 0; - } - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Previous} - */ - function previous$2(code) { - return code !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeCodeText(effects, ok, nok) { - let sizeOpen = 0; - /** @type {number} */ - let size; - /** @type {Token} */ - let token; - return start; - /** - * Start of code (text). - * - * ```markdown - * > | `a` - * ^ - * > | \`a` - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("codeText"); - effects.enter("codeTextSequence"); - return sequenceOpen(code); - } - /** - * In opening sequence. - * - * ```markdown - * > | `a` - * ^ - * ``` - * - * @type {State} - */ - function sequenceOpen(code) { - if (code === 96) { - effects.consume(code); - sizeOpen++; - return sequenceOpen; - } - effects.exit("codeTextSequence"); - return between(code); - } - /** - * Between something and something else. - * - * ```markdown - * > | `a` - * ^^ - * ``` - * - * @type {State} - */ - function between(code) { - if (code === null) return nok(code); - if (code === 32) { - effects.enter("space"); - effects.consume(code); - effects.exit("space"); - return between; - } - if (code === 96) { - token = effects.enter("codeTextSequence"); - size = 0; - return sequenceClose(code); - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return between; - } - effects.enter("codeTextData"); - return data(code); - } - /** - * In data. - * - * ```markdown - * > | `a` - * ^ - * ``` - * - * @type {State} - */ - function data(code) { - if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) { - effects.exit("codeTextData"); - return between(code); - } - effects.consume(code); - return data; - } - /** - * In closing sequence. - * - * ```markdown - * > | `a` - * ^ - * ``` - * - * @type {State} - */ - function sequenceClose(code) { - if (code === 96) { - effects.consume(code); - size++; - return sequenceClose; - } - if (size === sizeOpen) { - effects.exit("codeTextSequence"); - effects.exit("codeText"); - return ok(code); - } - token.type = "codeTextData"; - return data(code); - } - } - // node_modules/micromark-util-subtokenize/lib/splice-buffer.js - /** - * Some of the internal operations of micromark do lots of editing - * operations on very large arrays. This runs into problems with two - * properties of most circa-2020 JavaScript interpreters: - * - * - Array-length modifications at the high end of an array (push/pop) are - * expected to be common and are implemented in (amortized) time - * proportional to the number of elements added or removed, whereas - * other operations (shift/unshift and splice) are much less efficient. - * - Function arguments are passed on the stack, so adding tens of thousands - * of elements to an array with `arr.push(...newElements)` will frequently - * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>) - * - * SpliceBuffers are an implementation of gap buffers, which are a - * generalization of the "queue made of two stacks" idea. The splice buffer - * maintains a cursor, and moving the cursor has cost proportional to the - * distance the cursor moves, but inserting, deleting, or splicing in - * new information at the cursor is as efficient as the push/pop operation. - * This allows for an efficient sequence of splices (or pushes, pops, shifts, - * or unshifts) as long such edits happen at the same part of the array or - * generally sweep through the array from the beginning to the end. - * - * The interface for splice buffers also supports large numbers of inputs by - * passing a single array argument rather passing multiple arguments on the - * function call stack. - * - * @template T - * Item type. - */ - var SpliceBuffer = class { - /** - * @param {ReadonlyArray<T> | null | undefined} [initial] - * Initial items (optional). - * @returns - * Splice buffer. - */ - constructor(initial) { - /** @type {Array<T>} */ - this.left = initial ? [...initial] : []; - /** @type {Array<T>} */ - this.right = []; - } - /** - * Array access; - * does not move the cursor. - * - * @param {number} index - * Index. - * @return {T} - * Item. - */ - get(index) { - if (index < 0 || index >= this.left.length + this.right.length) throw new RangeError("Cannot access index `" + index + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`"); - if (index < this.left.length) return this.left[index]; - return this.right[this.right.length - index + this.left.length - 1]; - } - /** - * The length of the splice buffer, one greater than the largest index in the - * array. - */ - get length() { - return this.left.length + this.right.length; - } - /** - * Remove and return `list[0]`; - * moves the cursor to `0`. - * - * @returns {T | undefined} - * Item, optional. - */ - shift() { - this.setCursor(0); - return this.right.pop(); - } - /** - * Slice the buffer to get an array; - * does not move the cursor. - * - * @param {number} start - * Start. - * @param {number | null | undefined} [end] - * End (optional). - * @returns {Array<T>} - * Array of items. - */ - slice(start, end) { - /** @type {number} */ - const stop = end === null || end === void 0 ? Number.POSITIVE_INFINITY : end; - if (stop < this.left.length) return this.left.slice(start, stop); - if (start > this.left.length) return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse(); - return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse()); - } - /** - * Mimics the behavior of Array.prototype.splice() except for the change of - * interface necessary to avoid segfaults when patching in very large arrays. - * - * This operation moves cursor is moved to `start` and results in the cursor - * placed after any inserted items. - * - * @param {number} start - * Start; - * zero-based index at which to start changing the array; - * negative numbers count backwards from the end of the array and values - * that are out-of bounds are clamped to the appropriate end of the array. - * @param {number | null | undefined} [deleteCount=0] - * Delete count (default: `0`); - * maximum number of elements to delete, starting from start. - * @param {Array<T> | null | undefined} [items=[]] - * Items to include in place of the deleted items (default: `[]`). - * @return {Array<T>} - * Any removed items. - */ - splice(start, deleteCount, items) { - /** @type {number} */ - const count = deleteCount || 0; - this.setCursor(Math.trunc(start)); - const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY); - if (items) chunkedPush(this.left, items); - return removed.reverse(); - } - /** - * Remove and return the highest-numbered item in the array, so - * `list[list.length - 1]`; - * Moves the cursor to `length`. - * - * @returns {T | undefined} - * Item, optional. - */ - pop() { - this.setCursor(Number.POSITIVE_INFINITY); - return this.left.pop(); - } - /** - * Inserts a single item to the high-numbered side of the array; - * moves the cursor to `length`. - * - * @param {T} item - * Item. - * @returns {undefined} - * Nothing. - */ - push(item) { - this.setCursor(Number.POSITIVE_INFINITY); - this.left.push(item); - } - /** - * Inserts many items to the high-numbered side of the array. - * Moves the cursor to `length`. - * - * @param {Array<T>} items - * Items. - * @returns {undefined} - * Nothing. - */ - pushMany(items) { - this.setCursor(Number.POSITIVE_INFINITY); - chunkedPush(this.left, items); - } - /** - * Inserts a single item to the low-numbered side of the array; - * Moves the cursor to `0`. - * - * @param {T} item - * Item. - * @returns {undefined} - * Nothing. - */ - unshift(item) { - this.setCursor(0); - this.right.push(item); - } - /** - * Inserts many items to the low-numbered side of the array; - * moves the cursor to `0`. - * - * @param {Array<T>} items - * Items. - * @returns {undefined} - * Nothing. - */ - unshiftMany(items) { - this.setCursor(0); - chunkedPush(this.right, items.reverse()); - } - /** - * Move the cursor to a specific position in the array. Requires - * time proportional to the distance moved. - * - * If `n < 0`, the cursor will end up at the beginning. - * If `n > length`, the cursor will end up at the end. - * - * @param {number} n - * Position. - * @return {undefined} - * Nothing. - */ - setCursor(n) { - if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return; - if (n < this.left.length) { - const removed = this.left.splice(n, Number.POSITIVE_INFINITY); - chunkedPush(this.right, removed.reverse()); - } else { - const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY); - chunkedPush(this.left, removed.reverse()); - } - } - }; - /** - * Avoid stack overflow by pushing items onto the stack in segments - * - * @template T - * Item type. - * @param {Array<T>} list - * List to inject into. - * @param {ReadonlyArray<T>} right - * Items to inject. - * @return {undefined} - * Nothing. - */ - function chunkedPush(list, right) { - /** @type {number} */ - let chunkStart = 0; - if (right.length < 1e4) list.push(...right); - else while (chunkStart < right.length) { - list.push(...right.slice(chunkStart, chunkStart + 1e4)); - chunkStart += 1e4; - } - } - // node_modules/micromark-util-subtokenize/index.js - /** - * @import {Chunk, Event, Token} from 'micromark-util-types' - */ - /** - * Tokenize subcontent. - * - * @param {Array<Event>} eventsArray - * List of events. - * @returns {boolean} - * Whether subtokens were found. - */ - function subtokenize(eventsArray) { - /** @type {Record<string, number>} */ - const jumps = {}; - let index = -1; - /** @type {Event} */ - let event; - /** @type {number | undefined} */ - let lineIndex; - /** @type {number} */ - let otherIndex; - /** @type {Event} */ - let otherEvent; - /** @type {Array<Event>} */ - let parameters; - /** @type {Array<Event>} */ - let subevents; - /** @type {boolean | undefined} */ - let more; - const events = new SpliceBuffer(eventsArray); - while (++index < events.length) { - while (index in jumps) index = jumps[index]; - event = events.get(index); - if (index && event[1].type === "chunkFlow" && events.get(index - 1)[1].type === "listItemPrefix") { - subevents = event[1]._tokenizer.events; - otherIndex = 0; - if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") otherIndex += 2; - if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") while (++otherIndex < subevents.length) { - if (subevents[otherIndex][1].type === "content") break; - if (subevents[otherIndex][1].type === "chunkText") { - subevents[otherIndex][1]._isInFirstContentOfListItem = true; - otherIndex++; - } - } - } - if (event[0] === "enter") { - if (event[1].contentType) { - Object.assign(jumps, subcontent(events, index)); - index = jumps[index]; - more = true; - } - } else if (event[1]._container) { - otherIndex = index; - lineIndex = void 0; - while (otherIndex--) { - otherEvent = events.get(otherIndex); - if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { - if (otherEvent[0] === "enter") { - if (lineIndex) events.get(lineIndex)[1].type = "lineEndingBlank"; - otherEvent[1].type = "lineEnding"; - lineIndex = otherIndex; - } - } else if (otherEvent[1].type === "linePrefix" || otherEvent[1].type === "listItemIndent") {} else break; - } - if (lineIndex) { - event[1].end = { ...events.get(lineIndex)[1].start }; - parameters = events.slice(lineIndex, index); - parameters.unshift(event); - events.splice(lineIndex, index - lineIndex + 1, parameters); - } - } - } - splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0)); - return !more; - } - /** - * Tokenize embedded tokens. - * - * @param {SpliceBuffer<Event>} events - * Events. - * @param {number} eventIndex - * Index. - * @returns {Record<string, number>} - * Gaps. - */ - function subcontent(events, eventIndex) { - const token = events.get(eventIndex)[1]; - const context = events.get(eventIndex)[2]; - let startPosition = eventIndex - 1; - /** @type {Array<number>} */ - const startPositions = []; - let tokenizer = token._tokenizer; - if (!tokenizer) { - tokenizer = context.parser[token.contentType](token.start); - if (token._contentTypeTextTrailing) tokenizer._contentTypeTextTrailing = true; - } - const childEvents = tokenizer.events; - /** @type {Array<[number, number]>} */ - const jumps = []; - /** @type {Record<string, number>} */ - const gaps = {}; - /** @type {Array<Chunk>} */ - let stream; - /** @type {Token | undefined} */ - let previous; - let index = -1; - /** @type {Token | undefined} */ - let current = token; - let adjust = 0; - let start = 0; - const breaks = [start]; - while (current) { - while (events.get(++startPosition)[1] !== current); - startPositions.push(startPosition); - if (!current._tokenizer) { - stream = context.sliceStream(current); - if (!current.next) stream.push(null); - if (previous) tokenizer.defineSkip(current.start); - if (current._isInFirstContentOfListItem) tokenizer._gfmTasklistFirstContentOfListItem = true; - tokenizer.write(stream); - if (current._isInFirstContentOfListItem) tokenizer._gfmTasklistFirstContentOfListItem = void 0; - } - previous = current; - current = current.next; - } - current = token; - while (++index < childEvents.length) if (childEvents[index][0] === "exit" && childEvents[index - 1][0] === "enter" && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) { - start = index + 1; - breaks.push(start); - current._tokenizer = void 0; - current.previous = void 0; - current = current.next; - } - tokenizer.events = []; - if (current) { - current._tokenizer = void 0; - current.previous = void 0; - } else breaks.pop(); - index = breaks.length; - while (index--) { - const slice = childEvents.slice(breaks[index], breaks[index + 1]); - const start = startPositions.pop(); - jumps.push([start, start + slice.length - 1]); - events.splice(start, 2, slice); - } - jumps.reverse(); - index = -1; - while (++index < jumps.length) { - gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]; - adjust += jumps[index][1] - jumps[index][0] - 1; - } - return gaps; - } - // node_modules/micromark-core-commonmark/lib/content.js - /** - * @import { - * Construct, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** - * No name because it must not be turned off. - * @type {Construct} - */ - const content = { - resolve: resolveContent, - tokenize: tokenizeContent - }; - /** @type {Construct} */ - const continuationConstruct = { - partial: true, - tokenize: tokenizeContinuation - }; - /** - * Content is transparent: it’s parsed right now. That way, definitions are also - * parsed right now: before text in paragraphs (specifically, media) are parsed. - * - * @type {Resolver} - */ - function resolveContent(events) { - subtokenize(events); - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeContent(effects, ok) { - /** @type {Token | undefined} */ - let previous; - return chunkStart; - /** - * Before a content chunk. - * - * ```markdown - * > | abc - * ^ - * ``` - * - * @type {State} - */ - function chunkStart(code) { - effects.enter("content"); - previous = effects.enter("chunkContent", { contentType: "content" }); - return chunkInside(code); - } - /** - * In a content chunk. - * - * ```markdown - * > | abc - * ^^^ - * ``` - * - * @type {State} - */ - function chunkInside(code) { - if (code === null) return contentEnd(code); - if (markdownLineEnding(code)) return effects.check(continuationConstruct, contentContinue, contentEnd)(code); - effects.consume(code); - return chunkInside; - } - /** - * - * - * @type {State} - */ - function contentEnd(code) { - effects.exit("chunkContent"); - effects.exit("content"); - return ok(code); - } - /** - * - * - * @type {State} - */ - function contentContinue(code) { - effects.consume(code); - effects.exit("chunkContent"); - previous.next = effects.enter("chunkContent", { - contentType: "content", - previous - }); - previous = previous.next; - return chunkInside; - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeContinuation(effects, ok, nok) { - const self = this; - return startLookahead; - /** - * - * - * @type {State} - */ - function startLookahead(code) { - effects.exit("chunkContent"); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, prefixed, "linePrefix"); - } - /** - * - * - * @type {State} - */ - function prefixed(code) { - if (code === null || markdownLineEnding(code)) return nok(code); - const tail = self.events[self.events.length - 1]; - if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) return ok(code); - return effects.interrupt(self.parser.constructs.flow, nok, ok)(code); - } - } - // node_modules/micromark-factory-destination/index.js - /** - * @import {Effects, State, TokenType} from 'micromark-util-types' - */ - /** - * Parse destinations. - * - * ###### Examples - * - * ```markdown - * <a> - * <a\>b> - * <a b> - * <a)> - * a - * a\)b - * a(b)c - * a(b) - * ``` - * - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @param {State} nok - * State switched to when unsuccessful. - * @param {TokenType} type - * Type for whole (`<a>` or `b`). - * @param {TokenType} literalType - * Type when enclosed (`<a>`). - * @param {TokenType} literalMarkerType - * Type for enclosing (`<` and `>`). - * @param {TokenType} rawType - * Type when not enclosed (`b`). - * @param {TokenType} stringType - * Type for the value (`a` or `b`). - * @param {number | undefined} [max=Infinity] - * Depth of nested parens (inclusive). - * @returns {State} - * Start state. - */ - function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) { - const limit = max || Number.POSITIVE_INFINITY; - let balance = 0; - return start; - /** - * Start of destination. - * - * ```markdown - * > | <aa> - * ^ - * > | aa - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - if (code === 60) { - effects.enter(type); - effects.enter(literalType); - effects.enter(literalMarkerType); - effects.consume(code); - effects.exit(literalMarkerType); - return enclosedBefore; - } - if (code === null || code === 32 || code === 41 || asciiControl(code)) return nok(code); - effects.enter(type); - effects.enter(rawType); - effects.enter(stringType); - effects.enter("chunkString", { contentType: "string" }); - return raw(code); - } - /** - * After `<`, at an enclosed destination. - * - * ```markdown - * > | <aa> - * ^ - * ``` - * - * @type {State} - */ - function enclosedBefore(code) { - if (code === 62) { - effects.enter(literalMarkerType); - effects.consume(code); - effects.exit(literalMarkerType); - effects.exit(literalType); - effects.exit(type); - return ok; - } - effects.enter(stringType); - effects.enter("chunkString", { contentType: "string" }); - return enclosed(code); - } - /** - * In enclosed destination. - * - * ```markdown - * > | <aa> - * ^ - * ``` - * - * @type {State} - */ - function enclosed(code) { - if (code === 62) { - effects.exit("chunkString"); - effects.exit(stringType); - return enclosedBefore(code); - } - if (code === null || code === 60 || markdownLineEnding(code)) return nok(code); - effects.consume(code); - return code === 92 ? enclosedEscape : enclosed; - } - /** - * After `\`, at a special character. - * - * ```markdown - * > | <a\*a> - * ^ - * ``` - * - * @type {State} - */ - function enclosedEscape(code) { - if (code === 60 || code === 62 || code === 92) { - effects.consume(code); - return enclosed; - } - return enclosed(code); - } - /** - * In raw destination. - * - * ```markdown - * > | aa - * ^ - * ``` - * - * @type {State} - */ - function raw(code) { - if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) { - effects.exit("chunkString"); - effects.exit(stringType); - effects.exit(rawType); - effects.exit(type); - return ok(code); - } - if (balance < limit && code === 40) { - effects.consume(code); - balance++; - return raw; - } - if (code === 41) { - effects.consume(code); - balance--; - return raw; - } - if (code === null || code === 32 || code === 40 || asciiControl(code)) return nok(code); - effects.consume(code); - return code === 92 ? rawEscape : raw; - } - /** - * After `\`, at special character. - * - * ```markdown - * > | a\*a - * ^ - * ``` - * - * @type {State} - */ - function rawEscape(code) { - if (code === 40 || code === 41 || code === 92) { - effects.consume(code); - return raw; - } - return raw(code); - } - } - // node_modules/micromark-factory-label/index.js - /** - * @import { - * Effects, - * State, - * TokenizeContext, - * TokenType - * } from 'micromark-util-types' - */ - /** - * Parse labels. - * - * > 👉 **Note**: labels in markdown are capped at 999 characters in the string. - * - * ###### Examples - * - * ```markdown - * [a] - * [a - * b] - * [a\]b] - * ``` - * - * @this {TokenizeContext} - * Tokenize context. - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @param {State} nok - * State switched to when unsuccessful. - * @param {TokenType} type - * Type of the whole label (`[a]`). - * @param {TokenType} markerType - * Type for the markers (`[` and `]`). - * @param {TokenType} stringType - * Type for the identifier (`a`). - * @returns {State} - * Start state. - */ - function factoryLabel(effects, ok, nok, type, markerType, stringType) { - const self = this; - let size = 0; - /** @type {boolean} */ - let seen; - return start; - /** - * Start of label. - * - * ```markdown - * > | [a] - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter(type); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.enter(stringType); - return atBreak; - } - /** - * In label, at something, before something else. - * - * ```markdown - * > | [a] - * ^ - * ``` - * - * @type {State} - */ - function atBreak(code) { - if (size > 999 || code === null || code === 91 || code === 93 && !seen || - /* c8 ignore next 3 */ - code === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code); - if (code === 93) { - effects.exit(stringType); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.exit(type); - return ok; - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return atBreak; - } - effects.enter("chunkString", { contentType: "string" }); - return labelInside(code); - } - /** - * In label, in text. - * - * ```markdown - * > | [a] - * ^ - * ``` - * - * @type {State} - */ - function labelInside(code) { - if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) { - effects.exit("chunkString"); - return atBreak(code); - } - effects.consume(code); - if (!seen) seen = !markdownSpace(code); - return code === 92 ? labelEscape : labelInside; - } - /** - * After `\`, at a special character. - * - * ```markdown - * > | [a\*a] - * ^ - * ``` - * - * @type {State} - */ - function labelEscape(code) { - if (code === 91 || code === 92 || code === 93) { - effects.consume(code); - size++; - return labelInside; - } - return labelInside(code); - } - } - // node_modules/micromark-factory-title/index.js - /** - * @import { - * Code, - * Effects, - * State, - * TokenType - * } from 'micromark-util-types' - */ - /** - * Parse titles. - * - * ###### Examples - * - * ```markdown - * "a" - * 'b' - * (c) - * "a - * b" - * 'a - * b' - * (a\)b) - * ``` - * - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @param {State} nok - * State switched to when unsuccessful. - * @param {TokenType} type - * Type of the whole title (`"a"`, `'b'`, `(c)`). - * @param {TokenType} markerType - * Type for the markers (`"`, `'`, `(`, and `)`). - * @param {TokenType} stringType - * Type for the value (`a`). - * @returns {State} - * Start state. - */ - function factoryTitle(effects, ok, nok, type, markerType, stringType) { - /** @type {NonNullable<Code>} */ - let marker; - return start; - /** - * Start of title. - * - * ```markdown - * > | "a" - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - if (code === 34 || code === 39 || code === 40) { - effects.enter(type); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - marker = code === 40 ? 41 : code; - return begin; - } - return nok(code); - } - /** - * After opening marker. - * - * This is also used at the closing marker. - * - * ```markdown - * > | "a" - * ^ - * ``` - * - * @type {State} - */ - function begin(code) { - if (code === marker) { - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.exit(type); - return ok; - } - effects.enter(stringType); - return atBreak(code); - } - /** - * At something, before something else. - * - * ```markdown - * > | "a" - * ^ - * ``` - * - * @type {State} - */ - function atBreak(code) { - if (code === marker) { - effects.exit(stringType); - return begin(marker); - } - if (code === null) return nok(code); - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, atBreak, "linePrefix"); - } - effects.enter("chunkString", { contentType: "string" }); - return inside(code); - } - /** - * - * - * @type {State} - */ - function inside(code) { - if (code === marker || code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - return atBreak(code); - } - effects.consume(code); - return code === 92 ? escape : inside; - } - /** - * After `\`, at a special character. - * - * ```markdown - * > | "a\*b" - * ^ - * ``` - * - * @type {State} - */ - function escape(code) { - if (code === marker || code === 92) { - effects.consume(code); - return inside; - } - return inside(code); - } - } - // node_modules/micromark-factory-whitespace/index.js - /** - * @import {Effects, State} from 'micromark-util-types' - */ - /** - * Parse spaces and tabs. - * - * There is no `nok` parameter: - * - * * line endings or spaces in markdown are often optional, in which case this - * factory can be used and `ok` will be switched to whether spaces were found - * or not - * * one line ending or space can be detected with - * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace` - * - * @param {Effects} effects - * Context. - * @param {State} ok - * State switched to when successful. - * @returns {State} - * Start state. - */ - function factoryWhitespace(effects, ok) { - /** @type {boolean} */ - let seen; - return start; - /** @type {State} */ - function start(code) { - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - seen = true; - return start; - } - if (markdownSpace(code)) return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code); - return ok(code); - } - } - // node_modules/micromark-core-commonmark/lib/definition.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const definition = { - name: "definition", - tokenize: tokenizeDefinition - }; - /** @type {Construct} */ - const titleBefore = { - partial: true, - tokenize: tokenizeTitleBefore - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeDefinition(effects, ok, nok) { - const self = this; - /** @type {string} */ - let identifier; - return start; - /** - * At start of a definition. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("definition"); - return before(code); - } - /** - * After optional whitespace, at `[`. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function before(code) { - return factoryLabel.call(self, effects, labelAfter, nok, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(code); - } - /** - * After label. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function labelAfter(code) { - identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)); - if (code === 58) { - effects.enter("definitionMarker"); - effects.consume(code); - effects.exit("definitionMarker"); - return markerAfter; - } - return nok(code); - } - /** - * After marker. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function markerAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code); - } - /** - * Before destination. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function destinationBefore(code) { - return factoryDestination(effects, destinationAfter, nok, "definitionDestination", "definitionDestinationLiteral", "definitionDestinationLiteralMarker", "definitionDestinationRaw", "definitionDestinationString")(code); - } - /** - * After destination. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function destinationAfter(code) { - return effects.attempt(titleBefore, after, after)(code); - } - /** - * After definition. - * - * ```markdown - * > | [a]: b - * ^ - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - return markdownSpace(code) ? factorySpace(effects, afterWhitespace, "whitespace")(code) : afterWhitespace(code); - } - /** - * After definition, after optional whitespace. - * - * ```markdown - * > | [a]: b - * ^ - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function afterWhitespace(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("definition"); - self.parser.defined.push(identifier); - return ok(code); - } - return nok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeTitleBefore(effects, ok, nok) { - return titleBefore; - /** - * After destination, at whitespace. - * - * ```markdown - * > | [a]: b - * ^ - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function titleBefore(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code); - } - /** - * At title. - * - * ```markdown - * | [a]: b - * > | "c" - * ^ - * ``` - * - * @type {State} - */ - function beforeMarker(code) { - return factoryTitle(effects, titleAfter, nok, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(code); - } - /** - * After title. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function titleAfter(code) { - return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code) : titleAfterOptionalWhitespace(code); - } - /** - * After title, after optional whitespace. - * - * ```markdown - * > | [a]: b "c" - * ^ - * ``` - * - * @type {State} - */ - function titleAfterOptionalWhitespace(code) { - return code === null || markdownLineEnding(code) ? ok(code) : nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/hard-break-escape.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const hardBreakEscape = { - name: "hardBreakEscape", - tokenize: tokenizeHardBreakEscape - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeHardBreakEscape(effects, ok, nok) { - return start; - /** - * Start of a hard break (escape). - * - * ```markdown - * > | a\ - * ^ - * | b - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("hardBreakEscape"); - effects.consume(code); - return after; - } - /** - * After `\`, at eol. - * - * ```markdown - * > | a\ - * ^ - * | b - * ``` - * - * @type {State} - */ - function after(code) { - if (markdownLineEnding(code)) { - effects.exit("hardBreakEscape"); - return ok(code); - } - return nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/heading-atx.js - /** - * @import { - * Construct, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const headingAtx = { - name: "headingAtx", - resolve: resolveHeadingAtx, - tokenize: tokenizeHeadingAtx - }; - /** @type {Resolver} */ - function resolveHeadingAtx(events, context) { - let contentEnd = events.length - 2; - let contentStart = 3; - if (events[contentStart][1].type === "whitespace") contentStart += 2; - if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") contentEnd -= 2; - if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; - if (contentEnd > contentStart) { - const content = { - type: "atxHeadingText", - start: events[contentStart][1].start, - end: events[contentEnd][1].end - }; - const text = { - type: "chunkText", - start: events[contentStart][1].start, - end: events[contentEnd][1].end, - contentType: "text" - }; - splice(events, contentStart, contentEnd - contentStart + 1, [ - [ - "enter", - content, - context - ], - [ - "enter", - text, - context - ], - [ - "exit", - text, - context - ], - [ - "exit", - content, - context - ] - ]); - } - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeHeadingAtx(effects, ok, nok) { - let size = 0; - return start; - /** - * Start of a heading (atx). - * - * ```markdown - * > | ## aa - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("atxHeading"); - return before(code); - } - /** - * After optional whitespace, at `#`. - * - * ```markdown - * > | ## aa - * ^ - * ``` - * - * @type {State} - */ - function before(code) { - effects.enter("atxHeadingSequence"); - return sequenceOpen(code); - } - /** - * In opening sequence. - * - * ```markdown - * > | ## aa - * ^ - * ``` - * - * @type {State} - */ - function sequenceOpen(code) { - if (code === 35 && size++ < 6) { - effects.consume(code); - return sequenceOpen; - } - if (code === null || markdownLineEndingOrSpace(code)) { - effects.exit("atxHeadingSequence"); - return atBreak(code); - } - return nok(code); - } - /** - * After something, before something else. - * - * ```markdown - * > | ## aa - * ^ - * ``` - * - * @type {State} - */ - function atBreak(code) { - if (code === 35) { - effects.enter("atxHeadingSequence"); - return sequenceFurther(code); - } - if (code === null || markdownLineEnding(code)) { - effects.exit("atxHeading"); - return ok(code); - } - if (markdownSpace(code)) return factorySpace(effects, atBreak, "whitespace")(code); - effects.enter("atxHeadingText"); - return data(code); - } - /** - * In further sequence (after whitespace). - * - * Could be normal “visible” hashes in the heading or a final sequence. - * - * ```markdown - * > | ## aa ## - * ^ - * ``` - * - * @type {State} - */ - function sequenceFurther(code) { - if (code === 35) { - effects.consume(code); - return sequenceFurther; - } - effects.exit("atxHeadingSequence"); - return atBreak(code); - } - /** - * In text. - * - * ```markdown - * > | ## aa - * ^ - * ``` - * - * @type {State} - */ - function data(code) { - if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { - effects.exit("atxHeadingText"); - return atBreak(code); - } - effects.consume(code); - return data; - } - } - // node_modules/micromark-util-html-tag-name/index.js - /** - * List of lowercase HTML “block” tag names. - * - * The list, when parsing HTML (flow), results in more relaxed rules (condition - * 6). - * Because they are known blocks, the HTML-like syntax doesn’t have to be - * strictly parsed. - * For tag names not in this list, a more strict algorithm (condition 7) is used - * to detect whether the HTML-like syntax is seen as HTML (flow) or not. - * - * This is copied from: - * <https://spec.commonmark.org/0.30/#html-blocks>. - * - * > 👉 **Note**: `search` was added in `CommonMark@0.31`. - */ - const htmlBlockNames = [ - "address", - "article", - "aside", - "base", - "basefont", - "blockquote", - "body", - "caption", - "center", - "col", - "colgroup", - "dd", - "details", - "dialog", - "dir", - "div", - "dl", - "dt", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hr", - "html", - "iframe", - "legend", - "li", - "link", - "main", - "menu", - "menuitem", - "nav", - "noframes", - "ol", - "optgroup", - "option", - "p", - "param", - "search", - "section", - "summary", - "table", - "tbody", - "td", - "tfoot", - "th", - "thead", - "title", - "tr", - "track", - "ul" - ]; - /** - * List of lowercase HTML “raw” tag names. - * - * The list, when parsing HTML (flow), results in HTML that can include lines - * without exiting, until a closing tag also in this list is found (condition - * 1). - * - * This module is copied from: - * <https://spec.commonmark.org/0.30/#html-blocks>. - * - * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`. - */ - const htmlRawNames = [ - "pre", - "script", - "style", - "textarea" - ]; - // node_modules/micromark-core-commonmark/lib/html-flow.js - /** - * @import { - * Code, - * Construct, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const htmlFlow = { - concrete: true, - name: "htmlFlow", - resolveTo: resolveToHtmlFlow, - tokenize: tokenizeHtmlFlow - }; - /** @type {Construct} */ - const blankLineBefore = { - partial: true, - tokenize: tokenizeBlankLineBefore - }; - /** @type {Resolver} */ - function resolveToHtmlFlow(events) { - let index = events.length; - while (index--) if (events[index][0] === "enter" && events[index][1].type === "htmlFlow") break; - if (index > 1 && events[index - 2][1].type === "linePrefix") { - events[index][1].start = events[index - 2][1].start; - events[index + 1][1].start = events[index - 2][1].start; - events.splice(index - 2, 2); - } - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeHtmlFlow(effects, ok, nok) { - const self = this; - /** @type {number} */ - let marker; - /** @type {boolean} */ - let closingTag; - /** @type {string} */ - let buffer; - /** @type {number} */ - let index; - /** @type {Code} */ - let markerB; - return start; - /** - * Start of HTML (flow). - * - * ```markdown - * > | <x /> - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - return before(code); - } - /** - * At `<`, after optional whitespace. - * - * ```markdown - * > | <x /> - * ^ - * ``` - * - * @type {State} - */ - function before(code) { - effects.enter("htmlFlow"); - effects.enter("htmlFlowData"); - effects.consume(code); - return open; - } - /** - * After `<`, at tag name or other stuff. - * - * ```markdown - * > | <x /> - * ^ - * > | <!doctype> - * ^ - * > | <!--xxx--> - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (code === 33) { - effects.consume(code); - return declarationOpen; - } - if (code === 47) { - effects.consume(code); - closingTag = true; - return tagCloseStart; - } - if (code === 63) { - effects.consume(code); - marker = 3; - return self.interrupt ? ok : continuationDeclarationInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - buffer = String.fromCharCode(code); - return tagName; - } - return nok(code); - } - /** - * After `<!`, at declaration, comment, or CDATA. - * - * ```markdown - * > | <!doctype> - * ^ - * > | <!--xxx--> - * ^ - * > | <![CDATA[>&<]]> - * ^ - * ``` - * - * @type {State} - */ - function declarationOpen(code) { - if (code === 45) { - effects.consume(code); - marker = 2; - return commentOpenInside; - } - if (code === 91) { - effects.consume(code); - marker = 5; - index = 0; - return cdataOpenInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - marker = 4; - return self.interrupt ? ok : continuationDeclarationInside; - } - return nok(code); - } - /** - * After `<!-`, inside a comment, at another `-`. - * - * ```markdown - * > | <!--xxx--> - * ^ - * ``` - * - * @type {State} - */ - function commentOpenInside(code) { - if (code === 45) { - effects.consume(code); - return self.interrupt ? ok : continuationDeclarationInside; - } - return nok(code); - } - /** - * After `<![`, inside CDATA, expecting `CDATA[`. - * - * ```markdown - * > | <![CDATA[>&<]]> - * ^^^^^^ - * ``` - * - * @type {State} - */ - function cdataOpenInside(code) { - if (code === "CDATA[".charCodeAt(index++)) { - effects.consume(code); - if (index === 6) return self.interrupt ? ok : continuation; - return cdataOpenInside; - } - return nok(code); - } - /** - * After `</`, in closing tag, at tag name. - * - * ```markdown - * > | </x> - * ^ - * ``` - * - * @type {State} - */ - function tagCloseStart(code) { - if (asciiAlpha(code)) { - effects.consume(code); - buffer = String.fromCharCode(code); - return tagName; - } - return nok(code); - } - /** - * In tag name. - * - * ```markdown - * > | <ab> - * ^^ - * > | </ab> - * ^^ - * ``` - * - * @type {State} - */ - function tagName(code) { - if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { - const slash = code === 47; - const name = buffer.toLowerCase(); - if (!slash && !closingTag && htmlRawNames.includes(name)) { - marker = 1; - return self.interrupt ? ok(code) : continuation(code); - } - if (htmlBlockNames.includes(buffer.toLowerCase())) { - marker = 6; - if (slash) { - effects.consume(code); - return basicSelfClosing; - } - return self.interrupt ? ok(code) : continuation(code); - } - marker = 7; - return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code); - } - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - buffer += String.fromCharCode(code); - return tagName; - } - return nok(code); - } - /** - * After closing slash of a basic tag name. - * - * ```markdown - * > | <div/> - * ^ - * ``` - * - * @type {State} - */ - function basicSelfClosing(code) { - if (code === 62) { - effects.consume(code); - return self.interrupt ? ok : continuation; - } - return nok(code); - } - /** - * After closing slash of a complete tag name. - * - * ```markdown - * > | <x/> - * ^ - * ``` - * - * @type {State} - */ - function completeClosingTagAfter(code) { - if (markdownSpace(code)) { - effects.consume(code); - return completeClosingTagAfter; - } - return completeEnd(code); - } - /** - * At an attribute name. - * - * At first, this state is used after a complete tag name, after whitespace, - * where it expects optional attributes or the end of the tag. - * It is also reused after attributes, when expecting more optional - * attributes. - * - * ```markdown - * > | <a /> - * ^ - * > | <a :b> - * ^ - * > | <a _b> - * ^ - * > | <a b> - * ^ - * > | <a > - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeNameBefore(code) { - if (code === 47) { - effects.consume(code); - return completeEnd; - } - if (code === 58 || code === 95 || asciiAlpha(code)) { - effects.consume(code); - return completeAttributeName; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeNameBefore; - } - return completeEnd(code); - } - /** - * In attribute name. - * - * ```markdown - * > | <a :b> - * ^ - * > | <a _b> - * ^ - * > | <a b> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeName(code) { - if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { - effects.consume(code); - return completeAttributeName; - } - return completeAttributeNameAfter(code); - } - /** - * After attribute name, at an optional initializer, the end of the tag, or - * whitespace. - * - * ```markdown - * > | <a b> - * ^ - * > | <a b=c> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeNameAfter(code) { - if (code === 61) { - effects.consume(code); - return completeAttributeValueBefore; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeNameAfter; - } - return completeAttributeNameBefore(code); - } - /** - * Before unquoted, double quoted, or single quoted attribute value, allowing - * whitespace. - * - * ```markdown - * > | <a b=c> - * ^ - * > | <a b="c"> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeValueBefore(code) { - if (code === null || code === 60 || code === 61 || code === 62 || code === 96) return nok(code); - if (code === 34 || code === 39) { - effects.consume(code); - markerB = code; - return completeAttributeValueQuoted; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeValueBefore; - } - return completeAttributeValueUnquoted(code); - } - /** - * In double or single quoted attribute value. - * - * ```markdown - * > | <a b="c"> - * ^ - * > | <a b='c'> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeValueQuoted(code) { - if (code === markerB) { - effects.consume(code); - markerB = null; - return completeAttributeValueQuotedAfter; - } - if (code === null || markdownLineEnding(code)) return nok(code); - effects.consume(code); - return completeAttributeValueQuoted; - } - /** - * In unquoted attribute value. - * - * ```markdown - * > | <a b=c> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeValueUnquoted(code) { - if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) return completeAttributeNameAfter(code); - effects.consume(code); - return completeAttributeValueUnquoted; - } - /** - * After double or single quoted attribute value, before whitespace or the - * end of the tag. - * - * ```markdown - * > | <a b="c"> - * ^ - * ``` - * - * @type {State} - */ - function completeAttributeValueQuotedAfter(code) { - if (code === 47 || code === 62 || markdownSpace(code)) return completeAttributeNameBefore(code); - return nok(code); - } - /** - * In certain circumstances of a complete tag where only an `>` is allowed. - * - * ```markdown - * > | <a b="c"> - * ^ - * ``` - * - * @type {State} - */ - function completeEnd(code) { - if (code === 62) { - effects.consume(code); - return completeAfter; - } - return nok(code); - } - /** - * After `>` in a complete tag. - * - * ```markdown - * > | <x> - * ^ - * ``` - * - * @type {State} - */ - function completeAfter(code) { - if (code === null || markdownLineEnding(code)) return continuation(code); - if (markdownSpace(code)) { - effects.consume(code); - return completeAfter; - } - return nok(code); - } - /** - * In continuation of any HTML kind. - * - * ```markdown - * > | <!--xxx--> - * ^ - * ``` - * - * @type {State} - */ - function continuation(code) { - if (code === 45 && marker === 2) { - effects.consume(code); - return continuationCommentInside; - } - if (code === 60 && marker === 1) { - effects.consume(code); - return continuationRawTagOpen; - } - if (code === 62 && marker === 4) { - effects.consume(code); - return continuationClose; - } - if (code === 63 && marker === 3) { - effects.consume(code); - return continuationDeclarationInside; - } - if (code === 93 && marker === 5) { - effects.consume(code); - return continuationCdataInside; - } - if (markdownLineEnding(code) && (marker === 6 || marker === 7)) { - effects.exit("htmlFlowData"); - return effects.check(blankLineBefore, continuationAfter, continuationStart)(code); - } - if (code === null || markdownLineEnding(code)) { - effects.exit("htmlFlowData"); - return continuationStart(code); - } - effects.consume(code); - return continuation; - } - /** - * In continuation, at eol. - * - * ```markdown - * > | <x> - * ^ - * | asd - * ``` - * - * @type {State} - */ - function continuationStart(code) { - return effects.check(nonLazyContinuation$2, continuationStartNonLazy, continuationAfter)(code); - } - /** - * In continuation, at eol, before non-lazy content. - * - * ```markdown - * > | <x> - * ^ - * | asd - * ``` - * - * @type {State} - */ - function continuationStartNonLazy(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return continuationBefore; - } - /** - * In continuation, before non-lazy content. - * - * ```markdown - * | <x> - * > | asd - * ^ - * ``` - * - * @type {State} - */ - function continuationBefore(code) { - if (code === null || markdownLineEnding(code)) return continuationStart(code); - effects.enter("htmlFlowData"); - return continuation(code); - } - /** - * In comment continuation, after one `-`, expecting another. - * - * ```markdown - * > | <!--xxx--> - * ^ - * ``` - * - * @type {State} - */ - function continuationCommentInside(code) { - if (code === 45) { - effects.consume(code); - return continuationDeclarationInside; - } - return continuation(code); - } - /** - * In raw continuation, after `<`, at `/`. - * - * ```markdown - * > | <script>console.log(1)<\/script> - * ^ - * ``` - * - * @type {State} - */ - function continuationRawTagOpen(code) { - if (code === 47) { - effects.consume(code); - buffer = ""; - return continuationRawEndTag; - } - return continuation(code); - } - /** - * In raw continuation, after `</`, in a raw tag name. - * - * ```markdown - * > | <script>console.log(1)<\/script> - * ^^^^^^ - * ``` - * - * @type {State} - */ - function continuationRawEndTag(code) { - if (code === 62) { - const name = buffer.toLowerCase(); - if (htmlRawNames.includes(name)) { - effects.consume(code); - return continuationClose; - } - return continuation(code); - } - if (asciiAlpha(code) && buffer.length < 8) { - effects.consume(code); - buffer += String.fromCharCode(code); - return continuationRawEndTag; - } - return continuation(code); - } - /** - * In cdata continuation, after `]`, expecting `]>`. - * - * ```markdown - * > | <![CDATA[>&<]]> - * ^ - * ``` - * - * @type {State} - */ - function continuationCdataInside(code) { - if (code === 93) { - effects.consume(code); - return continuationDeclarationInside; - } - return continuation(code); - } - /** - * In declaration or instruction continuation, at `>`. - * - * ```markdown - * > | <!--> - * ^ - * > | <?> - * ^ - * > | <!q> - * ^ - * > | <!--ab--> - * ^ - * > | <![CDATA[>&<]]> - * ^ - * ``` - * - * @type {State} - */ - function continuationDeclarationInside(code) { - if (code === 62) { - effects.consume(code); - return continuationClose; - } - if (code === 45 && marker === 2) { - effects.consume(code); - return continuationDeclarationInside; - } - return continuation(code); - } - /** - * In closed continuation: everything we get until the eol/eof is part of it. - * - * ```markdown - * > | <!doctype> - * ^ - * ``` - * - * @type {State} - */ - function continuationClose(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("htmlFlowData"); - return continuationAfter(code); - } - effects.consume(code); - return continuationClose; - } - /** - * Done. - * - * ```markdown - * > | <!doctype> - * ^ - * ``` - * - * @type {State} - */ - function continuationAfter(code) { - effects.exit("htmlFlow"); - return ok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeBlankLineBefore(effects, ok, nok) { - return start; - /** - * Before eol, expecting blank line. - * - * ```markdown - * > | <div> - * ^ - * | - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return effects.attempt(blankLine, ok, nok); - } - } - // node_modules/micromark-core-commonmark/lib/html-text.js - /** - * @import { - * Code, - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const htmlText = { - name: "htmlText", - tokenize: tokenizeHtmlText - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeHtmlText(effects, ok, nok) { - const self = this; - /** @type {NonNullable<Code> | undefined} */ - let marker; - /** @type {number} */ - let index; - /** @type {State} */ - let returnState; - return start; - /** - * Start of HTML (text). - * - * ```markdown - * > | a <b> c - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("htmlText"); - effects.enter("htmlTextData"); - effects.consume(code); - return open; - } - /** - * After `<`, at tag name or other stuff. - * - * ```markdown - * > | a <b> c - * ^ - * > | a <!doctype> c - * ^ - * > | a <!--b--> c - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (code === 33) { - effects.consume(code); - return declarationOpen; - } - if (code === 47) { - effects.consume(code); - return tagCloseStart; - } - if (code === 63) { - effects.consume(code); - return instruction; - } - if (asciiAlpha(code)) { - effects.consume(code); - return tagOpen; - } - return nok(code); - } - /** - * After `<!`, at declaration, comment, or CDATA. - * - * ```markdown - * > | a <!doctype> c - * ^ - * > | a <!--b--> c - * ^ - * > | a <![CDATA[>&<]]> c - * ^ - * ``` - * - * @type {State} - */ - function declarationOpen(code) { - if (code === 45) { - effects.consume(code); - return commentOpenInside; - } - if (code === 91) { - effects.consume(code); - index = 0; - return cdataOpenInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - return declaration; - } - return nok(code); - } - /** - * In a comment, after `<!-`, at another `-`. - * - * ```markdown - * > | a <!--b--> c - * ^ - * ``` - * - * @type {State} - */ - function commentOpenInside(code) { - if (code === 45) { - effects.consume(code); - return commentEnd; - } - return nok(code); - } - /** - * In comment. - * - * ```markdown - * > | a <!--b--> c - * ^ - * ``` - * - * @type {State} - */ - function comment(code) { - if (code === null) return nok(code); - if (code === 45) { - effects.consume(code); - return commentClose; - } - if (markdownLineEnding(code)) { - returnState = comment; - return lineEndingBefore(code); - } - effects.consume(code); - return comment; - } - /** - * In comment, after `-`. - * - * ```markdown - * > | a <!--b--> c - * ^ - * ``` - * - * @type {State} - */ - function commentClose(code) { - if (code === 45) { - effects.consume(code); - return commentEnd; - } - return comment(code); - } - /** - * In comment, after `--`. - * - * ```markdown - * > | a <!--b--> c - * ^ - * ``` - * - * @type {State} - */ - function commentEnd(code) { - return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code); - } - /** - * After `<![`, in CDATA, expecting `CDATA[`. - * - * ```markdown - * > | a <![CDATA[>&<]]> b - * ^^^^^^ - * ``` - * - * @type {State} - */ - function cdataOpenInside(code) { - if (code === "CDATA[".charCodeAt(index++)) { - effects.consume(code); - return index === 6 ? cdata : cdataOpenInside; - } - return nok(code); - } - /** - * In CDATA. - * - * ```markdown - * > | a <![CDATA[>&<]]> b - * ^^^ - * ``` - * - * @type {State} - */ - function cdata(code) { - if (code === null) return nok(code); - if (code === 93) { - effects.consume(code); - return cdataClose; - } - if (markdownLineEnding(code)) { - returnState = cdata; - return lineEndingBefore(code); - } - effects.consume(code); - return cdata; - } - /** - * In CDATA, after `]`, at another `]`. - * - * ```markdown - * > | a <![CDATA[>&<]]> b - * ^ - * ``` - * - * @type {State} - */ - function cdataClose(code) { - if (code === 93) { - effects.consume(code); - return cdataEnd; - } - return cdata(code); - } - /** - * In CDATA, after `]]`, at `>`. - * - * ```markdown - * > | a <![CDATA[>&<]]> b - * ^ - * ``` - * - * @type {State} - */ - function cdataEnd(code) { - if (code === 62) return end(code); - if (code === 93) { - effects.consume(code); - return cdataEnd; - } - return cdata(code); - } - /** - * In declaration. - * - * ```markdown - * > | a <!b> c - * ^ - * ``` - * - * @type {State} - */ - function declaration(code) { - if (code === null || code === 62) return end(code); - if (markdownLineEnding(code)) { - returnState = declaration; - return lineEndingBefore(code); - } - effects.consume(code); - return declaration; - } - /** - * In instruction. - * - * ```markdown - * > | a <?b?> c - * ^ - * ``` - * - * @type {State} - */ - function instruction(code) { - if (code === null) return nok(code); - if (code === 63) { - effects.consume(code); - return instructionClose; - } - if (markdownLineEnding(code)) { - returnState = instruction; - return lineEndingBefore(code); - } - effects.consume(code); - return instruction; - } - /** - * In instruction, after `?`, at `>`. - * - * ```markdown - * > | a <?b?> c - * ^ - * ``` - * - * @type {State} - */ - function instructionClose(code) { - return code === 62 ? end(code) : instruction(code); - } - /** - * After `</`, in closing tag, at tag name. - * - * ```markdown - * > | a </b> c - * ^ - * ``` - * - * @type {State} - */ - function tagCloseStart(code) { - if (asciiAlpha(code)) { - effects.consume(code); - return tagClose; - } - return nok(code); - } - /** - * After `</x`, in a tag name. - * - * ```markdown - * > | a </b> c - * ^ - * ``` - * - * @type {State} - */ - function tagClose(code) { - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagClose; - } - return tagCloseBetween(code); - } - /** - * In closing tag, after tag name. - * - * ```markdown - * > | a </b> c - * ^ - * ``` - * - * @type {State} - */ - function tagCloseBetween(code) { - if (markdownLineEnding(code)) { - returnState = tagCloseBetween; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagCloseBetween; - } - return end(code); - } - /** - * After `<x`, in opening tag name. - * - * ```markdown - * > | a <b> c - * ^ - * ``` - * - * @type {State} - */ - function tagOpen(code) { - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagOpen; - } - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) return tagOpenBetween(code); - return nok(code); - } - /** - * In opening tag, after tag name. - * - * ```markdown - * > | a <b> c - * ^ - * ``` - * - * @type {State} - */ - function tagOpenBetween(code) { - if (code === 47) { - effects.consume(code); - return end; - } - if (code === 58 || code === 95 || asciiAlpha(code)) { - effects.consume(code); - return tagOpenAttributeName; - } - if (markdownLineEnding(code)) { - returnState = tagOpenBetween; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenBetween; - } - return end(code); - } - /** - * In attribute name. - * - * ```markdown - * > | a <b c> d - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeName(code) { - if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagOpenAttributeName; - } - return tagOpenAttributeNameAfter(code); - } - /** - * After attribute name, before initializer, the end of the tag, or - * whitespace. - * - * ```markdown - * > | a <b c> d - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeNameAfter(code) { - if (code === 61) { - effects.consume(code); - return tagOpenAttributeValueBefore; - } - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeNameAfter; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenAttributeNameAfter; - } - return tagOpenBetween(code); - } - /** - * Before unquoted, double quoted, or single quoted attribute value, allowing - * whitespace. - * - * ```markdown - * > | a <b c=d> e - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeValueBefore(code) { - if (code === null || code === 60 || code === 61 || code === 62 || code === 96) return nok(code); - if (code === 34 || code === 39) { - effects.consume(code); - marker = code; - return tagOpenAttributeValueQuoted; - } - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeValueBefore; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenAttributeValueBefore; - } - effects.consume(code); - return tagOpenAttributeValueUnquoted; - } - /** - * In double or single quoted attribute value. - * - * ```markdown - * > | a <b c="d"> e - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeValueQuoted(code) { - if (code === marker) { - effects.consume(code); - marker = void 0; - return tagOpenAttributeValueQuotedAfter; - } - if (code === null) return nok(code); - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeValueQuoted; - return lineEndingBefore(code); - } - effects.consume(code); - return tagOpenAttributeValueQuoted; - } - /** - * In unquoted attribute value. - * - * ```markdown - * > | a <b c=d> e - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeValueUnquoted(code) { - if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) return nok(code); - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) return tagOpenBetween(code); - effects.consume(code); - return tagOpenAttributeValueUnquoted; - } - /** - * After double or single quoted attribute value, before whitespace or the end - * of the tag. - * - * ```markdown - * > | a <b c="d"> e - * ^ - * ``` - * - * @type {State} - */ - function tagOpenAttributeValueQuotedAfter(code) { - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) return tagOpenBetween(code); - return nok(code); - } - /** - * In certain circumstances of a tag where only an `>` is allowed. - * - * ```markdown - * > | a <b c="d"> e - * ^ - * ``` - * - * @type {State} - */ - function end(code) { - if (code === 62) { - effects.consume(code); - effects.exit("htmlTextData"); - effects.exit("htmlText"); - return ok; - } - return nok(code); - } - /** - * At eol. - * - * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about - * > empty tokens. - * - * ```markdown - * > | a <!--a - * ^ - * | b--> - * ``` - * - * @type {State} - */ - function lineEndingBefore(code) { - effects.exit("htmlTextData"); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return lineEndingAfter; - } - /** - * After eol, at optional whitespace. - * - * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about - * > empty tokens. - * - * ```markdown - * | a <!--a - * > | b--> - * ^ - * ``` - * - * @type {State} - */ - function lineEndingAfter(code) { - return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code) : lineEndingAfterPrefix(code); - } - /** - * After eol, after optional whitespace. - * - * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about - * > empty tokens. - * - * ```markdown - * | a <!--a - * > | b--> - * ^ - * ``` - * - * @type {State} - */ - function lineEndingAfterPrefix(code) { - effects.enter("htmlTextData"); - return returnState(code); - } - } - // node_modules/micromark-core-commonmark/lib/label-end.js - /** - * @import { - * Construct, - * Event, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer, - * Token - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const labelEnd = { - name: "labelEnd", - resolveAll: resolveAllLabelEnd, - resolveTo: resolveToLabelEnd, - tokenize: tokenizeLabelEnd - }; - /** @type {Construct} */ - const resourceConstruct = { tokenize: tokenizeResource }; - /** @type {Construct} */ - const referenceFullConstruct = { tokenize: tokenizeReferenceFull }; - /** @type {Construct} */ - const referenceCollapsedConstruct = { tokenize: tokenizeReferenceCollapsed }; - /** @type {Resolver} */ - function resolveAllLabelEnd(events) { - let index = -1; - /** @type {Array<Event>} */ - const newEvents = []; - while (++index < events.length) { - const token = events[index][1]; - newEvents.push(events[index]); - if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") { - const offset = token.type === "labelImage" ? 4 : 2; - token.type = "data"; - index += offset; - } - } - if (events.length !== newEvents.length) splice(events, 0, events.length, newEvents); - return events; - } - /** @type {Resolver} */ - function resolveToLabelEnd(events, context) { - let index = events.length; - let offset = 0; - /** @type {number | undefined} */ - let open; - /** @type {number | undefined} */ - let close; - /** @type {Array<Event>} */ - let media; - while (index--) { - const token = events[index][1]; - if (open) { - if (token.type === "link" || token.type === "labelLink" && token._inactive) break; - if (events[index][0] === "enter" && token.type === "labelLink") token._inactive = true; - } else if (close) { - if (events[index][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) { - open = index; - if (token.type !== "labelLink") { - offset = 2; - break; - } - } - } else if (token.type === "labelEnd") close = index; - } - const group = { - type: events[open][1].type === "labelLink" ? "link" : "image", - start: { ...events[open][1].start }, - end: { ...events[events.length - 1][1].end } - }; - const label = { - type: "label", - start: { ...events[open][1].start }, - end: { ...events[close][1].end } - }; - const text = { - type: "labelText", - start: { ...events[open + offset + 2][1].end }, - end: { ...events[close - 2][1].start } - }; - media = [[ - "enter", - group, - context - ], [ - "enter", - label, - context - ]]; - media = push(media, events.slice(open + 1, open + offset + 3)); - media = push(media, [[ - "enter", - text, - context - ]]); - media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context)); - media = push(media, [ - [ - "exit", - text, - context - ], - events[close - 2], - events[close - 1], - [ - "exit", - label, - context - ] - ]); - media = push(media, events.slice(close + 1)); - media = push(media, [[ - "exit", - group, - context - ]]); - splice(events, open, events.length, media); - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeLabelEnd(effects, ok, nok) { - const self = this; - const labelStarts = self._labelStarts; - /** @type {Token} */ - let labelStart; - /** @type {boolean} */ - let defined; - if (labelStarts) { - while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) labelStarts.pop(); - labelStart = labelStarts[labelStarts.length - 1]; - } - return start; - /** - * Start of label end. - * - * ```markdown - * > | [a](b) c - * ^ - * > | [a][b] c - * ^ - * > | [a][] b - * ^ - * > | [a] b - * ``` - * - * @type {State} - */ - function start(code) { - if (!labelStart) return nok(code); - if (labelStart._inactive) return labelEndNok(code); - defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({ - start: labelStart.end, - end: self.now() - }))); - effects.enter("labelEnd"); - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - effects.exit("labelEnd"); - return after; - } - /** - * After `]`. - * - * ```markdown - * > | [a](b) c - * ^ - * > | [a][b] c - * ^ - * > | [a][] b - * ^ - * > | [a] b - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - if (code === 40) return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code); - if (code === 91) return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code); - return defined ? labelEndOk(code) : labelEndNok(code); - } - /** - * After `]`, at `[`, but not at a full reference. - * - * > 👉 **Note**: we only get here if the label is defined. - * - * ```markdown - * > | [a][] b - * ^ - * > | [a] b - * ^ - * ``` - * - * @type {State} - */ - function referenceNotFull(code) { - return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code); - } - /** - * Done, we found something. - * - * ```markdown - * > | [a](b) c - * ^ - * > | [a][b] c - * ^ - * > | [a][] b - * ^ - * > | [a] b - * ^ - * ``` - * - * @type {State} - */ - function labelEndOk(code) { - labelStarts.pop(); - return ok(code); - } - /** - * Done, it’s nothing. - * - * There was an okay opening, but we didn’t match anything. - * - * ```markdown - * > | [a](b c - * ^ - * > | [a][b c - * ^ - * > | [a] b - * ^ - * ``` - * - * @type {State} - */ - function labelEndNok(code) { - labelStart._balanced = true; - return nok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeResource(effects, ok, nok) { - return resourceStart; - /** - * At a resource. - * - * ```markdown - * > | [a](b) c - * ^ - * ``` - * - * @type {State} - */ - function resourceStart(code) { - effects.enter("resource"); - effects.enter("resourceMarker"); - effects.consume(code); - effects.exit("resourceMarker"); - return resourceBefore; - } - /** - * In resource, after `(`, at optional whitespace. - * - * ```markdown - * > | [a](b) c - * ^ - * ``` - * - * @type {State} - */ - function resourceBefore(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code); - } - /** - * In resource, after optional whitespace, at `)` or a destination. - * - * ```markdown - * > | [a](b) c - * ^ - * ``` - * - * @type {State} - */ - function resourceOpen(code) { - if (code === 41) return resourceEnd(code); - return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(code); - } - /** - * In resource, after destination, at optional whitespace. - * - * ```markdown - * > | [a](b) c - * ^ - * ``` - * - * @type {State} - */ - function resourceDestinationAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code); - } - /** - * At invalid destination. - * - * ```markdown - * > | [a](<<) b - * ^ - * ``` - * - * @type {State} - */ - function resourceDestinationMissing(code) { - return nok(code); - } - /** - * In resource, after destination and whitespace, at `(` or title. - * - * ```markdown - * > | [a](b ) c - * ^ - * ``` - * - * @type {State} - */ - function resourceBetween(code) { - if (code === 34 || code === 39 || code === 40) return factoryTitle(effects, resourceTitleAfter, nok, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(code); - return resourceEnd(code); - } - /** - * In resource, after title, at optional whitespace. - * - * ```markdown - * > | [a](b "c") d - * ^ - * ``` - * - * @type {State} - */ - function resourceTitleAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code); - } - /** - * In resource, at `)`. - * - * ```markdown - * > | [a](b) d - * ^ - * ``` - * - * @type {State} - */ - function resourceEnd(code) { - if (code === 41) { - effects.enter("resourceMarker"); - effects.consume(code); - effects.exit("resourceMarker"); - effects.exit("resource"); - return ok; - } - return nok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeReferenceFull(effects, ok, nok) { - const self = this; - return referenceFull; - /** - * In a reference (full), at the `[`. - * - * ```markdown - * > | [a][b] d - * ^ - * ``` - * - * @type {State} - */ - function referenceFull(code) { - return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, "reference", "referenceMarker", "referenceString")(code); - } - /** - * In a reference (full), after `]`. - * - * ```markdown - * > | [a][b] d - * ^ - * ``` - * - * @type {State} - */ - function referenceFullAfter(code) { - return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code); - } - /** - * In reference (full) that was missing. - * - * ```markdown - * > | [a][b d - * ^ - * ``` - * - * @type {State} - */ - function referenceFullMissing(code) { - return nok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeReferenceCollapsed(effects, ok, nok) { - return referenceCollapsedStart; - /** - * In reference (collapsed), at `[`. - * - * > 👉 **Note**: we only get here if the label is defined. - * - * ```markdown - * > | [a][] d - * ^ - * ``` - * - * @type {State} - */ - function referenceCollapsedStart(code) { - effects.enter("reference"); - effects.enter("referenceMarker"); - effects.consume(code); - effects.exit("referenceMarker"); - return referenceCollapsedOpen; - } - /** - * In reference (collapsed), at `]`. - * - * > 👉 **Note**: we only get here if the label is defined. - * - * ```markdown - * > | [a][] d - * ^ - * ``` - * - * @type {State} - */ - function referenceCollapsedOpen(code) { - if (code === 93) { - effects.enter("referenceMarker"); - effects.consume(code); - effects.exit("referenceMarker"); - effects.exit("reference"); - return ok; - } - return nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/label-start-image.js - /** - * @import { - * Construct, - * State, - * Token, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const labelStartImage = { - name: "labelStartImage", - resolveAll: labelEnd.resolveAll, - tokenize: tokenizeLabelStartImage - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeLabelStartImage(effects, ok, nok) { - const self = this; - /** @type {Token} */ - let labelImage; - return start; - /** - * Start of label (image) start. - * - * ```markdown - * > | a ![b] c - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("labelImage"); - effects.enter("labelImageMarker"); - effects.consume(code); - effects.exit("labelImageMarker"); - return open; - } - /** - * After `!`, at `[`. - * - * ```markdown - * > | a ![b] c - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (code === 91) { - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - labelImage = effects.exit("labelImage"); - return after; - } - return nok(code); - } - /** - * After `![`. - * - * ```markdown - * > | a ![b] c - * ^ - * ``` - * - * This is needed in because, when GFM footnotes are enabled, images never - * form when started with a `^`. - * Instead, links form: - * - * ```markdown - * ![^a](b) - * - * ![^a][b] - * - * [b]: c - * ``` - * - * ```html - * <p>!<a href=\"b\">^a</a></p> - * <p>!<a href=\"c\">^a</a></p> - * ``` - * - * @type {State} - */ - function after(code) { - /* c8 ignore next 6 */ - if (code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code); - self._labelStarts = self._labelStarts || []; - self._labelStarts.push(labelImage); - return ok(code); - } - } - // node_modules/micromark-core-commonmark/lib/label-start-link.js - /** - * @import { - * Construct, - * State, - * Token, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const labelStartLink = { - name: "labelStartLink", - resolveAll: labelEnd.resolveAll, - tokenize: tokenizeLabelStartLink - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeLabelStartLink(effects, ok, nok) { - const self = this; - /** @type {Token} */ - let labelLink; - return start; - /** - * Start of label (link) start. - * - * ```markdown - * > | a [b] c - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("labelLink"); - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - labelLink = effects.exit("labelLink"); - return after; - } - /** @type {State} */ - function after(code) { - /* c8 ignore next 6 */ - if (code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code); - self._labelStarts = self._labelStarts || []; - self._labelStarts.push(labelLink); - return ok(code); - } - } - // node_modules/micromark-core-commonmark/lib/line-ending.js - /** - * @import { - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const lineEnding = { - name: "lineEnding", - tokenize: tokenizeLineEnding - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeLineEnding(effects, ok) { - return start; - /** @type {State} */ - function start(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, ok, "linePrefix"); - } - } - // node_modules/micromark-core-commonmark/lib/thematic-break.js - /** - * @import { - * Code, - * Construct, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const thematicBreak = { - name: "thematicBreak", - tokenize: tokenizeThematicBreak - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeThematicBreak(effects, ok, nok) { - let size = 0; - /** @type {NonNullable<Code>} */ - let marker; - return start; - /** - * Start of thematic break. - * - * ```markdown - * > | *** - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("thematicBreak"); - return before(code); - } - /** - * After optional whitespace, at marker. - * - * ```markdown - * > | *** - * ^ - * ``` - * - * @type {State} - */ - function before(code) { - marker = code; - return atBreak(code); - } - /** - * After something, before something else. - * - * ```markdown - * > | *** - * ^ - * ``` - * - * @type {State} - */ - function atBreak(code) { - if (code === marker) { - effects.enter("thematicBreakSequence"); - return sequence(code); - } - if (size >= 3 && (code === null || markdownLineEnding(code))) { - effects.exit("thematicBreak"); - return ok(code); - } - return nok(code); - } - /** - * In sequence. - * - * ```markdown - * > | *** - * ^ - * ``` - * - * @type {State} - */ - function sequence(code) { - if (code === marker) { - effects.consume(code); - size++; - return sequence; - } - effects.exit("thematicBreakSequence"); - return markdownSpace(code) ? factorySpace(effects, atBreak, "whitespace")(code) : atBreak(code); - } - } - // node_modules/micromark-core-commonmark/lib/list.js - /** - * @import { - * Code, - * Construct, - * Exiter, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const list = { - continuation: { tokenize: tokenizeListContinuation }, - exit: tokenizeListEnd, - name: "list", - tokenize: tokenizeListStart - }; - /** @type {Construct} */ - const listItemPrefixWhitespaceConstruct = { - partial: true, - tokenize: tokenizeListItemPrefixWhitespace - }; - /** @type {Construct} */ - const indentConstruct = { - partial: true, - tokenize: tokenizeIndent$1 - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeListStart(effects, ok, nok) { - const self = this; - const tail = self.events[self.events.length - 1]; - let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; - let size = 0; - return start; - /** @type {State} */ - function start(code) { - const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? "listUnordered" : "listOrdered"); - if (kind === "listUnordered" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) { - if (!self.containerState.type) { - self.containerState.type = kind; - effects.enter(kind, { _container: true }); - } - if (kind === "listUnordered") { - effects.enter("listItemPrefix"); - return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code); - } - if (!self.interrupt || code === 49) { - effects.enter("listItemPrefix"); - effects.enter("listItemValue"); - return inside(code); - } - } - return nok(code); - } - /** @type {State} */ - function inside(code) { - if (asciiDigit(code) && ++size < 10) { - effects.consume(code); - return inside; - } - if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) { - effects.exit("listItemValue"); - return atMarker(code); - } - return nok(code); - } - /** - * @type {State} - **/ - function atMarker(code) { - effects.enter("listItemMarker"); - effects.consume(code); - effects.exit("listItemMarker"); - self.containerState.marker = self.containerState.marker || code; - return effects.check(blankLine, self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix)); - } - /** @type {State} */ - function onBlank(code) { - self.containerState.initialBlankLine = true; - initialSize++; - return endOfPrefix(code); - } - /** @type {State} */ - function otherPrefix(code) { - if (markdownSpace(code)) { - effects.enter("listItemPrefixWhitespace"); - effects.consume(code); - effects.exit("listItemPrefixWhitespace"); - return endOfPrefix; - } - return nok(code); - } - /** @type {State} */ - function endOfPrefix(code) { - self.containerState.size = initialSize + self.sliceSerialize(effects.exit("listItemPrefix"), true).length; - return ok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeListContinuation(effects, ok, nok) { - const self = this; - self.containerState._closeFlow = void 0; - return effects.check(blankLine, onBlank, notBlank); - /** @type {State} */ - function onBlank(code) { - self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine; - return factorySpace(effects, ok, "listItemIndent", self.containerState.size + 1)(code); - } - /** @type {State} */ - function notBlank(code) { - if (self.containerState.furtherBlankLines || !markdownSpace(code)) { - self.containerState.furtherBlankLines = void 0; - self.containerState.initialBlankLine = void 0; - return notInCurrentItem(code); - } - self.containerState.furtherBlankLines = void 0; - self.containerState.initialBlankLine = void 0; - return effects.attempt(indentConstruct, ok, notInCurrentItem)(code); - } - /** @type {State} */ - function notInCurrentItem(code) { - self.containerState._closeFlow = true; - self.interrupt = void 0; - return factorySpace(effects, effects.attempt(list, ok, nok), "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeIndent$1(effects, ok, nok) { - const self = this; - return factorySpace(effects, afterPrefix, "listItemIndent", self.containerState.size + 1); - /** @type {State} */ - function afterPrefix(code) { - const tail = self.events[self.events.length - 1]; - return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code); - } - } - /** - * @this {TokenizeContext} - * Context. - * @type {Exiter} - */ - function tokenizeListEnd(effects) { - effects.exit(this.containerState.type); - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeListItemPrefixWhitespace(effects, ok, nok) { - const self = this; - return factorySpace(effects, afterPrefix, "listItemPrefixWhitespace", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5); - /** @type {State} */ - function afterPrefix(code) { - const tail = self.events[self.events.length - 1]; - return !markdownSpace(code) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok(code) : nok(code); - } - } - // node_modules/micromark-core-commonmark/lib/setext-underline.js - /** - * @import { - * Code, - * Construct, - * Resolver, - * State, - * TokenizeContext, - * Tokenizer - * } from 'micromark-util-types' - */ - /** @type {Construct} */ - const setextUnderline = { - name: "setextUnderline", - resolveTo: resolveToSetextUnderline, - tokenize: tokenizeSetextUnderline - }; - /** @type {Resolver} */ - function resolveToSetextUnderline(events, context) { - const editMap = new EditMap$1(); - let index = events.length; - /** @type {number | undefined} */ - let content; - /** @type {number | undefined} */ - let text; - /** @type {number | undefined} */ - let definition; - while (index--) if (events[index][0] === "enter") { - if (events[index][1].type === "content") { - content = index; - break; - } - if (events[index][1].type === "paragraph") text = index; - } else { - if (events[index][1].type === "content") editMap.add(index, 1, []); - if (!definition && events[index][1].type === "definition") definition = index; - } - const heading = { - type: "setextHeading", - start: { ...events[content][1].start }, - end: { ...events[events.length - 1][1].end } - }; - events[text][1].type = "setextHeadingText"; - if (definition) { - editMap.add(text, 0, [[ - "enter", - heading, - context - ]]); - editMap.add(definition + 1, 0, [[ - "exit", - events[content][1], - context - ]]); - events[content][1].end = { ...events[definition][1].end }; - } else events[content][1] = heading; - editMap.add(events.length, 0, [[ - "exit", - heading, - context - ]]); - editMap.consume(events); - return events; - } - /** - * @this {TokenizeContext} - * Context. - * @type {Tokenizer} - */ - function tokenizeSetextUnderline(effects, ok, nok) { - const self = this; - /** @type {NonNullable<Code>} */ - let marker; - return start; - /** - * At start of heading (setext) underline. - * - * ```markdown - * | aa - * > | == - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - let index = self.events.length; - /** @type {boolean | undefined} */ - let paragraph; - while (index--) if (self.events[index][1].type !== "lineEnding" && self.events[index][1].type !== "linePrefix" && self.events[index][1].type !== "content") { - paragraph = self.events[index][1].type === "paragraph"; - break; - } - if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) { - effects.enter("setextHeadingLine"); - marker = code; - return before(code); - } - return nok(code); - } - /** - * After optional whitespace, at `-` or `=`. - * - * ```markdown - * | aa - * > | == - * ^ - * ``` - * - * @type {State} - */ - function before(code) { - effects.enter("setextHeadingLineSequence"); - return inside(code); - } - /** - * In sequence. - * - * ```markdown - * | aa - * > | == - * ^ - * ``` - * - * @type {State} - */ - function inside(code) { - if (code === marker) { - effects.consume(code); - return inside; - } - effects.exit("setextHeadingLineSequence"); - return markdownSpace(code) ? factorySpace(effects, after, "lineSuffix")(code) : after(code); - } - /** - * After sequence, after optional whitespace. - * - * ```markdown - * | aa - * > | == - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("setextHeadingLine"); - return ok(code); - } - return nok(code); - } - } - // node_modules/micromark/lib/initialize/flow.js - /** - * @import { - * InitialConstruct, - * Initializer, - * State, - * TokenizeContext - * } from 'micromark-util-types' - */ - /** @type {InitialConstruct} */ - const flow$1 = { tokenize: initializeFlow }; - /** - * @this {TokenizeContext} - * Self. - * @type {Initializer} - * Initializer. - */ - function initializeFlow(effects) { - const self = this; - const initial = effects.attempt(blankLine, atBlankEnding, effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), "linePrefix"))); - return initial; - /** @type {State} */ - function atBlankEnding(code) { - if (code === null) { - effects.consume(code); - return; - } - effects.enter("lineEndingBlank"); - effects.consume(code); - effects.exit("lineEndingBlank"); - self.currentConstruct = void 0; - return initial; - } - /** @type {State} */ - function afterConstruct(code) { - if (code === null) { - effects.consume(code); - return; - } - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - self.currentConstruct = void 0; - return initial; - } - } - // node_modules/micromark/lib/initialize/text.js - /** - * @import { - * Code, - * InitialConstruct, - * Initializer, - * Resolver, - * State, - * TokenizeContext - * } from 'micromark-util-types' - */ - const resolver = { resolveAll: createResolver() }; - const string$1 = initializeFactory("string"); - const text$5 = initializeFactory("text"); - /** - * @param {'string' | 'text'} field - * Field. - * @returns {InitialConstruct} - * Construct. - */ - function initializeFactory(field) { - return { - resolveAll: createResolver(field === "text" ? resolveAllLineSuffixes : void 0), - tokenize: initializeText - }; - /** - * @this {TokenizeContext} - * Context. - * @type {Initializer} - */ - function initializeText(effects) { - const self = this; - const constructs = this.parser.constructs[field]; - const text = effects.attempt(constructs, start, notText); - return start; - /** @type {State} */ - function start(code) { - return atBreak(code) ? text(code) : notText(code); - } - /** @type {State} */ - function notText(code) { - if (code === null) { - effects.consume(code); - return; - } - effects.enter("data"); - effects.consume(code); - return data; - } - /** @type {State} */ - function data(code) { - if (atBreak(code)) { - effects.exit("data"); - return text(code); - } - effects.consume(code); - return data; - } - /** - * @param {Code} code - * Code. - * @returns {boolean} - * Whether the code is a break. - */ - function atBreak(code) { - if (code === null) return true; - const list = constructs[code]; - let index = -1; - if (list) while (++index < list.length) { - const item = list[index]; - if (!item.previous || item.previous.call(self, self.previous)) return true; - } - return false; - } - } - } - /** - * @param {Resolver | undefined} [extraResolver] - * Resolver. - * @returns {Resolver} - * Resolver. - */ - function createResolver(extraResolver) { - return resolveAllText; - /** @type {Resolver} */ - function resolveAllText(events, context) { - let index = -1; - /** @type {number | undefined} */ - let enter; - while (++index <= events.length) if (enter === void 0) { - if (events[index] && events[index][1].type === "data") { - enter = index; - index++; - } - } else if (!events[index] || events[index][1].type !== "data") { - if (index !== enter + 2) { - events[enter][1].end = events[index - 1][1].end; - events.splice(enter + 2, index - enter - 2); - index = enter + 2; - } - enter = void 0; - } - return extraResolver ? extraResolver(events, context) : events; - } - } - /** - * A rather ugly set of instructions which again looks at chunks in the input - * stream. - * The reason to do this here is that it is *much* faster to parse in reverse. - * And that we can’t hook into `null` to split the line suffix before an EOF. - * To do: figure out if we can make this into a clean utility, or even in core. - * As it will be useful for GFMs literal autolink extension (and maybe even - * tables?) - * - * @type {Resolver} - */ - function resolveAllLineSuffixes(events, context) { - const editMap = new EditMap$1(); - let eventIndex = 0; - while (++eventIndex <= events.length) if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") { - const data = events[eventIndex - 1][1]; - const chunks = context.sliceStream(data); - let index = chunks.length; - let bufferIndex = -1; - let size = 0; - /** @type {boolean | undefined} */ - let tabs; - while (index--) { - const chunk = chunks[index]; - if (typeof chunk === "string") { - bufferIndex = chunk.length; - while (chunk.charCodeAt(bufferIndex - 1) === 32) { - size++; - bufferIndex--; - } - if (bufferIndex) break; - bufferIndex = -1; - } else if (chunk === -2) { - tabs = true; - size++; - } else if (chunk === -1) {} else { - index++; - break; - } - } - if (context._contentTypeTextTrailing && eventIndex === events.length) size = 0; - if (size) { - const token = { - type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing", - start: { - _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex, - _index: data.start._index + index, - line: data.end.line, - column: data.end.column - size, - offset: data.end.offset - size - }, - end: { ...data.end } - }; - data.end = { ...token.start }; - if (data.start.offset === data.end.offset) Object.assign(data, token); - else editMap.add(eventIndex, 0, [[ - "enter", - token, - context - ], [ - "exit", - token, - context - ]]); - } - eventIndex++; - } - editMap.consume(events); - return events; - } - // node_modules/micromark/lib/constructs.js - /** - * @import {Extension} from 'micromark-util-types' - */ - var constructs_exports = /* @__PURE__ */ __exportAll({ - attentionMarkers: () => attentionMarkers, - contentInitial: () => contentInitial, - disable: () => disable, - document: () => document$1, - flow: () => flow, - flowInitial: () => flowInitial, - insideSpan: () => insideSpan, - string: () => string, - text: () => text$4 - }); - /** @satisfies {Extension['document']} */ - const document$1 = { - [42]: list, - [43]: list, - [45]: list, - [48]: list, - [49]: list, - [50]: list, - [51]: list, - [52]: list, - [53]: list, - [54]: list, - [55]: list, - [56]: list, - [57]: list, - [62]: blockQuote - }; - /** @satisfies {Extension['contentInitial']} */ - const contentInitial = { [91]: definition }; - /** @satisfies {Extension['flowInitial']} */ - const flowInitial = { - [-2]: codeIndented, - [-1]: codeIndented, - [32]: codeIndented - }; - /** @satisfies {Extension['flow']} */ - const flow = { - [35]: headingAtx, - [42]: thematicBreak, - [45]: [setextUnderline, thematicBreak], - [60]: htmlFlow, - [61]: setextUnderline, - [95]: thematicBreak, - [96]: codeFenced, - [126]: codeFenced - }; - /** @satisfies {Extension['string']} */ - const string = { - [38]: characterReference, - [92]: characterEscape - }; - /** @satisfies {Extension['text']} */ - const text$4 = { - [-5]: lineEnding, - [-4]: lineEnding, - [-3]: lineEnding, - [33]: labelStartImage, - [38]: characterReference, - [42]: attention, - [60]: [autolink, htmlText], - [91]: labelStartLink, - [92]: [hardBreakEscape, characterEscape], - [93]: labelEnd, - [95]: attention, - [96]: codeText - }; - /** @satisfies {Extension['insideSpan']} */ - const insideSpan = { null: [attention, resolver] }; - /** @satisfies {Extension['attentionMarkers']} */ - const attentionMarkers = { null: [42, 95] }; - /** @satisfies {Extension['disable']} */ - const disable = { null: [] }; - // node_modules/micromark/lib/create-tokenizer.js - /** - * @import { - * Chunk, - * Code, - * ConstructRecord, - * Construct, - * Effects, - * InitialConstruct, - * ParseContext, - * Point, - * State, - * TokenizeContext, - * Token - * } from 'micromark-util-types' - */ - /** - * @callback Restore - * Restore the state. - * @returns {undefined} - * Nothing. - * - * @typedef Info - * Info. - * @property {Restore} restore - * Restore. - * @property {number} from - * From. - * - * @callback ReturnHandle - * Handle a successful run. - * @param {Construct} construct - * Construct. - * @param {Info} info - * Info. - * @returns {undefined} - * Nothing. - */ - /** - * Create a tokenizer. - * Tokenizers deal with one type of data (e.g., containers, flow, text). - * The parser is the object dealing with it all. - * `initialize` works like other constructs, except that only its `tokenize` - * function is used, in which case it doesn’t receive an `ok` or `nok`. - * `from` can be given to set the point before the first character, although - * when further lines are indented, they must be set with `defineSkip`. - * - * @param {ParseContext} parser - * Parser. - * @param {InitialConstruct} initialize - * Construct. - * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from] - * Point (optional). - * @returns {TokenizeContext} - * Context. - */ - function createTokenizer(parser, initialize, from) { - /** @type {Point} */ - let point = { - _bufferIndex: -1, - _index: 0, - line: from && from.line || 1, - column: from && from.column || 1, - offset: from && from.offset || 0 - }; - /** @type {Record<string, number>} */ - const columnStart = {}; - /** @type {Array<Construct>} */ - const resolveAllConstructs = []; - /** @type {Array<Chunk>} */ - let chunks = []; - /** @type {Array<Token>} */ - let stack = []; - /** - * Tools used for tokenizing. - * - * @type {Effects} - */ - const effects = { - attempt: constructFactory(onsuccessfulconstruct), - check: constructFactory(onsuccessfulcheck), - consume, - enter, - exit, - interrupt: constructFactory(onsuccessfulcheck, { interrupt: true }) - }; - /** - * State and tools for resolving and serializing. - * - * @type {TokenizeContext} - */ - const context = { - code: null, - containerState: {}, - defineSkip, - events: [], - now, - parser, - previous: null, - sliceSerialize, - sliceStream, - write - }; - /** - * The state function. - * - * @type {State | undefined} - */ - let state = initialize.tokenize.call(context, effects); - if (initialize.resolveAll) resolveAllConstructs.push(initialize); - return context; - /** @type {TokenizeContext['write']} */ - function write(slice) { - chunks = push(chunks, slice); - main(); - if (chunks[chunks.length - 1] !== null) return []; - addResult(initialize, 0); - context.events = resolveAll(resolveAllConstructs, context.events, context); - return context.events; - } - /** @type {TokenizeContext['sliceSerialize']} */ - function sliceSerialize(token, expandTabs) { - return serializeChunks(sliceStream(token), expandTabs); - } - /** @type {TokenizeContext['sliceStream']} */ - function sliceStream(token) { - return sliceChunks(chunks, token); - } - /** @type {TokenizeContext['now']} */ - function now() { - const { _bufferIndex, _index, line, column, offset } = point; - return { - _bufferIndex, - _index, - line, - column, - offset - }; - } - /** @type {TokenizeContext['defineSkip']} */ - function defineSkip(value) { - columnStart[value.line] = value.column; - accountForPotentialSkip(); - } - /** - * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by - * `consume`). - * Here is where we walk through the chunks, which either include strings of - * several characters, or numerical character codes. - * The reason to do this in a loop instead of a call is so the stack can - * drain. - * - * @returns {undefined} - * Nothing. - */ - function main() { - while (point._index < chunks.length) { - const chunk = chunks[point._index]; - if (typeof chunk === "string") { - const chunkIndex = point._index; - if (point._bufferIndex < 0) point._bufferIndex = 0; - while (point._index === chunkIndex && point._bufferIndex < chunk.length) go(chunk.charCodeAt(point._bufferIndex)); - } else go(chunk); - } - } - /** - * Deal with one code. - * - * @param {Code} code - * Code. - * @returns {undefined} - * Nothing. - */ - function go(code) { - state = state(code); - } - /** @type {Effects['consume']} */ - function consume(code) { - if (markdownLineEnding(code)) { - point.line++; - point.column = 1; - point.offset += code === -3 ? 2 : 1; - accountForPotentialSkip(); - } else if (code !== -1) { - point.column++; - point.offset++; - } - if (point._bufferIndex < 0) point._index++; - else { - point._bufferIndex++; - if (point._bufferIndex === chunks[point._index].length) { - point._bufferIndex = -1; - point._index++; - } - } - context.previous = code; - } - /** @type {Effects['enter']} */ - function enter(type, fields) { - /** @type {Token} */ - const token = fields || {}; - token.type = type; - token.start = now(); - context.events.push([ - "enter", - token, - context - ]); - stack.push(token); - return token; - } - /** @type {Effects['exit']} */ - function exit(type) { - const token = stack.pop(); - token.end = now(); - context.events.push([ - "exit", - token, - context - ]); - return token; - } - /** - * Use results. - * - * @type {ReturnHandle} - */ - function onsuccessfulconstruct(construct, info) { - addResult(construct, info.from); - } - /** - * Discard results. - * - * @type {ReturnHandle} - */ - function onsuccessfulcheck(_, info) { - info.restore(); - } - /** - * Factory to attempt/check/interrupt. - * - * @param {ReturnHandle} onreturn - * Callback. - * @param {{interrupt?: boolean | undefined} | undefined} [fields] - * Fields. - */ - function constructFactory(onreturn, fields) { - return hook; - /** - * Handle either an object mapping codes to constructs, a list of - * constructs, or a single construct. - * - * @param {Array<Construct> | ConstructRecord | Construct} constructs - * Constructs. - * @param {State} returnState - * State. - * @param {State | undefined} [bogusState] - * State. - * @returns {State} - * State. - */ - function hook(constructs, returnState, bogusState) { - /** @type {ReadonlyArray<Construct>} */ - let listOfConstructs; - /** @type {number} */ - let constructIndex; - /** @type {Construct} */ - let currentConstruct; - /** @type {Info} */ - let info; - return Array.isArray(constructs) ? handleListOfConstructs(constructs) : "tokenize" in constructs ? handleListOfConstructs([constructs]) : handleMapOfConstructs(constructs); - /** - * Handle a list of construct. - * - * @param {ConstructRecord} map - * Constructs. - * @returns {State} - * State. - */ - function handleMapOfConstructs(map) { - return start; - /** @type {State} */ - function start(code) { - const left = code !== null && map[code]; - const all = code !== null && map.null; - return handleListOfConstructs([...Array.isArray(left) ? left : left ? [left] : [], ...Array.isArray(all) ? all : all ? [all] : []])(code); - } - } - /** - * Handle a list of construct. - * - * @param {ReadonlyArray<Construct>} list - * Constructs. - * @returns {State} - * State. - */ - function handleListOfConstructs(list) { - listOfConstructs = list; - constructIndex = 0; - if (list.length === 0) return bogusState; - return handleConstruct(list[constructIndex]); - } - /** - * Handle a single construct. - * - * @param {Construct} construct - * Construct. - * @returns {State} - * State. - */ - function handleConstruct(construct) { - return start; - /** @type {State} */ - function start(code) { - info = store(); - currentConstruct = construct; - if (!construct.partial) context.currentConstruct = construct; - if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) return nok(code); - return construct.tokenize.call(fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code); - } - } - /** @type {State} */ - function ok(code) { - onreturn(currentConstruct, info); - return returnState; - } - /** @type {State} */ - function nok(code) { - info.restore(); - if (++constructIndex < listOfConstructs.length) return handleConstruct(listOfConstructs[constructIndex]); - return bogusState; - } - } - } - /** - * @param {Construct} construct - * Construct. - * @param {number} from - * From. - * @returns {undefined} - * Nothing. - */ - function addResult(construct, from) { - if (construct.resolveAll && !resolveAllConstructs.includes(construct)) resolveAllConstructs.push(construct); - if (construct.resolve) splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context)); - if (construct.resolveTo) context.events = construct.resolveTo(context.events, context); - } - /** - * Store state. - * - * @returns {Info} - * Info. - */ - function store() { - const startPoint = now(); - const startPrevious = context.previous; - const startCurrentConstruct = context.currentConstruct; - const startEventsIndex = context.events.length; - const startStack = Array.from(stack); - return { - from: startEventsIndex, - restore - }; - /** - * Restore state. - * - * @returns {undefined} - * Nothing. - */ - function restore() { - point = startPoint; - context.previous = startPrevious; - context.currentConstruct = startCurrentConstruct; - context.events.length = startEventsIndex; - stack = startStack; - accountForPotentialSkip(); - } - } - /** - * Move the current point a bit forward in the line when it’s on a column - * skip. - * - * @returns {undefined} - * Nothing. - */ - function accountForPotentialSkip() { - if (point.line in columnStart && point.column < 2) { - point.column = columnStart[point.line]; - point.offset += columnStart[point.line] - 1; - } - } - } - /** - * Get the chunks from a slice of chunks in the range of a token. - * - * @param {ReadonlyArray<Chunk>} chunks - * Chunks. - * @param {Pick<Token, 'end' | 'start'>} token - * Token. - * @returns {Array<Chunk>} - * Chunks. - */ - function sliceChunks(chunks, token) { - const startIndex = token.start._index; - const startBufferIndex = token.start._bufferIndex; - const endIndex = token.end._index; - const endBufferIndex = token.end._bufferIndex; - /** @type {Array<Chunk>} */ - let view; - if (startIndex === endIndex) view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; - else { - view = chunks.slice(startIndex, endIndex); - if (startBufferIndex > -1) { - const head = view[0]; - if (typeof head === "string") view[0] = head.slice(startBufferIndex); - else view.shift(); - } - if (endBufferIndex > 0) view.push(chunks[endIndex].slice(0, endBufferIndex)); - } - return view; - } - /** - * Get the string value of a slice of chunks. - * - * @param {ReadonlyArray<Chunk>} chunks - * Chunks. - * @param {boolean | undefined} [expandTabs=false] - * Whether to expand tabs (default: `false`). - * @returns {string} - * Result. - */ - function serializeChunks(chunks, expandTabs) { - let index = -1; - /** @type {Array<string>} */ - const result = []; - /** @type {boolean | undefined} */ - let atTab; - while (++index < chunks.length) { - const chunk = chunks[index]; - /** @type {string} */ - let value; - if (typeof chunk === "string") value = chunk; - else switch (chunk) { - case -5: - value = "\r"; - break; - case -4: - value = "\n"; - break; - case -3: - value = "\r\n"; - break; - case -2: - value = expandTabs ? " " : " "; - break; - case -1: - if (!expandTabs && atTab) continue; - value = " "; - break; - default: value = String.fromCharCode(chunk); - } - atTab = chunk === -2; - result.push(value); - } - return result.join(""); - } - // node_modules/micromark/lib/parse.js - /** - * @import { - * Create, - * FullNormalizedExtension, - * InitialConstruct, - * ParseContext, - * ParseOptions - * } from 'micromark-util-types' - */ - /** - * @param {ParseOptions | null | undefined} [options] - * Configuration (optional). - * @returns {ParseContext} - * Parser. - */ - function parse(options) { - /** @type {ParseContext} */ - const parser = { - constructs: combineExtensions([constructs_exports, ...(options || {}).extensions || []]), - content: create(content$1), - defined: [], - document: create(document$2), - flow: create(flow$1), - lazy: {}, - string: create(string$1), - text: create(text$5) - }; - return parser; - /** - * @param {InitialConstruct} initial - * Construct to start with. - * @returns {Create} - * Create a tokenizer. - */ - function create(initial) { - return creator; - /** @type {Create} */ - function creator(from) { - return createTokenizer(parser, initial, from); - } - } - } - // node_modules/micromark/lib/postprocess.js - /** - * @import {Event} from 'micromark-util-types' - */ - /** - * @param {Array<Event>} events - * Events. - * @returns {Array<Event>} - * Events. - */ - function postprocess(events) { - while (!subtokenize(events)); - return events; - } - // node_modules/micromark/lib/preprocess.js - /** - * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types' - */ - /** - * @callback Preprocessor - * Preprocess a value. - * @param {Value} value - * Value. - * @param {Encoding | null | undefined} [encoding] - * Encoding when `value` is a typed array (optional). - * @param {boolean | null | undefined} [end=false] - * Whether this is the last chunk (default: `false`). - * @returns {Array<Chunk>} - * Chunks. - */ - const search = /[\0\t\n\r]/g; - /** - * @returns {Preprocessor} - * Preprocess a value. - */ - function preprocess() { - let column = 1; - let buffer = ""; - /** @type {boolean | undefined} */ - let start = true; - /** @type {boolean | undefined} */ - let atCarriageReturn; - return preprocessor; - /** @type {Preprocessor} */ - function preprocessor(value, encoding, end) { - value = buffer + (typeof value === "string" ? value.toString() : new TextDecoder(encoding || void 0).decode(value)); - /** @type {Array<Chunk>} */ - const chunks = []; - let startPosition = 0; - buffer = ""; - if (start) { - if (value.charCodeAt(0) === 65279) startPosition++; - start = void 0; - } - while (startPosition < value.length) { - search.lastIndex = startPosition; - const match = search.exec(value); - const endPosition = match && match.index !== void 0 ? match.index : value.length; - const code = value.charCodeAt(endPosition); - if (!match) { - buffer = value.slice(startPosition); - break; - } - if (code === 10 && startPosition === endPosition && atCarriageReturn) { - chunks.push(-3); - atCarriageReturn = void 0; - } else { - if (atCarriageReturn) { - chunks.push(-5); - atCarriageReturn = void 0; - } - if (startPosition < endPosition) { - chunks.push(value.slice(startPosition, endPosition)); - column += endPosition - startPosition; - } - switch (code) { - case 0: - chunks.push(65533); - column++; - break; - case 9: { - const next = Math.ceil(column / 4) * 4; - chunks.push(-2); - while (column++ < next) chunks.push(-1); - break; - } - case 10: - chunks.push(-4); - column = 1; - break; - default: - atCarriageReturn = true; - column = 1; - } - } - startPosition = endPosition + 1; - } - if (end) { - if (atCarriageReturn) chunks.push(-5); - if (buffer) chunks.push(buffer); - chunks.push(null); - } - return chunks; - } - } - // node_modules/micromark-util-decode-string/index.js - const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; - /** - * Decode markdown strings (which occur in places such as fenced code info - * strings, destinations, labels, and titles). - * - * The “string” content type allows character escapes and -references. - * This decodes those. - * - * @param {string} value - * Value to decode. - * @returns {string} - * Decoded value. - */ - function decodeString(value) { - return value.replace(characterEscapeOrReference, decode); - } - /** - * @param {string} $0 - * Match. - * @param {string} $1 - * Character escape. - * @param {string} $2 - * Character reference. - * @returns {string} - * Decoded value - */ - function decode($0, $1, $2) { - if ($1) return $1; - if ($2.charCodeAt(0) === 35) { - const head = $2.charCodeAt(1); - const hex = head === 120 || head === 88; - return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10); - } - return decodeNamedCharacterReference($2) || $0; - } - // node_modules/unist-util-stringify-position/lib/index.js - /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Point} Point - * @typedef {import('unist').Position} Position - */ - /** - * @typedef NodeLike - * @property {string} type - * @property {PositionLike | null | undefined} [position] - * - * @typedef PointLike - * @property {number | null | undefined} [line] - * @property {number | null | undefined} [column] - * @property {number | null | undefined} [offset] - * - * @typedef PositionLike - * @property {PointLike | null | undefined} [start] - * @property {PointLike | null | undefined} [end] - */ - /** - * Serialize the positional info of a point, position (start and end points), - * or node. - * - * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value] - * Node, position, or point. - * @returns {string} - * Pretty printed positional info of a node (`string`). - * - * In the format of a range `ls:cs-le:ce` (when given `node` or `position`) - * or a point `l:c` (when given `point`), where `l` stands for line, `c` for - * column, `s` for `start`, and `e` for end. - * An empty string (`''`) is returned if the given value is neither `node`, - * `position`, nor `point`. - */ - function stringifyPosition(value) { - if (!value || typeof value !== "object") return ""; - if ("position" in value || "type" in value) return position(value.position); - if ("start" in value || "end" in value) return position(value); - if ("line" in value || "column" in value) return point$1(value); - return ""; - } - /** - * @param {Point | PointLike | null | undefined} point - * @returns {string} - */ - function point$1(point) { - return index(point && point.line) + ":" + index(point && point.column); - } - /** - * @param {Position | PositionLike | null | undefined} pos - * @returns {string} - */ - function position(pos) { - return point$1(pos && pos.start) + "-" + point$1(pos && pos.end); - } - /** - * @param {number | null | undefined} value - * @returns {number} - */ - function index(value) { - return value && typeof value === "number" ? value : 1; - } - // node_modules/mdast-util-from-markdown/lib/index.js - /** - * @import { - * Break, - * Blockquote, - * Code, - * Definition, - * Emphasis, - * Heading, - * Html, - * Image, - * InlineCode, - * Link, - * ListItem, - * List, - * Nodes, - * Paragraph, - * PhrasingContent, - * ReferenceType, - * Root, - * Strong, - * Text, - * ThematicBreak - * } from 'mdast' - * @import { - * Encoding, - * Event, - * Token, - * Value - * } from 'micromark-util-types' - * @import {Point} from 'unist' - * @import { - * CompileContext, - * CompileData, - * Config, - * Extension, - * Handle, - * OnEnterError, - * Options - * } from './types.js' - */ - const own = {}.hasOwnProperty; - /** - * Turn markdown into a syntax tree. - * - * @overload - * @param {Value} value - * @param {Encoding | null | undefined} [encoding] - * @param {Options | null | undefined} [options] - * @returns {Root} - * - * @overload - * @param {Value} value - * @param {Options | null | undefined} [options] - * @returns {Root} - * - * @param {Value} value - * Markdown to parse. - * @param {Encoding | Options | null | undefined} [encoding] - * Character encoding for when `value` is `Buffer`. - * @param {Options | null | undefined} [options] - * Configuration. - * @returns {Root} - * mdast tree. - */ - function fromMarkdown(value, encoding, options) { - if (encoding && typeof encoding === "object") { - options = encoding; - encoding = void 0; - } - return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true)))); - } - /** - * Note this compiler only understand complete buffering, not streaming. - * - * @param {Options | null | undefined} [options] - */ - function compiler(options) { - /** @type {Config} */ - const config = { - afterExit: [], - beforeEnter: [], - transforms: [], - canContainEols: [ - "emphasis", - "fragment", - "heading", - "paragraph", - "strong" - ], - enter: { - autolink: opener(link), - autolinkProtocol: onenterdata, - autolinkEmail: onenterdata, - atxHeading: opener(heading), - blockQuote: opener(blockQuote), - characterEscape: onenterdata, - characterReference: onenterdata, - codeFenced: opener(codeFlow), - codeFencedFenceInfo: buffer, - codeFencedFenceMeta: buffer, - codeIndented: opener(codeFlow, buffer), - codeText: opener(codeText, buffer), - codeTextData: onenterdata, - data: onenterdata, - codeFlowValue: onenterdata, - definition: opener(definition), - definitionDestinationString: buffer, - definitionLabelString: buffer, - definitionTitleString: buffer, - emphasis: opener(emphasis), - hardBreakEscape: opener(hardBreak), - hardBreakTrailing: opener(hardBreak), - htmlFlow: opener(html, buffer), - htmlFlowData: onenterdata, - htmlText: opener(html, buffer), - htmlTextData: onenterdata, - image: opener(image), - label: buffer, - link: opener(link), - listItem: opener(listItem), - listItemValue: onenterlistitemvalue, - listOrdered: opener(list, onenterlistordered), - listUnordered: opener(list), - paragraph: opener(paragraph), - reference: onenterreference, - referenceString: buffer, - resourceDestinationString: buffer, - resourceTitleString: buffer, - setextHeading: opener(heading), - strong: opener(strong), - thematicBreak: opener(thematicBreak) - }, - exit: { - atxHeading: closer(), - atxHeadingSequence: onexitatxheadingsequence, - autolink: closer(), - autolinkEmail: onexitautolinkemail, - autolinkProtocol: onexitautolinkprotocol, - blockQuote: closer(), - characterEscapeValue: onexitdata, - characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, - characterReferenceMarkerNumeric: onexitcharacterreferencemarker, - characterReferenceValue: onexitcharacterreferencevalue, - characterReference: onexitcharacterreference, - codeFenced: closer(onexitcodefenced), - codeFencedFence: onexitcodefencedfence, - codeFencedFenceInfo: onexitcodefencedfenceinfo, - codeFencedFenceMeta: onexitcodefencedfencemeta, - codeFlowValue: onexitdata, - codeIndented: closer(onexitcodeindented), - codeText: closer(onexitcodetext), - codeTextData: onexitdata, - data: onexitdata, - definition: closer(), - definitionDestinationString: onexitdefinitiondestinationstring, - definitionLabelString: onexitdefinitionlabelstring, - definitionTitleString: onexitdefinitiontitlestring, - emphasis: closer(), - hardBreakEscape: closer(onexithardbreak), - hardBreakTrailing: closer(onexithardbreak), - htmlFlow: closer(onexithtmlflow), - htmlFlowData: onexitdata, - htmlText: closer(onexithtmltext), - htmlTextData: onexitdata, - image: closer(onexitimage), - label: onexitlabel, - labelText: onexitlabeltext, - lineEnding: onexitlineending, - link: closer(onexitlink), - listItem: closer(), - listOrdered: closer(), - listUnordered: closer(), - paragraph: closer(), - referenceString: onexitreferencestring, - resourceDestinationString: onexitresourcedestinationstring, - resourceTitleString: onexitresourcetitlestring, - resource: onexitresource, - setextHeading: closer(onexitsetextheading), - setextHeadingLineSequence: onexitsetextheadinglinesequence, - setextHeadingText: onexitsetextheadingtext, - strong: closer(), - thematicBreak: closer() - } - }; - configure(config, (options || {}).mdastExtensions || []); - /** @type {CompileData} */ - const data = {}; - return compile; - /** - * Turn micromark events into an mdast tree. - * - * @param {Array<Event>} events - * Events. - * @returns {Root} - * mdast tree. - */ - function compile(events) { - /** @type {Root} */ - let tree = { - type: "root", - children: [], - position: void 0 - }; - /** @type {Omit<CompileContext, 'sliceSerialize'>} */ - const context = { - stack: [tree], - tokenStack: [], - config, - enter, - exit, - buffer, - resume, - data - }; - /** @type {Array<number>} */ - const listStack = []; - /** @type {Array<Event>} */ - const prepared = []; - let index = -1; - while (++index < events.length) { - prepared.push(events[index]); - if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered") { - if (events[index][0] === "enter") listStack.push(prepared.length - 1); - else prepareList(prepared, listStack.pop()); - } - } - events = prepared; - index = -1; - while (++index < events.length) { - const handler = config[events[index][0]]; - if (events[index][0] === "enter" && config.beforeEnter.length > 0) callListeners(config.beforeEnter, { - ...context, - sliceSerialize: events[index][2].sliceSerialize - }, events[index][1]); - if (own.call(handler, events[index][1].type)) handler[events[index][1].type].call({ - ...context, - sliceSerialize: events[index][2].sliceSerialize - }, events[index][1]); - if (events[index][0] === "exit" && config.afterExit.length > 0) callListeners(config.afterExit, { - ...context, - sliceSerialize: events[index][2].sliceSerialize - }, events[index][1]); - } - if (context.tokenStack.length > 0) { - const tail = context.tokenStack[context.tokenStack.length - 1]; - (tail[1] || defaultOnError).call(context, void 0, tail[0]); - } - tree.position = { - start: point(events.length > 0 ? events[0][1].start : { - line: 1, - column: 1, - offset: 0 - }), - end: point(events.length > 0 ? events[events.length - 2][1].end : { - line: 1, - column: 1, - offset: 0 - }) - }; - index = -1; - while (++index < config.transforms.length) tree = config.transforms[index](tree) || tree; - return tree; - } - /** - * @param {Array<Handle>} listeners - * Listeners. - * @param {CompileContext} context - * Context. - * @param {Token} token - * Token. - * @returns {undefined} - * Nothing. - */ - function callListeners(listeners, context, token) { - let index = -1; - while (++index < listeners.length) listeners[index].call(context, token); - } - /** - * @param {Array<Event>} events - * Events, ending with the list to prepare. - * @param {number} start - * Index of the list enter. - * @returns {undefined} - */ - function prepareList(events, start) { - const end = events.length - 1; - let index = start - 1; - let containerBalance = -1; - let listSpread = false; - /** @type {Token | undefined} */ - let listItem; - /** @type {number | undefined} */ - let lineIndex; - /** @type {number | undefined} */ - let firstBlankLineIndex; - /** @type {boolean | undefined} */ - let atMarker; - /** - * `listItem` events to insert before the event at `at`, in walk order. - * Merged in after the walk, as inserting while walking would shift the - * rest of the list once per item. - * @type {Array<{at: number, event: Event}>} - */ - const insertions = []; - while (++index <= end) { - const event = events[index]; - switch (event[1].type) { - case "listUnordered": - case "listOrdered": - case "blockQuote": - if (event[0] === "enter") containerBalance++; - else containerBalance--; - atMarker = void 0; - break; - case "lineEndingBlank": - if (event[0] === "enter") { - if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) firstBlankLineIndex = index; - atMarker = void 0; - } - break; - case "linePrefix": - case "listItemValue": - case "listItemMarker": - case "listItemPrefix": - case "listItemPrefixWhitespace": break; - default: atMarker = void 0; - } - if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { - if (listItem) { - let tailIndex = index; - lineIndex = void 0; - while (tailIndex--) { - const tailEvent = events[tailIndex]; - if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { - if (tailEvent[0] === "exit") continue; - if (lineIndex) { - events[lineIndex][1].type = "lineEndingBlank"; - listSpread = true; - } - tailEvent[1].type = "lineEnding"; - lineIndex = tailIndex; - } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") {} else break; - } - if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) listItem._spread = true; - listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end); - insertions.push({ - at: lineIndex || index, - event: [ - "exit", - listItem, - event[2] - ] - }); - } - if (event[1].type === "listItemPrefix") { - /** @type {Token} */ - const item = { - type: "listItem", - _spread: false, - start: Object.assign({}, event[1].start), - end: void 0 - }; - listItem = item; - insertions.push({ - at: index, - event: [ - "enter", - item, - event[2] - ] - }); - firstBlankLineIndex = void 0; - atMarker = true; - } - } - } - const listEvents = events.splice(start); - let insertion = 0; - index = -1; - while (++index < listEvents.length) { - while (insertion < insertions.length && insertions[insertion].at === start + index) events.push(insertions[insertion++].event); - events.push(listEvents[index]); - } - events[start][1]._spread = listSpread; - } - /** - * Create an opener handle. - * - * @param {(token: Token) => Nodes} create - * Create a node. - * @param {Handle | undefined} [and] - * Optional function to also run. - * @returns {Handle} - * Handle. - */ - function opener(create, and) { - return open; - /** - * @this {CompileContext} - * @param {Token} token - * @returns {undefined} - */ - function open(token) { - enter.call(this, create(token), token); - if (and) and.call(this, token); - } - } - /** - * @type {CompileContext['buffer']} - */ - function buffer() { - this.stack.push({ - type: "fragment", - children: [] - }); - } - /** - * @type {CompileContext['enter']} - */ - function enter(node, token, errorHandler) { - this.stack[this.stack.length - 1].children.push(node); - this.stack.push(node); - this.tokenStack.push([token, errorHandler || void 0]); - node.position = { - start: point(token.start), - end: void 0 - }; - } - /** - * Create a closer handle. - * - * @param {Handle | undefined} [and] - * Optional function to also run. - * @returns {Handle} - * Handle. - */ - function closer(and) { - return close; - /** - * @this {CompileContext} - * @param {Token} token - * @returns {undefined} - */ - function close(token) { - if (and) and.call(this, token); - exit.call(this, token); - } - } - /** - * @type {CompileContext['exit']} - */ - function exit(token, onExitError) { - const node = this.stack.pop(); - const open = this.tokenStack.pop(); - if (!open) throw new Error("Cannot close `" + token.type + "` (" + stringifyPosition({ - start: token.start, - end: token.end - }) + "): it’s not open"); - if (open[0].type !== token.type) { - if (onExitError) onExitError.call(this, token, open[0]); - else (open[1] || defaultOnError).call(this, token, open[0]); - } - node.position.end = point(token.end); - } - /** - * @type {CompileContext['resume']} - */ - function resume() { - return toString(this.stack.pop()); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onenterlistordered() { - this.data.expectingFirstListItemValue = true; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onenterlistitemvalue(token) { - if (this.data.expectingFirstListItemValue) { - const ancestor = this.stack[this.stack.length - 2]; - ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); - this.data.expectingFirstListItemValue = void 0; - } - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodefencedfenceinfo() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.lang = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodefencedfencemeta() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.meta = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodefencedfence() { - if (this.data.flowCodeInside) return; - this.buffer(); - this.data.flowCodeInside = true; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodefenced() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); - this.data.flowCodeInside = void 0; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodeindented() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data.replace(/(\r?\n|\r)$/g, ""); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitdefinitionlabelstring(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.label = label; - node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitdefinitiontitlestring() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.title = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitdefinitiondestinationstring() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.url = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitatxheadingsequence(token) { - const node = this.stack[this.stack.length - 1]; - if (!node.depth) node.depth = this.sliceSerialize(token).length; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitsetextheadingtext() { - this.data.setextHeadingSlurpLineEnding = true; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitsetextheadinglinesequence(token) { - const node = this.stack[this.stack.length - 1]; - node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitsetextheading() { - this.data.setextHeadingSlurpLineEnding = void 0; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onenterdata(token) { - /** @type {Array<Nodes>} */ - const siblings = this.stack[this.stack.length - 1].children; - let tail = siblings[siblings.length - 1]; - if (!tail || tail.type !== "text") { - tail = text(); - tail.position = { - start: point(token.start), - end: void 0 - }; - siblings.push(tail); - } - this.stack.push(tail); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitdata(token) { - const tail = this.stack.pop(); - tail.value += this.sliceSerialize(token); - tail.position.end = point(token.end); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitlineending(token) { - const context = this.stack[this.stack.length - 1]; - if (this.data.atHardBreak) { - const tail = context.children[context.children.length - 1]; - tail.position.end = point(token.end); - this.data.atHardBreak = void 0; - return; - } - if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) { - onenterdata.call(this, token); - onexitdata.call(this, token); - } - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexithardbreak() { - this.data.atHardBreak = true; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexithtmlflow() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexithtmltext() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcodetext() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitlink() { - const node = this.stack[this.stack.length - 1]; - if (this.data.inReference) { - /** @type {ReferenceType} */ - const referenceType = this.data.referenceType || "shortcut"; - node.type += "Reference"; - node.referenceType = referenceType; - delete node.url; - delete node.title; - } else { - delete node.identifier; - delete node.label; - } - this.data.referenceType = void 0; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitimage() { - const node = this.stack[this.stack.length - 1]; - if (this.data.inReference) { - /** @type {ReferenceType} */ - const referenceType = this.data.referenceType || "shortcut"; - node.type += "Reference"; - node.referenceType = referenceType; - delete node.url; - delete node.title; - } else { - delete node.identifier; - delete node.label; - } - this.data.referenceType = void 0; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitlabeltext(token) { - const string = this.sliceSerialize(token); - const ancestor = this.stack[this.stack.length - 2]; - ancestor.label = decodeString(string); - ancestor.identifier = normalizeIdentifier(string).toLowerCase(); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitlabel() { - const fragment = this.stack[this.stack.length - 1]; - const value = this.resume(); - const node = this.stack[this.stack.length - 1]; - this.data.inReference = true; - if (node.type === "link") node.children = fragment.children; - else node.alt = value; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitresourcedestinationstring() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.url = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitresourcetitlestring() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.title = data; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitresource() { - this.data.inReference = void 0; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onenterreference() { - this.data.referenceType = "collapsed"; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitreferencestring(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.label = label; - node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); - this.data.referenceType = "full"; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcharacterreferencemarker(token) { - this.data.characterReferenceType = token.type; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcharacterreferencevalue(token) { - const data = this.sliceSerialize(token); - const type = this.data.characterReferenceType; - /** @type {string} */ - let value; - if (type) { - value = decodeNumericCharacterReference(data, type === "characterReferenceMarkerNumeric" ? 10 : 16); - this.data.characterReferenceType = void 0; - } else value = decodeNamedCharacterReference(data); - const tail = this.stack[this.stack.length - 1]; - tail.value += value; - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitcharacterreference(token) { - const tail = this.stack.pop(); - tail.position.end = point(token.end); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitautolinkprotocol(token) { - onexitdata.call(this, token); - const node = this.stack[this.stack.length - 1]; - node.url = this.sliceSerialize(token); - } - /** - * @this {CompileContext} - * @type {Handle} - */ - function onexitautolinkemail(token) { - onexitdata.call(this, token); - const node = this.stack[this.stack.length - 1]; - node.url = "mailto:" + this.sliceSerialize(token); - } - /** @returns {Blockquote} */ - function blockQuote() { - return { - type: "blockquote", - children: [], - position: void 0 - }; - } - /** @returns {Code} */ - function codeFlow() { - return { - type: "code", - lang: null, - meta: null, - value: "", - position: void 0 - }; - } - /** @returns {InlineCode} */ - function codeText() { - return { - type: "inlineCode", - value: "", - position: void 0 - }; - } - /** @returns {Definition} */ - function definition() { - return { - type: "definition", - identifier: "", - label: null, - title: null, - url: "", - position: void 0 - }; - } - /** @returns {Emphasis} */ - function emphasis() { - return { - type: "emphasis", - children: [], - position: void 0 - }; - } - /** @returns {Heading} */ - function heading() { - return { - type: "heading", - depth: 0, - children: [], - position: void 0 - }; - } - /** @returns {Break} */ - function hardBreak() { - return { - type: "break", - position: void 0 - }; - } - /** @returns {Html} */ - function html() { - return { - type: "html", - value: "", - position: void 0 - }; - } - /** @returns {Image} */ - function image() { - return { - type: "image", - title: null, - url: "", - alt: null, - position: void 0 - }; - } - /** @returns {Link} */ - function link() { - return { - type: "link", - title: null, - url: "", - children: [], - position: void 0 - }; - } - /** - * @param {Token} token - * @returns {List} - */ - function list(token) { - return { - type: "list", - ordered: token.type === "listOrdered", - start: null, - spread: token._spread, - children: [], - position: void 0 - }; - } - /** - * @param {Token} token - * @returns {ListItem} - */ - function listItem(token) { - return { - type: "listItem", - spread: token._spread, - checked: null, - children: [], - position: void 0 - }; - } - /** @returns {Paragraph} */ - function paragraph() { - return { - type: "paragraph", - children: [], - position: void 0 - }; - } - /** @returns {Strong} */ - function strong() { - return { - type: "strong", - children: [], - position: void 0 - }; - } - /** @returns {Text} */ - function text() { - return { - type: "text", - value: "", - position: void 0 - }; - } - /** @returns {ThematicBreak} */ - function thematicBreak() { - return { - type: "thematicBreak", - position: void 0 - }; - } - } - /** - * Copy a point-like value. - * - * @param {Point} d - * Point-like value. - * @returns {Point} - * unist point. - */ - function point(d) { - return { - line: d.line, - column: d.column, - offset: d.offset - }; - } - /** - * @param {Config} combined - * @param {Array<Array<Extension> | Extension>} extensions - * @returns {undefined} - */ - function configure(combined, extensions) { - let index = -1; - while (++index < extensions.length) { - const value = extensions[index]; - if (Array.isArray(value)) configure(combined, value); - else extension(combined, value); - } - } - /** - * @param {Config} combined - * @param {Extension} extension - * @returns {undefined} - */ - function extension(combined, extension) { - /** @type {keyof Extension} */ - let key; - for (key in extension) if (own.call(extension, key)) switch (key) { - case "canContainEols": { - const right = extension[key]; - if (right) combined[key].push(...right); - break; - } - case "transforms": { - const right = extension[key]; - if (right) combined[key].push(...right); - break; - } - case "afterExit": - case "beforeEnter": { - const right = extension[key]; - if (right) combined[key].push(right); - break; - } - case "enter": - case "exit": { - const right = extension[key]; - if (right) Object.assign(combined[key], right); - break; - } - } - } - /** @type {OnEnterError} */ - function defaultOnError(left, right) { - if (left) throw new Error("Cannot close `" + left.type + "` (" + stringifyPosition({ - start: left.start, - end: left.end - }) + "): a different token (`" + right.type + "`, " + stringifyPosition({ - start: right.start, - end: right.end - }) + ") is open"); - throw new Error("Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({ - start: right.start, - end: right.end - }) + ") is still open"); - } - // node_modules/ccount/index.js - /** - * Count how often a character (or substring) is used in a string. - * - * @param {string} value - * Value to search in. - * @param {string} character - * Character (or substring) to look for. - * @return {number} - * Number of times `character` occurred in `value`. - */ - function ccount(value, character) { - const source = String(value); - if (typeof character !== "string") throw new TypeError("Expected character"); - let count = 0; - let index = source.indexOf(character); - while (index !== -1) { - count++; - index = source.indexOf(character, index + character.length); - } - return count; - } - // node_modules/escape-string-regexp/index.js - function escapeStringRegexp(string) { - if (typeof string !== "string") throw new TypeError("Expected a string"); - return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); - } - // node_modules/unist-util-is/lib/index.js - /** - * Generate an assertion from a test. - * - * Useful if you’re going to test many nodes, for example when creating a - * utility where something else passes a compatible test. - * - * The created function is a bit faster because it expects valid input only: - * a `node`, `index`, and `parent`. - * - * @param {Test} test - * * when nullish, checks if `node` is a `Node`. - * * when `string`, works like passing `(node) => node.type === test`. - * * when `function` checks if function passed the node is true. - * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * * when `array`, checks if any one of the subtests pass. - * @returns {Check} - * An assertion. - */ - const convert = ( - /** - * @param {Test} [test] - * @returns {Check} - */ - function(test) { - if (test === null || test === void 0) return ok; - if (typeof test === "function") return castFactory(test); - if (typeof test === "object") return Array.isArray(test) ? anyFactory(test) : propertiesFactory(test); - if (typeof test === "string") return typeFactory(test); - throw new Error("Expected function, string, or object as test"); - }); - /** - * @param {Array<Props | TestFunction | string>} tests - * @returns {Check} - */ - function anyFactory(tests) { - /** @type {Array<Check>} */ - const checks = []; - let index = -1; - while (++index < tests.length) checks[index] = convert(tests[index]); - return castFactory(any); - /** - * @this {unknown} - * @type {TestFunction} - */ - function any(...parameters) { - let index = -1; - while (++index < checks.length) if (checks[index].apply(this, parameters)) return true; - return false; - } - } - /** - * Turn an object into a test for a node with a certain fields. - * - * @param {Props} check - * @returns {Check} - */ - function propertiesFactory(check) { - const checkAsRecord = check; - return castFactory(all); - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - const nodeAsRecord = node; - /** @type {string} */ - let key; - for (key in check) if (nodeAsRecord[key] !== checkAsRecord[key]) return false; - return true; - } - } - /** - * Turn a string into a test for a node with a certain type. - * - * @param {string} check - * @returns {Check} - */ - function typeFactory(check) { - return castFactory(type); - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check; - } - } - /** - * Turn a custom test into a test for a node that passes that test. - * - * @param {TestFunction} testFunction - * @returns {Check} - */ - function castFactory(testFunction) { - return check; - /** - * @this {unknown} - * @type {Check} - */ - function check(value, index, parent) { - return Boolean(looksLikeANode(value) && testFunction.call(this, value, typeof index === "number" ? index : void 0, parent || void 0)); - } - } - function ok() { - return true; - } - /** - * @param {unknown} value - * @returns {value is Node} - */ - function looksLikeANode(value) { - return value !== null && typeof value === "object" && "type" in value; - } - // node_modules/unist-util-visit-parents/lib/color.node.js - /** - * Color a string. - * - * @param {string} d - * Value. - * @returns {string} - * Colored value. - */ - function color(d) { - return "\x1B[33m" + d + "\x1B[39m"; - } - // node_modules/unist-util-visit-parents/lib/index.js - /** - * @import {Node as UnistNode, Parent as UnistParent} from 'unist' - */ - /** - * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test - * Test from `unist-util-is`. - * - * Note: we have remove and add `undefined`, because otherwise when generating - * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, - * which doesn’t work when publishing on npm. - */ - /** - * @typedef {( - * Fn extends (value: any) => value is infer Thing - * ? Thing - * : Fallback - * )} Predicate - * Get the value of a type guard `Fn`. - * @template Fn - * Value; typically function that is a type guard (such as `(x): x is Y`). - * @template Fallback - * Value to yield if `Fn` is not a type guard. - */ - /** - * @typedef {( - * Check extends null | undefined // No test. - * ? Value - * : Value extends {type: Check} // String (type) test. - * ? Value - * : Value extends Check // Partial test. - * ? Value - * : Check extends Function // Function test. - * ? Predicate<Check, Value> extends Value - * ? Predicate<Check, Value> - * : never - * : never // Some other test? - * )} MatchesOne - * Check whether a node matches a primitive check in the type system. - * @template Value - * Value; typically unist `Node`. - * @template Check - * Value; typically `unist-util-is`-compatible test, but not arrays. - */ - /** - * @typedef {( - * Check extends ReadonlyArray<infer T> - * ? MatchesOne<Value, T> - * : Check extends Array<infer T> - * ? MatchesOne<Value, T> - * : MatchesOne<Value, Check> - * )} Matches - * Check whether a node matches a check in the type system. - * @template Value - * Value; typically unist `Node`. - * @template Check - * Value; typically `unist-util-is`-compatible test. - */ - /** - * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint - * Number; capped reasonably. - */ - /** - * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment - * Increment a number in the type system. - * @template {Uint} [I=0] - * Index. - */ - /** - * @typedef {( - * Node extends UnistParent - * ? Node extends {children: Array<infer Children>} - * ? Child extends Children ? Node : never - * : never - * : never - * )} InternalParent - * Collect nodes that can be parents of `Child`. - * @template {UnistNode} Node - * All node types in a tree. - * @template {UnistNode} Child - * Node to search for. - */ - /** - * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent - * Collect nodes in `Tree` that can be parents of `Child`. - * @template {UnistNode} Tree - * All node types in a tree. - * @template {UnistNode} Child - * Node to search for. - */ - /** - * @typedef {( - * Depth extends Max - * ? never - * : - * | InternalParent<Node, Child> - * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>> - * )} InternalAncestor - * Collect nodes in `Tree` that can be ancestors of `Child`. - * @template {UnistNode} Node - * All node types in a tree. - * @template {UnistNode} Child - * Node to search for. - * @template {Uint} [Max=10] - * Max; searches up to this depth. - * @template {Uint} [Depth=0] - * Current depth. - */ - /** - * @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor - * Collect nodes in `Tree` that can be ancestors of `Child`. - * @template {UnistNode} Tree - * All node types in a tree. - * @template {UnistNode} Child - * Node to search for. - */ - /** - * @typedef {( - * Tree extends UnistParent - * ? Depth extends Max - * ? Tree - * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>> - * : Tree - * )} InclusiveDescendant - * Collect all (inclusive) descendants of `Tree`. - * - * > 👉 **Note**: for performance reasons, this seems to be the fastest way to - * > recurse without actually running into an infinite loop, which the - * > previous version did. - * > - * > Practically, a max of `2` is typically enough assuming a `Root` is - * > passed, but it doesn’t improve performance. - * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. - * > Using up to `10` doesn’t hurt or help either. - * @template {UnistNode} Tree - * Tree type. - * @template {Uint} [Max=10] - * Max; searches up to this depth. - * @template {Uint} [Depth=0] - * Current depth. - */ - /** - * @typedef {'skip' | boolean} Action - * Union of the action types. - * - * @typedef {number} Index - * Move to the sibling at `index` next (after node itself is completely - * traversed). - * - * Useful if mutating the tree, such as removing the node the visitor is - * currently on, or any of its previous siblings. - * Results less than 0 or greater than or equal to `children.length` stop - * traversing the parent. - * - * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple - * List with one or two values, the first an action, the second an index. - * - * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult - * Any value that can be returned from an enter visitor. - * - * Like `VisitorResultExit`, - * but `SKIP` can also be returned, - * to not walk the children of the node, - * and `ActionTuple` can be used to combine an action with an index. - * - * @typedef {Index | boolean | null | undefined | void} VisitorResultExit - * Any value that can be returned from an exit visitor. - */ - /** - * @callback Visitor - * Handle a node (matching `test`, if given) before its children. - * - * Changes inside `node` are walked next. - * Replacing or removing it is easier in `exit`. - * When replacing or removing it here, - * return `SKIP` (as otherwise its old children are walked), - * or `[SKIP, index]` to continue with the node now at `index`. - * Changing next siblings (in walk order) is fine; - * changing previous siblings needs a new `Index`. - * Removing an ancestor or changing its previous siblings is not supported. - * @param {Visited} node - * Found node. - * @param {Array<VisitedParents>} ancestors - * Ancestors of `node`. - * @param {number | undefined} index - * Index of `node` in its parent (the last of `ancestors`), - * or `undefined` for the tree itself. - * @returns {VisitorResult} - * What to do next. - * - * Like `VisitorExit`, - * but `SKIP` can also be returned, - * to not walk the children of `node`. - * Passing a tuple back (`ActionTuple`) only makes sense as `[SKIP, Index]`. - * @template {UnistNode} [Visited=UnistNode] - * Visited node type. - * @template {UnistParent} [VisitedParents=UnistParent] - * Ancestor type. - */ - /** - * @callback VisitorExit - * Handle a node (matching `test`, if given) after its children. - * - * Changes inside `node` are not walked, - * which makes this a good place to change `node` based on its children, - * or to replace or remove it. - * When removing `node` or changing previous siblings (in walk order), - * return a new `Index`. - * Removing an ancestor or changing its previous siblings is not supported. - * @param {Visited} node - * Found node. - * @param {Array<VisitedParents>} ancestors - * Ancestors of `node`. - * @param {number | undefined} index - * Index of `node` in its parent (the last of `ancestors`), - * or `undefined` for the tree itself. - * @returns {VisitorResultExit} - * What to do next. - * - * `CONTINUE` (`true`, nothing) continues as normal, - * `EXIT` (`false`) stops traversing, - * and `Index` continues at that sibling. - * @template {UnistNode} [Visited=UnistNode] - * Visited node type. - * @template {UnistParent} [VisitedParents=UnistParent] - * Ancestor type. - */ - /** - * @template {UnistNode} [Visited=UnistNode] - * Visited node type. - * @template {UnistParent} [VisitedParents=UnistParent] - * Ancestor type. - * @typedef Visitors - * Handle nodes when entering and exiting them. - * The `enter` visitor is optional while `exit` is required. - * - * Pass an `enter` visitor directly to only handle nodes when entering them. - * - * `enter` is called before children (if any) are walked and `exit` after that. - * `exit` is still called when `enter` returns `SKIP`. - * Both `enter` and `exit` are only called for nodes that match an optional `test`. - * @property {Visitor<Visited, VisitedParents> | null | undefined} [enter] - * Handle a node before its children (optional). - * @property {VisitorExit<Visited, VisitedParents>} exit - * Handle a node after its children. - */ - /** - * @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor - * Build a typed `Visitor` function from a tree and a test. - * - * It will infer which values are passed as `node` and which as `parents`. - * @template {UnistNode} [Tree=UnistNode] - * Tree type. - * @template {Test} [Check=Test] - * Test type. - */ - /** - * @typedef {Visitors<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitors - * Build typed `Visitors` from a tree and a test. - * - * It will infer which values are passed as `node` and which as `parents`. - * @template {UnistNode} [Tree=UnistNode] - * Tree type. - * @template {Test} [Check=Test] - * Test type. - */ - /** @type {Readonly<ActionTuple>} */ - const empty = []; - /** - * Do not traverse this node’s children. - * Only works when entering a node. - */ - const SKIP = "skip"; - /** - * Visit nodes, with ancestral information. - * - * This algorithm performs *depth-first* *tree traversal* in *preorder* - * (**NLR**) or if `reverse` is given, - * in *reverse preorder* (**NRL**). - * An `exit` visitor is called in *postorder* (**LRN**) - * or if `reverse` is given, in *reverse postorder* (**RLN**). - * - * You can choose which nodes are visited by passing a `test`. - * For complex tests, you should test yourself in a visitor, as it will be - * faster and will have improved type information. - * - * Walking the tree is an intensive task. - * Make use of the return values of the visitor when possible. - * Instead of walking a tree multiple times, walk it once, use `unist-util-is` - * to check if a node matches, and then perform different operations. - * - * You can change the tree. - * Changes inside a node made when entering it are walked, - * changes made when exiting it are not. - * See `Visitor` and `VisitorExit` for more info. - * - * @overload - * @param {Tree} tree - * Tree to traverse. - * @param {Check} check - * `unist-util-is`-compatible test. - * @param {BuildVisitor<Tree, Check>} enter - * Handle each node when entering it. - * @param {boolean | null | undefined} [reverse] - * Walk children from last to first; - * for `enter`, reverse preorder (NRL) instead of preorder (NLR); - * for `exit`, reverse postorder (RLN) instead of postorder (LRN). - * @returns {undefined} - * Nothing. - * - * @overload - * @param {Tree} tree - * Tree to traverse. - * @param {Check} check - * `unist-util-is`-compatible test. - * @param {BuildVisitors<Tree, Check>} visitors - * Handle each node when exiting it, and optionally when entering it. - * @param {boolean | null | undefined} [reverse] - * Walk children from last to first; - * for `enter`, reverse preorder (NRL) instead of preorder (NLR); - * for `exit`, reverse postorder (RLN) instead of postorder (LRN). - * @returns {undefined} - * Nothing. - * - * @overload - * @param {Tree} tree - * Tree to traverse. - * @param {BuildVisitor<Tree>} enter - * Handle each node when entering it. - * @param {boolean | null | undefined} [reverse] - * Walk children from last to first; - * for `enter`, reverse preorder (NRL) instead of preorder (NLR); - * for `exit`, reverse postorder (RLN) instead of postorder (LRN). - * @returns {undefined} - * Nothing. - * - * @overload - * @param {Tree} tree - * Tree to traverse. - * @param {BuildVisitors<Tree>} visitors - * Handle each node when exiting it, and optionally when entering it. - * @param {boolean | null | undefined} [reverse] - * Walk children from last to first; - * for `enter`, reverse preorder (NRL) instead of preorder (NLR); - * for `exit`, reverse postorder (RLN) instead of postorder (LRN). - * @returns {undefined} - * Nothing. - * - * @param {UnistNode} tree - * Tree to traverse. - * @param {Visitor | Visitors | Test} testOrEnterOrVisitors - * `unist-util-is`-compatible test, `enter`, or `visitors`. - * @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse] - * `enter`, `visitors`, or `reverse` after a test. - * @param {boolean | null | undefined} [reverse] - * Walk children from last to first; - * for `enter`, reverse preorder (NRL) instead of preorder (NLR); - * for `exit`, reverse postorder (RLN) instead of postorder (LRN). - * @returns {undefined} - * Nothing. - * - * @template {UnistNode} Tree - * Node type. - * @template {Test} Check - * `unist-util-is`-compatible test. - */ - function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) { - if (!tree || typeof tree !== "object") throw new Error("Unexpected value `" + tree + "` for `tree`, expected node"); - let preorder = true; - /** @type {Test} */ - let check; - /** @type {Visitors | Visitor} */ - let visitors; - /** @type {Visitor | null | undefined} */ - let enter; - /** @type {VisitorExit | null | undefined} */ - let exit; - if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") { - check = testOrEnterOrVisitors; - visitors = enterOrVisitorsOrReverse; - if (reverse) preorder = false; - } else { - visitors = testOrEnterOrVisitors; - if (enterOrVisitorsOrReverse) preorder = false; - } - if (typeof visitors === "function") enter = visitors; - else if (visitors && typeof visitors === "object") { - if (visitors.enter === null || visitors.enter === void 0) {} else if (typeof visitors.enter === "function") enter = visitors.enter; - else throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor"); - if (typeof visitors.exit === "function") exit = visitors.exit; - else throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)"); - } else throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors"); - const is = convert(check); - const step = preorder ? 1 : -1; - factory(tree, void 0, [])(); - /** - * Create a function to visit a node. - * - * @param {UnistNode} node - * Node to visit. - * @param {number | undefined} index - * Index of `node` in its parent. - * @param {Array<UnistParent>} parents - * Ancestors of `node`. - * @returns {() => Readonly<ActionTuple>} - * Visit `node`. - */ - function factory(node, index, parents) { - const value = node && typeof node === "object" ? node : {}; - if (typeof value.type === "string") { - const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0; - Object.defineProperty(visit, "name", { value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")" }); - } - return visit; - function visit() { - const matches = !check || is(node, index, parents[parents.length - 1] || void 0); - /** @type {Readonly<ActionTuple>} */ - let result = empty; - if (enter && matches) { - result = toResult(enter(node, parents, index)); - if (result[0] === false) return result; - } - if ("children" in node && node.children) { - const nodeAsParent = node; - if (nodeAsParent.children && result[0] !== "skip") { - let offset = (preorder ? -1 : nodeAsParent.children.length) + step; - const grandparents = [...parents, nodeAsParent]; - while (offset > -1 && offset < nodeAsParent.children.length) { - const child = nodeAsParent.children[offset]; - const subresult = factory(child, offset, grandparents)(); - if (subresult[0] === false) return subresult; - offset = typeof subresult[1] === "number" ? subresult[1] : offset + step; - } - } - } - if (exit && matches) { - const exitResult = toResult(exit(node, parents, index)); - if (exitResult[0] === "skip") throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing"); - if (exitResult[0] === false || typeof exitResult[1] === "number") return exitResult; - } - return result; - } - } - } - /** - * Turn a return value into a clean result. - * - * @param {VisitorResult} value - * Valid return values from visitors. - * @returns {Readonly<ActionTuple>} - * Clean result. - */ - function toResult(value) { - if (Array.isArray(value)) return value; - if (typeof value === "number") return [true, value]; - return value === null || value === void 0 ? empty : [value]; - } - // node_modules/mdast-util-find-and-replace/lib/index.js - /** - * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast' - * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents' - */ - /** - * @typedef RegExpMatchObject - * Info on the match. - * @property {number} index - * The index of the search at which the result was found. - * @property {string} input - * A copy of the search string in the text node. - * @property {[...Array<Parents>, Text]} stack - * All ancestors of the text node, where the last node is the text itself. - * - * @typedef {RegExp | string} Find - * Pattern to find. - * - * Strings are escaped and then turned into global expressions. - * - * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList - * Several find and replaces, in array form. - * - * @typedef {[Find, Replace?]} FindAndReplaceTuple - * Find and replace in tuple form. - * - * @typedef {ReplaceFunction | string | null | undefined} Replace - * Thing to replace with. - * - * @callback ReplaceFunction - * Callback called when a search matches. - * @param {...any} parameters - * The parameters are the result of corresponding search expression: - * - * * `value` (`string`) — whole match - * * `...capture` (`Array<string>`) — matches from regex capture groups - * * `match` (`RegExpMatchObject`) — info on the match - * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined} - * Thing to replace with. - * - * * when `null`, `undefined`, `''`, remove the match - * * …or when `false`, do not replace at all - * * …or when `string`, replace with a text node of that value - * * …or when `Node` or `Array<Node>`, replace with those nodes - * - * @typedef {[RegExp, ReplaceFunction]} Pair - * Normalized find and replace. - * - * @typedef {Array<Pair>} Pairs - * All find and replaced. - * - * @typedef Options - * Configuration. - * @property {Test | null | undefined} [ignore] - * Test for which nodes to ignore (optional). - */ - /** - * Find patterns in a tree and replace them. - * - * The algorithm searches the tree in *preorder* for complete values in `Text` - * nodes. - * Partial matches are not supported. - * - * @param {Nodes} tree - * Tree to change. - * @param {FindAndReplaceList | FindAndReplaceTuple} list - * Patterns to find. - * @param {Options | null | undefined} [options] - * Configuration (optional). - * @returns {undefined} - * Nothing. - */ - function findAndReplace(tree, list, options) { - const ignored = convert((options || {}).ignore || []); - const pairs = toPairs(list); - let pairIndex = -1; - while (++pairIndex < pairs.length) visitParents(tree, visitor); - /** - * Handle text nodes and skip ignored nodes. - * - * @type {BuildVisitor<Root>} - */ - function visitor(node, parents, index) { - if (node.type === "text" && typeof index === "number") return handler(node, parents, index); - if (ignored(node, index, parents[parents.length - 1])) return SKIP; - } - /** - * Handle a text node which is not in an ignored parent. - * - * @param {Text} node - * Text node to search in. - * @param {Array<Parents>} parents - * Ancestors of `node`. - * @param {number} index - * Index of `node` in its parent. - * @returns {VisitorResult} - * Where to continue visiting. - */ - function handler(node, parents, index) { - const parent = parents[parents.length - 1]; - const find = pairs[pairIndex][0]; - const replace = pairs[pairIndex][1]; - let start = 0; - let change = false; - /** @type {Array<PhrasingContent>} */ - let nodes = []; - find.lastIndex = 0; - let match = find.exec(node.value); - while (match) { - const position = match.index; - /** @type {RegExpMatchObject} */ - const matchObject = { - index: match.index, - input: match.input, - stack: [...parents, node] - }; - let value = replace(...match, matchObject); - if (typeof value === "string") value = value.length > 0 ? { - type: "text", - value - } : void 0; - if (value === false) find.lastIndex = position + 1; - else { - if (start !== position) add({ - type: "text", - value: node.value.slice(start, position) - }); - if (Array.isArray(value)) for (const child of value) add(child); - else if (value) add(value); - start = position + match[0].length; - change = true; - } - if (!find.global) break; - match = find.exec(node.value); - } - if (change) { - if (start < node.value.length) add({ - type: "text", - value: node.value.slice(start) - }); - parent.children.splice(index, 1, ...nodes); - } else nodes = [node]; - return index + nodes.length; - /** - * Add a node. - * - * @param {PhrasingContent} child - * Node to add. - * @returns {undefined} - * Nothing. - */ - function add(child) { - const previous = nodes[nodes.length - 1]; - if (previous && previous.type === "text" && child.type === "text") previous.value += child.value; - else nodes.push(child); - } - } - } - /** - * Turn a tuple or a list of tuples into pairs. - * - * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList - * Schema. - * @returns {Pairs} - * Clean pairs. - */ - function toPairs(tupleOrList) { - if (!Array.isArray(tupleOrList)) throw new TypeError("Expected find and replace tuple or list of tuples"); - /** @type {Pairs} */ - const result = []; - const list = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList]; - let index = -1; - while (++index < list.length) { - const tuple = list[index]; - result.push([toExpression(tuple[0]), toFunction(tuple[1])]); - } - return result; - } - /** - * Turn a find into an expression. - * - * @param {Find} find - * Pattern to find. - * @returns {RegExp} - * Global expression. - */ - function toExpression(find) { - return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find; - } - /** - * Turn a replace into a function. - * - * @param {Replace} replace - * Thing to replace with. - * @returns {ReplaceFunction} - * Function that returns that thing. - */ - function toFunction(replace) { - return typeof replace === "function" ? replace : function() { - return replace; - }; - } - // node_modules/mdast-util-gfm-autolink-literal/lib/index.js - /** - * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace' - * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown' - * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown' - * @import {Link, PhrasingContent} from 'mdast' - */ - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM autolink - * literals in markdown. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-to-markdown` to enable GFM autolink literals. - */ - function gfmAutolinkLiteralFromMarkdown() { - return { - transforms: [transformGfmAutolinkLiterals], - enter: { - literalAutolink: enterLiteralAutolink, - literalAutolinkEmail: enterLiteralAutolinkValue, - literalAutolinkHttp: enterLiteralAutolinkValue, - literalAutolinkWww: enterLiteralAutolinkValue - }, - exit: { - literalAutolink: exitLiteralAutolink, - literalAutolinkEmail: exitLiteralAutolinkEmail, - literalAutolinkHttp: exitLiteralAutolinkHttp, - literalAutolinkWww: exitLiteralAutolinkWww - } - }; - } - /** - * Handle the start of an autolink literal. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterLiteralAutolink(token) { - this.enter({ - type: "link", - title: null, - url: "", - children: [], - position: void 0 - }, token); - } - /** - * Handle the start of an autolink literal value. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterLiteralAutolinkValue(token) { - this.config.enter.autolinkProtocol.call(this, token); - } - /** - * Handle the end of an HTTP autolink literal value. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitLiteralAutolinkHttp(token) { - this.config.exit.autolinkProtocol.call(this, token); - } - /** - * Handle the end of a `www` autolink literal value. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitLiteralAutolinkWww(token) { - this.config.exit.data.call(this, token); - const node = this.stack[this.stack.length - 1]; - node.type; - node.url = "http://" + this.sliceSerialize(token); - } - /** - * Handle the end of an email autolink literal value. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitLiteralAutolinkEmail(token) { - this.config.exit.autolinkEmail.call(this, token); - } - /** - * Handle the end of an autolink literal. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitLiteralAutolink(token) { - this.exit(token); - } - /** - * Find autolink literals in text and turn them into links. - * - * @type {FromMarkdownTransform} - */ - function transformGfmAutolinkLiterals(tree) { - findAndReplace(tree, [ - [/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi, findUrl], - [/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g, findXmpp], - [/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g, findMailto], - [/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g, findEmail] - ], { ignore: ["link", "linkReference"] }); - } - /** - * Turn a URL match into a link. - * - * @type {ReplaceFunction} - * @param {string} _ - * Whole match. - * @param {string} protocol - * Protocol (`http://`, `https://`) or `www`. - * @param {string} domain - * Host name, up to the path. - * @param {string} path - * Path, query, and fragment. - * @param {RegExpMatchObject} match - * Match object. - * @returns {Array<PhrasingContent> | Link | false} - * Link, link and trailing text, or `false` if not a URL. - */ - function findUrl(_, protocol, domain, path, match) { - if (!previous$1(match)) return false; - let prefix = ""; - if (/^w/i.test(protocol)) { - domain = protocol + domain; - protocol = ""; - prefix = "http://"; - } - if (unicodePunctuation(domain.charCodeAt(0)) || !isCorrectDomain(domain)) return false; - const parts = splitUrl(domain + path); - /** @type {Link} */ - const result = { - type: "link", - title: null, - url: prefix + protocol + parts[0], - children: [{ - type: "text", - value: protocol + parts[0], - position: void 0 - }], - position: void 0 - }; - if (parts[1]) return [result, { - type: "text", - value: parts[1], - position: void 0 - }]; - return result; - } - /** - * Turn an email match into a link. - * - * @type {ReplaceFunction} - * @param {string} _ - * Whole match. - * @param {string} atext - * Local part. - * @param {string} label - * Domain. - * @returns {Link | false} - * Link, or `false` if not an email. - */ - function findEmail(_, atext, label) { - if (/[\d\-_]$/.test(label)) return false; - return { - type: "link", - title: null, - url: "mailto:" + atext + "@" + label, - children: [{ - type: "text", - value: atext + "@" + label, - position: void 0 - }], - position: void 0 - }; - } - /** - * Turn a `mailto:` email match into a link. - * - * @type {ReplaceFunction} - * @param {string} _ - * Whole match. - * @param {string} atext - * Local part. - * @param {string} label - * Domain. - * @returns {Link | false} - * Link, or `false` if not an email. - */ - function findMailto(_, atext, label) { - if (/[\d\-_]$/.test(label)) return false; - const value = "mailto:" + atext + "@" + label; - return { - type: "link", - title: null, - url: value, - children: [{ - type: "text", - value, - position: void 0 - }], - position: void 0 - }; - } - /** - * Turn an `xmpp:` address match into a link. - * - * @type {ReplaceFunction} - * @param {string} matchValue - * Whole match. - * @param {string} atext - * Local part. - * @param {string} label - * Domain. - * @param {string | undefined} resource - * Resource (`/` and more), if any. - * @param {RegExpMatchObject} match - * Match object. - * @returns {Link | false} - * Link, or `false` if not an address. - */ - function findXmpp(matchValue, atext, label, resource, match) { - if (/[\d\-_]$/.test(label) || resource && (!/[A-Za-z]$/.test(resource) || match.input.charAt(match.index + matchValue.length) === "@")) return false; - const value = "xmpp:" + atext + "@" + label + (resource || ""); - return { - type: "link", - title: null, - url: value, - children: [{ - type: "text", - value, - position: void 0 - }], - position: void 0 - }; - } - /** - * Check if a domain is valid. - * - * @param {string} domain - * Host name to check. - * @returns {boolean} - * Whether the domain is valid. - */ - function isCorrectDomain(domain) { - const parts = domain.split("."); - if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[\dA-Za-z]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[\dA-Za-z]/.test(parts[parts.length - 2]))) return false; - return true; - } - /** - * Split trailing punctuation off a URL. - * - * @param {string} url - * Value to split. - * @returns {[string, string | undefined]} - * URL and trailing punctuation, if any. - */ - function splitUrl(url) { - let index = url.length; - while (index > 0) { - const code = url.charCodeAt(index - 1); - if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 62 || code === 63 || code === 93 || code === 125) index--; - else break; - } - if (index === url.length) return [url, void 0]; - let trail = url.slice(index); - url = url.slice(0, index); - let closingParenIndex = trail.indexOf(")"); - const openingParens = ccount(url, "("); - let closingParens = ccount(url, ")"); - while (closingParenIndex !== -1 && openingParens > closingParens) { - url += trail.slice(0, closingParenIndex + 1); - trail = trail.slice(closingParenIndex + 1); - closingParenIndex = trail.indexOf(")"); - closingParens++; - } - return [url, trail]; - } - /** - * Check if the character before a match is allowed. - * - * @param {RegExpMatchObject} match - * Match object. - * @returns {boolean} - * Whether the previous character is allowed. - */ - function previous$1(match) { - const code = match.input.charCodeAt(match.index - 1); - return match.index === 0 || unicodeWhitespace(code) || unicodePunctuation(code); - } - // node_modules/mdast-util-gfm-footnote/lib/index.js - /** - * @import { - * CompileContext, - * Extension as FromMarkdownExtension, - * Handle as FromMarkdownHandle - * } from 'mdast-util-from-markdown' - * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote' - * @import { - * Handle as ToMarkdownHandle, - * Map, - * Options as ToMarkdownExtension - * } from 'mdast-util-to-markdown' - * @import {FootnoteDefinition, FootnoteReference} from 'mdast' - */ - footnoteReference.peek = footnoteReferencePeek; - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterFootnoteCallString() { - this.buffer(); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterFootnoteCall(token) { - this.enter({ - type: "footnoteReference", - identifier: "", - label: "" - }, token); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterFootnoteDefinitionLabelString() { - this.buffer(); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterFootnoteDefinition(token) { - this.enter({ - type: "footnoteDefinition", - identifier: "", - label: "", - children: [] - }, token); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitFootnoteCallString(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.type; - node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); - node.label = label; - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitFootnoteCall(token) { - this.exit(token); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitFootnoteDefinitionLabelString(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.type; - node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); - node.label = label; - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitFootnoteDefinition(token) { - this.exit(token); - } - /** @type {ToMarkdownHandle} */ - function footnoteReferencePeek() { - return "["; - } - /** - * @type {ToMarkdownHandle} - * @param {FootnoteReference} node - */ - function footnoteReference(node, _, state, info) { - const tracker = state.createTracker(info); - let value = tracker.move("[^"); - const exit = state.enter("footnoteReference"); - const subexit = state.enter("reference"); - value += tracker.move(state.safe(state.associationId(node), { - after: "]", - before: value - })); - subexit(); - exit(); - value += tracker.move("]"); - return value; - } - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes - * in markdown. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-from-markdown`. - */ - function gfmFootnoteFromMarkdown() { - return { - enter: { - gfmFootnoteCallString: enterFootnoteCallString, - gfmFootnoteCall: enterFootnoteCall, - gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString, - gfmFootnoteDefinition: enterFootnoteDefinition - }, - exit: { - gfmFootnoteCallString: exitFootnoteCallString, - gfmFootnoteCall: exitFootnoteCall, - gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString, - gfmFootnoteDefinition: exitFootnoteDefinition - } - }; - } - // node_modules/mdast-util-gfm-strikethrough/lib/index.js - handleDelete.attention = attentionDelete; - handleDelete.peek = peekDelete; - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM - * strikethrough in markdown. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-from-markdown` to enable GFM strikethrough. - */ - function gfmStrikethroughFromMarkdown() { - return { - canContainEols: ["delete"], - enter: { strikethrough: enterStrikethrough }, - exit: { strikethrough: exitStrikethrough } - }; - } - /** - * Enter strikethrough. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterStrikethrough(token) { - this.enter({ - type: "delete", - children: [], - position: void 0 - }, token); - } - /** - * Exit strikethrough. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitStrikethrough(token) { - this.exit(token); - } - /** - * Serialize a delete node. - * - * @type {ToMarkdownHandle} - * @param {Delete} node - * Node to serialize. - */ - function handleDelete(node, _, state, info) { - const tracker = state.createTracker(info); - const sequence = state.stack.includes("strikethrough") ? "~" : "~~"; - const exit = state.enter("strikethrough"); - let value = tracker.move(sequence); - value += state.containerPhrasing(node, { - ...tracker.current(), - before: value, - after: "~" - }); - value += tracker.move(sequence); - exit(); - return value; - } - /** - * Serialize a delete node as attention. - * - * @type {Attention} - */ - function attentionDelete() { - return { - construct: "strikethrough", - markers: ["~"], - sizes: [2, 1] - }; - } - /** - * Peek the first character of a delete node. - * - * @type {ToMarkdownHandle} - */ - function peekDelete() { - return "~"; - } - // node_modules/mdast-util-gfm-table/lib/index.js - /** - * @import {Heading, InlineCode, Table, TableCell, TableRow} from 'mdast' - * @import {Options as MarkdownTableOptions} from 'markdown-table' - * @import { - * CompileContext, - * Extension as FromMarkdownExtension, - * Handle as FromMarkdownHandle, - * } from 'mdast-util-from-markdown' - * @import { - * Options as ToMarkdownExtension, - * Handle as ToMarkdownHandle, - * Info, - * Join, - * State - * } from 'mdast-util-to-markdown' - */ - /** - * @typedef Options - * Configuration. - * @property {boolean | null | undefined} [tableCellPadding=true] - * Whether to add a space of padding between delimiters and cells (default: - * `true`). - * @property {boolean | null | undefined} [tablePipeAlign=true] - * Whether to align the delimiters (default: `true`). - * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength] - * Function to detect the length of table cell content, used when aligning - * the delimiters between cells (optional). - */ - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM tables in - * markdown. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-from-markdown` to enable GFM tables. - */ - function gfmTableFromMarkdown() { - return { - enter: { - table: enterTable, - tableData: enterCell, - tableHeader: enterCell, - tableRow: enterRow - }, - exit: { - codeText: exitCodeText, - table: exitTable, - tableData: exit, - tableHeader: exit, - tableRow: exit - } - }; - } - /** - * Enter a table. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterTable(token) { - const align = token._align; - this.enter({ - type: "table", - align: align.map(function(d) { - return d === "none" ? null : d; - }), - children: [], - position: void 0 - }, token); - this.data.inTable = true; - } - /** - * Exit a table. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitTable(token) { - this.exit(token); - this.data.inTable = void 0; - } - /** - * Enter a row. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterRow(token) { - this.enter({ - type: "tableRow", - children: [], - position: void 0 - }, token); - } - /** - * Exit a row or cell. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exit(token) { - this.exit(token); - } - /** - * Enter a cell. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterCell(token) { - this.enter({ - type: "tableCell", - children: [], - position: void 0 - }, token); - } - /** - * Exit code (text). - * - * Overwrites the default code text data handler to unescape escaped pipes - * when they are in tables. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitCodeText(token) { - let value = this.resume(); - if (this.data.inTable) value = value.replace(/\\([\\|])/g, replace); - const node = this.stack[this.stack.length - 1]; - node.type; - node.value = value; - this.exit(token); - } - /** - * Unescape an escaped pipe. - * - * @param {string} $0 - * Whole match. - * @param {string} $1 - * Escaped character. - * @returns {string} - * Replacement. - */ - function replace($0, $1) { - return $1 === "|" ? $1 : $0; - } - // node_modules/mdast-util-gfm-task-list-item/lib/index.js - /** - * @import {ListItem, Paragraph, Parents} from 'mdast' - * @import { - * CompileContext, - * Extension as FromMarkdownExtension, - * Handle as FromMarkdownHandle - * } from 'mdast-util-from-markdown' - * @import { - * Handle as ToMarkdownHandle, - * Join as ToMarkdownJoin, - * Options as ToMarkdownExtension - * } from 'mdast-util-to-markdown' - */ - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM task - * list items in markdown. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-from-markdown` to enable GFM task list items. - */ - function gfmTaskListItemFromMarkdown() { - return { exit: { - taskListCheckValueChecked: exitCheck, - taskListCheckValueUnchecked: exitCheck, - paragraph: exitParagraphWithTaskListItem - } }; - } - /** - * Exit a check. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitCheck(token) { - const node = this.stack[this.stack.length - 2]; - node.type; - node.checked = token.type === "taskListCheckValueChecked"; - } - /** - * Exit a paragraph, removing the whitespace after a check. - * - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitParagraphWithTaskListItem(token) { - const parent = this.stack[this.stack.length - 2]; - if (parent && parent.type === "listItem" && typeof parent.checked === "boolean") { - const node = this.stack[this.stack.length - 1]; - node.type; - const head = node.children[0]; - if (head && head.type === "text") { - const siblings = parent.children; - let index = -1; - /** @type {Paragraph | undefined} */ - let firstParagraph; - while (++index < siblings.length) { - const sibling = siblings[index]; - if (sibling.type === "paragraph") { - firstParagraph = sibling; - break; - } - } - if (firstParagraph === node) { - head.value = head.value.slice(1); - if (head.value.length === 0) node.children.shift(); - else if (node.position && head.position && typeof head.position.start.offset === "number") { - head.position.start.column++; - head.position.start.offset++; - node.position.start = { ...head.position.start }; - } - } - } - } - this.exit(token); - } - // node_modules/mdast-util-gfm/lib/index.js - /** - * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown' - * @import {Options} from 'mdast-util-gfm' - * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown' - */ - /** - * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink - * literals, footnotes, strikethrough, tables, tasklists). - * - * @returns {Array<FromMarkdownExtension>} - * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals, - * footnotes, strikethrough, tables, tasklists). - */ - function gfmFromMarkdown() { - return [ - gfmAutolinkLiteralFromMarkdown(), - gfmFootnoteFromMarkdown(), - gfmStrikethroughFromMarkdown(), - gfmTableFromMarkdown(), - gfmTaskListItemFromMarkdown() - ]; - } - // node_modules/mdast-util-math/lib/index.js - /** - * @typedef {import('hast').Element} HastElement - * @typedef {import('hast').ElementContent} HastElementContent - * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext - * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension - * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle - * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle - * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension - * @typedef {import('../index.js').InlineMath} InlineMath - * @typedef {import('../index.js').Math} Math - * - * @typedef ToOptions - * Configuration. - * @property {boolean | null | undefined} [singleDollarTextMath=true] - * Whether to support math (text) with a single dollar (default: `true`). - * - * Single dollars work in Pandoc and many other places, but often interfere - * with “normal” dollars in text. - * If you turn this off, you can still use two or more dollars for text math. - */ - /** - * Create an extension for `mdast-util-from-markdown`. - * - * @returns {FromMarkdownExtension} - * Extension for `mdast-util-from-markdown`. - */ - function mathFromMarkdown() { - return { - enter: { - mathFlow: enterMathFlow, - mathFlowFenceMeta: enterMathFlowMeta, - mathText: enterMathText - }, - exit: { - mathFlow: exitMathFlow, - mathFlowFence: exitMathFlowFence, - mathFlowFenceMeta: exitMathFlowMeta, - mathFlowValue: exitMathData, - mathText: exitMathText, - mathTextData: exitMathData - } - }; - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterMathFlow(token) { - this.enter({ - type: "math", - meta: null, - value: "", - data: { - hName: "pre", - hChildren: [{ - type: "element", - tagName: "code", - properties: { className: ["language-math", "math-display"] }, - children: [] - }] - } - }, token); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterMathFlowMeta() { - this.buffer(); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitMathFlowMeta() { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.type; - node.meta = data; - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitMathFlowFence() { - if (this.data.mathFlowInside) return; - this.buffer(); - this.data.mathFlowInside = true; - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitMathFlow(token) { - const data = this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); - const node = this.stack[this.stack.length - 1]; - node.type; - this.exit(token); - node.value = data; - const code = node.data.hChildren[0]; - code.type; - code.tagName; - code.children.push({ - type: "text", - value: data - }); - this.data.mathFlowInside = void 0; - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function enterMathText(token) { - this.enter({ - type: "inlineMath", - value: "", - data: { - hName: "code", - hProperties: { className: ["language-math", "math-inline"] }, - hChildren: [] - } - }, token); - this.buffer(); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitMathText(token) { - const data = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.type; - this.exit(token); - node.value = data; - node.data.hChildren.push({ - type: "text", - value: data - }); - } - /** - * @this {CompileContext} - * @type {FromMarkdownHandle} - */ - function exitMathData(token) { - this.config.enter.data.call(this, token); - this.config.exit.data.call(this, token); - } - } - // node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js - /** - * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - const wwwPrefix = { - tokenize: tokenizeWwwPrefix, - partial: true - }; - const domain = { - tokenize: tokenizeDomain, - partial: true - }; - const path$1 = { - tokenize: tokenizePath, - partial: true - }; - const trail = { - tokenize: tokenizeTrail, - partial: true - }; - const emailDomainDotTrail = { - tokenize: tokenizeEmailDomainDotTrail, - partial: true - }; - const wwwAutolink = { - name: "wwwAutolink", - tokenize: tokenizeWwwAutolink, - previous: previousWww - }; - const protocolAutolink = { - name: "protocolAutolink", - tokenize: tokenizeProtocolAutolink, - previous: previousProtocol - }; - const emailAutolink = { - name: "emailAutolink", - tokenize: tokenizeEmailAutolink, - previous: previousEmail - }; - /** @type {ConstructRecord} */ - const text$3 = {}; - /** - * Create an extension for `micromark` to support GitHub autolink literal - * syntax. - * - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions` to enable GFM - * autolink literal syntax. - */ - function gfmAutolinkLiteral() { - return { text: text$3 }; - } - /** @type {Code} */ - let code = 48; - while (code < 123) { - text$3[code] = emailAutolink; - code++; - if (code === 58) code = 65; - else if (code === 91) code = 97; - } - text$3[43] = emailAutolink; - text$3[45] = emailAutolink; - text$3[46] = emailAutolink; - text$3[95] = emailAutolink; - text$3[72] = [emailAutolink, protocolAutolink]; - text$3[104] = [emailAutolink, protocolAutolink]; - text$3[87] = [emailAutolink, wwwAutolink]; - text$3[119] = [emailAutolink, wwwAutolink]; - /** - * Email autolink literal. - * - * ```markdown - * > | a contact@example.org b - * ^^^^^^^^^^^^^^^^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeEmailAutolink(effects, ok, nok) { - const self = this; - /** @type {boolean | undefined} */ - let dot; - /** @type {boolean} */ - let data; - return start; - /** - * Start of email autolink literal. - * - * ```markdown - * > | a contact@example.org b - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) return nok(code); - effects.enter("literalAutolink"); - effects.enter("literalAutolinkEmail"); - return atext(code); - } - /** - * In email atext. - * - * ```markdown - * > | a contact@example.org b - * ^ - * ``` - * - * @type {State} - */ - function atext(code) { - if (gfmAtext(code)) { - effects.consume(code); - return atext; - } - if (code === 64) { - effects.consume(code); - return emailDomain; - } - return nok(code); - } - /** - * In email domain. - * - * The reference code is a bit overly complex as it handles the `@`, of which - * there may be just one. - * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318> - * - * ```markdown - * > | a contact@example.org b - * ^ - * ``` - * - * @type {State} - */ - function emailDomain(code) { - if (code === 46) return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code); - if (code === 45 || code === 95 || asciiAlphanumeric(code)) { - data = true; - effects.consume(code); - return emailDomain; - } - return emailDomainAfter(code); - } - /** - * In email domain, on dot that is not a trail. - * - * ```markdown - * > | a contact@example.org b - * ^ - * ``` - * - * @type {State} - */ - function emailDomainDot(code) { - effects.consume(code); - dot = true; - return emailDomain; - } - /** - * After email domain. - * - * ```markdown - * > | a contact@example.org b - * ^ - * ``` - * - * @type {State} - */ - function emailDomainAfter(code) { - if (data && dot && asciiAlpha(self.previous)) { - effects.exit("literalAutolinkEmail"); - effects.exit("literalAutolink"); - return ok(code); - } - return nok(code); - } - } - /** - * `www` autolink literal. - * - * ```markdown - * > | a www.example.org b - * ^^^^^^^^^^^^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeWwwAutolink(effects, ok, nok) { - const self = this; - return wwwStart; - /** - * Start of www autolink literal. - * - * ```markdown - * > | www.example.com/a?b#c - * ^ - * ``` - * - * @type {State} - */ - function wwwStart(code) { - if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) return nok(code); - effects.enter("literalAutolink"); - effects.enter("literalAutolinkWww"); - return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path$1, wwwAfter), nok), nok)(code); - } - /** - * After a www autolink literal. - * - * ```markdown - * > | www.example.com/a?b#c - * ^ - * ``` - * - * @type {State} - */ - function wwwAfter(code) { - effects.exit("literalAutolinkWww"); - effects.exit("literalAutolink"); - return ok(code); - } - } - /** - * Protocol autolink literal. - * - * ```markdown - * > | a https://example.org b - * ^^^^^^^^^^^^^^^^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeProtocolAutolink(effects, ok, nok) { - const self = this; - let buffer = ""; - let seen = false; - return protocolStart; - /** - * Start of protocol autolink literal. - * - * ```markdown - * > | https://example.com/a?b#c - * ^ - * ``` - * - * @type {State} - */ - function protocolStart(code) { - if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) { - effects.enter("literalAutolink"); - effects.enter("literalAutolinkHttp"); - buffer += String.fromCodePoint(code); - effects.consume(code); - return protocolPrefixInside; - } - return nok(code); - } - /** - * In protocol. - * - * ```markdown - * > | https://example.com/a?b#c - * ^^^^^ - * ``` - * - * @type {State} - */ - function protocolPrefixInside(code) { - if (asciiAlpha(code) && buffer.length < 5) { - buffer += String.fromCodePoint(code); - effects.consume(code); - return protocolPrefixInside; - } - if (code === 58) { - const protocol = buffer.toLowerCase(); - if (protocol === "http" || protocol === "https") { - effects.consume(code); - return protocolSlashesInside; - } - } - return nok(code); - } - /** - * In slashes. - * - * ```markdown - * > | https://example.com/a?b#c - * ^^ - * ``` - * - * @type {State} - */ - function protocolSlashesInside(code) { - if (code === 47) { - effects.consume(code); - if (seen) return afterProtocol; - seen = true; - return protocolSlashesInside; - } - return nok(code); - } - /** - * After protocol, before domain. - * - * ```markdown - * > | https://example.com/a?b#c - * ^ - * ``` - * - * @type {State} - */ - function afterProtocol(code) { - return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path$1, protocolAfter), nok)(code); - } - /** - * After a protocol autolink literal. - * - * ```markdown - * > | https://example.com/a?b#c - * ^ - * ``` - * - * @type {State} - */ - function protocolAfter(code) { - effects.exit("literalAutolinkHttp"); - effects.exit("literalAutolink"); - return ok(code); - } - } - /** - * `www` prefix. - * - * ```markdown - * > | a www.example.org b - * ^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeWwwPrefix(effects, ok, nok) { - let size = 0; - return wwwPrefixInside; - /** - * In www prefix. - * - * ```markdown - * > | www.example.com - * ^^^^ - * ``` - * - * @type {State} - */ - function wwwPrefixInside(code) { - if ((code === 87 || code === 119) && size < 3) { - size++; - effects.consume(code); - return wwwPrefixInside; - } - if (code === 46 && size === 3) { - effects.consume(code); - return wwwPrefixAfter; - } - return nok(code); - } - /** - * After www prefix. - * - * ```markdown - * > | www.example.com - * ^ - * ``` - * - * @type {State} - */ - function wwwPrefixAfter(code) { - return code === null ? nok(code) : ok(code); - } - } - /** - * Domain. - * - * ```markdown - * > | a https://example.org b - * ^^^^^^^^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeDomain(effects, ok, nok) { - /** @type {boolean | undefined} */ - let underscoreInLastSegment; - /** @type {boolean | undefined} */ - let underscoreInLastLastSegment; - /** @type {boolean | undefined} */ - let seen; - return domainInside; - /** - * In domain. - * - * ```markdown - * > | https://example.com/a - * ^^^^^^^^^^^ - * ``` - * - * @type {State} - */ - function domainInside(code) { - if (code === 46 || code === 95) return effects.check(trail, domainAfter, domainAtPunctuation)(code); - if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) return domainAfter(code); - seen = true; - effects.consume(code); - return domainInside; - } - /** - * In domain, at potential trailing punctuation, that was not trailing. - * - * ```markdown - * > | https://example.com - * ^ - * ``` - * - * @type {State} - */ - function domainAtPunctuation(code) { - if (code === 95) underscoreInLastSegment = true; - else { - underscoreInLastLastSegment = underscoreInLastSegment; - underscoreInLastSegment = void 0; - } - effects.consume(code); - return domainInside; - } - /** - * After domain. - * - * ```markdown - * > | https://example.com/a - * ^ - * ``` - * - * @type {State} */ - function domainAfter(code) { - if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) return nok(code); - return ok(code); - } - } - /** - * Path. - * - * ```markdown - * > | a https://example.org/stuff b - * ^^^^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizePath(effects, ok) { - let sizeOpen = 0; - let sizeClose = 0; - return pathInside; - /** - * In path. - * - * ```markdown - * > | https://example.com/a - * ^^ - * ``` - * - * @type {State} - */ - function pathInside(code) { - if (code === 40) { - sizeOpen++; - effects.consume(code); - return pathInside; - } - if (code === 41 && sizeClose < sizeOpen) return pathAtPunctuation(code); - if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) return effects.check(trail, ok, pathAtPunctuation)(code); - if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code); - effects.consume(code); - return pathInside; - } - /** - * In path, at potential trailing punctuation, that was not trailing. - * - * ```markdown - * > | https://example.com/a"b - * ^ - * ``` - * - * @type {State} - */ - function pathAtPunctuation(code) { - if (code === 41) sizeClose++; - effects.consume(code); - return pathInside; - } - } - /** - * Trail. - * - * This calls `ok` if this *is* the trail, followed by an end, which means - * the entire trail is not part of the link. - * It calls `nok` if this *is* part of the link. - * - * ```markdown - * > | https://example.com"). - * ^^^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeTrail(effects, ok, nok) { - return trail; - /** - * In trail of domain or path. - * - * ```markdown - * > | https://example.com"). - * ^ - * ``` - * - * @type {State} - */ - function trail(code) { - if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) { - effects.consume(code); - return trail; - } - if (code === 38) { - effects.consume(code); - return trailCharacterReferenceStart; - } - if (code === 93) { - effects.consume(code); - return trailBracketAfter; - } - if (code === 60 || code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code); - return nok(code); - } - /** - * In trail, after `]`. - * - * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug. - * > See end of <https://github.com/github/cmark-gfm/issues/278> for more. - * - * ```markdown - * > | https://example.com]( - * ^ - * ``` - * - * @type {State} - */ - function trailBracketAfter(code) { - if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code); - return trail(code); - } - /** - * In character-reference like trail, after `&`. - * - * ```markdown - * > | https://example.com&). - * ^ - * ``` - * - * @type {State} - */ - function trailCharacterReferenceStart(code) { - return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code); - } - /** - * In character-reference like trail. - * - * ```markdown - * > | https://example.com&). - * ^ - * ``` - * - * @type {State} - */ - function trailCharacterReferenceInside(code) { - if (code === 59) { - effects.consume(code); - return trail; - } - if (asciiAlpha(code)) { - effects.consume(code); - return trailCharacterReferenceInside; - } - return nok(code); - } - } - /** - * Dot in email domain trail. - * - * This calls `ok` if this *is* the trail, followed by an end, which means - * the trail is not part of the link. - * It calls `nok` if this *is* part of the link. - * - * ```markdown - * > | contact@example.org. - * ^ - * ``` - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeEmailDomainDotTrail(effects, ok, nok) { - return start; - /** - * Dot. - * - * ```markdown - * > | contact@example.org. - * ^ ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.consume(code); - return after; - } - /** - * After dot. - * - * ```markdown - * > | contact@example.org. - * ^ ^ - * ``` - * - * @type {State} - */ - function after(code) { - return asciiAlphanumeric(code) ? nok(code) : ok(code); - } - } - /** - * See: - * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>. - * - * @type {Previous} - */ - function previousWww(code) { - return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code); - } - /** - * See: - * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>. - * - * @type {Previous} - */ - function previousProtocol(code) { - return !asciiAlpha(code); - } - /** - * @this {TokenizeContext} - * @type {Previous} - */ - function previousEmail(code) { - return !(code === 47 || gfmAtext(code)); - } - /** - * @param {Code} code - * @returns {boolean} - */ - function gfmAtext(code) { - return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code); - } - /** - * @param {Array<Event>} events - * @returns {boolean} - */ - function previousUnbalanced(events) { - let index = events.length; - let result = false; - while (index--) { - const token = events[index][1]; - if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) { - result = true; - break; - } - if (token._gfmAutolinkLiteralWalkedInto) { - result = false; - break; - } - } - if (events.length > 0 && !result) events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true; - return result; - } - // node_modules/micromark-extension-gfm-footnote/lib/syntax.js - /** - * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - const indent = { - tokenize: tokenizeIndent, - partial: true - }; - /** - * Create an extension for `micromark` to enable GFM footnote syntax. - * - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions` to - * enable GFM footnote syntax. - */ - function gfmFootnote() { - /** @type {Extension} */ - return { - document: { [91]: { - name: "gfmFootnoteDefinition", - tokenize: tokenizeDefinitionStart, - continuation: { tokenize: tokenizeDefinitionContinuation }, - exit: gfmFootnoteDefinitionEnd - } }, - text: { - [91]: { - name: "gfmFootnoteCall", - tokenize: tokenizeGfmFootnoteCall - }, - [93]: { - name: "gfmPotentialFootnoteCall", - add: "after", - tokenize: tokenizePotentialGfmFootnoteCall, - resolveTo: resolveToPotentialGfmFootnoteCall - } - } - }; - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizePotentialGfmFootnoteCall(effects, ok, nok) { - const self = this; - let index = self.events.length; - const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); - /** @type {Token} */ - let labelStart; - while (index--) { - const token = self.events[index][1]; - if (token.type === "labelImage") { - labelStart = token; - break; - } - if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") break; - } - return start; - /** - * @type {State} - */ - function start(code) { - if (!labelStart || !labelStart._balanced) return nok(code); - const id = normalizeIdentifier(self.sliceSerialize({ - start: labelStart.end, - end: self.now() - })); - if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) return nok(code); - effects.enter("gfmFootnoteCallLabelMarker"); - effects.consume(code); - effects.exit("gfmFootnoteCallLabelMarker"); - return ok(code); - } - } - /** @type {Resolver} */ - function resolveToPotentialGfmFootnoteCall(events, context) { - let index = events.length; - while (index--) if (events[index][1].type === "labelImage" && events[index][0] === "enter") { - events[index][1]; - break; - } - events[index + 1][1].type = "data"; - events[index + 3][1].type = "gfmFootnoteCallLabelMarker"; - /** @type {Token} */ - const call = { - type: "gfmFootnoteCall", - start: Object.assign({}, events[index + 3][1].start), - end: Object.assign({}, events[events.length - 1][1].end) - }; - /** @type {Token} */ - const marker = { - type: "gfmFootnoteCallMarker", - start: Object.assign({}, events[index + 3][1].end), - end: Object.assign({}, events[index + 3][1].end) - }; - marker.end.column++; - marker.end.offset++; - marker.end._bufferIndex++; - /** @type {Token} */ - const string = { - type: "gfmFootnoteCallString", - start: Object.assign({}, marker.end), - end: Object.assign({}, events[events.length - 1][1].start) - }; - /** @type {Token} */ - const chunk = { - type: "chunkString", - contentType: "string", - start: Object.assign({}, string.start), - end: Object.assign({}, string.end) - }; - /** @type {Array<Event>} */ - const replacement = [ - events[index + 1], - events[index + 2], - [ - "enter", - call, - context - ], - events[index + 3], - events[index + 4], - [ - "enter", - marker, - context - ], - [ - "exit", - marker, - context - ], - [ - "enter", - string, - context - ], - [ - "enter", - chunk, - context - ], - [ - "exit", - chunk, - context - ], - [ - "exit", - string, - context - ], - events[events.length - 2], - events[events.length - 1], - [ - "exit", - call, - context - ] - ]; - events.splice(index, events.length - index + 1, ...replacement); - return events; - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeGfmFootnoteCall(effects, ok, nok) { - const self = this; - const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); - let size = 0; - /** @type {boolean} */ - let data; - return start; - /** - * Start of footnote label. - * - * ```markdown - * > | a [^b] c - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("gfmFootnoteCall"); - effects.enter("gfmFootnoteCallLabelMarker"); - effects.consume(code); - effects.exit("gfmFootnoteCallLabelMarker"); - return callStart; - } - /** - * After `[`, at `^`. - * - * ```markdown - * > | a [^b] c - * ^ - * ``` - * - * @type {State} - */ - function callStart(code) { - if (code !== 94) return nok(code); - effects.enter("gfmFootnoteCallMarker"); - effects.consume(code); - effects.exit("gfmFootnoteCallMarker"); - effects.enter("gfmFootnoteCallString"); - effects.enter("chunkString").contentType = "string"; - return callData; - } - /** - * In label. - * - * ```markdown - * > | a [^b] c - * ^ - * ``` - * - * @type {State} - */ - function callData(code) { - if (size > 999 || code === 93 && !data || code === null || code === 91 || markdownLineEndingOrSpace(code)) return nok(code); - if (code === 93) { - effects.exit("chunkString"); - const token = effects.exit("gfmFootnoteCallString"); - if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) return nok(code); - effects.enter("gfmFootnoteCallLabelMarker"); - effects.consume(code); - effects.exit("gfmFootnoteCallLabelMarker"); - effects.exit("gfmFootnoteCall"); - return ok; - } - if (!markdownLineEndingOrSpace(code)) data = true; - size++; - effects.consume(code); - return code === 92 ? callEscape : callData; - } - /** - * On character after escape. - * - * ```markdown - * > | a [^b\c] d - * ^ - * ``` - * - * @type {State} - */ - function callEscape(code) { - if (code === 91 || code === 92 || code === 93) { - effects.consume(code); - size++; - return callData; - } - return callData(code); - } - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeDefinitionStart(effects, ok, nok) { - const self = this; - const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); - /** @type {string} */ - let identifier; - let size = 0; - /** @type {boolean | undefined} */ - let data; - return start; - /** - * Start of GFM footnote definition. - * - * ```markdown - * > | [^a]: b - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("gfmFootnoteDefinition")._container = true; - effects.enter("gfmFootnoteDefinitionLabel"); - effects.enter("gfmFootnoteDefinitionLabelMarker"); - effects.consume(code); - effects.exit("gfmFootnoteDefinitionLabelMarker"); - return labelAtMarker; - } - /** - * In label, at caret. - * - * ```markdown - * > | [^a]: b - * ^ - * ``` - * - * @type {State} - */ - function labelAtMarker(code) { - if (code === 94) { - effects.enter("gfmFootnoteDefinitionMarker"); - effects.consume(code); - effects.exit("gfmFootnoteDefinitionMarker"); - effects.enter("gfmFootnoteDefinitionLabelString"); - effects.enter("chunkString").contentType = "string"; - return labelInside; - } - return nok(code); - } - /** - * In label. - * - * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote - * > definition labels. - * - * ```markdown - * > | [^a]: b - * ^ - * ``` - * - * @type {State} - */ - function labelInside(code) { - if (size > 999 || code === 93 && !data || code === null || code === 91 || markdownLineEndingOrSpace(code)) return nok(code); - if (code === 93) { - effects.exit("chunkString"); - const token = effects.exit("gfmFootnoteDefinitionLabelString"); - identifier = normalizeIdentifier(self.sliceSerialize(token)); - effects.enter("gfmFootnoteDefinitionLabelMarker"); - effects.consume(code); - effects.exit("gfmFootnoteDefinitionLabelMarker"); - effects.exit("gfmFootnoteDefinitionLabel"); - return labelAfter; - } - if (!markdownLineEndingOrSpace(code)) data = true; - size++; - effects.consume(code); - return code === 92 ? labelEscape : labelInside; - } - /** - * After `\`, at a special character. - * - * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets: - * > <https://github.com/github/cmark-gfm/issues/240> - * - * ```markdown - * > | [^a\*b]: c - * ^ - * ``` - * - * @type {State} - */ - function labelEscape(code) { - if (code === 91 || code === 92 || code === 93) { - effects.consume(code); - size++; - return labelInside; - } - return labelInside(code); - } - /** - * After definition label. - * - * ```markdown - * > | [^a]: b - * ^ - * ``` - * - * @type {State} - */ - function labelAfter(code) { - if (code === 58) { - effects.enter("definitionMarker"); - effects.consume(code); - effects.exit("definitionMarker"); - if (!defined.includes(identifier)) defined.push(identifier); - return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace"); - } - return nok(code); - } - /** - * After definition prefix. - * - * ```markdown - * > | [^a]: b - * ^ - * ``` - * - * @type {State} - */ - function whitespaceAfter(code) { - return ok(code); - } - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeDefinitionContinuation(effects, ok, nok) { - return effects.check(blankLine, ok, effects.attempt(indent, ok, nok)); - } - /** @type {Exiter} */ - function gfmFootnoteDefinitionEnd(effects) { - effects.exit("gfmFootnoteDefinition"); - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeIndent(effects, ok, nok) { - const self = this; - return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 5); - /** - * @type {State} - */ - function afterPrefix(code) { - const tail = self.events[self.events.length - 1]; - return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code); - } - } - // node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js - /** - * @import {Options} from 'micromark-extension-gfm-strikethrough' - * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - /** - * Create an extension for `micromark` to enable GFM strikethrough syntax. - * - * @param {Options | null | undefined} [options={}] - * Configuration. - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions`, to - * enable GFM strikethrough syntax. - */ - function gfmStrikethrough(options) { - let single = (options || {}).singleTilde; - const tokenizer = { - name: "strikethrough", - tokenize: tokenizeStrikethrough, - resolveAll: resolveAllStrikethrough - }; - if (single === null || single === void 0) single = true; - return { - text: { [126]: tokenizer }, - insideSpan: { null: [tokenizer] }, - attentionMarkers: { null: [126] } - }; - /** - * Take events and resolve strikethrough. - * - * @type {Resolver} - */ - function resolveAllStrikethrough(events, context) { - let index = -1; - while (++index < events.length) if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) { - let open = index; - while (open--) if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) { - events[index][1].type = "strikethroughSequence"; - events[open][1].type = "strikethroughSequence"; - /** @type {Token} */ - const strikethrough = { - type: "strikethrough", - start: Object.assign({}, events[open][1].start), - end: Object.assign({}, events[index][1].end) - }; - /** @type {Token} */ - const text = { - type: "strikethroughText", - start: Object.assign({}, events[open][1].end), - end: Object.assign({}, events[index][1].start) - }; - /** @type {Array<Event>} */ - const nextEvents = [ - [ - "enter", - strikethrough, - context - ], - [ - "enter", - events[open][1], - context - ], - [ - "exit", - events[open][1], - context - ], - [ - "enter", - text, - context - ] - ]; - const insideSpan = context.parser.constructs.insideSpan.null; - if (insideSpan) splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context)); - splice(nextEvents, nextEvents.length, 0, [ - [ - "exit", - text, - context - ], - [ - "enter", - events[index][1], - context - ], - [ - "exit", - events[index][1], - context - ], - [ - "exit", - strikethrough, - context - ] - ]); - splice(events, open - 1, index - open + 3, nextEvents); - index = open + nextEvents.length - 2; - break; - } - } - index = -1; - while (++index < events.length) if (events[index][1].type === "strikethroughSequenceTemporary") events[index][1].type = "data"; - return events; - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeStrikethrough(effects, ok, nok) { - const previous = this.previous; - const events = this.events; - let size = 0; - return start; - /** @type {State} */ - function start(code) { - if (previous === 126 && events[events.length - 1][1].type !== "characterEscape") return nok(code); - effects.enter("strikethroughSequenceTemporary"); - return more(code); - } - /** @type {State} */ - function more(code) { - const before = classifyCharacter(previous); - if (code === 126) { - if (size > 1) return nok(code); - effects.consume(code); - size++; - return more; - } - if (size < 2 && !single) return nok(code); - const token = effects.exit("strikethroughSequenceTemporary"); - const after = classifyCharacter(code); - token._open = !after || after === 2 && Boolean(before); - token._close = !before || before === 2 && Boolean(after); - return ok(code); - } - } - } - // node_modules/micromark-extension-gfm-table/lib/edit-map.js - /** - * @import {Event} from 'micromark-util-types' - */ - /** - * @typedef {[number, number, Array<Event>]} Change - * @typedef {[number, number, number]} Jump - */ - /** - * Tracks a bunch of edits. - */ - var EditMap = class { - /** - * Create a new edit map. - */ - constructor() { - /** - * Record of changes. - * - * @type {Array<Change>} - */ - this.map = []; - /** - * Changes by index, so `add` does not scan `map` (quadratic on - * table-heavy documents). - * - * @type {Map<number, Change>} - */ - this.index = /* @__PURE__ */ new Map(); - } - /** - * Create an edit: a remove and/or add at a certain place. - * - * @param {number} index - * Index at which to apply the edit. - * @param {number} remove - * Count of items to remove at the index. - * @param {Array<Event>} add - * Items to add at the index. - * @returns {undefined} - * Nothing. - */ - add(index, remove, add) { - addImplementation(this, index, remove, add); - } - /** - * Done, change the events. - * - * @param {Array<Event>} events - * List of events to apply the edits to. - * @returns {undefined} - * Nothing. - */ - consume(events) { - this.map.sort(function(a, b) { - return a[0] - b[0]; - }); - /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */ - if (this.map.length === 0) return; - let index = this.map.length; - /** @type {Array<Array<Event>>} */ - const vecs = []; - while (index > 0) { - index -= 1; - vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]); - events.length = this.map[index][0]; - } - vecs.push(events.slice()); - events.length = 0; - let slice = vecs.pop(); - while (slice) { - for (const element of slice) events.push(element); - slice = vecs.pop(); - } - this.map.length = 0; - this.index.clear(); - } - }; - /** - * Create an edit. - * - * @param {EditMap} editMap - * Edit map to apply to. - * @param {number} at - * Index at which to apply the edit. - * @param {number} remove - * Count of items to remove at the index. - * @param {Array<Event>} add - * Items to add at the index. - * @returns {undefined} - * Nothing. - */ - function addImplementation(editMap, at, remove, add) { - /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */ - if (remove === 0 && add.length === 0) return; - const existing = editMap.index.get(at); - if (existing) { - existing[1] += remove; - existing[2].push(...add); - return; - } - /** @type {Change} */ - const change = [ - at, - remove, - add - ]; - editMap.map.push(change); - editMap.index.set(at, change); - } - // node_modules/micromark-extension-gfm-table/lib/infer.js - /** - * @import {Event} from 'micromark-util-types' - */ - /** - * @typedef {'center' | 'left' | 'none' | 'right'} Align - */ - /** - * Figure out the alignment of a GFM table. - * - * @param {Readonly<Array<Event>>} events - * List of events. - * @param {number} index - * Table enter event. - * @returns {Array<Align>} - * List of aligns. - */ - function gfmTableAlign(events, index) { - let inDelimiterRow = false; - /** @type {Array<Align>} */ - const align = []; - while (index < events.length) { - const event = events[index]; - if (inDelimiterRow) { - if (event[0] === "enter") { - if (event[1].type === "tableContent") align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none"); - } else if (event[1].type === "tableContent") { - if (events[index - 1][1].type === "tableDelimiterMarker") { - const alignIndex = align.length - 1; - align[alignIndex] = align[alignIndex] === "left" ? "center" : "right"; - } - } else if (event[1].type === "tableDelimiterRow") break; - } else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") inDelimiterRow = true; - index += 1; - } - return align; - } - // node_modules/micromark-extension-gfm-table/lib/syntax.js - /** - * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - /** - * @typedef {[number, number, number, number]} Range - * Cell info. - * - * @typedef {0 | 1 | 2 | 3} RowKind - * Where we are: `1` for head row, `2` for delimiter row, `3` for body row. - */ - /** - * Create an HTML extension for `micromark` to support GitHub tables syntax. - * - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions` to enable GFM - * table syntax. - */ - function gfmTable() { - return { flow: { null: { - name: "table", - tokenize: tokenizeTable, - resolveAll: resolveTable - } } }; - } - /** - * Tokenizer for GFM tables. - * - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeTable(effects, ok, nok) { - const self = this; - let size = 0; - let sizeB = 0; - /** @type {boolean | undefined} */ - let seen; - return start; - /** - * Start of a GFM table. - * - * If there is a valid table row or table head before, then we try to parse - * another row. - * Otherwise, we try to parse a head. - * - * ```markdown - * > | | a | - * ^ - * | | - | - * > | | b | - * ^ - * ``` - * @type {State} - */ - function start(code) { - let index = self.events.length - 1; - while (index > -1) { - const { type } = self.events[index][1]; - if (type === "lineEnding" || type === "linePrefix") index--; - else break; - } - const tail = index > -1 ? self.events[index][1].type : null; - const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore; - if (next === bodyRowStart && self.parser.lazy[self.now().line]) return nok(code); - return next(code); - } - /** - * Before table head row. - * - * ```markdown - * > | | a | - * ^ - * | | - | - * | | b | - * ``` - * - * @type {State} - */ - function headRowBefore(code) { - effects.enter("tableHead"); - effects.enter("tableRow"); - return headRowStart(code); - } - /** - * Before table head row, after whitespace. - * - * ```markdown - * > | | a | - * ^ - * | | - | - * | | b | - * ``` - * - * @type {State} - */ - function headRowStart(code) { - if (code === 124) return headRowBreak(code); - seen = true; - sizeB += 1; - return headRowBreak(code); - } - /** - * At break in table head row. - * - * ```markdown - * > | | a | - * ^ - * ^ - * ^ - * | | - | - * | | b | - * ``` - * - * @type {State} - */ - function headRowBreak(code) { - if (code === null) return nok(code); - if (markdownLineEnding(code)) { - if (sizeB > 1) { - sizeB = 0; - self.interrupt = true; - effects.exit("tableRow"); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return headDelimiterStart; - } - return nok(code); - } - if (markdownSpace(code)) return factorySpace(effects, headRowBreak, "whitespace")(code); - sizeB += 1; - if (seen) { - seen = false; - size += 1; - } - if (code === 124) { - effects.enter("tableCellDivider"); - effects.consume(code); - effects.exit("tableCellDivider"); - seen = true; - return headRowBreak; - } - effects.enter("data"); - return headRowData(code); - } - /** - * In table head row data. - * - * ```markdown - * > | | a | - * ^ - * | | - | - * | | b | - * ``` - * - * @type {State} - */ - function headRowData(code) { - if (code === null || code === 124 || markdownLineEndingOrSpace(code)) { - effects.exit("data"); - return headRowBreak(code); - } - effects.consume(code); - return code === 92 ? headRowEscape : headRowData; - } - /** - * In table head row escape. - * - * ```markdown - * > | | a\-b | - * ^ - * | | ---- | - * | | c | - * ``` - * - * @type {State} - */ - function headRowEscape(code) { - if (code === 92 || code === 124) { - effects.consume(code); - return headRowData; - } - return headRowData(code); - } - /** - * Before delimiter row. - * - * ```markdown - * | | a | - * > | | - | - * ^ - * | | b | - * ``` - * - * @type {State} - */ - function headDelimiterStart(code) { - self.interrupt = false; - if (self.parser.lazy[self.now().line]) return nok(code); - effects.enter("tableDelimiterRow"); - seen = false; - if (markdownSpace(code)) return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code); - return headDelimiterBefore(code); - } - /** - * Before delimiter row, after optional whitespace. - * - * Reused when a `|` is found later, to parse another cell. - * - * ```markdown - * | | a | - * > | | - | - * ^ - * | | b | - * ``` - * - * @type {State} - */ - function headDelimiterBefore(code) { - if (code === 45 || code === 58) return headDelimiterValueBefore(code); - if (code === 124) { - seen = true; - effects.enter("tableCellDivider"); - effects.consume(code); - effects.exit("tableCellDivider"); - return headDelimiterCellBefore; - } - return headDelimiterNok(code); - } - /** - * After `|`, before delimiter cell. - * - * ```markdown - * | | a | - * > | | - | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterCellBefore(code) { - if (markdownSpace(code)) return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code); - return headDelimiterValueBefore(code); - } - /** - * Before delimiter cell value. - * - * ```markdown - * | | a | - * > | | - | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterValueBefore(code) { - if (code === 58) { - sizeB += 1; - seen = true; - effects.enter("tableDelimiterMarker"); - effects.consume(code); - effects.exit("tableDelimiterMarker"); - return headDelimiterLeftAlignmentAfter; - } - if (code === 45) { - sizeB += 1; - return headDelimiterLeftAlignmentAfter(code); - } - if (code === null || markdownLineEnding(code)) return headDelimiterCellAfter(code); - return headDelimiterNok(code); - } - /** - * After delimiter cell left alignment marker. - * - * ```markdown - * | | a | - * > | | :- | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterLeftAlignmentAfter(code) { - if (code === 45) { - effects.enter("tableDelimiterFiller"); - return headDelimiterFiller(code); - } - return headDelimiterNok(code); - } - /** - * In delimiter cell filler. - * - * ```markdown - * | | a | - * > | | - | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterFiller(code) { - if (code === 45) { - effects.consume(code); - return headDelimiterFiller; - } - if (code === 58) { - seen = true; - effects.exit("tableDelimiterFiller"); - effects.enter("tableDelimiterMarker"); - effects.consume(code); - effects.exit("tableDelimiterMarker"); - return headDelimiterRightAlignmentAfter; - } - effects.exit("tableDelimiterFiller"); - return headDelimiterRightAlignmentAfter(code); - } - /** - * After delimiter cell right alignment marker. - * - * ```markdown - * | | a | - * > | | -: | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterRightAlignmentAfter(code) { - if (markdownSpace(code)) return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code); - return headDelimiterCellAfter(code); - } - /** - * After delimiter cell. - * - * ```markdown - * | | a | - * > | | -: | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterCellAfter(code) { - if (code === 124) return headDelimiterBefore(code); - if (code === null || markdownLineEnding(code)) { - if (!seen || size !== sizeB) return headDelimiterNok(code); - effects.exit("tableDelimiterRow"); - effects.exit("tableHead"); - return ok(code); - } - return headDelimiterNok(code); - } - /** - * In delimiter row, at a disallowed byte. - * - * ```markdown - * | | a | - * > | | x | - * ^ - * ``` - * - * @type {State} - */ - function headDelimiterNok(code) { - return nok(code); - } - /** - * Before table body row. - * - * ```markdown - * | | a | - * | | - | - * > | | b | - * ^ - * ``` - * - * @type {State} - */ - function bodyRowStart(code) { - effects.enter("tableRow"); - return bodyRowBreak(code); - } - /** - * At break in table body row. - * - * ```markdown - * | | a | - * | | - | - * > | | b | - * ^ - * ^ - * ^ - * ``` - * - * @type {State} - */ - function bodyRowBreak(code) { - if (code === 124) { - effects.enter("tableCellDivider"); - effects.consume(code); - effects.exit("tableCellDivider"); - return bodyRowBreak; - } - if (code === null || markdownLineEnding(code)) { - effects.exit("tableRow"); - return ok(code); - } - if (markdownSpace(code)) return factorySpace(effects, bodyRowBreak, "whitespace")(code); - effects.enter("data"); - return bodyRowData(code); - } - /** - * In table body row data. - * - * ```markdown - * | | a | - * | | - | - * > | | b | - * ^ - * ``` - * - * @type {State} - */ - function bodyRowData(code) { - if (code === null || code === 124 || markdownLineEndingOrSpace(code)) { - effects.exit("data"); - return bodyRowBreak(code); - } - effects.consume(code); - return code === 92 ? bodyRowEscape : bodyRowData; - } - /** - * In table body row escape. - * - * ```markdown - * | | a | - * | | ---- | - * > | | b\-c | - * ^ - * ``` - * - * @type {State} - */ - function bodyRowEscape(code) { - if (code === 92 || code === 124) { - effects.consume(code); - return bodyRowData; - } - return bodyRowData(code); - } - } - /** @type {Resolver} */ - function resolveTable(events, context) { - let index = -1; - let inFirstCellAwaitingPipe = true; - /** @type {RowKind} */ - let rowKind = 0; - /** @type {Range} */ - let lastCell = [ - 0, - 0, - 0, - 0 - ]; - /** @type {Range} */ - let cell = [ - 0, - 0, - 0, - 0 - ]; - let afterHeadAwaitingFirstBodyRow = false; - let lastTableEnd = 0; - /** @type {Token | undefined} */ - let currentTable; - /** @type {Token | undefined} */ - let currentBody; - /** @type {Token | undefined} */ - let currentCell; - const map = new EditMap(); - while (++index < events.length) { - const event = events[index]; - const token = event[1]; - if (event[0] === "enter") { - if (token.type === "tableHead") { - afterHeadAwaitingFirstBodyRow = false; - if (lastTableEnd !== 0) { - flushTableEnd(map, context, lastTableEnd, currentTable, currentBody); - currentBody = void 0; - lastTableEnd = 0; - } - currentTable = { - type: "table", - start: Object.assign({}, token.start), - end: Object.assign({}, token.end) - }; - map.add(index, 0, [[ - "enter", - currentTable, - context - ]]); - } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") { - inFirstCellAwaitingPipe = true; - currentCell = void 0; - lastCell = [ - 0, - 0, - 0, - 0 - ]; - cell = [ - 0, - index + 1, - 0, - 0 - ]; - if (afterHeadAwaitingFirstBodyRow) { - afterHeadAwaitingFirstBodyRow = false; - currentBody = { - type: "tableBody", - start: Object.assign({}, token.start), - end: Object.assign({}, token.end) - }; - map.add(index, 0, [[ - "enter", - currentBody, - context - ]]); - } - rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1; - } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) { - inFirstCellAwaitingPipe = false; - if (cell[2] === 0) { - if (lastCell[1] !== 0) { - cell[0] = cell[1]; - currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell); - lastCell = [ - 0, - 0, - 0, - 0 - ]; - } - cell[2] = index; - } - } else if (token.type === "tableCellDivider") { - if (inFirstCellAwaitingPipe) inFirstCellAwaitingPipe = false; - else { - if (lastCell[1] !== 0) { - cell[0] = cell[1]; - currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell); - } - lastCell = cell; - cell = [ - lastCell[1], - index, - 0, - 0 - ]; - } - } - } else if (token.type === "tableHead") { - afterHeadAwaitingFirstBodyRow = true; - lastTableEnd = index; - } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") { - lastTableEnd = index; - if (lastCell[1] !== 0) { - cell[0] = cell[1]; - currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell); - } else if (cell[1] !== 0) currentCell = flushCell(map, context, cell, rowKind, index, currentCell); - rowKind = 0; - } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) cell[3] = index; - } - if (lastTableEnd !== 0) flushTableEnd(map, context, lastTableEnd, currentTable, currentBody); - map.consume(context.events); - index = -1; - while (++index < context.events.length) { - const event = context.events[index]; - if (event[0] === "enter" && event[1].type === "table") event[1]._align = gfmTableAlign(context.events, index); - } - return events; - } - /** - * Generate a cell. - * - * @param {EditMap} map - * Edit map to apply to. - * @param {Readonly<TokenizeContext>} context - * Tokenize context. - * @param {Readonly<Range>} range - * Range of the cell within events. - * @param {RowKind} rowKind - * Type of row. - * @param {number | undefined} rowEnd - * Index of the end of the row, if known. - * @param {Token | undefined} previousCell - * Previous cell token, if any. - * @returns {Token | undefined} - * Current cell token after flushing, if any. - */ - function flushCell(map, context, range, rowKind, rowEnd, previousCell) { - const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData"; - const valueName = "tableContent"; - if (range[0] !== 0) { - previousCell.end = Object.assign({}, getPoint(context.events, range[0])); - map.add(range[0], 0, [[ - "exit", - previousCell, - context - ]]); - } - const now = getPoint(context.events, range[1]); - previousCell = { - type: groupName, - start: Object.assign({}, now), - end: Object.assign({}, now) - }; - map.add(range[1], 0, [[ - "enter", - previousCell, - context - ]]); - if (range[2] !== 0) { - const relatedStart = getPoint(context.events, range[2]); - const relatedEnd = getPoint(context.events, range[3]); - /** @type {Token} */ - const valueToken = { - type: valueName, - start: Object.assign({}, relatedStart), - end: Object.assign({}, relatedEnd) - }; - map.add(range[2], 0, [[ - "enter", - valueToken, - context - ]]); - if (rowKind !== 2) { - const start = context.events[range[2]]; - const end = context.events[range[3]]; - start[1].end = Object.assign({}, end[1].end); - start[1].type = "chunkText"; - start[1].contentType = "text"; - if (range[3] > range[2] + 1) { - const a = range[2] + 1; - const b = range[3] - range[2] - 1; - map.add(a, b, []); - } - } - map.add(range[3] + 1, 0, [[ - "exit", - valueToken, - context - ]]); - } - if (rowEnd !== void 0) { - previousCell.end = Object.assign({}, getPoint(context.events, rowEnd)); - map.add(rowEnd, 0, [[ - "exit", - previousCell, - context - ]]); - previousCell = void 0; - } - return previousCell; - } - /** - * Generate table end (and table body end). - * - * @param {Readonly<EditMap>} map - * Edit map to apply to. - * @param {Readonly<TokenizeContext>} context - * Tokenize context. - * @param {number} index - * Index within the events where the table end should be inserted. - * @param {Token} table - * Table token. - * @param {Token | undefined} tableBody - * Table body token, if any. - * @returns {undefined} - * Nothing. - */ - function flushTableEnd(map, context, index, table, tableBody) { - /** @type {Array<Event>} */ - const exits = []; - const related = getPoint(context.events, index); - if (tableBody) { - tableBody.end = Object.assign({}, related); - exits.push([ - "exit", - tableBody, - context - ]); - } - table.end = Object.assign({}, related); - exits.push([ - "exit", - table, - context - ]); - map.add(index + 1, 0, exits); - } - /** - * Get the point (start or end) for a given event in the list of events. - * - * @param {Readonly<Array<Event>>} events - * List of events. - * @param {number} index - * Index of the event to get the point for. - * @returns {Readonly<Point>} - * Start point for enter and end point for exit. - */ - function getPoint(events, index) { - const event = events[index]; - const side = event[0] === "enter" ? "start" : "end"; - return event[1][side]; - } - // node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js - /** - * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - const tasklistCheck = { - name: "tasklistCheck", - tokenize: tokenizeTasklistCheck - }; - /** - * Create an HTML extension for `micromark` to support GFM task list items - * syntax. - * - * @returns {Extension} - * Extension for `micromark` that can be passed in `htmlExtensions` to - * support GFM task list items when serializing to HTML. - */ - function gfmTaskListItem() { - return { text: { [91]: tasklistCheck } }; - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeTasklistCheck(effects, ok, nok) { - const self = this; - return open; - /** - * At start of task list item check. - * - * ```markdown - * > | * [x] y. - * ^ - * ``` - * - * @type {State} - */ - function open(code) { - if (self.previous !== null || !self._gfmTasklistFirstContentOfListItem) return nok(code); - effects.enter("taskListCheck"); - effects.enter("taskListCheckMarker"); - effects.consume(code); - effects.exit("taskListCheckMarker"); - return inside; - } - /** - * In task list item check. - * - * ```markdown - * > | * [x] y. - * ^ - * ``` - * - * @type {State} - */ - function inside(code) { - if (markdownLineEndingOrSpace(code)) { - effects.enter("taskListCheckValueUnchecked"); - effects.consume(code); - effects.exit("taskListCheckValueUnchecked"); - return close; - } - if (code === 88 || code === 120) { - effects.enter("taskListCheckValueChecked"); - effects.consume(code); - effects.exit("taskListCheckValueChecked"); - return close; - } - return nok(code); - } - /** - * At close of task list item check. - * - * ```markdown - * > | * [x] y. - * ^ - * ``` - * - * @type {State} - */ - function close(code) { - if (code === 93) { - effects.enter("taskListCheckMarker"); - effects.consume(code); - effects.exit("taskListCheckMarker"); - effects.exit("taskListCheck"); - return after; - } - return nok(code); - } - /** - * @type {State} - */ - function after(code) { - if (markdownLineEnding(code)) return ok(code); - if (markdownSpace(code)) return effects.check({ tokenize: spaceThenNonSpace }, ok, nok)(code); - return nok(code); - } - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function spaceThenNonSpace(effects, ok, nok) { - return factorySpace(effects, after, "whitespace"); - /** - * After whitespace, after task list item check. - * - * ```markdown - * > | * [x] y. - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - return code === null ? nok(code) : ok(code); - } - } - // node_modules/micromark-extension-gfm/index.js - /** - * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions - * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options - * @typedef {import('micromark-util-types').Extension} Extension - * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension - */ - /** - * Create an extension for `micromark` to enable GFM syntax. - * - * @param {Options | null | undefined} [options] - * Configuration (optional). - * - * Passed to `micromark-extens-gfm-strikethrough`. - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions` to enable GFM - * syntax. - */ - function gfm(options) { - return combineExtensions([ - gfmAutolinkLiteral(), - gfmFootnote(), - gfmStrikethrough(options), - gfmTable(), - gfmTaskListItem() - ]); - } - // node_modules/micromark-extension-math/lib/math-flow.js - /** - * @import {Construct, State, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - /** @type {Construct} */ - const mathFlow = { - tokenize: tokenizeMathFenced, - concrete: true, - name: "mathFlow" - }; - /** @type {Construct} */ - const nonLazyContinuation$1 = { - tokenize: tokenizeNonLazyContinuation$1, - partial: true - }; - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeMathFenced(effects, ok, nok) { - const self = this; - const tail = self.events[self.events.length - 1]; - const initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; - let sizeOpen = 0; - return start; - /** - * Start of math. - * - * ```markdown - * > | $$ - * ^ - * | \frac{1}{2} - * | $$ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("mathFlow"); - effects.enter("mathFlowFence"); - effects.enter("mathFlowFenceSequence"); - return sequenceOpen(code); - } - /** - * In opening fence sequence. - * - * ```markdown - * > | $$ - * ^ - * | \frac{1}{2} - * | $$ - * ``` - * - * @type {State} - */ - function sequenceOpen(code) { - if (code === 36) { - effects.consume(code); - sizeOpen++; - return sequenceOpen; - } - if (sizeOpen < 2) return nok(code); - effects.exit("mathFlowFenceSequence"); - return factorySpace(effects, metaBefore, "whitespace")(code); - } - /** - * In opening fence, before meta. - * - * ```markdown - * > | $$asciimath - * ^ - * | x < y - * | $$ - * ``` - * - * @type {State} - */ - function metaBefore(code) { - if (code === null || markdownLineEnding(code)) return metaAfter(code); - effects.enter("mathFlowFenceMeta"); - effects.enter("chunkString", { contentType: "string" }); - return meta(code); - } - /** - * In meta. - * - * ```markdown - * > | $$asciimath - * ^ - * | x < y - * | $$ - * ``` - * - * @type {State} - */ - function meta(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - effects.exit("mathFlowFenceMeta"); - return metaAfter(code); - } - if (code === 36) return nok(code); - effects.consume(code); - return meta; - } - /** - * After meta. - * - * ```markdown - * > | $$ - * ^ - * | \frac{1}{2} - * | $$ - * ``` - * - * @type {State} - */ - function metaAfter(code) { - effects.exit("mathFlowFence"); - if (self.interrupt) return ok(code); - return effects.attempt(nonLazyContinuation$1, beforeNonLazyContinuation, after)(code); - } - /** - * After eol/eof in math, at a non-lazy closing fence or content. - * - * ```markdown - * | $$ - * > | \frac{1}{2} - * ^ - * > | $$ - * ^ - * ``` - * - * @type {State} - */ - function beforeNonLazyContinuation(code) { - return effects.attempt({ - tokenize: tokenizeClosingFence, - partial: true - }, after, contentStart)(code); - } - /** - * Before math content, definitely not before a closing fence. - * - * ```markdown - * | $$ - * > | \frac{1}{2} - * ^ - * | $$ - * ``` - * - * @type {State} - */ - function contentStart(code) { - return (initialSize ? factorySpace(effects, beforeContentChunk, "linePrefix", initialSize + 1) : beforeContentChunk)(code); - } - /** - * Before math content, after optional prefix. - * - * ```markdown - * | $$ - * > | \frac{1}{2} - * ^ - * | $$ - * ``` - * - * @type {State} - */ - function beforeContentChunk(code) { - if (code === null) return after(code); - if (markdownLineEnding(code)) return effects.attempt(nonLazyContinuation$1, beforeNonLazyContinuation, after)(code); - effects.enter("mathFlowValue"); - return contentChunk(code); - } - /** - * In math content. - * - * ```markdown - * | $$ - * > | \frac{1}{2} - * ^ - * | $$ - * ``` - * - * @type {State} - */ - function contentChunk(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("mathFlowValue"); - return beforeContentChunk(code); - } - effects.consume(code); - return contentChunk; - } - /** - * After math (ha!). - * - * ```markdown - * | $$ - * | \frac{1}{2} - * > | $$ - * ^ - * ``` - * - * @type {State} - */ - function after(code) { - effects.exit("mathFlow"); - return ok(code); - } - /** @type {Tokenizer} */ - function tokenizeClosingFence(effects, ok, nok) { - let size = 0; - /** - * Before closing fence, at optional whitespace. - * - * ```markdown - * | $$ - * | \frac{1}{2} - * > | $$ - * ^ - * ``` - */ - return factorySpace(effects, beforeSequenceClose, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4); - /** - * In closing fence, after optional whitespace, at sequence. - * - * ```markdown - * | $$ - * | \frac{1}{2} - * > | $$ - * ^ - * ``` - * - * @type {State} - */ - function beforeSequenceClose(code) { - effects.enter("mathFlowFence"); - effects.enter("mathFlowFenceSequence"); - return sequenceClose(code); - } - /** - * In closing fence sequence. - * - * ```markdown - * | $$ - * | \frac{1}{2} - * > | $$ - * ^ - * ``` - * - * @type {State} - */ - function sequenceClose(code) { - if (code === 36) { - size++; - effects.consume(code); - return sequenceClose; - } - if (size < sizeOpen) return nok(code); - effects.exit("mathFlowFenceSequence"); - return factorySpace(effects, afterSequenceClose, "whitespace")(code); - } - /** - * After closing fence sequence, after optional whitespace. - * - * ```markdown - * | $$ - * | \frac{1}{2} - * > | $$ - * ^ - * ``` - * - * @type {State} - */ - function afterSequenceClose(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("mathFlowFence"); - return ok(code); - } - return nok(code); - } - } - } - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeNonLazyContinuation$1(effects, ok, nok) { - const self = this; - return start; - /** @type {State} */ - function start(code) { - if (code === null) return ok(code); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return lineStart; - } - /** @type {State} */ - function lineStart(code) { - return self.parser.lazy[self.now().line] ? nok(code) : ok(code); - } - } - // node_modules/micromark-extension-math/lib/math-text.js - /** - * @import {Options} from 'micromark-extension-math' - * @import {Construct, Previous, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' - */ - /** - * @param {Options | null | undefined} [options={}] - * Configuration (default: `{}`). - * @returns {Construct} - * Construct. - */ - function mathText(options) { - let single = (options || {}).singleDollarTextMath; - if (single === null || single === void 0) single = true; - return { - tokenize: tokenizeMathText, - resolve: resolveMathText, - previous, - name: "mathText" - }; - /** - * @this {TokenizeContext} - * @type {Tokenizer} - */ - function tokenizeMathText(effects, ok, nok) { - let sizeOpen = 0; - /** @type {number} */ - let size; - /** @type {Token} */ - let token; - return start; - /** - * Start of math (text). - * - * ```markdown - * > | $a$ - * ^ - * > | \$a$ - * ^ - * ``` - * - * @type {State} - */ - function start(code) { - effects.enter("mathText"); - effects.enter("mathTextSequence"); - return sequenceOpen(code); - } - /** - * In opening sequence. - * - * ```markdown - * > | $a$ - * ^ - * ``` - * - * @type {State} - */ - function sequenceOpen(code) { - if (code === 36) { - effects.consume(code); - sizeOpen++; - return sequenceOpen; - } - if (sizeOpen < 2 && !single) return nok(code); - effects.exit("mathTextSequence"); - return between(code); - } - /** - * Between something and something else. - * - * ```markdown - * > | $a$ - * ^^ - * ``` - * - * @type {State} - */ - function between(code) { - if (code === null) return nok(code); - if (code === 36) { - token = effects.enter("mathTextSequence"); - size = 0; - return sequenceClose(code); - } - if (code === 32) { - effects.enter("space"); - effects.consume(code); - effects.exit("space"); - return between; - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return between; - } - effects.enter("mathTextData"); - return data(code); - } - /** - * In data. - * - * ```markdown - * > | $a$ - * ^ - * ``` - * - * @type {State} - */ - function data(code) { - if (code === null || code === 32 || code === 36 || markdownLineEnding(code)) { - effects.exit("mathTextData"); - return between(code); - } - effects.consume(code); - return data; - } - /** - * In closing sequence. - * - * ```markdown - * > | `a` - * ^ - * ``` - * - * @type {State} - */ - function sequenceClose(code) { - if (code === 36) { - effects.consume(code); - size++; - return sequenceClose; - } - if (size === sizeOpen) { - effects.exit("mathTextSequence"); - effects.exit("mathText"); - return ok(code); - } - token.type = "mathTextData"; - return data(code); - } - } - } - /** @type {Resolver} */ - function resolveMathText(events) { - let tailExitIndex = events.length - 4; - let headEnterIndex = 3; - /** @type {number} */ - let index; - /** @type {number | undefined} */ - let enter; - if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { - index = headEnterIndex; - while (++index < tailExitIndex) if (events[index][1].type === "mathTextData") { - events[tailExitIndex][1].type = "mathTextPadding"; - events[headEnterIndex][1].type = "mathTextPadding"; - headEnterIndex += 2; - tailExitIndex -= 2; - break; - } - } - index = headEnterIndex - 1; - tailExitIndex++; - while (++index <= tailExitIndex) if (enter === void 0) { - if (index !== tailExitIndex && events[index][1].type !== "lineEnding") enter = index; - } else if (index === tailExitIndex || events[index][1].type === "lineEnding") { - events[enter][1].type = "mathTextData"; - if (index !== enter + 2) { - events[enter][1].end = events[index - 1][1].end; - events.splice(enter + 2, index - enter - 2); - tailExitIndex -= index - enter - 2; - index = enter + 2; - } - enter = void 0; - } - return events; - } - /** - * @this {TokenizeContext} - * @type {Previous} - */ - function previous(code) { - return code !== 36 || this.events[this.events.length - 1][1].type === "characterEscape"; - } - // node_modules/micromark-extension-math/lib/syntax.js - /** - * @import {Options} from 'micromark-extension-math' - * @import {Extension} from 'micromark-util-types' - */ - /** - * Create an extension for `micromark` to enable math syntax. - * - * @param {Options | null | undefined} [options={}] - * Configuration (default: `{}`). - * @returns {Extension} - * Extension for `micromark` that can be passed in `extensions`, to - * enable math syntax. - */ - function math$1(options) { - return { - flow: { [36]: mathFlow }, - text: { [36]: mathText(options) } - }; - } - // node_modules/micromark-util-symbol/lib/codes.js - /** - * Character codes. - * - * This module is compiled away! - * - * micromark works based on character codes. - * This module contains constants for the ASCII block and the replacement - * character. - * A couple of them are handled in a special way, such as the line endings - * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal - * tab) and its expansion based on what column it’s at (virtual space), - * and the end-of-file (eof) character. - * As values are preprocessed before handling them, the actual characters LF, - * CR, HT, and NUL (which is present as the replacement character), are - * guaranteed to not exist. - * - * Unicode basic latin block. - */ - const codes = { - carriageReturn: -5, - lineFeed: -4, - carriageReturnLineFeed: -3, - horizontalTab: -2, - virtualSpace: -1, - eof: null, - nul: 0, - soh: 1, - stx: 2, - etx: 3, - eot: 4, - enq: 5, - ack: 6, - bel: 7, - bs: 8, - ht: 9, - lf: 10, - vt: 11, - ff: 12, - cr: 13, - so: 14, - si: 15, - dle: 16, - dc1: 17, - dc2: 18, - dc3: 19, - dc4: 20, - nak: 21, - syn: 22, - etb: 23, - can: 24, - em: 25, - sub: 26, - esc: 27, - fs: 28, - gs: 29, - rs: 30, - us: 31, - space: 32, - exclamationMark: 33, - quotationMark: 34, - numberSign: 35, - dollarSign: 36, - percentSign: 37, - ampersand: 38, - apostrophe: 39, - leftParenthesis: 40, - rightParenthesis: 41, - asterisk: 42, - plusSign: 43, - comma: 44, - dash: 45, - dot: 46, - slash: 47, - digit0: 48, - digit1: 49, - digit2: 50, - digit3: 51, - digit4: 52, - digit5: 53, - digit6: 54, - digit7: 55, - digit8: 56, - digit9: 57, - colon: 58, - semicolon: 59, - lessThan: 60, - equalsTo: 61, - greaterThan: 62, - questionMark: 63, - atSign: 64, - uppercaseA: 65, - uppercaseB: 66, - uppercaseC: 67, - uppercaseD: 68, - uppercaseE: 69, - uppercaseF: 70, - uppercaseG: 71, - uppercaseH: 72, - uppercaseI: 73, - uppercaseJ: 74, - uppercaseK: 75, - uppercaseL: 76, - uppercaseM: 77, - uppercaseN: 78, - uppercaseO: 79, - uppercaseP: 80, - uppercaseQ: 81, - uppercaseR: 82, - uppercaseS: 83, - uppercaseT: 84, - uppercaseU: 85, - uppercaseV: 86, - uppercaseW: 87, - uppercaseX: 88, - uppercaseY: 89, - uppercaseZ: 90, - leftSquareBracket: 91, - backslash: 92, - rightSquareBracket: 93, - caret: 94, - underscore: 95, - graveAccent: 96, - lowercaseA: 97, - lowercaseB: 98, - lowercaseC: 99, - lowercaseD: 100, - lowercaseE: 101, - lowercaseF: 102, - lowercaseG: 103, - lowercaseH: 104, - lowercaseI: 105, - lowercaseJ: 106, - lowercaseK: 107, - lowercaseL: 108, - lowercaseM: 109, - lowercaseN: 110, - lowercaseO: 111, - lowercaseP: 112, - lowercaseQ: 113, - lowercaseR: 114, - lowercaseS: 115, - lowercaseT: 116, - lowercaseU: 117, - lowercaseV: 118, - lowercaseW: 119, - lowercaseX: 120, - lowercaseY: 121, - lowercaseZ: 122, - leftCurlyBrace: 123, - verticalBar: 124, - rightCurlyBrace: 125, - tilde: 126, - del: 127, - byteOrderMarker: 65279, - replacementCharacter: 65533 - }; - // node_modules/micromark-util-symbol/lib/constants.js - /** - * This module is compiled away! - * - * Parsing markdown comes with a couple of constants, such as minimum or maximum - * sizes of certain sequences. - * Additionally, there are a couple symbols used inside micromark. - * These are all defined here, but compiled away by scripts. - */ - const constants = { - attentionSideAfter: 2, - attentionSideBefore: 1, - atxHeadingOpeningFenceSizeMax: 6, - autolinkDomainSizeMax: 63, - autolinkSchemeSizeMax: 32, - cdataOpeningString: "CDATA[", - characterGroupPunctuation: 2, - characterGroupWhitespace: 1, - characterReferenceDecimalSizeMax: 7, - characterReferenceHexadecimalSizeMax: 6, - characterReferenceNamedSizeMax: 31, - codeFencedSequenceSizeMin: 3, - contentTypeContent: "content", - contentTypeDocument: "document", - contentTypeFlow: "flow", - contentTypeString: "string", - contentTypeText: "text", - hardBreakPrefixSizeMin: 2, - htmlBasic: 6, - htmlCdata: 5, - htmlComment: 2, - htmlComplete: 7, - htmlDeclaration: 4, - htmlInstruction: 3, - htmlRawSizeMax: 8, - htmlRaw: 1, - linkResourceDestinationBalanceMax: 32, - linkReferenceSizeMax: 999, - listItemValueSizeMax: 10, - numericBaseDecimal: 10, - numericBaseHexadecimal: 16, - tabSize: 4, - thematicBreakMarkerCountMin: 3, - v8MaxSafeChunkSize: 1e4 - }; - // node_modules/micromark-util-symbol/lib/types.js - /** - * This module is compiled away! - * - * Here is the list of all types of tokens exposed by micromark, with a short - * explanation of what they include and where they are found. - * In picking names, generally, the rule is to be as explicit as possible - * instead of reusing names. - * For example, there is a `definitionDestination` and a `resourceDestination`, - * instead of one shared name. - */ - const types = { - data: "data", - whitespace: "whitespace", - lineEnding: "lineEnding", - lineEndingBlank: "lineEndingBlank", - linePrefix: "linePrefix", - lineSuffix: "lineSuffix", - atxHeading: "atxHeading", - atxHeadingSequence: "atxHeadingSequence", - atxHeadingText: "atxHeadingText", - autolink: "autolink", - autolinkEmail: "autolinkEmail", - autolinkMarker: "autolinkMarker", - autolinkProtocol: "autolinkProtocol", - characterEscape: "characterEscape", - characterEscapeValue: "characterEscapeValue", - characterReference: "characterReference", - characterReferenceMarker: "characterReferenceMarker", - characterReferenceMarkerNumeric: "characterReferenceMarkerNumeric", - characterReferenceMarkerHexadecimal: "characterReferenceMarkerHexadecimal", - characterReferenceValue: "characterReferenceValue", - codeFenced: "codeFenced", - codeFencedFence: "codeFencedFence", - codeFencedFenceSequence: "codeFencedFenceSequence", - codeFencedFenceInfo: "codeFencedFenceInfo", - codeFencedFenceMeta: "codeFencedFenceMeta", - codeFlowValue: "codeFlowValue", - codeIndented: "codeIndented", - codeText: "codeText", - codeTextData: "codeTextData", - codeTextPadding: "codeTextPadding", - codeTextSequence: "codeTextSequence", - content: "content", - definition: "definition", - definitionDestination: "definitionDestination", - definitionDestinationLiteral: "definitionDestinationLiteral", - definitionDestinationLiteralMarker: "definitionDestinationLiteralMarker", - definitionDestinationRaw: "definitionDestinationRaw", - definitionDestinationString: "definitionDestinationString", - definitionLabel: "definitionLabel", - definitionLabelMarker: "definitionLabelMarker", - definitionLabelString: "definitionLabelString", - definitionMarker: "definitionMarker", - definitionTitle: "definitionTitle", - definitionTitleMarker: "definitionTitleMarker", - definitionTitleString: "definitionTitleString", - emphasis: "emphasis", - emphasisSequence: "emphasisSequence", - emphasisText: "emphasisText", - escapeMarker: "escapeMarker", - hardBreakEscape: "hardBreakEscape", - hardBreakTrailing: "hardBreakTrailing", - htmlFlow: "htmlFlow", - htmlFlowData: "htmlFlowData", - htmlText: "htmlText", - htmlTextData: "htmlTextData", - image: "image", - label: "label", - labelText: "labelText", - labelLink: "labelLink", - labelImage: "labelImage", - labelMarker: "labelMarker", - labelImageMarker: "labelImageMarker", - labelEnd: "labelEnd", - link: "link", - paragraph: "paragraph", - reference: "reference", - referenceMarker: "referenceMarker", - referenceString: "referenceString", - resource: "resource", - resourceDestination: "resourceDestination", - resourceDestinationLiteral: "resourceDestinationLiteral", - resourceDestinationLiteralMarker: "resourceDestinationLiteralMarker", - resourceDestinationRaw: "resourceDestinationRaw", - resourceDestinationString: "resourceDestinationString", - resourceMarker: "resourceMarker", - resourceTitle: "resourceTitle", - resourceTitleMarker: "resourceTitleMarker", - resourceTitleString: "resourceTitleString", - setextHeading: "setextHeading", - setextHeadingText: "setextHeadingText", - setextHeadingLine: "setextHeadingLine", - setextHeadingLineSequence: "setextHeadingLineSequence", - strong: "strong", - strongSequence: "strongSequence", - strongText: "strongText", - thematicBreak: "thematicBreak", - thematicBreakSequence: "thematicBreakSequence", - blockQuote: "blockQuote", - blockQuotePrefix: "blockQuotePrefix", - blockQuoteMarker: "blockQuoteMarker", - blockQuotePrefixWhitespace: "blockQuotePrefixWhitespace", - listOrdered: "listOrdered", - listUnordered: "listUnordered", - listItemIndent: "listItemIndent", - listItemMarker: "listItemMarker", - listItemPrefix: "listItemPrefix", - listItemPrefixWhitespace: "listItemPrefixWhitespace", - listItemValue: "listItemValue", - chunkDocument: "chunkDocument", - chunkContent: "chunkContent", - chunkFlow: "chunkFlow", - chunkText: "chunkText", - chunkString: "chunkString" - }; - // src/client/markdown/cjkFriendlyStrong.ts - /** Let asterisk strong emphasis close after punctuation when CJK prose continues without whitespace. */ - const cjkCharacter = new RegExp([ - "\\p{Script_Extensions=Han}", - "\\p{Script_Extensions=Hiragana}", - "\\p{Script_Extensions=Katakana}", - "\\p{Script_Extensions=Hangul}", - "\\p{Script_Extensions=Bopomofo}" - ].join("|"), "u"); - function isCjkCharacter(code) { - return code !== null && code >= 0 && cjkCharacter.test(String.fromCodePoint(code)); - } - const tokenizeCjkFriendlyAttention = function(effects, ok, nok) { - const configuredAttentionMarkers = this.parser.constructs.attentionMarkers.null; - if (configuredAttentionMarkers === void 0) throw new Error("micromark CommonMark attention markers are unavailable"); - const attentionMarkers = configuredAttentionMarkers; - const previous = this.previous; - const before = classifyCharacter(previous); - let marker = codes.eof; - return start; - function start(code) { - /* v8 ignore next -- this text construct is dispatched only for an asterisk. */ - if (code !== codes.asterisk) return nok(code); - marker = code; - effects.enter("attentionSequence"); - return inside(code); - } - function inside(code) { - if (code === marker) { - effects.consume(code); - return inside; - } - const token = effects.exit("attentionSequence"); - const after = classifyCharacter(code); - const open = !after || after === constants.characterGroupPunctuation && Boolean(before) || attentionMarkers.includes(code); - const commonMarkClose = !before || before === constants.characterGroupPunctuation && Boolean(after) || attentionMarkers.includes(previous); - const cjkStrongClose = token.end.offset - token.start.offset >= 2 && unicodePunctuation(previous) && isCjkCharacter(code); - const close = commonMarkClose || cjkStrongClose; - token._open = open; - token._close = close; - return ok(code); - } - }; - const cjkFriendlyAttention = { - name: "cjkFriendlyAttention", - resolveAll: attention.resolveAll, - tokenize: tokenizeCjkFriendlyAttention - }; - const cjkFriendlyStrongExtension = { text: { [codes.asterisk]: cjkFriendlyAttention } }; - /** - * Extend CommonMark asterisk strong emphasis for punctuation-delimited CJK - * prose, as a micromark syntax extension for `fromMarkdown`. - * @returns The micromark syntax extension. - */ - function cjkFriendlyStrong() { - return cjkFriendlyStrongExtension; - } - // src/client/markdown/mathCompatibility.ts - /** Extend upstream dollar-only math syntax with TeX delimiters while reusing its token vocabulary. */ - const previousBackslash = function(code) { - if (code !== codes.backslash) return true; - const tail = this.events.at(-1); - /* v8 ignore next -- a previous code necessarily has a preceding event. */ - if (tail === void 0) return false; - return tail[1].type === types.characterEscape; - }; - const tokenizeBackslashMathText = function(effects, ok, nok) { - return start; - function start(code) { - /* v8 ignore next -- the text construct is dispatched only for a backslash. */ - if (code !== codes.backslash) return nok(code); - effects.enter("mathText"); - effects.enter("mathTextSequence"); - effects.consume(code); - return open; - } - function open(code) { - if (code !== codes.leftParenthesis) return nok(code); - effects.consume(code); - effects.exit("mathTextSequence"); - return between; - } - function between(code) { - if (code === codes.eof) return nok(code); - if (code === codes.backslash) return effects.attempt({ - partial: true, - tokenize: tokenizeClose - }, close, afterCloseAttempt)(code); - if (markdownLineEnding(code)) { - effects.enter(types.lineEnding); - effects.consume(code); - effects.exit(types.lineEnding); - return between; - } - return dataStart(code); - } - function afterCloseAttempt(code) { - return effects.check({ - partial: true, - tokenize: tokenizeOpen - }, nok, dataStart)(code); - } - function dataStart(code) { - effects.enter("mathTextData"); - effects.consume(code); - return code === codes.backslash ? afterDataBackslash : data; - } - function afterDataBackslash(code) { - if (code === codes.backslash) { - effects.consume(code); - return data; - } - return data(code); - } - function data(code) { - if (code === codes.eof || code === codes.backslash || markdownLineEnding(code)) { - effects.exit("mathTextData"); - return between(code); - } - effects.consume(code); - return data; - } - function close(code) { - effects.exit("mathText"); - return ok(code); - } - function tokenizeClose(closeEffects, closeOk, closeNok) { - return slash; - function slash(code) { - /* v8 ignore next -- this partial construct is attempted only at a backslash. */ - if (code !== codes.backslash) return closeNok(code); - closeEffects.enter("mathTextSequence"); - closeEffects.consume(code); - return parenthesis; - } - function parenthesis(code) { - if (code !== codes.rightParenthesis) return closeNok(code); - closeEffects.consume(code); - closeEffects.exit("mathTextSequence"); - return closeOk; - } - } - function tokenizeOpen(openEffects, openOk, openNok) { - return slash; - function slash(code) { - /* v8 ignore next -- the opening check follows a failed close attempt at a backslash. */ - if (code !== codes.backslash) return openNok(code); - openEffects.enter(types.chunkString); - openEffects.consume(code); - return parenthesis; - } - function parenthesis(code) { - if (code !== codes.leftParenthesis) return openNok(code); - openEffects.consume(code); - openEffects.exit(types.chunkString); - return openOk; - } - } - }; - function createMathFlow(marker, openMarker, closeMarker, multiline) { - const tokenize = function(effects, ok, nok) { - const self = this; - let oddBackslashRun = false; - const tail = self.events.at(-1); - const initialSize = tail?.[1].type === types.linePrefix ? tail[2].sliceSerialize(tail[1], true).length : 0; - return start; - function start(code) { - /* v8 ignore next -- the flow construct is dispatched only for its marker. */ - if (code !== marker) return nok(code); - effects.enter("mathFlow"); - effects.enter("mathFlowFence"); - effects.enter("mathFlowFenceSequence"); - effects.consume(code); - return open; - } - function open(code) { - if (code !== openMarker) return nok(code); - effects.consume(code); - effects.exit("mathFlowFenceSequence"); - effects.exit("mathFlowFence"); - return marker === codes.dollarSign ? afterDollarOpen : content; - } - function afterDollarOpen(code) { - return code === codes.dollarSign ? nok(code) : content(code); - } - function content(code) { - if (code === codes.eof) return nok(code); - if (code === marker && (marker !== codes.dollarSign || !oddBackslashRun)) return effects.attempt({ - partial: true, - tokenize: tokenizeClosingFence - }, closed, afterClosingFenceAttempt)(code); - if (markdownLineEnding(code)) return multiline ? effects.attempt(nonLazyContinuation, afterContinuation, nok)(code) : nok(code); - return valueStart(code); - } - function afterClosingFenceAttempt(code) { - return marker === codes.backslash ? effects.check({ - partial: true, - tokenize: tokenizeOpeningFence - }, nok, markerValueStart)(code) : markerValueStart(code); - } - function afterContinuation(code) { - return effects.attempt({ - partial: true, - tokenize: tokenizeClosingFence - }, closed, initialSize ? factorySpace(effects, content, types.linePrefix, initialSize + 1) : content)(code); - } - function valueStart(code) { - effects.enter("mathFlowValue"); - oddBackslashRun = code === codes.backslash; - effects.consume(code); - return value; - } - function markerValueStart(code) { - effects.enter("mathFlowValue"); - oddBackslashRun = false; - effects.consume(code); - return valueAfterMarker; - } - function valueAfterMarker(code) { - if (code === marker) { - effects.consume(code); - return value; - } - return value(code); - } - function value(code) { - if (code === codes.eof || code === marker || markdownLineEnding(code)) { - effects.exit("mathFlowValue"); - return content(code); - } - oddBackslashRun = code === codes.backslash ? !oddBackslashRun : false; - effects.consume(code); - return value; - } - function closed(code) { - effects.exit("mathFlow"); - return ok(code); - } - function tokenizeClosingFence(closeEffects, closeOk, closeNok) { - return factorySpace(closeEffects, sequenceStart, types.linePrefix, constants.tabSize); - function sequenceStart(code) { - if (code !== marker) return closeNok(code); - closeEffects.enter("mathFlowFence"); - closeEffects.enter("mathFlowFenceSequence"); - closeEffects.consume(code); - return sequenceEnd; - } - function sequenceEnd(code) { - if (code !== closeMarker) return closeNok(code); - closeEffects.consume(code); - closeEffects.exit("mathFlowFenceSequence"); - return factorySpace(closeEffects, after, types.whitespace); - } - function after(code) { - if (code !== codes.eof && !markdownLineEnding(code)) return closeNok(code); - closeEffects.exit("mathFlowFence"); - return closeOk(code); - } - } - function tokenizeOpeningFence(openEffects, openOk, openNok) { - return sequenceStart; - function sequenceStart(code) { - /* v8 ignore next -- the opening check follows a failed close attempt at the marker. */ - if (code !== marker) return openNok(code); - openEffects.enter(types.chunkString); - openEffects.consume(code); - return sequenceEnd; - } - function sequenceEnd(code) { - if (code !== openMarker) return openNok(code); - openEffects.consume(code); - openEffects.exit(types.chunkString); - return openOk; - } - } - }; - return { - concrete: true, - name: marker === codes.dollarSign ? "sameLineDollarMathFlow" : "backslashMathFlow", - tokenize - }; - } - const tokenizeNonLazyContinuation = function(effects, ok, nok) { - const self = this; - return start; - function start(code) { - /* v8 ignore next -- continuation constructs are attempted only after a line ending. */ - if (code === codes.eof) return ok(code); - /* v8 ignore next -- continuation constructs are attempted only after a line ending. */ - if (!markdownLineEnding(code)) return nok(code); - effects.enter(types.lineEnding); - effects.consume(code); - effects.exit(types.lineEnding); - return lineStart; - } - function lineStart(code) { - return self.parser.lazy[self.now().line] ? nok(code) : ok(code); - } - }; - const nonLazyContinuation = { - partial: true, - tokenize: tokenizeNonLazyContinuation - }; - const backslashMathText = { - name: "backslashMathText", - previous: previousBackslash, - tokenize: tokenizeBackslashMathText - }; - const backslashMathFlow = createMathFlow(codes.backslash, codes.leftSquareBracket, codes.rightSquareBracket, true); - const sameLineDollarMathFlow = createMathFlow(codes.dollarSign, codes.dollarSign, codes.dollarSign, false); - const backslashMath = { - flow: { - [codes.backslash]: backslashMathFlow, - [codes.dollarSign]: sameLineDollarMathFlow - }, - text: { [codes.backslash]: backslashMathText } - }; - /** - * TeX backslash delimiters and same-line display-dollar blocks as a micromark - * syntax extension reusing `micromark-extension-math`'s token vocabulary; the - * caller must also register `math()` on the same parse so the emitted tokens - * compile to standard math nodes. - * @returns The micromark syntax extension. - */ - function mathCompatibility() { - return backslashMath; - } - // src/client/markdown/parse.ts - /** - * Parse GFM markdown (the streaming arm's grammar: no math, so incomplete - * TeX never flashes KaTeX errors mid-stream). - * @param text - Markdown source. - * @returns The mdast root. - */ - function parseGfm(text) { - return fromMarkdown(text, { - extensions: [gfm(), cjkFriendlyStrong()], - mdastExtensions: [gfmFromMarkdown()] - }); - } - /** - * Parse GFM markdown plus TeX math with the compatibility delimiters - * (the settled arm's grammar). - * @param text - Markdown source. - * @returns The mdast root. - */ - function parseGfmWithMath(text) { - return fromMarkdown(text, { - extensions: [ - gfm(), - cjkFriendlyStrong(), - mathCompatibility(), - math$1() - ], - mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown()] - }); - } - // node_modules/clsx/dist/clsx.mjs - function r(e) { - var t, f, n = ""; - if ("string" == typeof e || "number" == typeof e) n += e; - else if ("object" == typeof e) if (Array.isArray(e)) { - var o = e.length; - for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); - } else for (f in e) e[f] && (n && (n += " "), n += f); - return n; - } - function clsx() { - for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); - return n; - } - // node_modules/katex/dist/katex.mjs - /** - * This is the ParseError class, which is the main error thrown by KaTeX - * functions when something has gone wrong. This is used to distinguish internal - * errors from errors in the expression that the user provided. - * - * If possible, a caller should provide a Token or ParseNode with information - * about where in the source string the problem occurred. - */ - var ParseError = class ParseError extends Error { - constructor(message, token) { - var error = "KaTeX parse error: " + message; - var start; - var end; - var loc = token && token.loc; - if (loc && loc.start <= loc.end) { - var input = loc.lexer.input; - start = loc.start; - end = loc.end; - if (start === input.length) error += " at end of input: "; - else error += " at position " + (start + 1) + ": "; - var underlined = input.slice(start, end).replace(/[^]/g, "$&̲"); - var left; - if (start > 15) left = "…" + input.slice(start - 15, start); - else left = input.slice(0, start); - var right; - if (end + 15 < input.length) right = input.slice(end, end + 15) + "…"; - else right = input.slice(end); - error += left + underlined + right; - } - super(error); - this.name = "ParseError"; - this.position = void 0; - this.length = void 0; - this.rawMessage = void 0; - Object.setPrototypeOf(this, ParseError.prototype); - this.position = start; - if (start != null && end != null) this.length = end - start; - this.rawMessage = message; - } - }; - /** - * This file contains a list of utility functions which are useful in other - * files. - */ - var uppercase = /([A-Z])/g; - var hyphenate = (str) => str.replace(uppercase, "-$1").toLowerCase(); - var ESCAPE_LOOKUP = { - "&": "&", - ">": ">", - "<": "<", - "\"": """, - "'": "'" - }; - var ESCAPE_REGEX = /[&><"']/g; - /** - * Escapes text to prevent scripting attacks. - */ - var escape = (text) => String(text).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); - /** - * Sometimes we want to pull out the innermost element of a group. In most - * cases, this will just be the group itself, but when ordgroups and colors have - * a single element, we want to pull that out. - */ - var getBaseElem = (group) => { - if (group.type === "ordgroup") { - if (group.body.length === 1) return getBaseElem(group.body[0]); - else return group; - } else if (group.type === "color") { - if (group.body.length === 1) return getBaseElem(group.body[0]); - else return group; - } else if (group.type === "font") return getBaseElem(group.body); - else return group; - }; - var characterNodesTypes = /* @__PURE__ */ new Set([ - "mathord", - "textord", - "atom" - ]); - /** - * TeXbook algorithms often reference "character boxes", which are simply groups - * with a single character in them. To decide if something is a character box, - * we find its innermost group, and see if it is a single character. - */ - var isCharacterBox = (group) => characterNodesTypes.has(getBaseElem(group).type); - /** - * Return the protocol of a URL, or "_relative" if the URL does not specify a - * protocol (and thus is relative), or `null` if URL has invalid protocol - * (so should be outright rejected). - */ - var protocolFromUrl = (url) => { - var protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url); - if (!protocol) return "_relative"; - if (protocol[2] !== ":") return null; - if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) return null; - return protocol[1].toLowerCase(); - }; - var SETTINGS_SCHEMA = { - displayMode: { - type: "boolean", - description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.", - cli: "-d, --display-mode" - }, - output: { - type: { enum: [ - "htmlAndMathml", - "html", - "mathml" - ] }, - description: "Determines the markup language of the output.", - cli: "-F, --format <type>" - }, - leqno: { - type: "boolean", - description: "Render display math in leqno style (left-justified tags)." - }, - fleqn: { - type: "boolean", - description: "Render display math flush left." - }, - throwOnError: { - type: "boolean", - default: true, - cli: "-t, --no-throw-on-error", - cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error." - }, - errorColor: { - type: "string", - default: "#cc0000", - cli: "-c, --error-color <color>", - cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.", - cliProcessor: (color) => "#" + color - }, - macros: { - type: "object", - cli: "-m, --macro <def>", - cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).", - cliDefault: [], - cliProcessor: (def, defs) => { - defs.push(def); - return defs; - } - }, - minRuleThickness: { - type: "number", - description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.", - processor: (t) => Math.max(0, t), - cli: "--min-rule-thickness <size>", - cliProcessor: parseFloat - }, - colorIsTextColor: { - type: "boolean", - description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.", - cli: "-b, --color-is-text-color" - }, - strict: { - type: [ - { enum: [ - "warn", - "ignore", - "error" - ] }, - "boolean", - "function" - ], - description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.", - cli: "-S, --strict", - cliDefault: false - }, - trust: { - type: ["boolean", "function"], - description: "Trust the input, enabling all HTML features such as \\url.", - cli: "-T, --trust" - }, - maxSize: { - type: "number", - default: 1e400, - description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large", - processor: (s) => Math.max(0, s), - cli: "-s, --max-size <n>", - cliProcessor: parseInt - }, - maxExpand: { - type: "number", - default: 1e3, - description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.", - processor: (n) => Math.max(0, n), - cli: "-e, --max-expand <n>", - cliProcessor: (n) => n === "Infinity" ? 1e400 : parseInt(n) - }, - globalGroup: { - type: "boolean", - cli: false - } - }; - function getImplicitDefault(type) { - if (typeof type !== "string") return type.enum[0]; - switch (type) { - case "boolean": return false; - case "string": return ""; - case "number": return 0; - case "object": return {}; - default: throw new Error("Unexpected schema type; settings must declare an explicit default."); - } - } - function getDefaultValue(schema) { - if (Object.prototype.hasOwnProperty.call(schema, "default") && schema.default !== void 0) return schema.default; - return getImplicitDefault(Array.isArray(schema.type) ? schema.type[0] : schema.type); - } - function applySetting(target, prop, options, schema) { - var optionValue = Object.prototype.hasOwnProperty.call(options, prop) ? options[prop] : void 0; - var processor = Object.prototype.hasOwnProperty.call(schema, "processor") ? schema.processor : void 0; - target[prop] = optionValue !== void 0 ? processor ? processor(optionValue) : optionValue : getDefaultValue(schema); - } - /** - * The main Settings object - * - * The current options stored are: - * - displayMode: Whether the expression should be typeset as inline math - * (false, the default), meaning that the math starts in - * \textstyle and is placed in an inline-block); or as display - * math (true), meaning that the math starts in \displaystyle - * and is placed in a block with vertical margin. - */ - var Settings = class { - constructor(options) { - if (options === void 0) options = {}; - this.displayMode = void 0; - this.output = void 0; - this.leqno = void 0; - this.fleqn = void 0; - this.throwOnError = void 0; - this.errorColor = void 0; - this.macros = void 0; - this.minRuleThickness = void 0; - this.colorIsTextColor = void 0; - this.strict = void 0; - this.trust = void 0; - this.maxSize = void 0; - this.maxExpand = void 0; - this.globalGroup = void 0; - options = options || {}; - for (var prop of Object.keys(SETTINGS_SCHEMA)) { - var schema = SETTINGS_SCHEMA[prop]; - if (schema) applySetting(this, prop, options, schema); - } - } - /** - * Check whether to test potentially dangerous input, and return - * `true` (trusted) or `false` (untrusted). The sole argument `context` - * should be an object with `command` field specifying the relevant LaTeX - * command (as a string starting with `\`), and any other arguments, etc. - * If `context` has a `url` field, a `protocol` field will automatically - * get added by this function (changing the specified object). - */ - isTrusted(context) { - if ("url" in context && context.url && !context.protocol) { - var protocol = protocolFromUrl(context.url); - if (protocol == null) return false; - context.protocol = protocol; - } - var trust = typeof this.trust === "function" ? this.trust(context) : this.trust; - return Boolean(trust); - } - }; - /** - * This file contains information and classes for the various kinds of styles - * used in TeX. It provides a generic `Style` class, which holds information - * about a specific style. It then provides instances of all the different kinds - * of styles possible, and provides functions to move between them and get - * information about them. - */ - /** - * The main style class. Contains a unique id for the style, a size (which is - * the same for cramped and uncramped version of a style), and a cramped flag. - */ - var Style = class { - constructor(id, size, cramped) { - this.id = void 0; - this.size = void 0; - this.cramped = void 0; - this.id = id; - this.size = size; - this.cramped = cramped; - } - /** - * Get the style of a superscript given a base in the current style. - */ - sup() { - return styles[sup[this.id]]; - } - /** - * Get the style of a subscript given a base in the current style. - */ - sub() { - return styles[sub[this.id]]; - } - /** - * Get the style of a fraction numerator given the fraction in the current - * style. - */ - fracNum() { - return styles[fracNum[this.id]]; - } - /** - * Get the style of a fraction denominator given the fraction in the current - * style. - */ - fracDen() { - return styles[fracDen[this.id]]; - } - /** - * Get the cramped version of a style (in particular, cramping a cramped style - * doesn't change the style). - */ - cramp() { - return styles[cramp[this.id]]; - } - /** - * Get a text or display version of this style. - */ - text() { - return styles[text$1[this.id]]; - } - /** - * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle) - */ - isTight() { - return this.size >= 2; - } - }; - var D = 0; - var Dc = 1; - var T = 2; - var Tc = 3; - var S = 4; - var Sc = 5; - var SS = 6; - var SSc = 7; - var styles = [ - new Style(D, 0, false), - new Style(Dc, 0, true), - new Style(T, 1, false), - new Style(Tc, 1, true), - new Style(S, 2, false), - new Style(Sc, 2, true), - new Style(SS, 3, false), - new Style(SSc, 3, true) - ]; - var sup = [ - S, - Sc, - S, - Sc, - SS, - SSc, - SS, - SSc - ]; - var sub = [ - Sc, - Sc, - Sc, - Sc, - SSc, - SSc, - SSc, - SSc - ]; - var fracNum = [ - T, - Tc, - S, - Sc, - SS, - SSc, - SS, - SSc - ]; - var fracDen = [ - Tc, - Tc, - Sc, - Sc, - SSc, - SSc, - SSc, - SSc - ]; - var cramp = [ - Dc, - Dc, - Tc, - Tc, - Sc, - Sc, - SSc, - SSc - ]; - var text$1 = [ - D, - Dc, - T, - Tc, - T, - Tc, - T, - Tc - ]; - var Style$1 = { - DISPLAY: styles[D], - TEXT: styles[T], - SCRIPT: styles[S], - SCRIPTSCRIPT: styles[SS] - }; - /** - * Unicode block data for the families of scripts we support in \text{}. - * Scripts only need to appear here if they do not have font metrics. - */ - var scriptData = [ - { - name: "latin", - blocks: [[256, 591], [768, 879]] - }, - { - name: "cyrillic", - blocks: [[1024, 1279]] - }, - { - name: "armenian", - blocks: [[1328, 1423]] - }, - { - name: "brahmic", - blocks: [[2304, 4255]] - }, - { - name: "georgian", - blocks: [[4256, 4351]] - }, - { - name: "cjk", - blocks: [ - [12288, 12543], - [19968, 40879], - [65280, 65376] - ] - }, - { - name: "hangul", - blocks: [[44032, 55215]] - } - ]; - /** - * Given a codepoint, return the name of the script or script family - * it is from, or null if it is not part of a known block - */ - function scriptFromCodepoint(codepoint) { - for (var i = 0; i < scriptData.length; i++) { - var script = scriptData[i]; - for (var _i = 0; _i < script.blocks.length; _i++) { - var block = script.blocks[_i]; - if (codepoint >= block[0] && codepoint <= block[1]) return script.name; - } - } - return null; - } - /** - * A flattened version of all the supported blocks in a single array. - * This is an optimization to make supportedCodepoint() fast. - */ - var allBlocks = []; - scriptData.forEach((s) => s.blocks.forEach((b) => allBlocks.push(...b))); - /** - * Given a codepoint, return true if it falls within one of the - * scripts or script families defined above and false otherwise. - * - * Micro benchmarks shows that this is faster than - * /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test() - * in Firefox, Chrome and Node. - */ - function supportedCodepoint(codepoint) { - for (var i = 0; i < allBlocks.length; i += 2) if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) return true; - return false; - } - /** - * This file provides support to domTree.js and delimiter.js. - * It's a storehouse of path geometry for SVG images. - */ - var doubleBrushStroke = (svgPath) => svgPath + " " + svgPath; - var hLinePad = 80; - var sqrtMain = function sqrtMain(extraVinculum, hLinePad) { - return "M95," + (622 + extraVinculum + hLinePad) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize1 = function sqrtSize1(extraVinculum, hLinePad) { - return "M263," + (601 + extraVinculum + hLinePad) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize2 = function sqrtSize2(extraVinculum, hLinePad) { - return "M983 " + (10 + extraVinculum + hLinePad) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize3 = function sqrtSize3(extraVinculum, hLinePad) { - return "M424," + (2398 + extraVinculum + hLinePad) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad + "\nh400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize4 = function sqrtSize4(extraVinculum, hLinePad) { - return "M473," + (2713 + extraVinculum + hLinePad) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "H1017.7z"; - }; - var phasePath = function phasePath(y) { - var x = y / 2; - return "M400000 " + y + " H0 L" + x + " 0 l65 45 L145 " + (y - 80) + " H400000z"; - }; - var sqrtTall = function sqrtTall(extraVinculum, hLinePad, viewBoxHeight) { - var vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum; - return "M702 " + (extraVinculum + hLinePad) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad + "H400000v" + (40 + extraVinculum) + "H742z"; - }; - var sqrtPath = function sqrtPath(size, extraVinculum, viewBoxHeight) { - extraVinculum = 1e3 * extraVinculum; - var path = ""; - switch (size) { - case "sqrtMain": - path = sqrtMain(extraVinculum, hLinePad); - break; - case "sqrtSize1": - path = sqrtSize1(extraVinculum, hLinePad); - break; - case "sqrtSize2": - path = sqrtSize2(extraVinculum, hLinePad); - break; - case "sqrtSize3": - path = sqrtSize3(extraVinculum, hLinePad); - break; - case "sqrtSize4": - path = sqrtSize4(extraVinculum, hLinePad); - break; - case "sqrtTall": path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight); - } - return path; - }; - var innerPath = function innerPath(name, height) { - switch (name) { - case "⎜": return doubleBrushStroke("M291 0 H417 V" + height + " H291z"); - case "∣": return doubleBrushStroke("M145 0 H188 V" + height + " H145z"); - case "∥": return doubleBrushStroke("M145 0 H188 V" + height + " H145z") + doubleBrushStroke("M367 0 H410 V" + height + " H367z"); - case "⎟": return doubleBrushStroke("M457 0 H583 V" + height + " H457z"); - case "⎢": return doubleBrushStroke("M319 0 H403 V" + height + " H319z"); - case "⎥": return doubleBrushStroke("M263 0 H347 V" + height + " H263z"); - case "⎪": return doubleBrushStroke("M384 0 H504 V" + height + " H384z"); - case "⏐": return doubleBrushStroke("M312 0 H355 V" + height + " H312z"); - case "‖": return doubleBrushStroke("M257 0 H300 V" + height + " H257z") + doubleBrushStroke("M478 0 H521 V" + height + " H478z"); - default: return ""; - } - }; - var path = { - doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z", - doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z", - leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z", - leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z", - leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z", - leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z", - leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z", - leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z", - leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z", - leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z", - leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z", - lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z", - leftlinesegment: doubleBrushStroke("M40 281 V428 H0 V94 H40 V241 H400000 v40z"), - leftbracketunder: doubleBrushStroke("M0 0 h120 V290 H399995 v120 H0z"), - leftbracketover: doubleBrushStroke("M0 440 h120 V150 H399995 v-120 H0z"), - leftmapsto: doubleBrushStroke("M40 281 V448H0V74H40V241H400000v40z"), - leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z", - longequal: doubleBrushStroke("M0 50 h400000 v40H0z m0 194h40000v40H0z"), - midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z", - midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z", - oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z", - oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z", - oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z", - oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z", - rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z", - rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z", - rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z", - rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z", - rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z", - rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z", - rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z", - rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z", - rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z", - righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z", - rightlinesegment: doubleBrushStroke("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"), - rightbracketunder: doubleBrushStroke("M399995 0 h-120 V290 H0 v120 H400000z"), - rightbracketover: doubleBrushStroke("M399995 440 h-120 V150 H0 v-120 H399995z"), - rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z", - twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z", - twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z", - tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z", - tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z", - tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z", - tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z", - vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z", - widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z", - widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z", - widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z", - rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z", - baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z", - rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z", - shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z", - shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z" - }; - var tallDelim = function tallDelim(label, midHeight) { - switch (label) { - case "lbrack": return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 v84 h84z"; - case "rbrack": return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z"; - case "vert": return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z"; - case "doublevert": return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z"; - case "lfloor": return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; - case "rfloor": return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; - case "lceil": return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z"; - case "rceil": return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z"; - case "lparen": return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z"; - case "rparen": return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z"; - default: throw new Error("Unknown stretchy delimiter."); - } - }; - function isMathDomNode(node) { - return "toText" in node; - } - /** - * This node represents a document fragment, which contains elements, but when - * placed into the DOM doesn't have any representation itself. It only contains - * children and doesn't have any DOM node properties. - */ - var DocumentFragment = class { - constructor(children) { - this.children = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - this.children = children; - this.classes = []; - this.height = 0; - this.depth = 0; - this.maxFontSize = 0; - this.style = {}; - } - hasClass(className) { - return this.classes.includes(className); - } - /** Convert the fragment into a node. */ - toNode() { - var frag = document.createDocumentFragment(); - for (var i = 0; i < this.children.length; i++) frag.appendChild(this.children[i].toNode()); - return frag; - } - /** Convert the fragment into HTML markup. */ - toMarkup() { - var markup = ""; - for (var i = 0; i < this.children.length; i++) markup += this.children[i].toMarkup(); - return markup; - } - /** - * Converts the math node into a string, similar to innerText. Applies to - * MathDomNode's only. - */ - toText() { - return this.children.map((child) => { - if (isMathDomNode(child)) return child.toText(); - throw new Error("Expected MathDomNode with toText, got " + child.constructor.name); - }).join(""); - } - }; - /** - * This file does conversion between units. In particular, it provides - * calculateSize to convert other units into ems. - */ - var ptPerUnit = { - "pt": 1, - "mm": 7227 / 2540, - "cm": 7227 / 254, - "in": 72.27, - "bp": 803 / 800, - "pc": 12, - "dd": 1238 / 1157, - "cc": 14856 / 1157, - "nd": 685 / 642, - "nc": 1370 / 107, - "sp": 1 / 65536, - "px": 803 / 800 - }; - var relativeUnit = { - "ex": true, - "em": true, - "mu": true - }; - /** - * Determine whether the specified unit (either a string defining the unit - * or a "size" parse node containing a unit field) is valid. - */ - var validUnit = function validUnit(unit) { - if (typeof unit !== "string") unit = unit.unit; - return unit in ptPerUnit || unit in relativeUnit || unit === "ex"; - }; - var calculateSize = function calculateSize(sizeValue, options) { - var scale; - if (sizeValue.unit in ptPerUnit) scale = ptPerUnit[sizeValue.unit] / options.fontMetrics().ptPerEm / options.sizeMultiplier; - else if (sizeValue.unit === "mu") scale = options.fontMetrics().cssEmPerMu; - else { - var unitOptions; - if (options.style.isTight()) unitOptions = options.havingStyle(options.style.text()); - else unitOptions = options; - if (sizeValue.unit === "ex") scale = unitOptions.fontMetrics().xHeight; - else if (sizeValue.unit === "em") scale = unitOptions.fontMetrics().quad; - else throw new ParseError("Invalid unit: '" + sizeValue.unit + "'"); - if (unitOptions !== options) scale *= unitOptions.sizeMultiplier / options.sizeMultiplier; - } - return Math.min(sizeValue.number * scale, options.maxSize); - }; - /** - * Round `n` to 4 decimal places, or to the nearest 1/10,000th em. See - * https://github.com/KaTeX/KaTeX/pull/2460. - */ - var makeEm = function makeEm(n) { - return +n.toFixed(4) + "em"; - }; - /** - * These objects store the data about the DOM nodes we create, as well as some - * extra data. They can then be transformed into real DOM nodes with the - * `toNode` function or HTML markup using `toMarkup`. They are useful for both - * storing extra properties on the nodes, as well as providing a way to easily - * work with the DOM. - * - * Similar functions for working with MathML nodes exist in mathMLTree.js. - * - * TODO: refactor `span` and `anchor` into common superclass when - * target environments support class inheritance - */ - /** - * Create an HTML className based on a list of classes. In addition to joining - * with spaces, we also remove empty classes. - */ - var createClass = function createClass(classes) { - return classes.filter((cls) => cls).join(" "); - }; - /** - * Serialize a CssStyle object into a semicolon-delimited inline-style string - * (hyphenating camelCase property names). Returns "" when no property is set. - */ - var cssStyleToString = function cssStyleToString(style) { - var styles = ""; - for (var key of Object.keys(style)) { - var value = style[key]; - if (value !== void 0) styles += hyphenate(key) + ":" + value + ";"; - } - return styles; - }; - var initNode = function initNode(classes, options, style) { - this.classes = classes || []; - this.attributes = {}; - this.height = 0; - this.depth = 0; - this.maxFontSize = 0; - this.style = style || {}; - if (options) { - if (options.style.isTight()) this.classes.push("mtight"); - var color = options.getColor(); - if (color) this.style.color = color; - } - }; - /** - * Convert into an HTML node - */ - var toNode = function toNode(tagName) { - var node = document.createElement(tagName); - node.className = createClass(this.classes); - Object.assign(node.style, this.style); - for (var attr of Object.keys(this.attributes)) node.setAttribute(attr, this.attributes[attr]); - for (var i = 0; i < this.children.length; i++) node.appendChild(this.children[i].toNode()); - return node; - }; - /** - * https://w3c.github.io/html-reference/syntax.html#syntax-attributes - * - * > Attribute Names must consist of one or more characters - * other than the space characters, U+0000 NULL, - * '"', "'", ">", "/", "=", the control characters, - * and any characters that are not defined by Unicode. - */ - var invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/; - /** - * Convert into an HTML markup string - */ - var toMarkup = function toMarkup(tagName) { - var markup = "<" + tagName; - if (this.classes.length) markup += " class=\"" + escape(createClass(this.classes)) + "\""; - var styles = cssStyleToString(this.style); - if (styles) markup += " style=\"" + escape(styles) + "\""; - for (var attr of Object.keys(this.attributes)) { - if (invalidAttributeNameRegex.test(attr)) throw new ParseError("Invalid attribute name '" + attr + "'"); - markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\""; - } - markup += ">"; - for (var i = 0; i < this.children.length; i++) markup += this.children[i].toMarkup(); - markup += "</" + tagName + ">"; - return markup; - }; - /** - * This node represents a span node, with a className, a list of children, and - * an inline style. It also contains information about its height, depth, and - * maxFontSize. - * - * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan - * otherwise. This typesafety is important when HTML builders access a span's - * children. - */ - var Span = class { - constructor(classes, children, options, style) { - this.children = void 0; - this.attributes = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.width = void 0; - this.maxFontSize = void 0; - this.style = void 0; - /** - * Italic correction carried over from a SymbolNode when the symbol is - * wrapped in a vlist (e.g. \oiint / \oiiint). Read by supsub to adjust - * subscript positioning. Only set when nonzero; use `?? 0` at read sites. - */ - this.italic = void 0; - initNode.call(this, classes, options, style); - this.children = children || []; - } - /** - * Sets an arbitrary attribute on the span. Warning: use this wisely. Not - * all browsers support attributes the same, and having too many custom - * attributes is probably bad. - */ - setAttribute(attribute, value) { - this.attributes[attribute] = value; - } - hasClass(className) { - return this.classes.includes(className); - } - toNode() { - return toNode.call(this, "span"); - } - toMarkup() { - return toMarkup.call(this, "span"); - } - }; - /** - * This node represents an anchor (<a>) element with a hyperlink. See `span` - * for further details. - */ - var Anchor = class { - constructor(href, classes, children, options) { - this.children = void 0; - this.attributes = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - initNode.call(this, classes, options); - this.children = children || []; - this.setAttribute("href", href); - } - setAttribute(attribute, value) { - this.attributes[attribute] = value; - } - hasClass(className) { - return this.classes.includes(className); - } - toNode() { - return toNode.call(this, "a"); - } - toMarkup() { - return toMarkup.call(this, "a"); - } - }; - /** - * This node represents an image embed (<img>) element. - */ - var Img = class { - constructor(src, alt, style) { - this.src = void 0; - this.alt = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - this.alt = alt; - this.src = src; - this.classes = ["mord"]; - this.height = 0; - this.depth = 0; - this.maxFontSize = 0; - this.style = style; - } - hasClass(className) { - return this.classes.includes(className); - } - toNode() { - var node = document.createElement("img"); - node.src = this.src; - node.alt = this.alt; - node.className = "mord"; - Object.assign(node.style, this.style); - return node; - } - toMarkup() { - var markup = "<img src=\"" + escape(this.src) + "\"" + (" alt=\"" + escape(this.alt) + "\""); - var styles = cssStyleToString(this.style); - if (styles) markup += " style=\"" + escape(styles) + "\""; - markup += "'/>"; - return markup; - } - }; - var iCombinations = { - "î": "ı̂", - "ï": "ı̈", - "í": "ı́", - "ì": "ı̀" - }; - /** - * A symbol node contains information about a single symbol. It either renders - * to a single text node, or a span with a single text node in it, depending on - * whether it has CSS classes, styles, or needs italic correction. - */ - var SymbolNode = class { - constructor(text, height, depth, italic, skew, width, classes, style) { - this.text = void 0; - this.height = void 0; - this.depth = void 0; - this.italic = void 0; - this.skew = void 0; - this.width = void 0; - this.maxFontSize = void 0; - this.classes = void 0; - this.style = void 0; - this.text = text; - this.height = height || 0; - this.depth = depth || 0; - this.italic = italic || 0; - this.skew = skew || 0; - this.width = width || 0; - this.classes = classes || []; - this.style = style || {}; - this.maxFontSize = 0; - var script = scriptFromCodepoint(this.text.charCodeAt(0)); - if (script) this.classes.push(script + "_fallback"); - if (/[îïíì]/.test(this.text)) this.text = iCombinations[this.text]; - } - hasClass(className) { - return this.classes.includes(className); - } - /** - * Creates a text node or span from a symbol node. Note that a span is only - * created if it is needed. - */ - toNode() { - var node = document.createTextNode(this.text); - var span = null; - if (this.italic > 0) { - span = document.createElement("span"); - span.style.marginRight = makeEm(this.italic); - } - if (this.classes.length > 0) { - span = span || document.createElement("span"); - span.className = createClass(this.classes); - } - if (Object.keys(this.style).length > 0) { - span = span || document.createElement("span"); - Object.assign(span.style, this.style); - } - if (span) { - span.appendChild(node); - return span; - } else return node; - } - /** - * Creates markup for a symbol node. - */ - toMarkup() { - var needsSpan = false; - var markup = "<span"; - if (this.classes.length) { - needsSpan = true; - markup += " class=\""; - markup += escape(createClass(this.classes)); - markup += "\""; - } - var styles = ""; - if (this.italic > 0) styles += "margin-right:" + makeEm(this.italic) + ";"; - styles += cssStyleToString(this.style); - if (styles) { - needsSpan = true; - markup += " style=\"" + escape(styles) + "\""; - } - var escaped = escape(this.text); - if (needsSpan) { - markup += ">"; - markup += escaped; - markup += "</span>"; - return markup; - } else return escaped; - } - }; - /** - * SVG nodes are used to render stretchy wide elements. - */ - var SvgNode = class { - constructor(children, attributes) { - this.children = void 0; - this.attributes = void 0; - this.children = children || []; - this.attributes = attributes || {}; - } - toNode() { - var node = document.createElementNS("http://www.w3.org/2000/svg", "svg"); - for (var attr of Object.keys(this.attributes)) node.setAttribute(attr, this.attributes[attr]); - for (var i = 0; i < this.children.length; i++) node.appendChild(this.children[i].toNode()); - return node; - } - toMarkup() { - var markup = "<svg xmlns=\"http://www.w3.org/2000/svg\""; - for (var attr of Object.keys(this.attributes)) markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\""; - markup += ">"; - for (var i = 0; i < this.children.length; i++) markup += this.children[i].toMarkup(); - markup += "</svg>"; - return markup; - } - }; - var PathNode = class { - constructor(pathName, alternate) { - this.pathName = void 0; - this.alternate = void 0; - this.pathName = pathName; - this.alternate = alternate; - } - toNode() { - var node = document.createElementNS("http://www.w3.org/2000/svg", "path"); - if (this.alternate) node.setAttribute("d", this.alternate); - else node.setAttribute("d", path[this.pathName]); - return node; - } - toMarkup() { - if (this.alternate) return "<path d=\"" + escape(this.alternate) + "\"/>"; - else return "<path d=\"" + escape(path[this.pathName]) + "\"/>"; - } - }; - var LineNode = class { - constructor(attributes) { - this.attributes = void 0; - this.attributes = attributes || {}; - } - toNode() { - var node = document.createElementNS("http://www.w3.org/2000/svg", "line"); - for (var attr of Object.keys(this.attributes)) node.setAttribute(attr, this.attributes[attr]); - return node; - } - toMarkup() { - var markup = "<line"; - for (var attr of Object.keys(this.attributes)) markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\""; - markup += "/>"; - return markup; - } - }; - function assertSymbolDomNode(group) { - if (group instanceof SymbolNode) return group; - else throw new Error("Expected symbolNode but got " + String(group) + "."); - } - function assertSpan(group) { - if (group instanceof Span) return group; - else throw new Error("Expected span<HtmlDomNode> but got " + String(group) + "."); - } - /** - * Whether an HtmlDomNode has HtmlDomNode children. - * HtmlDomNode is a base type representing a union of - * SymbolNode, SvgSpan, DomSpan, Anchor, and documentFragment. - * In the last three cases, the children are HtmlDomNode[]. - */ - var hasHtmlDomChildren = (node) => node instanceof Span || node instanceof Anchor || node instanceof DocumentFragment; - var fontMetricsData = { - "AMS-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "65": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "66": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "67": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "68": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "69": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "70": [ - 0, - .68889, - 0, - 0, - .61111 - ], - "71": [ - 0, - .68889, - 0, - 0, - .77778 - ], - "72": [ - 0, - .68889, - 0, - 0, - .77778 - ], - "73": [ - 0, - .68889, - 0, - 0, - .38889 - ], - "74": [ - .16667, - .68889, - 0, - 0, - .5 - ], - "75": [ - 0, - .68889, - 0, - 0, - .77778 - ], - "76": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "77": [ - 0, - .68889, - 0, - 0, - .94445 - ], - "78": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "79": [ - .16667, - .68889, - 0, - 0, - .77778 - ], - "80": [ - 0, - .68889, - 0, - 0, - .61111 - ], - "81": [ - .16667, - .68889, - 0, - 0, - .77778 - ], - "82": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "83": [ - 0, - .68889, - 0, - 0, - .55556 - ], - "84": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "85": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "86": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "87": [ - 0, - .68889, - 0, - 0, - 1 - ], - "88": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "89": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "90": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "107": [ - 0, - .68889, - 0, - 0, - .55556 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "165": [ - 0, - .675, - .025, - 0, - .75 - ], - "174": [ - .15559, - .69224, - 0, - 0, - .94666 - ], - "240": [ - 0, - .68889, - 0, - 0, - .55556 - ], - "295": [ - 0, - .68889, - 0, - 0, - .54028 - ], - "710": [ - 0, - .825, - 0, - 0, - 2.33334 - ], - "732": [ - 0, - .9, - 0, - 0, - 2.33334 - ], - "770": [ - 0, - .825, - 0, - 0, - 2.33334 - ], - "771": [ - 0, - .9, - 0, - 0, - 2.33334 - ], - "989": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "1008": [ - 0, - .43056, - .04028, - 0, - .66667 - ], - "8245": [ - 0, - .54986, - 0, - 0, - .275 - ], - "8463": [ - 0, - .68889, - 0, - 0, - .54028 - ], - "8487": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "8498": [ - 0, - .68889, - 0, - 0, - .55556 - ], - "8502": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "8503": [ - 0, - .68889, - 0, - 0, - .44445 - ], - "8504": [ - 0, - .68889, - 0, - 0, - .66667 - ], - "8513": [ - 0, - .68889, - 0, - 0, - .63889 - ], - "8592": [ - -.03598, - .46402, - 0, - 0, - .5 - ], - "8594": [ - -.03598, - .46402, - 0, - 0, - .5 - ], - "8602": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8603": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8606": [ - .01354, - .52239, - 0, - 0, - 1 - ], - "8608": [ - .01354, - .52239, - 0, - 0, - 1 - ], - "8610": [ - .01354, - .52239, - 0, - 0, - 1.11111 - ], - "8611": [ - .01354, - .52239, - 0, - 0, - 1.11111 - ], - "8619": [ - 0, - .54986, - 0, - 0, - 1 - ], - "8620": [ - 0, - .54986, - 0, - 0, - 1 - ], - "8621": [ - -.13313, - .37788, - 0, - 0, - 1.38889 - ], - "8622": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8624": [ - 0, - .69224, - 0, - 0, - .5 - ], - "8625": [ - 0, - .69224, - 0, - 0, - .5 - ], - "8630": [ - 0, - .43056, - 0, - 0, - 1 - ], - "8631": [ - 0, - .43056, - 0, - 0, - 1 - ], - "8634": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8635": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8638": [ - .19444, - .69224, - 0, - 0, - .41667 - ], - "8639": [ - .19444, - .69224, - 0, - 0, - .41667 - ], - "8642": [ - .19444, - .69224, - 0, - 0, - .41667 - ], - "8643": [ - .19444, - .69224, - 0, - 0, - .41667 - ], - "8644": [ - .1808, - .675, - 0, - 0, - 1 - ], - "8646": [ - .1808, - .675, - 0, - 0, - 1 - ], - "8647": [ - .1808, - .675, - 0, - 0, - 1 - ], - "8648": [ - .19444, - .69224, - 0, - 0, - .83334 - ], - "8649": [ - .1808, - .675, - 0, - 0, - 1 - ], - "8650": [ - .19444, - .69224, - 0, - 0, - .83334 - ], - "8651": [ - .01354, - .52239, - 0, - 0, - 1 - ], - "8652": [ - .01354, - .52239, - 0, - 0, - 1 - ], - "8653": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8654": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8655": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8666": [ - .13667, - .63667, - 0, - 0, - 1 - ], - "8667": [ - .13667, - .63667, - 0, - 0, - 1 - ], - "8669": [ - -.13313, - .37788, - 0, - 0, - 1 - ], - "8672": [ - -.064, - .437, - 0, - 0, - 1.334 - ], - "8674": [ - -.064, - .437, - 0, - 0, - 1.334 - ], - "8705": [ - 0, - .825, - 0, - 0, - .5 - ], - "8708": [ - 0, - .68889, - 0, - 0, - .55556 - ], - "8709": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8717": [ - 0, - .43056, - 0, - 0, - .42917 - ], - "8722": [ - -.03598, - .46402, - 0, - 0, - .5 - ], - "8724": [ - .08198, - .69224, - 0, - 0, - .77778 - ], - "8726": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8733": [ - 0, - .69224, - 0, - 0, - .77778 - ], - "8736": [ - 0, - .69224, - 0, - 0, - .72222 - ], - "8737": [ - 0, - .69224, - 0, - 0, - .72222 - ], - "8738": [ - .03517, - .52239, - 0, - 0, - .72222 - ], - "8739": [ - .08167, - .58167, - 0, - 0, - .22222 - ], - "8740": [ - .25142, - .74111, - 0, - 0, - .27778 - ], - "8741": [ - .08167, - .58167, - 0, - 0, - .38889 - ], - "8742": [ - .25142, - .74111, - 0, - 0, - .5 - ], - "8756": [ - 0, - .69224, - 0, - 0, - .66667 - ], - "8757": [ - 0, - .69224, - 0, - 0, - .66667 - ], - "8764": [ - -.13313, - .36687, - 0, - 0, - .77778 - ], - "8765": [ - -.13313, - .37788, - 0, - 0, - .77778 - ], - "8769": [ - -.13313, - .36687, - 0, - 0, - .77778 - ], - "8770": [ - -.03625, - .46375, - 0, - 0, - .77778 - ], - "8774": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8776": [ - -.01688, - .48312, - 0, - 0, - .77778 - ], - "8778": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8782": [ - .06062, - .54986, - 0, - 0, - .77778 - ], - "8783": [ - .06062, - .54986, - 0, - 0, - .77778 - ], - "8785": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8786": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8787": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8790": [ - 0, - .69224, - 0, - 0, - .77778 - ], - "8791": [ - .22958, - .72958, - 0, - 0, - .77778 - ], - "8796": [ - .08198, - .91667, - 0, - 0, - .77778 - ], - "8806": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "8807": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "8808": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "8809": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "8812": [ - .25583, - .75583, - 0, - 0, - .5 - ], - "8814": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8815": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8816": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8817": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8818": [ - .22958, - .72958, - 0, - 0, - .77778 - ], - "8819": [ - .22958, - .72958, - 0, - 0, - .77778 - ], - "8822": [ - .1808, - .675, - 0, - 0, - .77778 - ], - "8823": [ - .1808, - .675, - 0, - 0, - .77778 - ], - "8828": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8829": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8830": [ - .22958, - .72958, - 0, - 0, - .77778 - ], - "8831": [ - .22958, - .72958, - 0, - 0, - .77778 - ], - "8832": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8833": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8840": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8841": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8842": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8843": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8847": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8848": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8858": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8859": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8861": [ - .08198, - .58198, - 0, - 0, - .77778 - ], - "8862": [ - 0, - .675, - 0, - 0, - .77778 - ], - "8863": [ - 0, - .675, - 0, - 0, - .77778 - ], - "8864": [ - 0, - .675, - 0, - 0, - .77778 - ], - "8865": [ - 0, - .675, - 0, - 0, - .77778 - ], - "8872": [ - 0, - .69224, - 0, - 0, - .61111 - ], - "8873": [ - 0, - .69224, - 0, - 0, - .72222 - ], - "8874": [ - 0, - .69224, - 0, - 0, - .88889 - ], - "8876": [ - 0, - .68889, - 0, - 0, - .61111 - ], - "8877": [ - 0, - .68889, - 0, - 0, - .61111 - ], - "8878": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "8879": [ - 0, - .68889, - 0, - 0, - .72222 - ], - "8882": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8883": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8884": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8885": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8888": [ - 0, - .54986, - 0, - 0, - 1.11111 - ], - "8890": [ - .19444, - .43056, - 0, - 0, - .55556 - ], - "8891": [ - .19444, - .69224, - 0, - 0, - .61111 - ], - "8892": [ - .19444, - .69224, - 0, - 0, - .61111 - ], - "8901": [ - 0, - .54986, - 0, - 0, - .27778 - ], - "8903": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8905": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8906": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "8907": [ - 0, - .69224, - 0, - 0, - .77778 - ], - "8908": [ - 0, - .69224, - 0, - 0, - .77778 - ], - "8909": [ - -.03598, - .46402, - 0, - 0, - .77778 - ], - "8910": [ - 0, - .54986, - 0, - 0, - .76042 - ], - "8911": [ - 0, - .54986, - 0, - 0, - .76042 - ], - "8912": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8913": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "8914": [ - 0, - .54986, - 0, - 0, - .66667 - ], - "8915": [ - 0, - .54986, - 0, - 0, - .66667 - ], - "8916": [ - 0, - .69224, - 0, - 0, - .66667 - ], - "8918": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8919": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8920": [ - .03517, - .54986, - 0, - 0, - 1.33334 - ], - "8921": [ - .03517, - .54986, - 0, - 0, - 1.33334 - ], - "8922": [ - .38569, - .88569, - 0, - 0, - .77778 - ], - "8923": [ - .38569, - .88569, - 0, - 0, - .77778 - ], - "8926": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8927": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "8928": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8929": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8934": [ - .23222, - .74111, - 0, - 0, - .77778 - ], - "8935": [ - .23222, - .74111, - 0, - 0, - .77778 - ], - "8936": [ - .23222, - .74111, - 0, - 0, - .77778 - ], - "8937": [ - .23222, - .74111, - 0, - 0, - .77778 - ], - "8938": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8939": [ - .20576, - .70576, - 0, - 0, - .77778 - ], - "8940": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8941": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "8994": [ - .19444, - .69224, - 0, - 0, - .77778 - ], - "8995": [ - .19444, - .69224, - 0, - 0, - .77778 - ], - "9416": [ - .15559, - .69224, - 0, - 0, - .90222 - ], - "9484": [ - 0, - .69224, - 0, - 0, - .5 - ], - "9488": [ - 0, - .69224, - 0, - 0, - .5 - ], - "9492": [ - 0, - .37788, - 0, - 0, - .5 - ], - "9496": [ - 0, - .37788, - 0, - 0, - .5 - ], - "9585": [ - .19444, - .68889, - 0, - 0, - .88889 - ], - "9586": [ - .19444, - .74111, - 0, - 0, - .88889 - ], - "9632": [ - 0, - .675, - 0, - 0, - .77778 - ], - "9633": [ - 0, - .675, - 0, - 0, - .77778 - ], - "9650": [ - 0, - .54986, - 0, - 0, - .72222 - ], - "9651": [ - 0, - .54986, - 0, - 0, - .72222 - ], - "9654": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "9660": [ - 0, - .54986, - 0, - 0, - .72222 - ], - "9661": [ - 0, - .54986, - 0, - 0, - .72222 - ], - "9664": [ - .03517, - .54986, - 0, - 0, - .77778 - ], - "9674": [ - .11111, - .69224, - 0, - 0, - .66667 - ], - "9733": [ - .19444, - .69224, - 0, - 0, - .94445 - ], - "10003": [ - 0, - .69224, - 0, - 0, - .83334 - ], - "10016": [ - 0, - .69224, - 0, - 0, - .83334 - ], - "10731": [ - .11111, - .69224, - 0, - 0, - .66667 - ], - "10846": [ - .19444, - .75583, - 0, - 0, - .61111 - ], - "10877": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "10878": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "10885": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "10886": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "10887": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "10888": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "10889": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10890": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10891": [ - .48256, - .98256, - 0, - 0, - .77778 - ], - "10892": [ - .48256, - .98256, - 0, - 0, - .77778 - ], - "10901": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "10902": [ - .13667, - .63667, - 0, - 0, - .77778 - ], - "10933": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "10934": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "10935": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10936": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10937": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10938": [ - .26167, - .75726, - 0, - 0, - .77778 - ], - "10949": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "10950": [ - .25583, - .75583, - 0, - 0, - .77778 - ], - "10955": [ - .28481, - .79383, - 0, - 0, - .77778 - ], - "10956": [ - .28481, - .79383, - 0, - 0, - .77778 - ], - "57350": [ - .08167, - .58167, - 0, - 0, - .22222 - ], - "57351": [ - .08167, - .58167, - 0, - 0, - .38889 - ], - "57352": [ - .08167, - .58167, - 0, - 0, - .77778 - ], - "57353": [ - 0, - .43056, - .04028, - 0, - .66667 - ], - "57356": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57357": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57358": [ - .41951, - .91951, - 0, - 0, - .77778 - ], - "57359": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "57360": [ - .30274, - .79383, - 0, - 0, - .77778 - ], - "57361": [ - .41951, - .91951, - 0, - 0, - .77778 - ], - "57366": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57367": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57368": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57369": [ - .25142, - .75726, - 0, - 0, - .77778 - ], - "57370": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "57371": [ - .13597, - .63597, - 0, - 0, - .77778 - ] - }, - "Caligraphic-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "65": [ - 0, - .68333, - 0, - .19445, - .79847 - ], - "66": [ - 0, - .68333, - .03041, - .13889, - .65681 - ], - "67": [ - 0, - .68333, - .05834, - .13889, - .52653 - ], - "68": [ - 0, - .68333, - .02778, - .08334, - .77139 - ], - "69": [ - 0, - .68333, - .08944, - .11111, - .52778 - ], - "70": [ - 0, - .68333, - .09931, - .11111, - .71875 - ], - "71": [ - .09722, - .68333, - .0593, - .11111, - .59487 - ], - "72": [ - 0, - .68333, - .00965, - .11111, - .84452 - ], - "73": [ - 0, - .68333, - .07382, - 0, - .54452 - ], - "74": [ - .09722, - .68333, - .18472, - .16667, - .67778 - ], - "75": [ - 0, - .68333, - .01445, - .05556, - .76195 - ], - "76": [ - 0, - .68333, - 0, - .13889, - .68972 - ], - "77": [ - 0, - .68333, - 0, - .13889, - 1.2009 - ], - "78": [ - 0, - .68333, - .14736, - .08334, - .82049 - ], - "79": [ - 0, - .68333, - .02778, - .11111, - .79611 - ], - "80": [ - 0, - .68333, - .08222, - .08334, - .69556 - ], - "81": [ - .09722, - .68333, - 0, - .11111, - .81667 - ], - "82": [ - 0, - .68333, - 0, - .08334, - .8475 - ], - "83": [ - 0, - .68333, - .075, - .13889, - .60556 - ], - "84": [ - 0, - .68333, - .25417, - 0, - .54464 - ], - "85": [ - 0, - .68333, - .09931, - .08334, - .62583 - ], - "86": [ - 0, - .68333, - .08222, - 0, - .61278 - ], - "87": [ - 0, - .68333, - .08222, - .08334, - .98778 - ], - "88": [ - 0, - .68333, - .14643, - .13889, - .7133 - ], - "89": [ - .09722, - .68333, - .08222, - .08334, - .66834 - ], - "90": [ - 0, - .68333, - .07944, - .13889, - .72473 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ] - }, - "Fraktur-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69141, - 0, - 0, - .29574 - ], - "34": [ - 0, - .69141, - 0, - 0, - .21471 - ], - "38": [ - 0, - .69141, - 0, - 0, - .73786 - ], - "39": [ - 0, - .69141, - 0, - 0, - .21201 - ], - "40": [ - .24982, - .74947, - 0, - 0, - .38865 - ], - "41": [ - .24982, - .74947, - 0, - 0, - .38865 - ], - "42": [ - 0, - .62119, - 0, - 0, - .27764 - ], - "43": [ - .08319, - .58283, - 0, - 0, - .75623 - ], - "44": [ - 0, - .10803, - 0, - 0, - .27764 - ], - "45": [ - .08319, - .58283, - 0, - 0, - .75623 - ], - "46": [ - 0, - .10803, - 0, - 0, - .27764 - ], - "47": [ - .24982, - .74947, - 0, - 0, - .50181 - ], - "48": [ - 0, - .47534, - 0, - 0, - .50181 - ], - "49": [ - 0, - .47534, - 0, - 0, - .50181 - ], - "50": [ - 0, - .47534, - 0, - 0, - .50181 - ], - "51": [ - .18906, - .47534, - 0, - 0, - .50181 - ], - "52": [ - .18906, - .47534, - 0, - 0, - .50181 - ], - "53": [ - .18906, - .47534, - 0, - 0, - .50181 - ], - "54": [ - 0, - .69141, - 0, - 0, - .50181 - ], - "55": [ - .18906, - .47534, - 0, - 0, - .50181 - ], - "56": [ - 0, - .69141, - 0, - 0, - .50181 - ], - "57": [ - .18906, - .47534, - 0, - 0, - .50181 - ], - "58": [ - 0, - .47534, - 0, - 0, - .21606 - ], - "59": [ - .12604, - .47534, - 0, - 0, - .21606 - ], - "61": [ - -.13099, - .36866, - 0, - 0, - .75623 - ], - "63": [ - 0, - .69141, - 0, - 0, - .36245 - ], - "65": [ - 0, - .69141, - 0, - 0, - .7176 - ], - "66": [ - 0, - .69141, - 0, - 0, - .88397 - ], - "67": [ - 0, - .69141, - 0, - 0, - .61254 - ], - "68": [ - 0, - .69141, - 0, - 0, - .83158 - ], - "69": [ - 0, - .69141, - 0, - 0, - .66278 - ], - "70": [ - .12604, - .69141, - 0, - 0, - .61119 - ], - "71": [ - 0, - .69141, - 0, - 0, - .78539 - ], - "72": [ - .06302, - .69141, - 0, - 0, - .7203 - ], - "73": [ - 0, - .69141, - 0, - 0, - .55448 - ], - "74": [ - .12604, - .69141, - 0, - 0, - .55231 - ], - "75": [ - 0, - .69141, - 0, - 0, - .66845 - ], - "76": [ - 0, - .69141, - 0, - 0, - .66602 - ], - "77": [ - 0, - .69141, - 0, - 0, - 1.04953 - ], - "78": [ - 0, - .69141, - 0, - 0, - .83212 - ], - "79": [ - 0, - .69141, - 0, - 0, - .82699 - ], - "80": [ - .18906, - .69141, - 0, - 0, - .82753 - ], - "81": [ - .03781, - .69141, - 0, - 0, - .82699 - ], - "82": [ - 0, - .69141, - 0, - 0, - .82807 - ], - "83": [ - 0, - .69141, - 0, - 0, - .82861 - ], - "84": [ - 0, - .69141, - 0, - 0, - .66899 - ], - "85": [ - 0, - .69141, - 0, - 0, - .64576 - ], - "86": [ - 0, - .69141, - 0, - 0, - .83131 - ], - "87": [ - 0, - .69141, - 0, - 0, - 1.04602 - ], - "88": [ - 0, - .69141, - 0, - 0, - .71922 - ], - "89": [ - .18906, - .69141, - 0, - 0, - .83293 - ], - "90": [ - .12604, - .69141, - 0, - 0, - .60201 - ], - "91": [ - .24982, - .74947, - 0, - 0, - .27764 - ], - "93": [ - .24982, - .74947, - 0, - 0, - .27764 - ], - "94": [ - 0, - .69141, - 0, - 0, - .49965 - ], - "97": [ - 0, - .47534, - 0, - 0, - .50046 - ], - "98": [ - 0, - .69141, - 0, - 0, - .51315 - ], - "99": [ - 0, - .47534, - 0, - 0, - .38946 - ], - "100": [ - 0, - .62119, - 0, - 0, - .49857 - ], - "101": [ - 0, - .47534, - 0, - 0, - .40053 - ], - "102": [ - .18906, - .69141, - 0, - 0, - .32626 - ], - "103": [ - .18906, - .47534, - 0, - 0, - .5037 - ], - "104": [ - .18906, - .69141, - 0, - 0, - .52126 - ], - "105": [ - 0, - .69141, - 0, - 0, - .27899 - ], - "106": [ - 0, - .69141, - 0, - 0, - .28088 - ], - "107": [ - 0, - .69141, - 0, - 0, - .38946 - ], - "108": [ - 0, - .69141, - 0, - 0, - .27953 - ], - "109": [ - 0, - .47534, - 0, - 0, - .76676 - ], - "110": [ - 0, - .47534, - 0, - 0, - .52666 - ], - "111": [ - 0, - .47534, - 0, - 0, - .48885 - ], - "112": [ - .18906, - .52396, - 0, - 0, - .50046 - ], - "113": [ - .18906, - .47534, - 0, - 0, - .48912 - ], - "114": [ - 0, - .47534, - 0, - 0, - .38919 - ], - "115": [ - 0, - .47534, - 0, - 0, - .44266 - ], - "116": [ - 0, - .62119, - 0, - 0, - .33301 - ], - "117": [ - 0, - .47534, - 0, - 0, - .5172 - ], - "118": [ - 0, - .52396, - 0, - 0, - .5118 - ], - "119": [ - 0, - .52396, - 0, - 0, - .77351 - ], - "120": [ - .18906, - .47534, - 0, - 0, - .38865 - ], - "121": [ - .18906, - .47534, - 0, - 0, - .49884 - ], - "122": [ - .18906, - .47534, - 0, - 0, - .39054 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "8216": [ - 0, - .69141, - 0, - 0, - .21471 - ], - "8217": [ - 0, - .69141, - 0, - 0, - .21471 - ], - "58112": [ - 0, - .62119, - 0, - 0, - .49749 - ], - "58113": [ - 0, - .62119, - 0, - 0, - .4983 - ], - "58114": [ - .18906, - .69141, - 0, - 0, - .33328 - ], - "58115": [ - .18906, - .69141, - 0, - 0, - .32923 - ], - "58116": [ - .18906, - .47534, - 0, - 0, - .50343 - ], - "58117": [ - 0, - .69141, - 0, - 0, - .33301 - ], - "58118": [ - 0, - .62119, - 0, - 0, - .33409 - ], - "58119": [ - 0, - .47534, - 0, - 0, - .50073 - ] - }, - "Main-Bold": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - 0, - 0, - .35 - ], - "34": [ - 0, - .69444, - 0, - 0, - .60278 - ], - "35": [ - .19444, - .69444, - 0, - 0, - .95833 - ], - "36": [ - .05556, - .75, - 0, - 0, - .575 - ], - "37": [ - .05556, - .75, - 0, - 0, - .95833 - ], - "38": [ - 0, - .69444, - 0, - 0, - .89444 - ], - "39": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "40": [ - .25, - .75, - 0, - 0, - .44722 - ], - "41": [ - .25, - .75, - 0, - 0, - .44722 - ], - "42": [ - 0, - .75, - 0, - 0, - .575 - ], - "43": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "44": [ - .19444, - .15556, - 0, - 0, - .31944 - ], - "45": [ - 0, - .44444, - 0, - 0, - .38333 - ], - "46": [ - 0, - .15556, - 0, - 0, - .31944 - ], - "47": [ - .25, - .75, - 0, - 0, - .575 - ], - "48": [ - 0, - .64444, - 0, - 0, - .575 - ], - "49": [ - 0, - .64444, - 0, - 0, - .575 - ], - "50": [ - 0, - .64444, - 0, - 0, - .575 - ], - "51": [ - 0, - .64444, - 0, - 0, - .575 - ], - "52": [ - 0, - .64444, - 0, - 0, - .575 - ], - "53": [ - 0, - .64444, - 0, - 0, - .575 - ], - "54": [ - 0, - .64444, - 0, - 0, - .575 - ], - "55": [ - 0, - .64444, - 0, - 0, - .575 - ], - "56": [ - 0, - .64444, - 0, - 0, - .575 - ], - "57": [ - 0, - .64444, - 0, - 0, - .575 - ], - "58": [ - 0, - .44444, - 0, - 0, - .31944 - ], - "59": [ - .19444, - .44444, - 0, - 0, - .31944 - ], - "60": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "61": [ - -.10889, - .39111, - 0, - 0, - .89444 - ], - "62": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "63": [ - 0, - .69444, - 0, - 0, - .54305 - ], - "64": [ - 0, - .69444, - 0, - 0, - .89444 - ], - "65": [ - 0, - .68611, - 0, - 0, - .86944 - ], - "66": [ - 0, - .68611, - 0, - 0, - .81805 - ], - "67": [ - 0, - .68611, - 0, - 0, - .83055 - ], - "68": [ - 0, - .68611, - 0, - 0, - .88194 - ], - "69": [ - 0, - .68611, - 0, - 0, - .75555 - ], - "70": [ - 0, - .68611, - 0, - 0, - .72361 - ], - "71": [ - 0, - .68611, - 0, - 0, - .90416 - ], - "72": [ - 0, - .68611, - 0, - 0, - .9 - ], - "73": [ - 0, - .68611, - 0, - 0, - .43611 - ], - "74": [ - 0, - .68611, - 0, - 0, - .59444 - ], - "75": [ - 0, - .68611, - 0, - 0, - .90138 - ], - "76": [ - 0, - .68611, - 0, - 0, - .69166 - ], - "77": [ - 0, - .68611, - 0, - 0, - 1.09166 - ], - "78": [ - 0, - .68611, - 0, - 0, - .9 - ], - "79": [ - 0, - .68611, - 0, - 0, - .86388 - ], - "80": [ - 0, - .68611, - 0, - 0, - .78611 - ], - "81": [ - .19444, - .68611, - 0, - 0, - .86388 - ], - "82": [ - 0, - .68611, - 0, - 0, - .8625 - ], - "83": [ - 0, - .68611, - 0, - 0, - .63889 - ], - "84": [ - 0, - .68611, - 0, - 0, - .8 - ], - "85": [ - 0, - .68611, - 0, - 0, - .88472 - ], - "86": [ - 0, - .68611, - .01597, - 0, - .86944 - ], - "87": [ - 0, - .68611, - .01597, - 0, - 1.18888 - ], - "88": [ - 0, - .68611, - 0, - 0, - .86944 - ], - "89": [ - 0, - .68611, - .02875, - 0, - .86944 - ], - "90": [ - 0, - .68611, - 0, - 0, - .70277 - ], - "91": [ - .25, - .75, - 0, - 0, - .31944 - ], - "92": [ - .25, - .75, - 0, - 0, - .575 - ], - "93": [ - .25, - .75, - 0, - 0, - .31944 - ], - "94": [ - 0, - .69444, - 0, - 0, - .575 - ], - "95": [ - .31, - .13444, - .03194, - 0, - .575 - ], - "97": [ - 0, - .44444, - 0, - 0, - .55902 - ], - "98": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "99": [ - 0, - .44444, - 0, - 0, - .51111 - ], - "100": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "101": [ - 0, - .44444, - 0, - 0, - .52708 - ], - "102": [ - 0, - .69444, - .10903, - 0, - .35139 - ], - "103": [ - .19444, - .44444, - .01597, - 0, - .575 - ], - "104": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "105": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "106": [ - .19444, - .69444, - 0, - 0, - .35139 - ], - "107": [ - 0, - .69444, - 0, - 0, - .60694 - ], - "108": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "109": [ - 0, - .44444, - 0, - 0, - .95833 - ], - "110": [ - 0, - .44444, - 0, - 0, - .63889 - ], - "111": [ - 0, - .44444, - 0, - 0, - .575 - ], - "112": [ - .19444, - .44444, - 0, - 0, - .63889 - ], - "113": [ - .19444, - .44444, - 0, - 0, - .60694 - ], - "114": [ - 0, - .44444, - 0, - 0, - .47361 - ], - "115": [ - 0, - .44444, - 0, - 0, - .45361 - ], - "116": [ - 0, - .63492, - 0, - 0, - .44722 - ], - "117": [ - 0, - .44444, - 0, - 0, - .63889 - ], - "118": [ - 0, - .44444, - .01597, - 0, - .60694 - ], - "119": [ - 0, - .44444, - .01597, - 0, - .83055 - ], - "120": [ - 0, - .44444, - 0, - 0, - .60694 - ], - "121": [ - .19444, - .44444, - .01597, - 0, - .60694 - ], - "122": [ - 0, - .44444, - 0, - 0, - .51111 - ], - "123": [ - .25, - .75, - 0, - 0, - .575 - ], - "124": [ - .25, - .75, - 0, - 0, - .31944 - ], - "125": [ - .25, - .75, - 0, - 0, - .575 - ], - "126": [ - .35, - .34444, - 0, - 0, - .575 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "163": [ - 0, - .69444, - 0, - 0, - .86853 - ], - "168": [ - 0, - .69444, - 0, - 0, - .575 - ], - "172": [ - 0, - .44444, - 0, - 0, - .76666 - ], - "176": [ - 0, - .69444, - 0, - 0, - .86944 - ], - "177": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "184": [ - .17014, - 0, - 0, - 0, - .51111 - ], - "198": [ - 0, - .68611, - 0, - 0, - 1.04166 - ], - "215": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "216": [ - .04861, - .73472, - 0, - 0, - .89444 - ], - "223": [ - 0, - .69444, - 0, - 0, - .59722 - ], - "230": [ - 0, - .44444, - 0, - 0, - .83055 - ], - "247": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "248": [ - .09722, - .54167, - 0, - 0, - .575 - ], - "305": [ - 0, - .44444, - 0, - 0, - .31944 - ], - "338": [ - 0, - .68611, - 0, - 0, - 1.16944 - ], - "339": [ - 0, - .44444, - 0, - 0, - .89444 - ], - "567": [ - .19444, - .44444, - 0, - 0, - .35139 - ], - "710": [ - 0, - .69444, - 0, - 0, - .575 - ], - "711": [ - 0, - .63194, - 0, - 0, - .575 - ], - "713": [ - 0, - .59611, - 0, - 0, - .575 - ], - "714": [ - 0, - .69444, - 0, - 0, - .575 - ], - "715": [ - 0, - .69444, - 0, - 0, - .575 - ], - "728": [ - 0, - .69444, - 0, - 0, - .575 - ], - "729": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "730": [ - 0, - .69444, - 0, - 0, - .86944 - ], - "732": [ - 0, - .69444, - 0, - 0, - .575 - ], - "733": [ - 0, - .69444, - 0, - 0, - .575 - ], - "915": [ - 0, - .68611, - 0, - 0, - .69166 - ], - "916": [ - 0, - .68611, - 0, - 0, - .95833 - ], - "920": [ - 0, - .68611, - 0, - 0, - .89444 - ], - "923": [ - 0, - .68611, - 0, - 0, - .80555 - ], - "926": [ - 0, - .68611, - 0, - 0, - .76666 - ], - "928": [ - 0, - .68611, - 0, - 0, - .9 - ], - "931": [ - 0, - .68611, - 0, - 0, - .83055 - ], - "933": [ - 0, - .68611, - 0, - 0, - .89444 - ], - "934": [ - 0, - .68611, - 0, - 0, - .83055 - ], - "936": [ - 0, - .68611, - 0, - 0, - .89444 - ], - "937": [ - 0, - .68611, - 0, - 0, - .83055 - ], - "8211": [ - 0, - .44444, - .03194, - 0, - .575 - ], - "8212": [ - 0, - .44444, - .03194, - 0, - 1.14999 - ], - "8216": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "8217": [ - 0, - .69444, - 0, - 0, - .31944 - ], - "8220": [ - 0, - .69444, - 0, - 0, - .60278 - ], - "8221": [ - 0, - .69444, - 0, - 0, - .60278 - ], - "8224": [ - .19444, - .69444, - 0, - 0, - .51111 - ], - "8225": [ - .19444, - .69444, - 0, - 0, - .51111 - ], - "8242": [ - 0, - .55556, - 0, - 0, - .34444 - ], - "8407": [ - 0, - .72444, - .15486, - 0, - .575 - ], - "8463": [ - 0, - .69444, - 0, - 0, - .66759 - ], - "8465": [ - 0, - .69444, - 0, - 0, - .83055 - ], - "8467": [ - 0, - .69444, - 0, - 0, - .47361 - ], - "8472": [ - .19444, - .44444, - 0, - 0, - .74027 - ], - "8476": [ - 0, - .69444, - 0, - 0, - .83055 - ], - "8501": [ - 0, - .69444, - 0, - 0, - .70277 - ], - "8592": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8593": [ - .19444, - .69444, - 0, - 0, - .575 - ], - "8594": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8595": [ - .19444, - .69444, - 0, - 0, - .575 - ], - "8596": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8597": [ - .25, - .75, - 0, - 0, - .575 - ], - "8598": [ - .19444, - .69444, - 0, - 0, - 1.14999 - ], - "8599": [ - .19444, - .69444, - 0, - 0, - 1.14999 - ], - "8600": [ - .19444, - .69444, - 0, - 0, - 1.14999 - ], - "8601": [ - .19444, - .69444, - 0, - 0, - 1.14999 - ], - "8636": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8637": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8640": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8641": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8656": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8657": [ - .19444, - .69444, - 0, - 0, - .70277 - ], - "8658": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8659": [ - .19444, - .69444, - 0, - 0, - .70277 - ], - "8660": [ - -.10889, - .39111, - 0, - 0, - 1.14999 - ], - "8661": [ - .25, - .75, - 0, - 0, - .70277 - ], - "8704": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "8706": [ - 0, - .69444, - .06389, - 0, - .62847 - ], - "8707": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "8709": [ - .05556, - .75, - 0, - 0, - .575 - ], - "8711": [ - 0, - .68611, - 0, - 0, - .95833 - ], - "8712": [ - .08556, - .58556, - 0, - 0, - .76666 - ], - "8715": [ - .08556, - .58556, - 0, - 0, - .76666 - ], - "8722": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8723": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8725": [ - .25, - .75, - 0, - 0, - .575 - ], - "8726": [ - .25, - .75, - 0, - 0, - .575 - ], - "8727": [ - -.02778, - .47222, - 0, - 0, - .575 - ], - "8728": [ - -.02639, - .47361, - 0, - 0, - .575 - ], - "8729": [ - -.02639, - .47361, - 0, - 0, - .575 - ], - "8730": [ - .18, - .82, - 0, - 0, - .95833 - ], - "8733": [ - 0, - .44444, - 0, - 0, - .89444 - ], - "8734": [ - 0, - .44444, - 0, - 0, - 1.14999 - ], - "8736": [ - 0, - .69224, - 0, - 0, - .72222 - ], - "8739": [ - .25, - .75, - 0, - 0, - .31944 - ], - "8741": [ - .25, - .75, - 0, - 0, - .575 - ], - "8743": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8744": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8745": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8746": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8747": [ - .19444, - .69444, - .12778, - 0, - .56875 - ], - "8764": [ - -.10889, - .39111, - 0, - 0, - .89444 - ], - "8768": [ - .19444, - .69444, - 0, - 0, - .31944 - ], - "8771": [ - .00222, - .50222, - 0, - 0, - .89444 - ], - "8773": [ - .027, - .638, - 0, - 0, - .894 - ], - "8776": [ - .02444, - .52444, - 0, - 0, - .89444 - ], - "8781": [ - .00222, - .50222, - 0, - 0, - .89444 - ], - "8801": [ - .00222, - .50222, - 0, - 0, - .89444 - ], - "8804": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8805": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8810": [ - .08556, - .58556, - 0, - 0, - 1.14999 - ], - "8811": [ - .08556, - .58556, - 0, - 0, - 1.14999 - ], - "8826": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "8827": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "8834": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "8835": [ - .08556, - .58556, - 0, - 0, - .89444 - ], - "8838": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8839": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8846": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8849": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8850": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "8851": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8852": [ - 0, - .55556, - 0, - 0, - .76666 - ], - "8853": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8854": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8855": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8856": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8857": [ - .13333, - .63333, - 0, - 0, - .89444 - ], - "8866": [ - 0, - .69444, - 0, - 0, - .70277 - ], - "8867": [ - 0, - .69444, - 0, - 0, - .70277 - ], - "8868": [ - 0, - .69444, - 0, - 0, - .89444 - ], - "8869": [ - 0, - .69444, - 0, - 0, - .89444 - ], - "8900": [ - -.02639, - .47361, - 0, - 0, - .575 - ], - "8901": [ - -.02639, - .47361, - 0, - 0, - .31944 - ], - "8902": [ - -.02778, - .47222, - 0, - 0, - .575 - ], - "8968": [ - .25, - .75, - 0, - 0, - .51111 - ], - "8969": [ - .25, - .75, - 0, - 0, - .51111 - ], - "8970": [ - .25, - .75, - 0, - 0, - .51111 - ], - "8971": [ - .25, - .75, - 0, - 0, - .51111 - ], - "8994": [ - -.13889, - .36111, - 0, - 0, - 1.14999 - ], - "8995": [ - -.13889, - .36111, - 0, - 0, - 1.14999 - ], - "9651": [ - .19444, - .69444, - 0, - 0, - 1.02222 - ], - "9657": [ - -.02778, - .47222, - 0, - 0, - .575 - ], - "9661": [ - .19444, - .69444, - 0, - 0, - 1.02222 - ], - "9667": [ - -.02778, - .47222, - 0, - 0, - .575 - ], - "9711": [ - .19444, - .69444, - 0, - 0, - 1.14999 - ], - "9824": [ - .12963, - .69444, - 0, - 0, - .89444 - ], - "9825": [ - .12963, - .69444, - 0, - 0, - .89444 - ], - "9826": [ - .12963, - .69444, - 0, - 0, - .89444 - ], - "9827": [ - .12963, - .69444, - 0, - 0, - .89444 - ], - "9837": [ - 0, - .75, - 0, - 0, - .44722 - ], - "9838": [ - .19444, - .69444, - 0, - 0, - .44722 - ], - "9839": [ - .19444, - .69444, - 0, - 0, - .44722 - ], - "10216": [ - .25, - .75, - 0, - 0, - .44722 - ], - "10217": [ - .25, - .75, - 0, - 0, - .44722 - ], - "10815": [ - 0, - .68611, - 0, - 0, - .9 - ], - "10927": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "10928": [ - .19667, - .69667, - 0, - 0, - .89444 - ], - "57376": [ - .19444, - .69444, - 0, - 0, - 0 - ] - }, - "Main-BoldItalic": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - .11417, - 0, - .38611 - ], - "34": [ - 0, - .69444, - .07939, - 0, - .62055 - ], - "35": [ - .19444, - .69444, - .06833, - 0, - .94444 - ], - "37": [ - .05556, - .75, - .12861, - 0, - .94444 - ], - "38": [ - 0, - .69444, - .08528, - 0, - .88555 - ], - "39": [ - 0, - .69444, - .12945, - 0, - .35555 - ], - "40": [ - .25, - .75, - .15806, - 0, - .47333 - ], - "41": [ - .25, - .75, - .03306, - 0, - .47333 - ], - "42": [ - 0, - .75, - .14333, - 0, - .59111 - ], - "43": [ - .10333, - .60333, - .03306, - 0, - .88555 - ], - "44": [ - .19444, - .14722, - 0, - 0, - .35555 - ], - "45": [ - 0, - .44444, - .02611, - 0, - .41444 - ], - "46": [ - 0, - .14722, - 0, - 0, - .35555 - ], - "47": [ - .25, - .75, - .15806, - 0, - .59111 - ], - "48": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "49": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "50": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "51": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "52": [ - .19444, - .64444, - .13167, - 0, - .59111 - ], - "53": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "54": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "55": [ - .19444, - .64444, - .13167, - 0, - .59111 - ], - "56": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "57": [ - 0, - .64444, - .13167, - 0, - .59111 - ], - "58": [ - 0, - .44444, - .06695, - 0, - .35555 - ], - "59": [ - .19444, - .44444, - .06695, - 0, - .35555 - ], - "61": [ - -.10889, - .39111, - .06833, - 0, - .88555 - ], - "63": [ - 0, - .69444, - .11472, - 0, - .59111 - ], - "64": [ - 0, - .69444, - .09208, - 0, - .88555 - ], - "65": [ - 0, - .68611, - 0, - 0, - .86555 - ], - "66": [ - 0, - .68611, - .0992, - 0, - .81666 - ], - "67": [ - 0, - .68611, - .14208, - 0, - .82666 - ], - "68": [ - 0, - .68611, - .09062, - 0, - .87555 - ], - "69": [ - 0, - .68611, - .11431, - 0, - .75666 - ], - "70": [ - 0, - .68611, - .12903, - 0, - .72722 - ], - "71": [ - 0, - .68611, - .07347, - 0, - .89527 - ], - "72": [ - 0, - .68611, - .17208, - 0, - .8961 - ], - "73": [ - 0, - .68611, - .15681, - 0, - .47166 - ], - "74": [ - 0, - .68611, - .145, - 0, - .61055 - ], - "75": [ - 0, - .68611, - .14208, - 0, - .89499 - ], - "76": [ - 0, - .68611, - 0, - 0, - .69777 - ], - "77": [ - 0, - .68611, - .17208, - 0, - 1.07277 - ], - "78": [ - 0, - .68611, - .17208, - 0, - .8961 - ], - "79": [ - 0, - .68611, - .09062, - 0, - .85499 - ], - "80": [ - 0, - .68611, - .0992, - 0, - .78721 - ], - "81": [ - .19444, - .68611, - .09062, - 0, - .85499 - ], - "82": [ - 0, - .68611, - .02559, - 0, - .85944 - ], - "83": [ - 0, - .68611, - .11264, - 0, - .64999 - ], - "84": [ - 0, - .68611, - .12903, - 0, - .7961 - ], - "85": [ - 0, - .68611, - .17208, - 0, - .88083 - ], - "86": [ - 0, - .68611, - .18625, - 0, - .86555 - ], - "87": [ - 0, - .68611, - .18625, - 0, - 1.15999 - ], - "88": [ - 0, - .68611, - .15681, - 0, - .86555 - ], - "89": [ - 0, - .68611, - .19803, - 0, - .86555 - ], - "90": [ - 0, - .68611, - .14208, - 0, - .70888 - ], - "91": [ - .25, - .75, - .1875, - 0, - .35611 - ], - "93": [ - .25, - .75, - .09972, - 0, - .35611 - ], - "94": [ - 0, - .69444, - .06709, - 0, - .59111 - ], - "95": [ - .31, - .13444, - .09811, - 0, - .59111 - ], - "97": [ - 0, - .44444, - .09426, - 0, - .59111 - ], - "98": [ - 0, - .69444, - .07861, - 0, - .53222 - ], - "99": [ - 0, - .44444, - .05222, - 0, - .53222 - ], - "100": [ - 0, - .69444, - .10861, - 0, - .59111 - ], - "101": [ - 0, - .44444, - .085, - 0, - .53222 - ], - "102": [ - .19444, - .69444, - .21778, - 0, - .4 - ], - "103": [ - .19444, - .44444, - .105, - 0, - .53222 - ], - "104": [ - 0, - .69444, - .09426, - 0, - .59111 - ], - "105": [ - 0, - .69326, - .11387, - 0, - .35555 - ], - "106": [ - .19444, - .69326, - .1672, - 0, - .35555 - ], - "107": [ - 0, - .69444, - .11111, - 0, - .53222 - ], - "108": [ - 0, - .69444, - .10861, - 0, - .29666 - ], - "109": [ - 0, - .44444, - .09426, - 0, - .94444 - ], - "110": [ - 0, - .44444, - .09426, - 0, - .64999 - ], - "111": [ - 0, - .44444, - .07861, - 0, - .59111 - ], - "112": [ - .19444, - .44444, - .07861, - 0, - .59111 - ], - "113": [ - .19444, - .44444, - .105, - 0, - .53222 - ], - "114": [ - 0, - .44444, - .11111, - 0, - .50167 - ], - "115": [ - 0, - .44444, - .08167, - 0, - .48694 - ], - "116": [ - 0, - .63492, - .09639, - 0, - .385 - ], - "117": [ - 0, - .44444, - .09426, - 0, - .62055 - ], - "118": [ - 0, - .44444, - .11111, - 0, - .53222 - ], - "119": [ - 0, - .44444, - .11111, - 0, - .76777 - ], - "120": [ - 0, - .44444, - .12583, - 0, - .56055 - ], - "121": [ - .19444, - .44444, - .105, - 0, - .56166 - ], - "122": [ - 0, - .44444, - .13889, - 0, - .49055 - ], - "126": [ - .35, - .34444, - .11472, - 0, - .59111 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "168": [ - 0, - .69444, - .11473, - 0, - .59111 - ], - "176": [ - 0, - .69444, - 0, - 0, - .94888 - ], - "184": [ - .17014, - 0, - 0, - 0, - .53222 - ], - "198": [ - 0, - .68611, - .11431, - 0, - 1.02277 - ], - "216": [ - .04861, - .73472, - .09062, - 0, - .88555 - ], - "223": [ - .19444, - .69444, - .09736, - 0, - .665 - ], - "230": [ - 0, - .44444, - .085, - 0, - .82666 - ], - "248": [ - .09722, - .54167, - .09458, - 0, - .59111 - ], - "305": [ - 0, - .44444, - .09426, - 0, - .35555 - ], - "338": [ - 0, - .68611, - .11431, - 0, - 1.14054 - ], - "339": [ - 0, - .44444, - .085, - 0, - .82666 - ], - "567": [ - .19444, - .44444, - .04611, - 0, - .385 - ], - "710": [ - 0, - .69444, - .06709, - 0, - .59111 - ], - "711": [ - 0, - .63194, - .08271, - 0, - .59111 - ], - "713": [ - 0, - .59444, - .10444, - 0, - .59111 - ], - "714": [ - 0, - .69444, - .08528, - 0, - .59111 - ], - "715": [ - 0, - .69444, - 0, - 0, - .59111 - ], - "728": [ - 0, - .69444, - .10333, - 0, - .59111 - ], - "729": [ - 0, - .69444, - .12945, - 0, - .35555 - ], - "730": [ - 0, - .69444, - 0, - 0, - .94888 - ], - "732": [ - 0, - .69444, - .11472, - 0, - .59111 - ], - "733": [ - 0, - .69444, - .11472, - 0, - .59111 - ], - "915": [ - 0, - .68611, - .12903, - 0, - .69777 - ], - "916": [ - 0, - .68611, - 0, - 0, - .94444 - ], - "920": [ - 0, - .68611, - .09062, - 0, - .88555 - ], - "923": [ - 0, - .68611, - 0, - 0, - .80666 - ], - "926": [ - 0, - .68611, - .15092, - 0, - .76777 - ], - "928": [ - 0, - .68611, - .17208, - 0, - .8961 - ], - "931": [ - 0, - .68611, - .11431, - 0, - .82666 - ], - "933": [ - 0, - .68611, - .10778, - 0, - .88555 - ], - "934": [ - 0, - .68611, - .05632, - 0, - .82666 - ], - "936": [ - 0, - .68611, - .10778, - 0, - .88555 - ], - "937": [ - 0, - .68611, - .0992, - 0, - .82666 - ], - "8211": [ - 0, - .44444, - .09811, - 0, - .59111 - ], - "8212": [ - 0, - .44444, - .09811, - 0, - 1.18221 - ], - "8216": [ - 0, - .69444, - .12945, - 0, - .35555 - ], - "8217": [ - 0, - .69444, - .12945, - 0, - .35555 - ], - "8220": [ - 0, - .69444, - .16772, - 0, - .62055 - ], - "8221": [ - 0, - .69444, - .07939, - 0, - .62055 - ] - }, - "Main-Italic": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - .12417, - 0, - .30667 - ], - "34": [ - 0, - .69444, - .06961, - 0, - .51444 - ], - "35": [ - .19444, - .69444, - .06616, - 0, - .81777 - ], - "37": [ - .05556, - .75, - .13639, - 0, - .81777 - ], - "38": [ - 0, - .69444, - .09694, - 0, - .76666 - ], - "39": [ - 0, - .69444, - .12417, - 0, - .30667 - ], - "40": [ - .25, - .75, - .16194, - 0, - .40889 - ], - "41": [ - .25, - .75, - .03694, - 0, - .40889 - ], - "42": [ - 0, - .75, - .14917, - 0, - .51111 - ], - "43": [ - .05667, - .56167, - .03694, - 0, - .76666 - ], - "44": [ - .19444, - .10556, - 0, - 0, - .30667 - ], - "45": [ - 0, - .43056, - .02826, - 0, - .35778 - ], - "46": [ - 0, - .10556, - 0, - 0, - .30667 - ], - "47": [ - .25, - .75, - .16194, - 0, - .51111 - ], - "48": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "49": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "50": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "51": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "52": [ - .19444, - .64444, - .13556, - 0, - .51111 - ], - "53": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "54": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "55": [ - .19444, - .64444, - .13556, - 0, - .51111 - ], - "56": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "57": [ - 0, - .64444, - .13556, - 0, - .51111 - ], - "58": [ - 0, - .43056, - .0582, - 0, - .30667 - ], - "59": [ - .19444, - .43056, - .0582, - 0, - .30667 - ], - "61": [ - -.13313, - .36687, - .06616, - 0, - .76666 - ], - "63": [ - 0, - .69444, - .1225, - 0, - .51111 - ], - "64": [ - 0, - .69444, - .09597, - 0, - .76666 - ], - "65": [ - 0, - .68333, - 0, - 0, - .74333 - ], - "66": [ - 0, - .68333, - .10257, - 0, - .70389 - ], - "67": [ - 0, - .68333, - .14528, - 0, - .71555 - ], - "68": [ - 0, - .68333, - .09403, - 0, - .755 - ], - "69": [ - 0, - .68333, - .12028, - 0, - .67833 - ], - "70": [ - 0, - .68333, - .13305, - 0, - .65277 - ], - "71": [ - 0, - .68333, - .08722, - 0, - .77361 - ], - "72": [ - 0, - .68333, - .16389, - 0, - .74333 - ], - "73": [ - 0, - .68333, - .15806, - 0, - .38555 - ], - "74": [ - 0, - .68333, - .14028, - 0, - .525 - ], - "75": [ - 0, - .68333, - .14528, - 0, - .76888 - ], - "76": [ - 0, - .68333, - 0, - 0, - .62722 - ], - "77": [ - 0, - .68333, - .16389, - 0, - .89666 - ], - "78": [ - 0, - .68333, - .16389, - 0, - .74333 - ], - "79": [ - 0, - .68333, - .09403, - 0, - .76666 - ], - "80": [ - 0, - .68333, - .10257, - 0, - .67833 - ], - "81": [ - .19444, - .68333, - .09403, - 0, - .76666 - ], - "82": [ - 0, - .68333, - .03868, - 0, - .72944 - ], - "83": [ - 0, - .68333, - .11972, - 0, - .56222 - ], - "84": [ - 0, - .68333, - .13305, - 0, - .71555 - ], - "85": [ - 0, - .68333, - .16389, - 0, - .74333 - ], - "86": [ - 0, - .68333, - .18361, - 0, - .74333 - ], - "87": [ - 0, - .68333, - .18361, - 0, - .99888 - ], - "88": [ - 0, - .68333, - .15806, - 0, - .74333 - ], - "89": [ - 0, - .68333, - .19383, - 0, - .74333 - ], - "90": [ - 0, - .68333, - .14528, - 0, - .61333 - ], - "91": [ - .25, - .75, - .1875, - 0, - .30667 - ], - "93": [ - .25, - .75, - .10528, - 0, - .30667 - ], - "94": [ - 0, - .69444, - .06646, - 0, - .51111 - ], - "95": [ - .31, - .12056, - .09208, - 0, - .51111 - ], - "97": [ - 0, - .43056, - .07671, - 0, - .51111 - ], - "98": [ - 0, - .69444, - .06312, - 0, - .46 - ], - "99": [ - 0, - .43056, - .05653, - 0, - .46 - ], - "100": [ - 0, - .69444, - .10333, - 0, - .51111 - ], - "101": [ - 0, - .43056, - .07514, - 0, - .46 - ], - "102": [ - .19444, - .69444, - .21194, - 0, - .30667 - ], - "103": [ - .19444, - .43056, - .08847, - 0, - .46 - ], - "104": [ - 0, - .69444, - .07671, - 0, - .51111 - ], - "105": [ - 0, - .65536, - .1019, - 0, - .30667 - ], - "106": [ - .19444, - .65536, - .14467, - 0, - .30667 - ], - "107": [ - 0, - .69444, - .10764, - 0, - .46 - ], - "108": [ - 0, - .69444, - .10333, - 0, - .25555 - ], - "109": [ - 0, - .43056, - .07671, - 0, - .81777 - ], - "110": [ - 0, - .43056, - .07671, - 0, - .56222 - ], - "111": [ - 0, - .43056, - .06312, - 0, - .51111 - ], - "112": [ - .19444, - .43056, - .06312, - 0, - .51111 - ], - "113": [ - .19444, - .43056, - .08847, - 0, - .46 - ], - "114": [ - 0, - .43056, - .10764, - 0, - .42166 - ], - "115": [ - 0, - .43056, - .08208, - 0, - .40889 - ], - "116": [ - 0, - .61508, - .09486, - 0, - .33222 - ], - "117": [ - 0, - .43056, - .07671, - 0, - .53666 - ], - "118": [ - 0, - .43056, - .10764, - 0, - .46 - ], - "119": [ - 0, - .43056, - .10764, - 0, - .66444 - ], - "120": [ - 0, - .43056, - .12042, - 0, - .46389 - ], - "121": [ - .19444, - .43056, - .08847, - 0, - .48555 - ], - "122": [ - 0, - .43056, - .12292, - 0, - .40889 - ], - "126": [ - .35, - .31786, - .11585, - 0, - .51111 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "168": [ - 0, - .66786, - .10474, - 0, - .51111 - ], - "176": [ - 0, - .69444, - 0, - 0, - .83129 - ], - "184": [ - .17014, - 0, - 0, - 0, - .46 - ], - "198": [ - 0, - .68333, - .12028, - 0, - .88277 - ], - "216": [ - .04861, - .73194, - .09403, - 0, - .76666 - ], - "223": [ - .19444, - .69444, - .10514, - 0, - .53666 - ], - "230": [ - 0, - .43056, - .07514, - 0, - .71555 - ], - "248": [ - .09722, - .52778, - .09194, - 0, - .51111 - ], - "338": [ - 0, - .68333, - .12028, - 0, - .98499 - ], - "339": [ - 0, - .43056, - .07514, - 0, - .71555 - ], - "710": [ - 0, - .69444, - .06646, - 0, - .51111 - ], - "711": [ - 0, - .62847, - .08295, - 0, - .51111 - ], - "713": [ - 0, - .56167, - .10333, - 0, - .51111 - ], - "714": [ - 0, - .69444, - .09694, - 0, - .51111 - ], - "715": [ - 0, - .69444, - 0, - 0, - .51111 - ], - "728": [ - 0, - .69444, - .10806, - 0, - .51111 - ], - "729": [ - 0, - .66786, - .11752, - 0, - .30667 - ], - "730": [ - 0, - .69444, - 0, - 0, - .83129 - ], - "732": [ - 0, - .66786, - .11585, - 0, - .51111 - ], - "733": [ - 0, - .69444, - .1225, - 0, - .51111 - ], - "915": [ - 0, - .68333, - .13305, - 0, - .62722 - ], - "916": [ - 0, - .68333, - 0, - 0, - .81777 - ], - "920": [ - 0, - .68333, - .09403, - 0, - .76666 - ], - "923": [ - 0, - .68333, - 0, - 0, - .69222 - ], - "926": [ - 0, - .68333, - .15294, - 0, - .66444 - ], - "928": [ - 0, - .68333, - .16389, - 0, - .74333 - ], - "931": [ - 0, - .68333, - .12028, - 0, - .71555 - ], - "933": [ - 0, - .68333, - .11111, - 0, - .76666 - ], - "934": [ - 0, - .68333, - .05986, - 0, - .71555 - ], - "936": [ - 0, - .68333, - .11111, - 0, - .76666 - ], - "937": [ - 0, - .68333, - .10257, - 0, - .71555 - ], - "8211": [ - 0, - .43056, - .09208, - 0, - .51111 - ], - "8212": [ - 0, - .43056, - .09208, - 0, - 1.02222 - ], - "8216": [ - 0, - .69444, - .12417, - 0, - .30667 - ], - "8217": [ - 0, - .69444, - .12417, - 0, - .30667 - ], - "8220": [ - 0, - .69444, - .1685, - 0, - .51444 - ], - "8221": [ - 0, - .69444, - .06961, - 0, - .51444 - ], - "8463": [ - 0, - .68889, - 0, - 0, - .54028 - ] - }, - "Main-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "34": [ - 0, - .69444, - 0, - 0, - .5 - ], - "35": [ - .19444, - .69444, - 0, - 0, - .83334 - ], - "36": [ - .05556, - .75, - 0, - 0, - .5 - ], - "37": [ - .05556, - .75, - 0, - 0, - .83334 - ], - "38": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "39": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "40": [ - .25, - .75, - 0, - 0, - .38889 - ], - "41": [ - .25, - .75, - 0, - 0, - .38889 - ], - "42": [ - 0, - .75, - 0, - 0, - .5 - ], - "43": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "44": [ - .19444, - .10556, - 0, - 0, - .27778 - ], - "45": [ - 0, - .43056, - 0, - 0, - .33333 - ], - "46": [ - 0, - .10556, - 0, - 0, - .27778 - ], - "47": [ - .25, - .75, - 0, - 0, - .5 - ], - "48": [ - 0, - .64444, - 0, - 0, - .5 - ], - "49": [ - 0, - .64444, - 0, - 0, - .5 - ], - "50": [ - 0, - .64444, - 0, - 0, - .5 - ], - "51": [ - 0, - .64444, - 0, - 0, - .5 - ], - "52": [ - 0, - .64444, - 0, - 0, - .5 - ], - "53": [ - 0, - .64444, - 0, - 0, - .5 - ], - "54": [ - 0, - .64444, - 0, - 0, - .5 - ], - "55": [ - 0, - .64444, - 0, - 0, - .5 - ], - "56": [ - 0, - .64444, - 0, - 0, - .5 - ], - "57": [ - 0, - .64444, - 0, - 0, - .5 - ], - "58": [ - 0, - .43056, - 0, - 0, - .27778 - ], - "59": [ - .19444, - .43056, - 0, - 0, - .27778 - ], - "60": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "61": [ - -.13313, - .36687, - 0, - 0, - .77778 - ], - "62": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "63": [ - 0, - .69444, - 0, - 0, - .47222 - ], - "64": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "65": [ - 0, - .68333, - 0, - 0, - .75 - ], - "66": [ - 0, - .68333, - 0, - 0, - .70834 - ], - "67": [ - 0, - .68333, - 0, - 0, - .72222 - ], - "68": [ - 0, - .68333, - 0, - 0, - .76389 - ], - "69": [ - 0, - .68333, - 0, - 0, - .68056 - ], - "70": [ - 0, - .68333, - 0, - 0, - .65278 - ], - "71": [ - 0, - .68333, - 0, - 0, - .78472 - ], - "72": [ - 0, - .68333, - 0, - 0, - .75 - ], - "73": [ - 0, - .68333, - 0, - 0, - .36111 - ], - "74": [ - 0, - .68333, - 0, - 0, - .51389 - ], - "75": [ - 0, - .68333, - 0, - 0, - .77778 - ], - "76": [ - 0, - .68333, - 0, - 0, - .625 - ], - "77": [ - 0, - .68333, - 0, - 0, - .91667 - ], - "78": [ - 0, - .68333, - 0, - 0, - .75 - ], - "79": [ - 0, - .68333, - 0, - 0, - .77778 - ], - "80": [ - 0, - .68333, - 0, - 0, - .68056 - ], - "81": [ - .19444, - .68333, - 0, - 0, - .77778 - ], - "82": [ - 0, - .68333, - 0, - 0, - .73611 - ], - "83": [ - 0, - .68333, - 0, - 0, - .55556 - ], - "84": [ - 0, - .68333, - 0, - 0, - .72222 - ], - "85": [ - 0, - .68333, - 0, - 0, - .75 - ], - "86": [ - 0, - .68333, - .01389, - 0, - .75 - ], - "87": [ - 0, - .68333, - .01389, - 0, - 1.02778 - ], - "88": [ - 0, - .68333, - 0, - 0, - .75 - ], - "89": [ - 0, - .68333, - .025, - 0, - .75 - ], - "90": [ - 0, - .68333, - 0, - 0, - .61111 - ], - "91": [ - .25, - .75, - 0, - 0, - .27778 - ], - "92": [ - .25, - .75, - 0, - 0, - .5 - ], - "93": [ - .25, - .75, - 0, - 0, - .27778 - ], - "94": [ - 0, - .69444, - 0, - 0, - .5 - ], - "95": [ - .31, - .12056, - .02778, - 0, - .5 - ], - "97": [ - 0, - .43056, - 0, - 0, - .5 - ], - "98": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "99": [ - 0, - .43056, - 0, - 0, - .44445 - ], - "100": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "101": [ - 0, - .43056, - 0, - 0, - .44445 - ], - "102": [ - 0, - .69444, - .07778, - 0, - .30556 - ], - "103": [ - .19444, - .43056, - .01389, - 0, - .5 - ], - "104": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "105": [ - 0, - .66786, - 0, - 0, - .27778 - ], - "106": [ - .19444, - .66786, - 0, - 0, - .30556 - ], - "107": [ - 0, - .69444, - 0, - 0, - .52778 - ], - "108": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "109": [ - 0, - .43056, - 0, - 0, - .83334 - ], - "110": [ - 0, - .43056, - 0, - 0, - .55556 - ], - "111": [ - 0, - .43056, - 0, - 0, - .5 - ], - "112": [ - .19444, - .43056, - 0, - 0, - .55556 - ], - "113": [ - .19444, - .43056, - 0, - 0, - .52778 - ], - "114": [ - 0, - .43056, - 0, - 0, - .39167 - ], - "115": [ - 0, - .43056, - 0, - 0, - .39445 - ], - "116": [ - 0, - .61508, - 0, - 0, - .38889 - ], - "117": [ - 0, - .43056, - 0, - 0, - .55556 - ], - "118": [ - 0, - .43056, - .01389, - 0, - .52778 - ], - "119": [ - 0, - .43056, - .01389, - 0, - .72222 - ], - "120": [ - 0, - .43056, - 0, - 0, - .52778 - ], - "121": [ - .19444, - .43056, - .01389, - 0, - .52778 - ], - "122": [ - 0, - .43056, - 0, - 0, - .44445 - ], - "123": [ - .25, - .75, - 0, - 0, - .5 - ], - "124": [ - .25, - .75, - 0, - 0, - .27778 - ], - "125": [ - .25, - .75, - 0, - 0, - .5 - ], - "126": [ - .35, - .31786, - 0, - 0, - .5 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "163": [ - 0, - .69444, - 0, - 0, - .76909 - ], - "167": [ - .19444, - .69444, - 0, - 0, - .44445 - ], - "168": [ - 0, - .66786, - 0, - 0, - .5 - ], - "172": [ - 0, - .43056, - 0, - 0, - .66667 - ], - "176": [ - 0, - .69444, - 0, - 0, - .75 - ], - "177": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "182": [ - .19444, - .69444, - 0, - 0, - .61111 - ], - "184": [ - .17014, - 0, - 0, - 0, - .44445 - ], - "198": [ - 0, - .68333, - 0, - 0, - .90278 - ], - "215": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "216": [ - .04861, - .73194, - 0, - 0, - .77778 - ], - "223": [ - 0, - .69444, - 0, - 0, - .5 - ], - "230": [ - 0, - .43056, - 0, - 0, - .72222 - ], - "247": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "248": [ - .09722, - .52778, - 0, - 0, - .5 - ], - "305": [ - 0, - .43056, - 0, - 0, - .27778 - ], - "338": [ - 0, - .68333, - 0, - 0, - 1.01389 - ], - "339": [ - 0, - .43056, - 0, - 0, - .77778 - ], - "567": [ - .19444, - .43056, - 0, - 0, - .30556 - ], - "710": [ - 0, - .69444, - 0, - 0, - .5 - ], - "711": [ - 0, - .62847, - 0, - 0, - .5 - ], - "713": [ - 0, - .56778, - 0, - 0, - .5 - ], - "714": [ - 0, - .69444, - 0, - 0, - .5 - ], - "715": [ - 0, - .69444, - 0, - 0, - .5 - ], - "728": [ - 0, - .69444, - 0, - 0, - .5 - ], - "729": [ - 0, - .66786, - 0, - 0, - .27778 - ], - "730": [ - 0, - .69444, - 0, - 0, - .75 - ], - "732": [ - 0, - .66786, - 0, - 0, - .5 - ], - "733": [ - 0, - .69444, - 0, - 0, - .5 - ], - "915": [ - 0, - .68333, - 0, - 0, - .625 - ], - "916": [ - 0, - .68333, - 0, - 0, - .83334 - ], - "920": [ - 0, - .68333, - 0, - 0, - .77778 - ], - "923": [ - 0, - .68333, - 0, - 0, - .69445 - ], - "926": [ - 0, - .68333, - 0, - 0, - .66667 - ], - "928": [ - 0, - .68333, - 0, - 0, - .75 - ], - "931": [ - 0, - .68333, - 0, - 0, - .72222 - ], - "933": [ - 0, - .68333, - 0, - 0, - .77778 - ], - "934": [ - 0, - .68333, - 0, - 0, - .72222 - ], - "936": [ - 0, - .68333, - 0, - 0, - .77778 - ], - "937": [ - 0, - .68333, - 0, - 0, - .72222 - ], - "8211": [ - 0, - .43056, - .02778, - 0, - .5 - ], - "8212": [ - 0, - .43056, - .02778, - 0, - 1 - ], - "8216": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "8217": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "8220": [ - 0, - .69444, - 0, - 0, - .5 - ], - "8221": [ - 0, - .69444, - 0, - 0, - .5 - ], - "8224": [ - .19444, - .69444, - 0, - 0, - .44445 - ], - "8225": [ - .19444, - .69444, - 0, - 0, - .44445 - ], - "8230": [ - 0, - .123, - 0, - 0, - 1.172 - ], - "8242": [ - 0, - .55556, - 0, - 0, - .275 - ], - "8407": [ - 0, - .71444, - .15382, - 0, - .5 - ], - "8463": [ - 0, - .68889, - 0, - 0, - .54028 - ], - "8465": [ - 0, - .69444, - 0, - 0, - .72222 - ], - "8467": [ - 0, - .69444, - 0, - .11111, - .41667 - ], - "8472": [ - .19444, - .43056, - 0, - .11111, - .63646 - ], - "8476": [ - 0, - .69444, - 0, - 0, - .72222 - ], - "8501": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "8592": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8593": [ - .19444, - .69444, - 0, - 0, - .5 - ], - "8594": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8595": [ - .19444, - .69444, - 0, - 0, - .5 - ], - "8596": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8597": [ - .25, - .75, - 0, - 0, - .5 - ], - "8598": [ - .19444, - .69444, - 0, - 0, - 1 - ], - "8599": [ - .19444, - .69444, - 0, - 0, - 1 - ], - "8600": [ - .19444, - .69444, - 0, - 0, - 1 - ], - "8601": [ - .19444, - .69444, - 0, - 0, - 1 - ], - "8614": [ - .011, - .511, - 0, - 0, - 1 - ], - "8617": [ - .011, - .511, - 0, - 0, - 1.126 - ], - "8618": [ - .011, - .511, - 0, - 0, - 1.126 - ], - "8636": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8637": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8640": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8641": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8652": [ - .011, - .671, - 0, - 0, - 1 - ], - "8656": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8657": [ - .19444, - .69444, - 0, - 0, - .61111 - ], - "8658": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8659": [ - .19444, - .69444, - 0, - 0, - .61111 - ], - "8660": [ - -.13313, - .36687, - 0, - 0, - 1 - ], - "8661": [ - .25, - .75, - 0, - 0, - .61111 - ], - "8704": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "8706": [ - 0, - .69444, - .05556, - .08334, - .5309 - ], - "8707": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "8709": [ - .05556, - .75, - 0, - 0, - .5 - ], - "8711": [ - 0, - .68333, - 0, - 0, - .83334 - ], - "8712": [ - .0391, - .5391, - 0, - 0, - .66667 - ], - "8715": [ - .0391, - .5391, - 0, - 0, - .66667 - ], - "8722": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8723": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8725": [ - .25, - .75, - 0, - 0, - .5 - ], - "8726": [ - .25, - .75, - 0, - 0, - .5 - ], - "8727": [ - -.03472, - .46528, - 0, - 0, - .5 - ], - "8728": [ - -.05555, - .44445, - 0, - 0, - .5 - ], - "8729": [ - -.05555, - .44445, - 0, - 0, - .5 - ], - "8730": [ - .2, - .8, - 0, - 0, - .83334 - ], - "8733": [ - 0, - .43056, - 0, - 0, - .77778 - ], - "8734": [ - 0, - .43056, - 0, - 0, - 1 - ], - "8736": [ - 0, - .69224, - 0, - 0, - .72222 - ], - "8739": [ - .25, - .75, - 0, - 0, - .27778 - ], - "8741": [ - .25, - .75, - 0, - 0, - .5 - ], - "8743": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8744": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8745": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8746": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8747": [ - .19444, - .69444, - .11111, - 0, - .41667 - ], - "8764": [ - -.13313, - .36687, - 0, - 0, - .77778 - ], - "8768": [ - .19444, - .69444, - 0, - 0, - .27778 - ], - "8771": [ - -.03625, - .46375, - 0, - 0, - .77778 - ], - "8773": [ - -.022, - .589, - 0, - 0, - .778 - ], - "8776": [ - -.01688, - .48312, - 0, - 0, - .77778 - ], - "8781": [ - -.03625, - .46375, - 0, - 0, - .77778 - ], - "8784": [ - -.133, - .673, - 0, - 0, - .778 - ], - "8801": [ - -.03625, - .46375, - 0, - 0, - .77778 - ], - "8804": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8805": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8810": [ - .0391, - .5391, - 0, - 0, - 1 - ], - "8811": [ - .0391, - .5391, - 0, - 0, - 1 - ], - "8826": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8827": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8834": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8835": [ - .0391, - .5391, - 0, - 0, - .77778 - ], - "8838": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8839": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8846": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8849": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8850": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "8851": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8852": [ - 0, - .55556, - 0, - 0, - .66667 - ], - "8853": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8854": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8855": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8856": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8857": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "8866": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "8867": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "8868": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "8869": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "8872": [ - .249, - .75, - 0, - 0, - .867 - ], - "8900": [ - -.05555, - .44445, - 0, - 0, - .5 - ], - "8901": [ - -.05555, - .44445, - 0, - 0, - .27778 - ], - "8902": [ - -.03472, - .46528, - 0, - 0, - .5 - ], - "8904": [ - .005, - .505, - 0, - 0, - .9 - ], - "8942": [ - .03, - .903, - 0, - 0, - .278 - ], - "8943": [ - -.19, - .313, - 0, - 0, - 1.172 - ], - "8945": [ - -.1, - .823, - 0, - 0, - 1.282 - ], - "8968": [ - .25, - .75, - 0, - 0, - .44445 - ], - "8969": [ - .25, - .75, - 0, - 0, - .44445 - ], - "8970": [ - .25, - .75, - 0, - 0, - .44445 - ], - "8971": [ - .25, - .75, - 0, - 0, - .44445 - ], - "8994": [ - -.14236, - .35764, - 0, - 0, - 1 - ], - "8995": [ - -.14236, - .35764, - 0, - 0, - 1 - ], - "9136": [ - .244, - .744, - 0, - 0, - .412 - ], - "9137": [ - .244, - .745, - 0, - 0, - .412 - ], - "9651": [ - .19444, - .69444, - 0, - 0, - .88889 - ], - "9657": [ - -.03472, - .46528, - 0, - 0, - .5 - ], - "9661": [ - .19444, - .69444, - 0, - 0, - .88889 - ], - "9667": [ - -.03472, - .46528, - 0, - 0, - .5 - ], - "9711": [ - .19444, - .69444, - 0, - 0, - 1 - ], - "9824": [ - .12963, - .69444, - 0, - 0, - .77778 - ], - "9825": [ - .12963, - .69444, - 0, - 0, - .77778 - ], - "9826": [ - .12963, - .69444, - 0, - 0, - .77778 - ], - "9827": [ - .12963, - .69444, - 0, - 0, - .77778 - ], - "9837": [ - 0, - .75, - 0, - 0, - .38889 - ], - "9838": [ - .19444, - .69444, - 0, - 0, - .38889 - ], - "9839": [ - .19444, - .69444, - 0, - 0, - .38889 - ], - "10216": [ - .25, - .75, - 0, - 0, - .38889 - ], - "10217": [ - .25, - .75, - 0, - 0, - .38889 - ], - "10222": [ - .244, - .744, - 0, - 0, - .412 - ], - "10223": [ - .244, - .745, - 0, - 0, - .412 - ], - "10229": [ - .011, - .511, - 0, - 0, - 1.609 - ], - "10230": [ - .011, - .511, - 0, - 0, - 1.638 - ], - "10231": [ - .011, - .511, - 0, - 0, - 1.859 - ], - "10232": [ - .024, - .525, - 0, - 0, - 1.609 - ], - "10233": [ - .024, - .525, - 0, - 0, - 1.638 - ], - "10234": [ - .024, - .525, - 0, - 0, - 1.858 - ], - "10236": [ - .011, - .511, - 0, - 0, - 1.638 - ], - "10815": [ - 0, - .68333, - 0, - 0, - .75 - ], - "10927": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "10928": [ - .13597, - .63597, - 0, - 0, - .77778 - ], - "57376": [ - .19444, - .69444, - 0, - 0, - 0 - ] - }, - "Math-BoldItalic": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "48": [ - 0, - .44444, - 0, - 0, - .575 - ], - "49": [ - 0, - .44444, - 0, - 0, - .575 - ], - "50": [ - 0, - .44444, - 0, - 0, - .575 - ], - "51": [ - .19444, - .44444, - 0, - 0, - .575 - ], - "52": [ - .19444, - .44444, - 0, - 0, - .575 - ], - "53": [ - .19444, - .44444, - 0, - 0, - .575 - ], - "54": [ - 0, - .64444, - 0, - 0, - .575 - ], - "55": [ - .19444, - .44444, - 0, - 0, - .575 - ], - "56": [ - 0, - .64444, - 0, - 0, - .575 - ], - "57": [ - .19444, - .44444, - 0, - 0, - .575 - ], - "65": [ - 0, - .68611, - 0, - 0, - .86944 - ], - "66": [ - 0, - .68611, - .04835, - 0, - .8664 - ], - "67": [ - 0, - .68611, - .06979, - 0, - .81694 - ], - "68": [ - 0, - .68611, - .03194, - 0, - .93812 - ], - "69": [ - 0, - .68611, - .05451, - 0, - .81007 - ], - "70": [ - 0, - .68611, - .15972, - 0, - .68889 - ], - "71": [ - 0, - .68611, - 0, - 0, - .88673 - ], - "72": [ - 0, - .68611, - .08229, - 0, - .98229 - ], - "73": [ - 0, - .68611, - .07778, - 0, - .51111 - ], - "74": [ - 0, - .68611, - .10069, - 0, - .63125 - ], - "75": [ - 0, - .68611, - .06979, - 0, - .97118 - ], - "76": [ - 0, - .68611, - 0, - 0, - .75555 - ], - "77": [ - 0, - .68611, - .11424, - 0, - 1.14201 - ], - "78": [ - 0, - .68611, - .11424, - 0, - .95034 - ], - "79": [ - 0, - .68611, - .03194, - 0, - .83666 - ], - "80": [ - 0, - .68611, - .15972, - 0, - .72309 - ], - "81": [ - .19444, - .68611, - 0, - 0, - .86861 - ], - "82": [ - 0, - .68611, - .00421, - 0, - .87235 - ], - "83": [ - 0, - .68611, - .05382, - 0, - .69271 - ], - "84": [ - 0, - .68611, - .15972, - 0, - .63663 - ], - "85": [ - 0, - .68611, - .11424, - 0, - .80027 - ], - "86": [ - 0, - .68611, - .25555, - 0, - .67778 - ], - "87": [ - 0, - .68611, - .15972, - 0, - 1.09305 - ], - "88": [ - 0, - .68611, - .07778, - 0, - .94722 - ], - "89": [ - 0, - .68611, - .25555, - 0, - .67458 - ], - "90": [ - 0, - .68611, - .06979, - 0, - .77257 - ], - "97": [ - 0, - .44444, - 0, - 0, - .63287 - ], - "98": [ - 0, - .69444, - 0, - 0, - .52083 - ], - "99": [ - 0, - .44444, - 0, - 0, - .51342 - ], - "100": [ - 0, - .69444, - 0, - 0, - .60972 - ], - "101": [ - 0, - .44444, - 0, - 0, - .55361 - ], - "102": [ - .19444, - .69444, - .11042, - 0, - .56806 - ], - "103": [ - .19444, - .44444, - .03704, - 0, - .5449 - ], - "104": [ - 0, - .69444, - 0, - 0, - .66759 - ], - "105": [ - 0, - .69326, - 0, - 0, - .4048 - ], - "106": [ - .19444, - .69326, - .0622, - 0, - .47083 - ], - "107": [ - 0, - .69444, - .01852, - 0, - .6037 - ], - "108": [ - 0, - .69444, - .0088, - 0, - .34815 - ], - "109": [ - 0, - .44444, - 0, - 0, - 1.0324 - ], - "110": [ - 0, - .44444, - 0, - 0, - .71296 - ], - "111": [ - 0, - .44444, - 0, - 0, - .58472 - ], - "112": [ - .19444, - .44444, - 0, - 0, - .60092 - ], - "113": [ - .19444, - .44444, - .03704, - 0, - .54213 - ], - "114": [ - 0, - .44444, - .03194, - 0, - .5287 - ], - "115": [ - 0, - .44444, - 0, - 0, - .53125 - ], - "116": [ - 0, - .63492, - 0, - 0, - .41528 - ], - "117": [ - 0, - .44444, - 0, - 0, - .68102 - ], - "118": [ - 0, - .44444, - .03704, - 0, - .56666 - ], - "119": [ - 0, - .44444, - .02778, - 0, - .83148 - ], - "120": [ - 0, - .44444, - 0, - 0, - .65903 - ], - "121": [ - .19444, - .44444, - .03704, - 0, - .59028 - ], - "122": [ - 0, - .44444, - .04213, - 0, - .55509 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "915": [ - 0, - .68611, - .15972, - 0, - .65694 - ], - "916": [ - 0, - .68611, - 0, - 0, - .95833 - ], - "920": [ - 0, - .68611, - .03194, - 0, - .86722 - ], - "923": [ - 0, - .68611, - 0, - 0, - .80555 - ], - "926": [ - 0, - .68611, - .07458, - 0, - .84125 - ], - "928": [ - 0, - .68611, - .08229, - 0, - .98229 - ], - "931": [ - 0, - .68611, - .05451, - 0, - .88507 - ], - "933": [ - 0, - .68611, - .15972, - 0, - .67083 - ], - "934": [ - 0, - .68611, - 0, - 0, - .76666 - ], - "936": [ - 0, - .68611, - .11653, - 0, - .71402 - ], - "937": [ - 0, - .68611, - .04835, - 0, - .8789 - ], - "945": [ - 0, - .44444, - 0, - 0, - .76064 - ], - "946": [ - .19444, - .69444, - .03403, - 0, - .65972 - ], - "947": [ - .19444, - .44444, - .06389, - 0, - .59003 - ], - "948": [ - 0, - .69444, - .03819, - 0, - .52222 - ], - "949": [ - 0, - .44444, - 0, - 0, - .52882 - ], - "950": [ - .19444, - .69444, - .06215, - 0, - .50833 - ], - "951": [ - .19444, - .44444, - .03704, - 0, - .6 - ], - "952": [ - 0, - .69444, - .03194, - 0, - .5618 - ], - "953": [ - 0, - .44444, - 0, - 0, - .41204 - ], - "954": [ - 0, - .44444, - 0, - 0, - .66759 - ], - "955": [ - 0, - .69444, - 0, - 0, - .67083 - ], - "956": [ - .19444, - .44444, - 0, - 0, - .70787 - ], - "957": [ - 0, - .44444, - .06898, - 0, - .57685 - ], - "958": [ - .19444, - .69444, - .03021, - 0, - .50833 - ], - "959": [ - 0, - .44444, - 0, - 0, - .58472 - ], - "960": [ - 0, - .44444, - .03704, - 0, - .68241 - ], - "961": [ - .19444, - .44444, - 0, - 0, - .6118 - ], - "962": [ - .09722, - .44444, - .07917, - 0, - .42361 - ], - "963": [ - 0, - .44444, - .03704, - 0, - .68588 - ], - "964": [ - 0, - .44444, - .13472, - 0, - .52083 - ], - "965": [ - 0, - .44444, - .03704, - 0, - .63055 - ], - "966": [ - .19444, - .44444, - 0, - 0, - .74722 - ], - "967": [ - .19444, - .44444, - 0, - 0, - .71805 - ], - "968": [ - .19444, - .69444, - .03704, - 0, - .75833 - ], - "969": [ - 0, - .44444, - .03704, - 0, - .71782 - ], - "977": [ - 0, - .69444, - 0, - 0, - .69155 - ], - "981": [ - .19444, - .69444, - 0, - 0, - .7125 - ], - "982": [ - 0, - .44444, - .03194, - 0, - .975 - ], - "1009": [ - .19444, - .44444, - 0, - 0, - .6118 - ], - "1013": [ - 0, - .44444, - 0, - 0, - .48333 - ], - "57649": [ - 0, - .44444, - 0, - 0, - .39352 - ], - "57911": [ - .19444, - .44444, - 0, - 0, - .43889 - ] - }, - "Math-Italic": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "48": [ - 0, - .43056, - 0, - 0, - .5 - ], - "49": [ - 0, - .43056, - 0, - 0, - .5 - ], - "50": [ - 0, - .43056, - 0, - 0, - .5 - ], - "51": [ - .19444, - .43056, - 0, - 0, - .5 - ], - "52": [ - .19444, - .43056, - 0, - 0, - .5 - ], - "53": [ - .19444, - .43056, - 0, - 0, - .5 - ], - "54": [ - 0, - .64444, - 0, - 0, - .5 - ], - "55": [ - .19444, - .43056, - 0, - 0, - .5 - ], - "56": [ - 0, - .64444, - 0, - 0, - .5 - ], - "57": [ - .19444, - .43056, - 0, - 0, - .5 - ], - "65": [ - 0, - .68333, - 0, - .13889, - .75 - ], - "66": [ - 0, - .68333, - .05017, - .08334, - .75851 - ], - "67": [ - 0, - .68333, - .07153, - .08334, - .71472 - ], - "68": [ - 0, - .68333, - .02778, - .05556, - .82792 - ], - "69": [ - 0, - .68333, - .05764, - .08334, - .7382 - ], - "70": [ - 0, - .68333, - .13889, - .08334, - .64306 - ], - "71": [ - 0, - .68333, - 0, - .08334, - .78625 - ], - "72": [ - 0, - .68333, - .08125, - .05556, - .83125 - ], - "73": [ - 0, - .68333, - .07847, - .11111, - .43958 - ], - "74": [ - 0, - .68333, - .09618, - .16667, - .55451 - ], - "75": [ - 0, - .68333, - .07153, - .05556, - .84931 - ], - "76": [ - 0, - .68333, - 0, - .02778, - .68056 - ], - "77": [ - 0, - .68333, - .10903, - .08334, - .97014 - ], - "78": [ - 0, - .68333, - .10903, - .08334, - .80347 - ], - "79": [ - 0, - .68333, - .02778, - .08334, - .76278 - ], - "80": [ - 0, - .68333, - .13889, - .08334, - .64201 - ], - "81": [ - .19444, - .68333, - 0, - .08334, - .79056 - ], - "82": [ - 0, - .68333, - .00773, - .08334, - .75929 - ], - "83": [ - 0, - .68333, - .05764, - .08334, - .6132 - ], - "84": [ - 0, - .68333, - .13889, - .08334, - .58438 - ], - "85": [ - 0, - .68333, - .10903, - .02778, - .68278 - ], - "86": [ - 0, - .68333, - .22222, - 0, - .58333 - ], - "87": [ - 0, - .68333, - .13889, - 0, - .94445 - ], - "88": [ - 0, - .68333, - .07847, - .08334, - .82847 - ], - "89": [ - 0, - .68333, - .22222, - 0, - .58056 - ], - "90": [ - 0, - .68333, - .07153, - .08334, - .68264 - ], - "97": [ - 0, - .43056, - 0, - 0, - .52859 - ], - "98": [ - 0, - .69444, - 0, - 0, - .42917 - ], - "99": [ - 0, - .43056, - 0, - .05556, - .43276 - ], - "100": [ - 0, - .69444, - 0, - .16667, - .52049 - ], - "101": [ - 0, - .43056, - 0, - .05556, - .46563 - ], - "102": [ - .19444, - .69444, - .10764, - .16667, - .48959 - ], - "103": [ - .19444, - .43056, - .03588, - .02778, - .47697 - ], - "104": [ - 0, - .69444, - 0, - 0, - .57616 - ], - "105": [ - 0, - .65952, - 0, - 0, - .34451 - ], - "106": [ - .19444, - .65952, - .05724, - 0, - .41181 - ], - "107": [ - 0, - .69444, - .03148, - 0, - .5206 - ], - "108": [ - 0, - .69444, - .01968, - .08334, - .29838 - ], - "109": [ - 0, - .43056, - 0, - 0, - .87801 - ], - "110": [ - 0, - .43056, - 0, - 0, - .60023 - ], - "111": [ - 0, - .43056, - 0, - .05556, - .48472 - ], - "112": [ - .19444, - .43056, - 0, - .08334, - .50313 - ], - "113": [ - .19444, - .43056, - .03588, - .08334, - .44641 - ], - "114": [ - 0, - .43056, - .02778, - .05556, - .45116 - ], - "115": [ - 0, - .43056, - 0, - .05556, - .46875 - ], - "116": [ - 0, - .61508, - 0, - .08334, - .36111 - ], - "117": [ - 0, - .43056, - 0, - .02778, - .57246 - ], - "118": [ - 0, - .43056, - .03588, - .02778, - .48472 - ], - "119": [ - 0, - .43056, - .02691, - .08334, - .71592 - ], - "120": [ - 0, - .43056, - 0, - .02778, - .57153 - ], - "121": [ - .19444, - .43056, - .03588, - .05556, - .49028 - ], - "122": [ - 0, - .43056, - .04398, - .05556, - .46505 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "915": [ - 0, - .68333, - .13889, - .08334, - .61528 - ], - "916": [ - 0, - .68333, - 0, - .16667, - .83334 - ], - "920": [ - 0, - .68333, - .02778, - .08334, - .76278 - ], - "923": [ - 0, - .68333, - 0, - .16667, - .69445 - ], - "926": [ - 0, - .68333, - .07569, - .08334, - .74236 - ], - "928": [ - 0, - .68333, - .08125, - .05556, - .83125 - ], - "931": [ - 0, - .68333, - .05764, - .08334, - .77986 - ], - "933": [ - 0, - .68333, - .13889, - .05556, - .58333 - ], - "934": [ - 0, - .68333, - 0, - .08334, - .66667 - ], - "936": [ - 0, - .68333, - .11, - .05556, - .61222 - ], - "937": [ - 0, - .68333, - .05017, - .08334, - .7724 - ], - "945": [ - 0, - .43056, - .0037, - .02778, - .6397 - ], - "946": [ - .19444, - .69444, - .05278, - .08334, - .56563 - ], - "947": [ - .19444, - .43056, - .05556, - 0, - .51773 - ], - "948": [ - 0, - .69444, - .03785, - .05556, - .44444 - ], - "949": [ - 0, - .43056, - 0, - .08334, - .46632 - ], - "950": [ - .19444, - .69444, - .07378, - .08334, - .4375 - ], - "951": [ - .19444, - .43056, - .03588, - .05556, - .49653 - ], - "952": [ - 0, - .69444, - .02778, - .08334, - .46944 - ], - "953": [ - 0, - .43056, - 0, - .05556, - .35394 - ], - "954": [ - 0, - .43056, - 0, - 0, - .57616 - ], - "955": [ - 0, - .69444, - 0, - 0, - .58334 - ], - "956": [ - .19444, - .43056, - 0, - .02778, - .60255 - ], - "957": [ - 0, - .43056, - .06366, - .02778, - .49398 - ], - "958": [ - .19444, - .69444, - .04601, - .11111, - .4375 - ], - "959": [ - 0, - .43056, - 0, - .05556, - .48472 - ], - "960": [ - 0, - .43056, - .03588, - 0, - .57003 - ], - "961": [ - .19444, - .43056, - 0, - .08334, - .51702 - ], - "962": [ - .09722, - .43056, - .07986, - .08334, - .36285 - ], - "963": [ - 0, - .43056, - .03588, - 0, - .57141 - ], - "964": [ - 0, - .43056, - .1132, - .02778, - .43715 - ], - "965": [ - 0, - .43056, - .03588, - .02778, - .54028 - ], - "966": [ - .19444, - .43056, - 0, - .08334, - .65417 - ], - "967": [ - .19444, - .43056, - 0, - .05556, - .62569 - ], - "968": [ - .19444, - .69444, - .03588, - .11111, - .65139 - ], - "969": [ - 0, - .43056, - .03588, - 0, - .62245 - ], - "977": [ - 0, - .69444, - 0, - .08334, - .59144 - ], - "981": [ - .19444, - .69444, - 0, - .08334, - .59583 - ], - "982": [ - 0, - .43056, - .02778, - 0, - .82813 - ], - "1009": [ - .19444, - .43056, - 0, - .08334, - .51702 - ], - "1013": [ - 0, - .43056, - 0, - .05556, - .4059 - ], - "57649": [ - 0, - .43056, - 0, - .02778, - .32246 - ], - "57911": [ - .19444, - .43056, - 0, - .08334, - .38403 - ] - }, - "SansSerif-Bold": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - 0, - 0, - .36667 - ], - "34": [ - 0, - .69444, - 0, - 0, - .55834 - ], - "35": [ - .19444, - .69444, - 0, - 0, - .91667 - ], - "36": [ - .05556, - .75, - 0, - 0, - .55 - ], - "37": [ - .05556, - .75, - 0, - 0, - 1.02912 - ], - "38": [ - 0, - .69444, - 0, - 0, - .83056 - ], - "39": [ - 0, - .69444, - 0, - 0, - .30556 - ], - "40": [ - .25, - .75, - 0, - 0, - .42778 - ], - "41": [ - .25, - .75, - 0, - 0, - .42778 - ], - "42": [ - 0, - .75, - 0, - 0, - .55 - ], - "43": [ - .11667, - .61667, - 0, - 0, - .85556 - ], - "44": [ - .10556, - .13056, - 0, - 0, - .30556 - ], - "45": [ - 0, - .45833, - 0, - 0, - .36667 - ], - "46": [ - 0, - .13056, - 0, - 0, - .30556 - ], - "47": [ - .25, - .75, - 0, - 0, - .55 - ], - "48": [ - 0, - .69444, - 0, - 0, - .55 - ], - "49": [ - 0, - .69444, - 0, - 0, - .55 - ], - "50": [ - 0, - .69444, - 0, - 0, - .55 - ], - "51": [ - 0, - .69444, - 0, - 0, - .55 - ], - "52": [ - 0, - .69444, - 0, - 0, - .55 - ], - "53": [ - 0, - .69444, - 0, - 0, - .55 - ], - "54": [ - 0, - .69444, - 0, - 0, - .55 - ], - "55": [ - 0, - .69444, - 0, - 0, - .55 - ], - "56": [ - 0, - .69444, - 0, - 0, - .55 - ], - "57": [ - 0, - .69444, - 0, - 0, - .55 - ], - "58": [ - 0, - .45833, - 0, - 0, - .30556 - ], - "59": [ - .10556, - .45833, - 0, - 0, - .30556 - ], - "61": [ - -.09375, - .40625, - 0, - 0, - .85556 - ], - "63": [ - 0, - .69444, - 0, - 0, - .51945 - ], - "64": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "65": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "66": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "67": [ - 0, - .69444, - 0, - 0, - .70278 - ], - "68": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "69": [ - 0, - .69444, - 0, - 0, - .64167 - ], - "70": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "71": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "72": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "73": [ - 0, - .69444, - 0, - 0, - .33056 - ], - "74": [ - 0, - .69444, - 0, - 0, - .51945 - ], - "75": [ - 0, - .69444, - 0, - 0, - .76389 - ], - "76": [ - 0, - .69444, - 0, - 0, - .58056 - ], - "77": [ - 0, - .69444, - 0, - 0, - .97778 - ], - "78": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "79": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "80": [ - 0, - .69444, - 0, - 0, - .70278 - ], - "81": [ - .10556, - .69444, - 0, - 0, - .79445 - ], - "82": [ - 0, - .69444, - 0, - 0, - .70278 - ], - "83": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "84": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "85": [ - 0, - .69444, - 0, - 0, - .76389 - ], - "86": [ - 0, - .69444, - .01528, - 0, - .73334 - ], - "87": [ - 0, - .69444, - .01528, - 0, - 1.03889 - ], - "88": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "89": [ - 0, - .69444, - .0275, - 0, - .73334 - ], - "90": [ - 0, - .69444, - 0, - 0, - .67223 - ], - "91": [ - .25, - .75, - 0, - 0, - .34306 - ], - "93": [ - .25, - .75, - 0, - 0, - .34306 - ], - "94": [ - 0, - .69444, - 0, - 0, - .55 - ], - "95": [ - .35, - .10833, - .03056, - 0, - .55 - ], - "97": [ - 0, - .45833, - 0, - 0, - .525 - ], - "98": [ - 0, - .69444, - 0, - 0, - .56111 - ], - "99": [ - 0, - .45833, - 0, - 0, - .48889 - ], - "100": [ - 0, - .69444, - 0, - 0, - .56111 - ], - "101": [ - 0, - .45833, - 0, - 0, - .51111 - ], - "102": [ - 0, - .69444, - .07639, - 0, - .33611 - ], - "103": [ - .19444, - .45833, - .01528, - 0, - .55 - ], - "104": [ - 0, - .69444, - 0, - 0, - .56111 - ], - "105": [ - 0, - .69444, - 0, - 0, - .25556 - ], - "106": [ - .19444, - .69444, - 0, - 0, - .28611 - ], - "107": [ - 0, - .69444, - 0, - 0, - .53056 - ], - "108": [ - 0, - .69444, - 0, - 0, - .25556 - ], - "109": [ - 0, - .45833, - 0, - 0, - .86667 - ], - "110": [ - 0, - .45833, - 0, - 0, - .56111 - ], - "111": [ - 0, - .45833, - 0, - 0, - .55 - ], - "112": [ - .19444, - .45833, - 0, - 0, - .56111 - ], - "113": [ - .19444, - .45833, - 0, - 0, - .56111 - ], - "114": [ - 0, - .45833, - .01528, - 0, - .37222 - ], - "115": [ - 0, - .45833, - 0, - 0, - .42167 - ], - "116": [ - 0, - .58929, - 0, - 0, - .40417 - ], - "117": [ - 0, - .45833, - 0, - 0, - .56111 - ], - "118": [ - 0, - .45833, - .01528, - 0, - .5 - ], - "119": [ - 0, - .45833, - .01528, - 0, - .74445 - ], - "120": [ - 0, - .45833, - 0, - 0, - .5 - ], - "121": [ - .19444, - .45833, - .01528, - 0, - .5 - ], - "122": [ - 0, - .45833, - 0, - 0, - .47639 - ], - "126": [ - .35, - .34444, - 0, - 0, - .55 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "168": [ - 0, - .69444, - 0, - 0, - .55 - ], - "176": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "180": [ - 0, - .69444, - 0, - 0, - .55 - ], - "184": [ - .17014, - 0, - 0, - 0, - .48889 - ], - "305": [ - 0, - .45833, - 0, - 0, - .25556 - ], - "567": [ - .19444, - .45833, - 0, - 0, - .28611 - ], - "710": [ - 0, - .69444, - 0, - 0, - .55 - ], - "711": [ - 0, - .63542, - 0, - 0, - .55 - ], - "713": [ - 0, - .63778, - 0, - 0, - .55 - ], - "728": [ - 0, - .69444, - 0, - 0, - .55 - ], - "729": [ - 0, - .69444, - 0, - 0, - .30556 - ], - "730": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "732": [ - 0, - .69444, - 0, - 0, - .55 - ], - "733": [ - 0, - .69444, - 0, - 0, - .55 - ], - "915": [ - 0, - .69444, - 0, - 0, - .58056 - ], - "916": [ - 0, - .69444, - 0, - 0, - .91667 - ], - "920": [ - 0, - .69444, - 0, - 0, - .85556 - ], - "923": [ - 0, - .69444, - 0, - 0, - .67223 - ], - "926": [ - 0, - .69444, - 0, - 0, - .73334 - ], - "928": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "931": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "933": [ - 0, - .69444, - 0, - 0, - .85556 - ], - "934": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "936": [ - 0, - .69444, - 0, - 0, - .85556 - ], - "937": [ - 0, - .69444, - 0, - 0, - .79445 - ], - "8211": [ - 0, - .45833, - .03056, - 0, - .55 - ], - "8212": [ - 0, - .45833, - .03056, - 0, - 1.10001 - ], - "8216": [ - 0, - .69444, - 0, - 0, - .30556 - ], - "8217": [ - 0, - .69444, - 0, - 0, - .30556 - ], - "8220": [ - 0, - .69444, - 0, - 0, - .55834 - ], - "8221": [ - 0, - .69444, - 0, - 0, - .55834 - ] - }, - "SansSerif-Italic": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - .05733, - 0, - .31945 - ], - "34": [ - 0, - .69444, - .00316, - 0, - .5 - ], - "35": [ - .19444, - .69444, - .05087, - 0, - .83334 - ], - "36": [ - .05556, - .75, - .11156, - 0, - .5 - ], - "37": [ - .05556, - .75, - .03126, - 0, - .83334 - ], - "38": [ - 0, - .69444, - .03058, - 0, - .75834 - ], - "39": [ - 0, - .69444, - .07816, - 0, - .27778 - ], - "40": [ - .25, - .75, - .13164, - 0, - .38889 - ], - "41": [ - .25, - .75, - .02536, - 0, - .38889 - ], - "42": [ - 0, - .75, - .11775, - 0, - .5 - ], - "43": [ - .08333, - .58333, - .02536, - 0, - .77778 - ], - "44": [ - .125, - .08333, - 0, - 0, - .27778 - ], - "45": [ - 0, - .44444, - .01946, - 0, - .33333 - ], - "46": [ - 0, - .08333, - 0, - 0, - .27778 - ], - "47": [ - .25, - .75, - .13164, - 0, - .5 - ], - "48": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "49": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "50": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "51": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "52": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "53": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "54": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "55": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "56": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "57": [ - 0, - .65556, - .11156, - 0, - .5 - ], - "58": [ - 0, - .44444, - .02502, - 0, - .27778 - ], - "59": [ - .125, - .44444, - .02502, - 0, - .27778 - ], - "61": [ - -.13, - .37, - .05087, - 0, - .77778 - ], - "63": [ - 0, - .69444, - .11809, - 0, - .47222 - ], - "64": [ - 0, - .69444, - .07555, - 0, - .66667 - ], - "65": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "66": [ - 0, - .69444, - .08293, - 0, - .66667 - ], - "67": [ - 0, - .69444, - .11983, - 0, - .63889 - ], - "68": [ - 0, - .69444, - .07555, - 0, - .72223 - ], - "69": [ - 0, - .69444, - .11983, - 0, - .59722 - ], - "70": [ - 0, - .69444, - .13372, - 0, - .56945 - ], - "71": [ - 0, - .69444, - .11983, - 0, - .66667 - ], - "72": [ - 0, - .69444, - .08094, - 0, - .70834 - ], - "73": [ - 0, - .69444, - .13372, - 0, - .27778 - ], - "74": [ - 0, - .69444, - .08094, - 0, - .47222 - ], - "75": [ - 0, - .69444, - .11983, - 0, - .69445 - ], - "76": [ - 0, - .69444, - 0, - 0, - .54167 - ], - "77": [ - 0, - .69444, - .08094, - 0, - .875 - ], - "78": [ - 0, - .69444, - .08094, - 0, - .70834 - ], - "79": [ - 0, - .69444, - .07555, - 0, - .73611 - ], - "80": [ - 0, - .69444, - .08293, - 0, - .63889 - ], - "81": [ - .125, - .69444, - .07555, - 0, - .73611 - ], - "82": [ - 0, - .69444, - .08293, - 0, - .64584 - ], - "83": [ - 0, - .69444, - .09205, - 0, - .55556 - ], - "84": [ - 0, - .69444, - .13372, - 0, - .68056 - ], - "85": [ - 0, - .69444, - .08094, - 0, - .6875 - ], - "86": [ - 0, - .69444, - .1615, - 0, - .66667 - ], - "87": [ - 0, - .69444, - .1615, - 0, - .94445 - ], - "88": [ - 0, - .69444, - .13372, - 0, - .66667 - ], - "89": [ - 0, - .69444, - .17261, - 0, - .66667 - ], - "90": [ - 0, - .69444, - .11983, - 0, - .61111 - ], - "91": [ - .25, - .75, - .15942, - 0, - .28889 - ], - "93": [ - .25, - .75, - .08719, - 0, - .28889 - ], - "94": [ - 0, - .69444, - .0799, - 0, - .5 - ], - "95": [ - .35, - .09444, - .08616, - 0, - .5 - ], - "97": [ - 0, - .44444, - .00981, - 0, - .48056 - ], - "98": [ - 0, - .69444, - .03057, - 0, - .51667 - ], - "99": [ - 0, - .44444, - .08336, - 0, - .44445 - ], - "100": [ - 0, - .69444, - .09483, - 0, - .51667 - ], - "101": [ - 0, - .44444, - .06778, - 0, - .44445 - ], - "102": [ - 0, - .69444, - .21705, - 0, - .30556 - ], - "103": [ - .19444, - .44444, - .10836, - 0, - .5 - ], - "104": [ - 0, - .69444, - .01778, - 0, - .51667 - ], - "105": [ - 0, - .67937, - .09718, - 0, - .23889 - ], - "106": [ - .19444, - .67937, - .09162, - 0, - .26667 - ], - "107": [ - 0, - .69444, - .08336, - 0, - .48889 - ], - "108": [ - 0, - .69444, - .09483, - 0, - .23889 - ], - "109": [ - 0, - .44444, - .01778, - 0, - .79445 - ], - "110": [ - 0, - .44444, - .01778, - 0, - .51667 - ], - "111": [ - 0, - .44444, - .06613, - 0, - .5 - ], - "112": [ - .19444, - .44444, - .0389, - 0, - .51667 - ], - "113": [ - .19444, - .44444, - .04169, - 0, - .51667 - ], - "114": [ - 0, - .44444, - .10836, - 0, - .34167 - ], - "115": [ - 0, - .44444, - .0778, - 0, - .38333 - ], - "116": [ - 0, - .57143, - .07225, - 0, - .36111 - ], - "117": [ - 0, - .44444, - .04169, - 0, - .51667 - ], - "118": [ - 0, - .44444, - .10836, - 0, - .46111 - ], - "119": [ - 0, - .44444, - .10836, - 0, - .68334 - ], - "120": [ - 0, - .44444, - .09169, - 0, - .46111 - ], - "121": [ - .19444, - .44444, - .10836, - 0, - .46111 - ], - "122": [ - 0, - .44444, - .08752, - 0, - .43472 - ], - "126": [ - .35, - .32659, - .08826, - 0, - .5 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "168": [ - 0, - .67937, - .06385, - 0, - .5 - ], - "176": [ - 0, - .69444, - 0, - 0, - .73752 - ], - "184": [ - .17014, - 0, - 0, - 0, - .44445 - ], - "305": [ - 0, - .44444, - .04169, - 0, - .23889 - ], - "567": [ - .19444, - .44444, - .04169, - 0, - .26667 - ], - "710": [ - 0, - .69444, - .0799, - 0, - .5 - ], - "711": [ - 0, - .63194, - .08432, - 0, - .5 - ], - "713": [ - 0, - .60889, - .08776, - 0, - .5 - ], - "714": [ - 0, - .69444, - .09205, - 0, - .5 - ], - "715": [ - 0, - .69444, - 0, - 0, - .5 - ], - "728": [ - 0, - .69444, - .09483, - 0, - .5 - ], - "729": [ - 0, - .67937, - .07774, - 0, - .27778 - ], - "730": [ - 0, - .69444, - 0, - 0, - .73752 - ], - "732": [ - 0, - .67659, - .08826, - 0, - .5 - ], - "733": [ - 0, - .69444, - .09205, - 0, - .5 - ], - "915": [ - 0, - .69444, - .13372, - 0, - .54167 - ], - "916": [ - 0, - .69444, - 0, - 0, - .83334 - ], - "920": [ - 0, - .69444, - .07555, - 0, - .77778 - ], - "923": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "926": [ - 0, - .69444, - .12816, - 0, - .66667 - ], - "928": [ - 0, - .69444, - .08094, - 0, - .70834 - ], - "931": [ - 0, - .69444, - .11983, - 0, - .72222 - ], - "933": [ - 0, - .69444, - .09031, - 0, - .77778 - ], - "934": [ - 0, - .69444, - .04603, - 0, - .72222 - ], - "936": [ - 0, - .69444, - .09031, - 0, - .77778 - ], - "937": [ - 0, - .69444, - .08293, - 0, - .72222 - ], - "8211": [ - 0, - .44444, - .08616, - 0, - .5 - ], - "8212": [ - 0, - .44444, - .08616, - 0, - 1 - ], - "8216": [ - 0, - .69444, - .07816, - 0, - .27778 - ], - "8217": [ - 0, - .69444, - .07816, - 0, - .27778 - ], - "8220": [ - 0, - .69444, - .14205, - 0, - .5 - ], - "8221": [ - 0, - .69444, - .00316, - 0, - .5 - ] - }, - "SansSerif-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "33": [ - 0, - .69444, - 0, - 0, - .31945 - ], - "34": [ - 0, - .69444, - 0, - 0, - .5 - ], - "35": [ - .19444, - .69444, - 0, - 0, - .83334 - ], - "36": [ - .05556, - .75, - 0, - 0, - .5 - ], - "37": [ - .05556, - .75, - 0, - 0, - .83334 - ], - "38": [ - 0, - .69444, - 0, - 0, - .75834 - ], - "39": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "40": [ - .25, - .75, - 0, - 0, - .38889 - ], - "41": [ - .25, - .75, - 0, - 0, - .38889 - ], - "42": [ - 0, - .75, - 0, - 0, - .5 - ], - "43": [ - .08333, - .58333, - 0, - 0, - .77778 - ], - "44": [ - .125, - .08333, - 0, - 0, - .27778 - ], - "45": [ - 0, - .44444, - 0, - 0, - .33333 - ], - "46": [ - 0, - .08333, - 0, - 0, - .27778 - ], - "47": [ - .25, - .75, - 0, - 0, - .5 - ], - "48": [ - 0, - .65556, - 0, - 0, - .5 - ], - "49": [ - 0, - .65556, - 0, - 0, - .5 - ], - "50": [ - 0, - .65556, - 0, - 0, - .5 - ], - "51": [ - 0, - .65556, - 0, - 0, - .5 - ], - "52": [ - 0, - .65556, - 0, - 0, - .5 - ], - "53": [ - 0, - .65556, - 0, - 0, - .5 - ], - "54": [ - 0, - .65556, - 0, - 0, - .5 - ], - "55": [ - 0, - .65556, - 0, - 0, - .5 - ], - "56": [ - 0, - .65556, - 0, - 0, - .5 - ], - "57": [ - 0, - .65556, - 0, - 0, - .5 - ], - "58": [ - 0, - .44444, - 0, - 0, - .27778 - ], - "59": [ - .125, - .44444, - 0, - 0, - .27778 - ], - "61": [ - -.13, - .37, - 0, - 0, - .77778 - ], - "63": [ - 0, - .69444, - 0, - 0, - .47222 - ], - "64": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "65": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "66": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "67": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "68": [ - 0, - .69444, - 0, - 0, - .72223 - ], - "69": [ - 0, - .69444, - 0, - 0, - .59722 - ], - "70": [ - 0, - .69444, - 0, - 0, - .56945 - ], - "71": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "72": [ - 0, - .69444, - 0, - 0, - .70834 - ], - "73": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "74": [ - 0, - .69444, - 0, - 0, - .47222 - ], - "75": [ - 0, - .69444, - 0, - 0, - .69445 - ], - "76": [ - 0, - .69444, - 0, - 0, - .54167 - ], - "77": [ - 0, - .69444, - 0, - 0, - .875 - ], - "78": [ - 0, - .69444, - 0, - 0, - .70834 - ], - "79": [ - 0, - .69444, - 0, - 0, - .73611 - ], - "80": [ - 0, - .69444, - 0, - 0, - .63889 - ], - "81": [ - .125, - .69444, - 0, - 0, - .73611 - ], - "82": [ - 0, - .69444, - 0, - 0, - .64584 - ], - "83": [ - 0, - .69444, - 0, - 0, - .55556 - ], - "84": [ - 0, - .69444, - 0, - 0, - .68056 - ], - "85": [ - 0, - .69444, - 0, - 0, - .6875 - ], - "86": [ - 0, - .69444, - .01389, - 0, - .66667 - ], - "87": [ - 0, - .69444, - .01389, - 0, - .94445 - ], - "88": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "89": [ - 0, - .69444, - .025, - 0, - .66667 - ], - "90": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "91": [ - .25, - .75, - 0, - 0, - .28889 - ], - "93": [ - .25, - .75, - 0, - 0, - .28889 - ], - "94": [ - 0, - .69444, - 0, - 0, - .5 - ], - "95": [ - .35, - .09444, - .02778, - 0, - .5 - ], - "97": [ - 0, - .44444, - 0, - 0, - .48056 - ], - "98": [ - 0, - .69444, - 0, - 0, - .51667 - ], - "99": [ - 0, - .44444, - 0, - 0, - .44445 - ], - "100": [ - 0, - .69444, - 0, - 0, - .51667 - ], - "101": [ - 0, - .44444, - 0, - 0, - .44445 - ], - "102": [ - 0, - .69444, - .06944, - 0, - .30556 - ], - "103": [ - .19444, - .44444, - .01389, - 0, - .5 - ], - "104": [ - 0, - .69444, - 0, - 0, - .51667 - ], - "105": [ - 0, - .67937, - 0, - 0, - .23889 - ], - "106": [ - .19444, - .67937, - 0, - 0, - .26667 - ], - "107": [ - 0, - .69444, - 0, - 0, - .48889 - ], - "108": [ - 0, - .69444, - 0, - 0, - .23889 - ], - "109": [ - 0, - .44444, - 0, - 0, - .79445 - ], - "110": [ - 0, - .44444, - 0, - 0, - .51667 - ], - "111": [ - 0, - .44444, - 0, - 0, - .5 - ], - "112": [ - .19444, - .44444, - 0, - 0, - .51667 - ], - "113": [ - .19444, - .44444, - 0, - 0, - .51667 - ], - "114": [ - 0, - .44444, - .01389, - 0, - .34167 - ], - "115": [ - 0, - .44444, - 0, - 0, - .38333 - ], - "116": [ - 0, - .57143, - 0, - 0, - .36111 - ], - "117": [ - 0, - .44444, - 0, - 0, - .51667 - ], - "118": [ - 0, - .44444, - .01389, - 0, - .46111 - ], - "119": [ - 0, - .44444, - .01389, - 0, - .68334 - ], - "120": [ - 0, - .44444, - 0, - 0, - .46111 - ], - "121": [ - .19444, - .44444, - .01389, - 0, - .46111 - ], - "122": [ - 0, - .44444, - 0, - 0, - .43472 - ], - "126": [ - .35, - .32659, - 0, - 0, - .5 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "168": [ - 0, - .67937, - 0, - 0, - .5 - ], - "176": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "184": [ - .17014, - 0, - 0, - 0, - .44445 - ], - "305": [ - 0, - .44444, - 0, - 0, - .23889 - ], - "567": [ - .19444, - .44444, - 0, - 0, - .26667 - ], - "710": [ - 0, - .69444, - 0, - 0, - .5 - ], - "711": [ - 0, - .63194, - 0, - 0, - .5 - ], - "713": [ - 0, - .60889, - 0, - 0, - .5 - ], - "714": [ - 0, - .69444, - 0, - 0, - .5 - ], - "715": [ - 0, - .69444, - 0, - 0, - .5 - ], - "728": [ - 0, - .69444, - 0, - 0, - .5 - ], - "729": [ - 0, - .67937, - 0, - 0, - .27778 - ], - "730": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "732": [ - 0, - .67659, - 0, - 0, - .5 - ], - "733": [ - 0, - .69444, - 0, - 0, - .5 - ], - "915": [ - 0, - .69444, - 0, - 0, - .54167 - ], - "916": [ - 0, - .69444, - 0, - 0, - .83334 - ], - "920": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "923": [ - 0, - .69444, - 0, - 0, - .61111 - ], - "926": [ - 0, - .69444, - 0, - 0, - .66667 - ], - "928": [ - 0, - .69444, - 0, - 0, - .70834 - ], - "931": [ - 0, - .69444, - 0, - 0, - .72222 - ], - "933": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "934": [ - 0, - .69444, - 0, - 0, - .72222 - ], - "936": [ - 0, - .69444, - 0, - 0, - .77778 - ], - "937": [ - 0, - .69444, - 0, - 0, - .72222 - ], - "8211": [ - 0, - .44444, - .02778, - 0, - .5 - ], - "8212": [ - 0, - .44444, - .02778, - 0, - 1 - ], - "8216": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "8217": [ - 0, - .69444, - 0, - 0, - .27778 - ], - "8220": [ - 0, - .69444, - 0, - 0, - .5 - ], - "8221": [ - 0, - .69444, - 0, - 0, - .5 - ] - }, - "Script-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "65": [ - 0, - .7, - .22925, - 0, - .80253 - ], - "66": [ - 0, - .7, - .04087, - 0, - .90757 - ], - "67": [ - 0, - .7, - .1689, - 0, - .66619 - ], - "68": [ - 0, - .7, - .09371, - 0, - .77443 - ], - "69": [ - 0, - .7, - .18583, - 0, - .56162 - ], - "70": [ - 0, - .7, - .13634, - 0, - .89544 - ], - "71": [ - 0, - .7, - .17322, - 0, - .60961 - ], - "72": [ - 0, - .7, - .29694, - 0, - .96919 - ], - "73": [ - 0, - .7, - .19189, - 0, - .80907 - ], - "74": [ - .27778, - .7, - .19189, - 0, - 1.05159 - ], - "75": [ - 0, - .7, - .31259, - 0, - .91364 - ], - "76": [ - 0, - .7, - .19189, - 0, - .87373 - ], - "77": [ - 0, - .7, - .15981, - 0, - 1.08031 - ], - "78": [ - 0, - .7, - .3525, - 0, - .9015 - ], - "79": [ - 0, - .7, - .08078, - 0, - .73787 - ], - "80": [ - 0, - .7, - .08078, - 0, - 1.01262 - ], - "81": [ - 0, - .7, - .03305, - 0, - .88282 - ], - "82": [ - 0, - .7, - .06259, - 0, - .85 - ], - "83": [ - 0, - .7, - .19189, - 0, - .86767 - ], - "84": [ - 0, - .7, - .29087, - 0, - .74697 - ], - "85": [ - 0, - .7, - .25815, - 0, - .79996 - ], - "86": [ - 0, - .7, - .27523, - 0, - .62204 - ], - "87": [ - 0, - .7, - .27523, - 0, - .80532 - ], - "88": [ - 0, - .7, - .26006, - 0, - .94445 - ], - "89": [ - 0, - .7, - .2939, - 0, - .70961 - ], - "90": [ - 0, - .7, - .24037, - 0, - .8212 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ] - }, - "Size1-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "40": [ - .35001, - .85, - 0, - 0, - .45834 - ], - "41": [ - .35001, - .85, - 0, - 0, - .45834 - ], - "47": [ - .35001, - .85, - 0, - 0, - .57778 - ], - "91": [ - .35001, - .85, - 0, - 0, - .41667 - ], - "92": [ - .35001, - .85, - 0, - 0, - .57778 - ], - "93": [ - .35001, - .85, - 0, - 0, - .41667 - ], - "123": [ - .35001, - .85, - 0, - 0, - .58334 - ], - "125": [ - .35001, - .85, - 0, - 0, - .58334 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "710": [ - 0, - .72222, - 0, - 0, - .55556 - ], - "732": [ - 0, - .72222, - 0, - 0, - .55556 - ], - "770": [ - 0, - .72222, - 0, - 0, - .55556 - ], - "771": [ - 0, - .72222, - 0, - 0, - .55556 - ], - "8214": [ - -99e-5, - .601, - 0, - 0, - .77778 - ], - "8593": [ - 1e-5, - .6, - 0, - 0, - .66667 - ], - "8595": [ - 1e-5, - .6, - 0, - 0, - .66667 - ], - "8657": [ - 1e-5, - .6, - 0, - 0, - .77778 - ], - "8659": [ - 1e-5, - .6, - 0, - 0, - .77778 - ], - "8719": [ - .25001, - .75, - 0, - 0, - .94445 - ], - "8720": [ - .25001, - .75, - 0, - 0, - .94445 - ], - "8721": [ - .25001, - .75, - 0, - 0, - 1.05556 - ], - "8730": [ - .35001, - .85, - 0, - 0, - 1 - ], - "8739": [ - -.00599, - .606, - 0, - 0, - .33333 - ], - "8741": [ - -.00599, - .606, - 0, - 0, - .55556 - ], - "8747": [ - .30612, - .805, - .19445, - 0, - .47222 - ], - "8748": [ - .306, - .805, - .19445, - 0, - .47222 - ], - "8749": [ - .306, - .805, - .19445, - 0, - .47222 - ], - "8750": [ - .30612, - .805, - .19445, - 0, - .47222 - ], - "8896": [ - .25001, - .75, - 0, - 0, - .83334 - ], - "8897": [ - .25001, - .75, - 0, - 0, - .83334 - ], - "8898": [ - .25001, - .75, - 0, - 0, - .83334 - ], - "8899": [ - .25001, - .75, - 0, - 0, - .83334 - ], - "8968": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "8969": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "8970": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "8971": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "9168": [ - -99e-5, - .601, - 0, - 0, - .66667 - ], - "10216": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "10217": [ - .35001, - .85, - 0, - 0, - .47222 - ], - "10752": [ - .25001, - .75, - 0, - 0, - 1.11111 - ], - "10753": [ - .25001, - .75, - 0, - 0, - 1.11111 - ], - "10754": [ - .25001, - .75, - 0, - 0, - 1.11111 - ], - "10756": [ - .25001, - .75, - 0, - 0, - .83334 - ], - "10758": [ - .25001, - .75, - 0, - 0, - .83334 - ] - }, - "Size2-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "40": [ - .65002, - 1.15, - 0, - 0, - .59722 - ], - "41": [ - .65002, - 1.15, - 0, - 0, - .59722 - ], - "47": [ - .65002, - 1.15, - 0, - 0, - .81111 - ], - "91": [ - .65002, - 1.15, - 0, - 0, - .47222 - ], - "92": [ - .65002, - 1.15, - 0, - 0, - .81111 - ], - "93": [ - .65002, - 1.15, - 0, - 0, - .47222 - ], - "123": [ - .65002, - 1.15, - 0, - 0, - .66667 - ], - "125": [ - .65002, - 1.15, - 0, - 0, - .66667 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "710": [ - 0, - .75, - 0, - 0, - 1 - ], - "732": [ - 0, - .75, - 0, - 0, - 1 - ], - "770": [ - 0, - .75, - 0, - 0, - 1 - ], - "771": [ - 0, - .75, - 0, - 0, - 1 - ], - "8719": [ - .55001, - 1.05, - 0, - 0, - 1.27778 - ], - "8720": [ - .55001, - 1.05, - 0, - 0, - 1.27778 - ], - "8721": [ - .55001, - 1.05, - 0, - 0, - 1.44445 - ], - "8730": [ - .65002, - 1.15, - 0, - 0, - 1 - ], - "8747": [ - .86225, - 1.36, - .44445, - 0, - .55556 - ], - "8748": [ - .862, - 1.36, - .44445, - 0, - .55556 - ], - "8749": [ - .862, - 1.36, - .44445, - 0, - .55556 - ], - "8750": [ - .86225, - 1.36, - .44445, - 0, - .55556 - ], - "8896": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ], - "8897": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ], - "8898": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ], - "8899": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ], - "8968": [ - .65002, - 1.15, - 0, - 0, - .52778 - ], - "8969": [ - .65002, - 1.15, - 0, - 0, - .52778 - ], - "8970": [ - .65002, - 1.15, - 0, - 0, - .52778 - ], - "8971": [ - .65002, - 1.15, - 0, - 0, - .52778 - ], - "10216": [ - .65002, - 1.15, - 0, - 0, - .61111 - ], - "10217": [ - .65002, - 1.15, - 0, - 0, - .61111 - ], - "10752": [ - .55001, - 1.05, - 0, - 0, - 1.51112 - ], - "10753": [ - .55001, - 1.05, - 0, - 0, - 1.51112 - ], - "10754": [ - .55001, - 1.05, - 0, - 0, - 1.51112 - ], - "10756": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ], - "10758": [ - .55001, - 1.05, - 0, - 0, - 1.11111 - ] - }, - "Size3-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "40": [ - .95003, - 1.45, - 0, - 0, - .73611 - ], - "41": [ - .95003, - 1.45, - 0, - 0, - .73611 - ], - "47": [ - .95003, - 1.45, - 0, - 0, - 1.04445 - ], - "91": [ - .95003, - 1.45, - 0, - 0, - .52778 - ], - "92": [ - .95003, - 1.45, - 0, - 0, - 1.04445 - ], - "93": [ - .95003, - 1.45, - 0, - 0, - .52778 - ], - "123": [ - .95003, - 1.45, - 0, - 0, - .75 - ], - "125": [ - .95003, - 1.45, - 0, - 0, - .75 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "710": [ - 0, - .75, - 0, - 0, - 1.44445 - ], - "732": [ - 0, - .75, - 0, - 0, - 1.44445 - ], - "770": [ - 0, - .75, - 0, - 0, - 1.44445 - ], - "771": [ - 0, - .75, - 0, - 0, - 1.44445 - ], - "8730": [ - .95003, - 1.45, - 0, - 0, - 1 - ], - "8968": [ - .95003, - 1.45, - 0, - 0, - .58334 - ], - "8969": [ - .95003, - 1.45, - 0, - 0, - .58334 - ], - "8970": [ - .95003, - 1.45, - 0, - 0, - .58334 - ], - "8971": [ - .95003, - 1.45, - 0, - 0, - .58334 - ], - "10216": [ - .95003, - 1.45, - 0, - 0, - .75 - ], - "10217": [ - .95003, - 1.45, - 0, - 0, - .75 - ] - }, - "Size4-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .25 - ], - "40": [ - 1.25003, - 1.75, - 0, - 0, - .79167 - ], - "41": [ - 1.25003, - 1.75, - 0, - 0, - .79167 - ], - "47": [ - 1.25003, - 1.75, - 0, - 0, - 1.27778 - ], - "91": [ - 1.25003, - 1.75, - 0, - 0, - .58334 - ], - "92": [ - 1.25003, - 1.75, - 0, - 0, - 1.27778 - ], - "93": [ - 1.25003, - 1.75, - 0, - 0, - .58334 - ], - "123": [ - 1.25003, - 1.75, - 0, - 0, - .80556 - ], - "125": [ - 1.25003, - 1.75, - 0, - 0, - .80556 - ], - "160": [ - 0, - 0, - 0, - 0, - .25 - ], - "710": [ - 0, - .825, - 0, - 0, - 1.8889 - ], - "732": [ - 0, - .825, - 0, - 0, - 1.8889 - ], - "770": [ - 0, - .825, - 0, - 0, - 1.8889 - ], - "771": [ - 0, - .825, - 0, - 0, - 1.8889 - ], - "8730": [ - 1.25003, - 1.75, - 0, - 0, - 1 - ], - "8968": [ - 1.25003, - 1.75, - 0, - 0, - .63889 - ], - "8969": [ - 1.25003, - 1.75, - 0, - 0, - .63889 - ], - "8970": [ - 1.25003, - 1.75, - 0, - 0, - .63889 - ], - "8971": [ - 1.25003, - 1.75, - 0, - 0, - .63889 - ], - "9115": [ - .64502, - 1.155, - 0, - 0, - .875 - ], - "9116": [ - 1e-5, - .6, - 0, - 0, - .875 - ], - "9117": [ - .64502, - 1.155, - 0, - 0, - .875 - ], - "9118": [ - .64502, - 1.155, - 0, - 0, - .875 - ], - "9119": [ - 1e-5, - .6, - 0, - 0, - .875 - ], - "9120": [ - .64502, - 1.155, - 0, - 0, - .875 - ], - "9121": [ - .64502, - 1.155, - 0, - 0, - .66667 - ], - "9122": [ - -99e-5, - .601, - 0, - 0, - .66667 - ], - "9123": [ - .64502, - 1.155, - 0, - 0, - .66667 - ], - "9124": [ - .64502, - 1.155, - 0, - 0, - .66667 - ], - "9125": [ - -99e-5, - .601, - 0, - 0, - .66667 - ], - "9126": [ - .64502, - 1.155, - 0, - 0, - .66667 - ], - "9127": [ - 1e-5, - .9, - 0, - 0, - .88889 - ], - "9128": [ - .65002, - 1.15, - 0, - 0, - .88889 - ], - "9129": [ - .90001, - 0, - 0, - 0, - .88889 - ], - "9130": [ - 0, - .3, - 0, - 0, - .88889 - ], - "9131": [ - 1e-5, - .9, - 0, - 0, - .88889 - ], - "9132": [ - .65002, - 1.15, - 0, - 0, - .88889 - ], - "9133": [ - .90001, - 0, - 0, - 0, - .88889 - ], - "9143": [ - .88502, - .915, - 0, - 0, - 1.05556 - ], - "10216": [ - 1.25003, - 1.75, - 0, - 0, - .80556 - ], - "10217": [ - 1.25003, - 1.75, - 0, - 0, - .80556 - ], - "57344": [ - -.00499, - .605, - 0, - 0, - 1.05556 - ], - "57345": [ - -.00499, - .605, - 0, - 0, - 1.05556 - ], - "57680": [ - 0, - .12, - 0, - 0, - .45 - ], - "57681": [ - 0, - .12, - 0, - 0, - .45 - ], - "57682": [ - 0, - .12, - 0, - 0, - .45 - ], - "57683": [ - 0, - .12, - 0, - 0, - .45 - ] - }, - "Typewriter-Regular": { - "32": [ - 0, - 0, - 0, - 0, - .525 - ], - "33": [ - 0, - .61111, - 0, - 0, - .525 - ], - "34": [ - 0, - .61111, - 0, - 0, - .525 - ], - "35": [ - 0, - .61111, - 0, - 0, - .525 - ], - "36": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "37": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "38": [ - 0, - .61111, - 0, - 0, - .525 - ], - "39": [ - 0, - .61111, - 0, - 0, - .525 - ], - "40": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "41": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "42": [ - 0, - .52083, - 0, - 0, - .525 - ], - "43": [ - -.08056, - .53055, - 0, - 0, - .525 - ], - "44": [ - .13889, - .125, - 0, - 0, - .525 - ], - "45": [ - -.08056, - .53055, - 0, - 0, - .525 - ], - "46": [ - 0, - .125, - 0, - 0, - .525 - ], - "47": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "48": [ - 0, - .61111, - 0, - 0, - .525 - ], - "49": [ - 0, - .61111, - 0, - 0, - .525 - ], - "50": [ - 0, - .61111, - 0, - 0, - .525 - ], - "51": [ - 0, - .61111, - 0, - 0, - .525 - ], - "52": [ - 0, - .61111, - 0, - 0, - .525 - ], - "53": [ - 0, - .61111, - 0, - 0, - .525 - ], - "54": [ - 0, - .61111, - 0, - 0, - .525 - ], - "55": [ - 0, - .61111, - 0, - 0, - .525 - ], - "56": [ - 0, - .61111, - 0, - 0, - .525 - ], - "57": [ - 0, - .61111, - 0, - 0, - .525 - ], - "58": [ - 0, - .43056, - 0, - 0, - .525 - ], - "59": [ - .13889, - .43056, - 0, - 0, - .525 - ], - "60": [ - -.05556, - .55556, - 0, - 0, - .525 - ], - "61": [ - -.19549, - .41562, - 0, - 0, - .525 - ], - "62": [ - -.05556, - .55556, - 0, - 0, - .525 - ], - "63": [ - 0, - .61111, - 0, - 0, - .525 - ], - "64": [ - 0, - .61111, - 0, - 0, - .525 - ], - "65": [ - 0, - .61111, - 0, - 0, - .525 - ], - "66": [ - 0, - .61111, - 0, - 0, - .525 - ], - "67": [ - 0, - .61111, - 0, - 0, - .525 - ], - "68": [ - 0, - .61111, - 0, - 0, - .525 - ], - "69": [ - 0, - .61111, - 0, - 0, - .525 - ], - "70": [ - 0, - .61111, - 0, - 0, - .525 - ], - "71": [ - 0, - .61111, - 0, - 0, - .525 - ], - "72": [ - 0, - .61111, - 0, - 0, - .525 - ], - "73": [ - 0, - .61111, - 0, - 0, - .525 - ], - "74": [ - 0, - .61111, - 0, - 0, - .525 - ], - "75": [ - 0, - .61111, - 0, - 0, - .525 - ], - "76": [ - 0, - .61111, - 0, - 0, - .525 - ], - "77": [ - 0, - .61111, - 0, - 0, - .525 - ], - "78": [ - 0, - .61111, - 0, - 0, - .525 - ], - "79": [ - 0, - .61111, - 0, - 0, - .525 - ], - "80": [ - 0, - .61111, - 0, - 0, - .525 - ], - "81": [ - .13889, - .61111, - 0, - 0, - .525 - ], - "82": [ - 0, - .61111, - 0, - 0, - .525 - ], - "83": [ - 0, - .61111, - 0, - 0, - .525 - ], - "84": [ - 0, - .61111, - 0, - 0, - .525 - ], - "85": [ - 0, - .61111, - 0, - 0, - .525 - ], - "86": [ - 0, - .61111, - 0, - 0, - .525 - ], - "87": [ - 0, - .61111, - 0, - 0, - .525 - ], - "88": [ - 0, - .61111, - 0, - 0, - .525 - ], - "89": [ - 0, - .61111, - 0, - 0, - .525 - ], - "90": [ - 0, - .61111, - 0, - 0, - .525 - ], - "91": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "92": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "93": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "94": [ - 0, - .61111, - 0, - 0, - .525 - ], - "95": [ - .09514, - 0, - 0, - 0, - .525 - ], - "96": [ - 0, - .61111, - 0, - 0, - .525 - ], - "97": [ - 0, - .43056, - 0, - 0, - .525 - ], - "98": [ - 0, - .61111, - 0, - 0, - .525 - ], - "99": [ - 0, - .43056, - 0, - 0, - .525 - ], - "100": [ - 0, - .61111, - 0, - 0, - .525 - ], - "101": [ - 0, - .43056, - 0, - 0, - .525 - ], - "102": [ - 0, - .61111, - 0, - 0, - .525 - ], - "103": [ - .22222, - .43056, - 0, - 0, - .525 - ], - "104": [ - 0, - .61111, - 0, - 0, - .525 - ], - "105": [ - 0, - .61111, - 0, - 0, - .525 - ], - "106": [ - .22222, - .61111, - 0, - 0, - .525 - ], - "107": [ - 0, - .61111, - 0, - 0, - .525 - ], - "108": [ - 0, - .61111, - 0, - 0, - .525 - ], - "109": [ - 0, - .43056, - 0, - 0, - .525 - ], - "110": [ - 0, - .43056, - 0, - 0, - .525 - ], - "111": [ - 0, - .43056, - 0, - 0, - .525 - ], - "112": [ - .22222, - .43056, - 0, - 0, - .525 - ], - "113": [ - .22222, - .43056, - 0, - 0, - .525 - ], - "114": [ - 0, - .43056, - 0, - 0, - .525 - ], - "115": [ - 0, - .43056, - 0, - 0, - .525 - ], - "116": [ - 0, - .55358, - 0, - 0, - .525 - ], - "117": [ - 0, - .43056, - 0, - 0, - .525 - ], - "118": [ - 0, - .43056, - 0, - 0, - .525 - ], - "119": [ - 0, - .43056, - 0, - 0, - .525 - ], - "120": [ - 0, - .43056, - 0, - 0, - .525 - ], - "121": [ - .22222, - .43056, - 0, - 0, - .525 - ], - "122": [ - 0, - .43056, - 0, - 0, - .525 - ], - "123": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "124": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "125": [ - .08333, - .69444, - 0, - 0, - .525 - ], - "126": [ - 0, - .61111, - 0, - 0, - .525 - ], - "127": [ - 0, - .61111, - 0, - 0, - .525 - ], - "160": [ - 0, - 0, - 0, - 0, - .525 - ], - "176": [ - 0, - .61111, - 0, - 0, - .525 - ], - "184": [ - .19445, - 0, - 0, - 0, - .525 - ], - "305": [ - 0, - .43056, - 0, - 0, - .525 - ], - "567": [ - .22222, - .43056, - 0, - 0, - .525 - ], - "711": [ - 0, - .56597, - 0, - 0, - .525 - ], - "713": [ - 0, - .56555, - 0, - 0, - .525 - ], - "714": [ - 0, - .61111, - 0, - 0, - .525 - ], - "715": [ - 0, - .61111, - 0, - 0, - .525 - ], - "728": [ - 0, - .61111, - 0, - 0, - .525 - ], - "730": [ - 0, - .61111, - 0, - 0, - .525 - ], - "770": [ - 0, - .61111, - 0, - 0, - .525 - ], - "771": [ - 0, - .61111, - 0, - 0, - .525 - ], - "776": [ - 0, - .61111, - 0, - 0, - .525 - ], - "915": [ - 0, - .61111, - 0, - 0, - .525 - ], - "916": [ - 0, - .61111, - 0, - 0, - .525 - ], - "920": [ - 0, - .61111, - 0, - 0, - .525 - ], - "923": [ - 0, - .61111, - 0, - 0, - .525 - ], - "926": [ - 0, - .61111, - 0, - 0, - .525 - ], - "928": [ - 0, - .61111, - 0, - 0, - .525 - ], - "931": [ - 0, - .61111, - 0, - 0, - .525 - ], - "933": [ - 0, - .61111, - 0, - 0, - .525 - ], - "934": [ - 0, - .61111, - 0, - 0, - .525 - ], - "936": [ - 0, - .61111, - 0, - 0, - .525 - ], - "937": [ - 0, - .61111, - 0, - 0, - .525 - ], - "8216": [ - 0, - .61111, - 0, - 0, - .525 - ], - "8217": [ - 0, - .61111, - 0, - 0, - .525 - ], - "8242": [ - 0, - .61111, - 0, - 0, - .525 - ], - "9251": [ - .11111, - .21944, - 0, - 0, - .525 - ] - } - }; - /** - * This file contains metrics regarding fonts and individual symbols. The sigma - * and xi variables, as well as the metricMap map contain data extracted from - * TeX, TeX font metrics, and the TTF files. These data are then exposed via the - * `metrics` variable and the getCharacterMetrics function. - */ - var sigmasAndXis = { - slant: [ - .25, - .25, - .25 - ], - space: [ - 0, - 0, - 0 - ], - stretch: [ - 0, - 0, - 0 - ], - shrink: [ - 0, - 0, - 0 - ], - xHeight: [ - .431, - .431, - .431 - ], - quad: [ - 1, - 1.171, - 1.472 - ], - extraSpace: [ - 0, - 0, - 0 - ], - num1: [ - .677, - .732, - .925 - ], - num2: [ - .394, - .384, - .387 - ], - num3: [ - .444, - .471, - .504 - ], - denom1: [ - .686, - .752, - 1.025 - ], - denom2: [ - .345, - .344, - .532 - ], - sup1: [ - .413, - .503, - .504 - ], - sup2: [ - .363, - .431, - .404 - ], - sup3: [ - .289, - .286, - .294 - ], - sub1: [ - .15, - .143, - .2 - ], - sub2: [ - .247, - .286, - .4 - ], - supDrop: [ - .386, - .353, - .494 - ], - subDrop: [ - .05, - .071, - .1 - ], - delim1: [ - 2.39, - 1.7, - 1.98 - ], - delim2: [ - 1.01, - 1.157, - 1.42 - ], - axisHeight: [ - .25, - .25, - .25 - ], - defaultRuleThickness: [ - .04, - .049, - .049 - ], - bigOpSpacing1: [ - .111, - .111, - .111 - ], - bigOpSpacing2: [ - .166, - .166, - .166 - ], - bigOpSpacing3: [ - .2, - .2, - .2 - ], - bigOpSpacing4: [ - .6, - .611, - .611 - ], - bigOpSpacing5: [ - .1, - .143, - .143 - ], - sqrtRuleThickness: [ - .04, - .04, - .04 - ], - ptPerEm: [ - 10, - 10, - 10 - ], - doubleRuleSep: [ - .2, - .2, - .2 - ], - arrayRuleWidth: [ - .04, - .04, - .04 - ], - fboxsep: [ - .3, - .3, - .3 - ], - fboxrule: [ - .04, - .04, - .04 - ] - }; - var extraCharacterMap = { - "Å": "A", - "Ð": "D", - "Þ": "o", - "å": "a", - "ð": "d", - "þ": "o", - "А": "A", - "Б": "B", - "В": "B", - "Г": "F", - "Д": "A", - "Е": "E", - "Ж": "K", - "З": "3", - "И": "N", - "Й": "N", - "К": "K", - "Л": "N", - "М": "M", - "Н": "H", - "О": "O", - "П": "N", - "Р": "P", - "С": "C", - "Т": "T", - "У": "y", - "Ф": "O", - "Х": "X", - "Ц": "U", - "Ч": "h", - "Ш": "W", - "Щ": "W", - "Ъ": "B", - "Ы": "X", - "Ь": "B", - "Э": "3", - "Ю": "X", - "Я": "R", - "а": "a", - "б": "b", - "в": "a", - "г": "r", - "д": "y", - "е": "e", - "ж": "m", - "з": "e", - "и": "n", - "й": "n", - "к": "n", - "л": "n", - "м": "m", - "н": "n", - "о": "o", - "п": "n", - "р": "p", - "с": "c", - "т": "o", - "у": "y", - "ф": "b", - "х": "x", - "ц": "n", - "ч": "n", - "ш": "w", - "щ": "w", - "ъ": "a", - "ы": "m", - "ь": "a", - "э": "e", - "ю": "m", - "я": "r" - }; - /** - * This function adds new font metrics to default metricMap - * It can also override existing metrics - */ - function setFontMetrics(fontName, metrics) { - fontMetricsData[fontName] = metrics; - } - /** - * This function is a convenience function for looking up information in the - * metricMap table. It takes a character as a string, and a font. - * - * Note: the `width` property may be undefined if fontMetricsData.js wasn't - * built using `Make extended_metrics`. - */ - function getCharacterMetrics(character, font, mode) { - if (!fontMetricsData[font]) throw new Error("Font metrics not found for font: " + font + "."); - var ch = character.charCodeAt(0); - var metrics = fontMetricsData[font][ch]; - if (!metrics && character[0] in extraCharacterMap) { - ch = extraCharacterMap[character[0]].charCodeAt(0); - metrics = fontMetricsData[font][ch]; - } - if (!metrics && mode === "text") { - if (supportedCodepoint(ch)) metrics = fontMetricsData[font][77]; - } - if (metrics) return { - depth: metrics[0], - height: metrics[1], - italic: metrics[2], - skew: metrics[3], - width: metrics[4] - }; - } - var fontMetricsBySizeIndex = {}; - /** - * Get the font metrics for a given size. - */ - function getGlobalMetrics(size) { - var sizeIndex; - if (size >= 5) sizeIndex = 0; - else if (size >= 3) sizeIndex = 1; - else sizeIndex = 2; - if (!fontMetricsBySizeIndex[sizeIndex]) { - var metrics = fontMetricsBySizeIndex[sizeIndex] = { cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18 }; - for (var key of Object.keys(sigmasAndXis)) metrics[key] = sigmasAndXis[key][sizeIndex]; - } - return fontMetricsBySizeIndex[sizeIndex]; - } - /** - * This file holds a list of all no-argument functions and single-character - * symbols (like 'a' or ';'). - * - * For each of the symbols, there are three properties they can have: - * - font (required): the font to be used for this symbol. Either "main" (the - normal font), or "ams" (the ams fonts). - * - group (required): the ParseNode group type the symbol should have (i.e. - "textord", "mathord", etc). - See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types - * - replace: the character that this symbol or function should be - * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi - * character in the main font). - * - * The outermost map in the table indicates what mode the symbols should be - * accepted in (e.g. "math" or "text"). - */ - var symbols = { - "math": {}, - "text": {} - }; - /** `acceptUnicodeChar = true` is only applicable if `replace` is set. */ - function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) { - symbols[mode][name] = { - font, - group, - replace - }; - if (acceptUnicodeChar && replace) symbols[mode][replace] = symbols[mode][name]; - } - var math = "math"; - var text$2 = "text"; - var main = "main"; - var ams = "ams"; - var accent = "accent-token"; - var bin = "bin"; - var close = "close"; - var inner = "inner"; - var mathord = "mathord"; - var op = "op-token"; - var open = "open"; - var punct = "punct"; - var rel = "rel"; - var spacing = "spacing"; - var textord = "textord"; - defineSymbol(math, main, rel, "≡", "\\equiv", true); - defineSymbol(math, main, rel, "≺", "\\prec", true); - defineSymbol(math, main, rel, "≻", "\\succ", true); - defineSymbol(math, main, rel, "∼", "\\sim", true); - defineSymbol(math, main, rel, "⊥", "\\perp"); - defineSymbol(math, main, rel, "⪯", "\\preceq", true); - defineSymbol(math, main, rel, "⪰", "\\succeq", true); - defineSymbol(math, main, rel, "≃", "\\simeq", true); - defineSymbol(math, main, rel, "∣", "\\mid", true); - defineSymbol(math, main, rel, "≪", "\\ll", true); - defineSymbol(math, main, rel, "≫", "\\gg", true); - defineSymbol(math, main, rel, "≍", "\\asymp", true); - defineSymbol(math, main, rel, "∥", "\\parallel"); - defineSymbol(math, main, rel, "⋈", "\\bowtie", true); - defineSymbol(math, main, rel, "⌣", "\\smile", true); - defineSymbol(math, main, rel, "⊑", "\\sqsubseteq", true); - defineSymbol(math, main, rel, "⊒", "\\sqsupseteq", true); - defineSymbol(math, main, rel, "≐", "\\doteq", true); - defineSymbol(math, main, rel, "⌢", "\\frown", true); - defineSymbol(math, main, rel, "∋", "\\ni", true); - defineSymbol(math, main, rel, "∝", "\\propto", true); - defineSymbol(math, main, rel, "⊢", "\\vdash", true); - defineSymbol(math, main, rel, "⊣", "\\dashv", true); - defineSymbol(math, main, rel, "∋", "\\owns"); - defineSymbol(math, main, punct, ".", "\\ldotp"); - defineSymbol(math, main, punct, "⋅", "\\cdotp"); - defineSymbol(math, main, punct, "⋅", "·"); - defineSymbol(text$2, main, textord, "⋅", "·"); - defineSymbol(math, main, textord, "#", "\\#"); - defineSymbol(text$2, main, textord, "#", "\\#"); - defineSymbol(math, main, textord, "&", "\\&"); - defineSymbol(text$2, main, textord, "&", "\\&"); - defineSymbol(math, main, textord, "ℵ", "\\aleph", true); - defineSymbol(math, main, textord, "∀", "\\forall", true); - defineSymbol(math, main, textord, "ℏ", "\\hbar", true); - defineSymbol(math, main, textord, "∃", "\\exists", true); - defineSymbol(math, main, textord, "∇", "\\nabla", true); - defineSymbol(math, main, textord, "♭", "\\flat", true); - defineSymbol(math, main, textord, "ℓ", "\\ell", true); - defineSymbol(math, main, textord, "♮", "\\natural", true); - defineSymbol(math, main, textord, "♣", "\\clubsuit", true); - defineSymbol(math, main, textord, "℘", "\\wp", true); - defineSymbol(math, main, textord, "♯", "\\sharp", true); - defineSymbol(math, main, textord, "♢", "\\diamondsuit", true); - defineSymbol(math, main, textord, "ℜ", "\\Re", true); - defineSymbol(math, main, textord, "♡", "\\heartsuit", true); - defineSymbol(math, main, textord, "ℑ", "\\Im", true); - defineSymbol(math, main, textord, "♠", "\\spadesuit", true); - defineSymbol(math, main, textord, "§", "\\S", true); - defineSymbol(text$2, main, textord, "§", "\\S"); - defineSymbol(math, main, textord, "¶", "\\P", true); - defineSymbol(text$2, main, textord, "¶", "\\P"); - defineSymbol(math, main, textord, "†", "\\dag"); - defineSymbol(text$2, main, textord, "†", "\\dag"); - defineSymbol(text$2, main, textord, "†", "\\textdagger"); - defineSymbol(math, main, textord, "‡", "\\ddag"); - defineSymbol(text$2, main, textord, "‡", "\\ddag"); - defineSymbol(text$2, main, textord, "‡", "\\textdaggerdbl"); - defineSymbol(math, main, close, "⎱", "\\rmoustache", true); - defineSymbol(math, main, open, "⎰", "\\lmoustache", true); - defineSymbol(math, main, close, "⟯", "\\rgroup", true); - defineSymbol(math, main, open, "⟮", "\\lgroup", true); - defineSymbol(math, main, bin, "∓", "\\mp", true); - defineSymbol(math, main, bin, "⊖", "\\ominus", true); - defineSymbol(math, main, bin, "⊎", "\\uplus", true); - defineSymbol(math, main, bin, "⊓", "\\sqcap", true); - defineSymbol(math, main, bin, "∗", "\\ast"); - defineSymbol(math, main, bin, "⊔", "\\sqcup", true); - defineSymbol(math, main, bin, "◯", "\\bigcirc", true); - defineSymbol(math, main, bin, "∙", "\\bullet", true); - defineSymbol(math, main, bin, "‡", "\\ddagger"); - defineSymbol(math, main, bin, "≀", "\\wr", true); - defineSymbol(math, main, bin, "⨿", "\\amalg"); - defineSymbol(math, main, bin, "&", "\\And"); - defineSymbol(math, main, rel, "⟵", "\\longleftarrow", true); - defineSymbol(math, main, rel, "⇐", "\\Leftarrow", true); - defineSymbol(math, main, rel, "⟸", "\\Longleftarrow", true); - defineSymbol(math, main, rel, "⟶", "\\longrightarrow", true); - defineSymbol(math, main, rel, "⇒", "\\Rightarrow", true); - defineSymbol(math, main, rel, "⟹", "\\Longrightarrow", true); - defineSymbol(math, main, rel, "↔", "\\leftrightarrow", true); - defineSymbol(math, main, rel, "⟷", "\\longleftrightarrow", true); - defineSymbol(math, main, rel, "⇔", "\\Leftrightarrow", true); - defineSymbol(math, main, rel, "⟺", "\\Longleftrightarrow", true); - defineSymbol(math, main, rel, "↦", "\\mapsto", true); - defineSymbol(math, main, rel, "⟼", "\\longmapsto", true); - defineSymbol(math, main, rel, "↗", "\\nearrow", true); - defineSymbol(math, main, rel, "↩", "\\hookleftarrow", true); - defineSymbol(math, main, rel, "↪", "\\hookrightarrow", true); - defineSymbol(math, main, rel, "↘", "\\searrow", true); - defineSymbol(math, main, rel, "↼", "\\leftharpoonup", true); - defineSymbol(math, main, rel, "⇀", "\\rightharpoonup", true); - defineSymbol(math, main, rel, "↙", "\\swarrow", true); - defineSymbol(math, main, rel, "↽", "\\leftharpoondown", true); - defineSymbol(math, main, rel, "⇁", "\\rightharpoondown", true); - defineSymbol(math, main, rel, "↖", "\\nwarrow", true); - defineSymbol(math, main, rel, "⇌", "\\rightleftharpoons", true); - defineSymbol(math, ams, rel, "≮", "\\nless", true); - defineSymbol(math, ams, rel, "", "\\@nleqslant"); - defineSymbol(math, ams, rel, "", "\\@nleqq"); - defineSymbol(math, ams, rel, "⪇", "\\lneq", true); - defineSymbol(math, ams, rel, "≨", "\\lneqq", true); - defineSymbol(math, ams, rel, "", "\\@lvertneqq"); - defineSymbol(math, ams, rel, "⋦", "\\lnsim", true); - defineSymbol(math, ams, rel, "⪉", "\\lnapprox", true); - defineSymbol(math, ams, rel, "⊀", "\\nprec", true); - defineSymbol(math, ams, rel, "⋠", "\\npreceq", true); - defineSymbol(math, ams, rel, "⋨", "\\precnsim", true); - defineSymbol(math, ams, rel, "⪹", "\\precnapprox", true); - defineSymbol(math, ams, rel, "≁", "\\nsim", true); - defineSymbol(math, ams, rel, "", "\\@nshortmid"); - defineSymbol(math, ams, rel, "∤", "\\nmid", true); - defineSymbol(math, ams, rel, "⊬", "\\nvdash", true); - defineSymbol(math, ams, rel, "⊭", "\\nvDash", true); - defineSymbol(math, ams, rel, "⋪", "\\ntriangleleft"); - defineSymbol(math, ams, rel, "⋬", "\\ntrianglelefteq", true); - defineSymbol(math, ams, rel, "⊊", "\\subsetneq", true); - defineSymbol(math, ams, rel, "", "\\@varsubsetneq"); - defineSymbol(math, ams, rel, "⫋", "\\subsetneqq", true); - defineSymbol(math, ams, rel, "", "\\@varsubsetneqq"); - defineSymbol(math, ams, rel, "≯", "\\ngtr", true); - defineSymbol(math, ams, rel, "", "\\@ngeqslant"); - defineSymbol(math, ams, rel, "", "\\@ngeqq"); - defineSymbol(math, ams, rel, "⪈", "\\gneq", true); - defineSymbol(math, ams, rel, "≩", "\\gneqq", true); - defineSymbol(math, ams, rel, "", "\\@gvertneqq"); - defineSymbol(math, ams, rel, "⋧", "\\gnsim", true); - defineSymbol(math, ams, rel, "⪊", "\\gnapprox", true); - defineSymbol(math, ams, rel, "⊁", "\\nsucc", true); - defineSymbol(math, ams, rel, "⋡", "\\nsucceq", true); - defineSymbol(math, ams, rel, "⋩", "\\succnsim", true); - defineSymbol(math, ams, rel, "⪺", "\\succnapprox", true); - defineSymbol(math, ams, rel, "≆", "\\ncong", true); - defineSymbol(math, ams, rel, "", "\\@nshortparallel"); - defineSymbol(math, ams, rel, "∦", "\\nparallel", true); - defineSymbol(math, ams, rel, "⊯", "\\nVDash", true); - defineSymbol(math, ams, rel, "⋫", "\\ntriangleright"); - defineSymbol(math, ams, rel, "⋭", "\\ntrianglerighteq", true); - defineSymbol(math, ams, rel, "", "\\@nsupseteqq"); - defineSymbol(math, ams, rel, "⊋", "\\supsetneq", true); - defineSymbol(math, ams, rel, "", "\\@varsupsetneq"); - defineSymbol(math, ams, rel, "⫌", "\\supsetneqq", true); - defineSymbol(math, ams, rel, "", "\\@varsupsetneqq"); - defineSymbol(math, ams, rel, "⊮", "\\nVdash", true); - defineSymbol(math, ams, rel, "⪵", "\\precneqq", true); - defineSymbol(math, ams, rel, "⪶", "\\succneqq", true); - defineSymbol(math, ams, rel, "", "\\@nsubseteqq"); - defineSymbol(math, ams, bin, "⊴", "\\unlhd"); - defineSymbol(math, ams, bin, "⊵", "\\unrhd"); - defineSymbol(math, ams, rel, "↚", "\\nleftarrow", true); - defineSymbol(math, ams, rel, "↛", "\\nrightarrow", true); - defineSymbol(math, ams, rel, "⇍", "\\nLeftarrow", true); - defineSymbol(math, ams, rel, "⇏", "\\nRightarrow", true); - defineSymbol(math, ams, rel, "↮", "\\nleftrightarrow", true); - defineSymbol(math, ams, rel, "⇎", "\\nLeftrightarrow", true); - defineSymbol(math, ams, rel, "△", "\\vartriangle"); - defineSymbol(math, ams, textord, "ℏ", "\\hslash"); - defineSymbol(math, ams, textord, "▽", "\\triangledown"); - defineSymbol(math, ams, textord, "◊", "\\lozenge"); - defineSymbol(math, ams, textord, "Ⓢ", "\\circledS"); - defineSymbol(math, ams, textord, "®", "\\circledR"); - defineSymbol(text$2, ams, textord, "®", "\\circledR"); - defineSymbol(math, ams, textord, "∡", "\\measuredangle", true); - defineSymbol(math, ams, textord, "∄", "\\nexists"); - defineSymbol(math, ams, textord, "℧", "\\mho"); - defineSymbol(math, ams, textord, "Ⅎ", "\\Finv", true); - defineSymbol(math, ams, textord, "⅁", "\\Game", true); - defineSymbol(math, ams, textord, "‵", "\\backprime"); - defineSymbol(math, ams, textord, "▲", "\\blacktriangle"); - defineSymbol(math, ams, textord, "▼", "\\blacktriangledown"); - defineSymbol(math, ams, textord, "■", "\\blacksquare"); - defineSymbol(math, ams, textord, "⧫", "\\blacklozenge"); - defineSymbol(math, ams, textord, "★", "\\bigstar"); - defineSymbol(math, ams, textord, "∢", "\\sphericalangle", true); - defineSymbol(math, ams, textord, "∁", "\\complement", true); - defineSymbol(math, ams, textord, "ð", "\\eth", true); - defineSymbol(text$2, main, textord, "ð", "ð"); - defineSymbol(math, ams, textord, "╱", "\\diagup"); - defineSymbol(math, ams, textord, "╲", "\\diagdown"); - defineSymbol(math, ams, textord, "□", "\\square"); - defineSymbol(math, ams, textord, "□", "\\Box"); - defineSymbol(math, ams, textord, "◊", "\\Diamond"); - defineSymbol(math, ams, textord, "¥", "\\yen", true); - defineSymbol(text$2, ams, textord, "¥", "\\yen", true); - defineSymbol(math, ams, textord, "✓", "\\checkmark", true); - defineSymbol(text$2, ams, textord, "✓", "\\checkmark"); - defineSymbol(math, ams, textord, "ℶ", "\\beth", true); - defineSymbol(math, ams, textord, "ℸ", "\\daleth", true); - defineSymbol(math, ams, textord, "ℷ", "\\gimel", true); - defineSymbol(math, ams, textord, "ϝ", "\\digamma", true); - defineSymbol(math, ams, textord, "ϰ", "\\varkappa"); - defineSymbol(math, ams, open, "┌", "\\@ulcorner", true); - defineSymbol(math, ams, close, "┐", "\\@urcorner", true); - defineSymbol(math, ams, open, "└", "\\@llcorner", true); - defineSymbol(math, ams, close, "┘", "\\@lrcorner", true); - defineSymbol(math, ams, rel, "≦", "\\leqq", true); - defineSymbol(math, ams, rel, "⩽", "\\leqslant", true); - defineSymbol(math, ams, rel, "⪕", "\\eqslantless", true); - defineSymbol(math, ams, rel, "≲", "\\lesssim", true); - defineSymbol(math, ams, rel, "⪅", "\\lessapprox", true); - defineSymbol(math, ams, rel, "≊", "\\approxeq", true); - defineSymbol(math, ams, bin, "⋖", "\\lessdot"); - defineSymbol(math, ams, rel, "⋘", "\\lll", true); - defineSymbol(math, ams, rel, "≶", "\\lessgtr", true); - defineSymbol(math, ams, rel, "⋚", "\\lesseqgtr", true); - defineSymbol(math, ams, rel, "⪋", "\\lesseqqgtr", true); - defineSymbol(math, ams, rel, "≑", "\\doteqdot"); - defineSymbol(math, ams, rel, "≓", "\\risingdotseq", true); - defineSymbol(math, ams, rel, "≒", "\\fallingdotseq", true); - defineSymbol(math, ams, rel, "∽", "\\backsim", true); - defineSymbol(math, ams, rel, "⋍", "\\backsimeq", true); - defineSymbol(math, ams, rel, "⫅", "\\subseteqq", true); - defineSymbol(math, ams, rel, "⋐", "\\Subset", true); - defineSymbol(math, ams, rel, "⊏", "\\sqsubset", true); - defineSymbol(math, ams, rel, "≼", "\\preccurlyeq", true); - defineSymbol(math, ams, rel, "⋞", "\\curlyeqprec", true); - defineSymbol(math, ams, rel, "≾", "\\precsim", true); - defineSymbol(math, ams, rel, "⪷", "\\precapprox", true); - defineSymbol(math, ams, rel, "⊲", "\\vartriangleleft"); - defineSymbol(math, ams, rel, "⊴", "\\trianglelefteq"); - defineSymbol(math, ams, rel, "⊨", "\\vDash", true); - defineSymbol(math, ams, rel, "⊪", "\\Vvdash", true); - defineSymbol(math, ams, rel, "⌣", "\\smallsmile"); - defineSymbol(math, ams, rel, "⌢", "\\smallfrown"); - defineSymbol(math, ams, rel, "≏", "\\bumpeq", true); - defineSymbol(math, ams, rel, "≎", "\\Bumpeq", true); - defineSymbol(math, ams, rel, "≧", "\\geqq", true); - defineSymbol(math, ams, rel, "⩾", "\\geqslant", true); - defineSymbol(math, ams, rel, "⪖", "\\eqslantgtr", true); - defineSymbol(math, ams, rel, "≳", "\\gtrsim", true); - defineSymbol(math, ams, rel, "⪆", "\\gtrapprox", true); - defineSymbol(math, ams, bin, "⋗", "\\gtrdot"); - defineSymbol(math, ams, rel, "⋙", "\\ggg", true); - defineSymbol(math, ams, rel, "≷", "\\gtrless", true); - defineSymbol(math, ams, rel, "⋛", "\\gtreqless", true); - defineSymbol(math, ams, rel, "⪌", "\\gtreqqless", true); - defineSymbol(math, ams, rel, "≖", "\\eqcirc", true); - defineSymbol(math, ams, rel, "≗", "\\circeq", true); - defineSymbol(math, ams, rel, "≜", "\\triangleq", true); - defineSymbol(math, ams, rel, "∼", "\\thicksim"); - defineSymbol(math, ams, rel, "≈", "\\thickapprox"); - defineSymbol(math, ams, rel, "⫆", "\\supseteqq", true); - defineSymbol(math, ams, rel, "⋑", "\\Supset", true); - defineSymbol(math, ams, rel, "⊐", "\\sqsupset", true); - defineSymbol(math, ams, rel, "≽", "\\succcurlyeq", true); - defineSymbol(math, ams, rel, "⋟", "\\curlyeqsucc", true); - defineSymbol(math, ams, rel, "≿", "\\succsim", true); - defineSymbol(math, ams, rel, "⪸", "\\succapprox", true); - defineSymbol(math, ams, rel, "⊳", "\\vartriangleright"); - defineSymbol(math, ams, rel, "⊵", "\\trianglerighteq"); - defineSymbol(math, ams, rel, "⊩", "\\Vdash", true); - defineSymbol(math, ams, rel, "∣", "\\shortmid"); - defineSymbol(math, ams, rel, "∥", "\\shortparallel"); - defineSymbol(math, ams, rel, "≬", "\\between", true); - defineSymbol(math, ams, rel, "⋔", "\\pitchfork", true); - defineSymbol(math, ams, rel, "∝", "\\varpropto"); - defineSymbol(math, ams, rel, "◀", "\\blacktriangleleft"); - defineSymbol(math, ams, rel, "∴", "\\therefore", true); - defineSymbol(math, ams, rel, "∍", "\\backepsilon"); - defineSymbol(math, ams, rel, "▶", "\\blacktriangleright"); - defineSymbol(math, ams, rel, "∵", "\\because", true); - defineSymbol(math, ams, rel, "⋘", "\\llless"); - defineSymbol(math, ams, rel, "⋙", "\\gggtr"); - defineSymbol(math, ams, bin, "⊲", "\\lhd"); - defineSymbol(math, ams, bin, "⊳", "\\rhd"); - defineSymbol(math, ams, rel, "≂", "\\eqsim", true); - defineSymbol(math, main, rel, "⋈", "\\Join"); - defineSymbol(math, ams, rel, "≑", "\\Doteq", true); - defineSymbol(math, ams, bin, "∔", "\\dotplus", true); - defineSymbol(math, ams, bin, "∖", "\\smallsetminus"); - defineSymbol(math, ams, bin, "⋒", "\\Cap", true); - defineSymbol(math, ams, bin, "⋓", "\\Cup", true); - defineSymbol(math, ams, bin, "⩞", "\\doublebarwedge", true); - defineSymbol(math, ams, bin, "⊟", "\\boxminus", true); - defineSymbol(math, ams, bin, "⊞", "\\boxplus", true); - defineSymbol(math, ams, bin, "⋇", "\\divideontimes", true); - defineSymbol(math, ams, bin, "⋉", "\\ltimes", true); - defineSymbol(math, ams, bin, "⋊", "\\rtimes", true); - defineSymbol(math, ams, bin, "⋋", "\\leftthreetimes", true); - defineSymbol(math, ams, bin, "⋌", "\\rightthreetimes", true); - defineSymbol(math, ams, bin, "⋏", "\\curlywedge", true); - defineSymbol(math, ams, bin, "⋎", "\\curlyvee", true); - defineSymbol(math, ams, bin, "⊝", "\\circleddash", true); - defineSymbol(math, ams, bin, "⊛", "\\circledast", true); - defineSymbol(math, ams, bin, "⋅", "\\centerdot"); - defineSymbol(math, ams, bin, "⊺", "\\intercal", true); - defineSymbol(math, ams, bin, "⋒", "\\doublecap"); - defineSymbol(math, ams, bin, "⋓", "\\doublecup"); - defineSymbol(math, ams, bin, "⊠", "\\boxtimes", true); - defineSymbol(math, ams, rel, "⇢", "\\dashrightarrow", true); - defineSymbol(math, ams, rel, "⇠", "\\dashleftarrow", true); - defineSymbol(math, ams, rel, "⇇", "\\leftleftarrows", true); - defineSymbol(math, ams, rel, "⇆", "\\leftrightarrows", true); - defineSymbol(math, ams, rel, "⇚", "\\Lleftarrow", true); - defineSymbol(math, ams, rel, "↞", "\\twoheadleftarrow", true); - defineSymbol(math, ams, rel, "↢", "\\leftarrowtail", true); - defineSymbol(math, ams, rel, "↫", "\\looparrowleft", true); - defineSymbol(math, ams, rel, "⇋", "\\leftrightharpoons", true); - defineSymbol(math, ams, rel, "↶", "\\curvearrowleft", true); - defineSymbol(math, ams, rel, "↺", "\\circlearrowleft", true); - defineSymbol(math, ams, rel, "↰", "\\Lsh", true); - defineSymbol(math, ams, rel, "⇈", "\\upuparrows", true); - defineSymbol(math, ams, rel, "↿", "\\upharpoonleft", true); - defineSymbol(math, ams, rel, "⇃", "\\downharpoonleft", true); - defineSymbol(math, main, rel, "⊶", "\\origof", true); - defineSymbol(math, main, rel, "⊷", "\\imageof", true); - defineSymbol(math, ams, rel, "⊸", "\\multimap", true); - defineSymbol(math, ams, rel, "↭", "\\leftrightsquigarrow", true); - defineSymbol(math, ams, rel, "⇉", "\\rightrightarrows", true); - defineSymbol(math, ams, rel, "⇄", "\\rightleftarrows", true); - defineSymbol(math, ams, rel, "↠", "\\twoheadrightarrow", true); - defineSymbol(math, ams, rel, "↣", "\\rightarrowtail", true); - defineSymbol(math, ams, rel, "↬", "\\looparrowright", true); - defineSymbol(math, ams, rel, "↷", "\\curvearrowright", true); - defineSymbol(math, ams, rel, "↻", "\\circlearrowright", true); - defineSymbol(math, ams, rel, "↱", "\\Rsh", true); - defineSymbol(math, ams, rel, "⇊", "\\downdownarrows", true); - defineSymbol(math, ams, rel, "↾", "\\upharpoonright", true); - defineSymbol(math, ams, rel, "⇂", "\\downharpoonright", true); - defineSymbol(math, ams, rel, "⇝", "\\rightsquigarrow", true); - defineSymbol(math, ams, rel, "⇝", "\\leadsto"); - defineSymbol(math, ams, rel, "⇛", "\\Rrightarrow", true); - defineSymbol(math, ams, rel, "↾", "\\restriction"); - defineSymbol(math, main, textord, "‘", "`"); - defineSymbol(math, main, textord, "$", "\\$"); - defineSymbol(text$2, main, textord, "$", "\\$"); - defineSymbol(text$2, main, textord, "$", "\\textdollar"); - defineSymbol(math, main, textord, "%", "\\%"); - defineSymbol(text$2, main, textord, "%", "\\%"); - defineSymbol(math, main, textord, "_", "\\_"); - defineSymbol(text$2, main, textord, "_", "\\_"); - defineSymbol(text$2, main, textord, "_", "\\textunderscore"); - defineSymbol(math, main, textord, "∠", "\\angle", true); - defineSymbol(math, main, textord, "∞", "\\infty", true); - defineSymbol(math, main, textord, "′", "\\prime"); - defineSymbol(math, main, textord, "△", "\\triangle"); - defineSymbol(math, main, textord, "Γ", "\\Gamma", true); - defineSymbol(math, main, textord, "Δ", "\\Delta", true); - defineSymbol(math, main, textord, "Θ", "\\Theta", true); - defineSymbol(math, main, textord, "Λ", "\\Lambda", true); - defineSymbol(math, main, textord, "Ξ", "\\Xi", true); - defineSymbol(math, main, textord, "Π", "\\Pi", true); - defineSymbol(math, main, textord, "Σ", "\\Sigma", true); - defineSymbol(math, main, textord, "Υ", "\\Upsilon", true); - defineSymbol(math, main, textord, "Φ", "\\Phi", true); - defineSymbol(math, main, textord, "Ψ", "\\Psi", true); - defineSymbol(math, main, textord, "Ω", "\\Omega", true); - defineSymbol(math, main, textord, "A", "Α"); - defineSymbol(math, main, textord, "B", "Β"); - defineSymbol(math, main, textord, "E", "Ε"); - defineSymbol(math, main, textord, "Z", "Ζ"); - defineSymbol(math, main, textord, "H", "Η"); - defineSymbol(math, main, textord, "I", "Ι"); - defineSymbol(math, main, textord, "K", "Κ"); - defineSymbol(math, main, textord, "M", "Μ"); - defineSymbol(math, main, textord, "N", "Ν"); - defineSymbol(math, main, textord, "O", "Ο"); - defineSymbol(math, main, textord, "P", "Ρ"); - defineSymbol(math, main, textord, "T", "Τ"); - defineSymbol(math, main, textord, "X", "Χ"); - defineSymbol(math, main, textord, "¬", "\\neg", true); - defineSymbol(math, main, textord, "¬", "\\lnot"); - defineSymbol(math, main, textord, "⊤", "\\top"); - defineSymbol(math, main, textord, "⊥", "\\bot"); - defineSymbol(math, main, textord, "∅", "\\emptyset"); - defineSymbol(math, ams, textord, "∅", "\\varnothing"); - defineSymbol(math, main, mathord, "α", "\\alpha", true); - defineSymbol(math, main, mathord, "β", "\\beta", true); - defineSymbol(math, main, mathord, "γ", "\\gamma", true); - defineSymbol(math, main, mathord, "δ", "\\delta", true); - defineSymbol(math, main, mathord, "ϵ", "\\epsilon", true); - defineSymbol(math, main, mathord, "ζ", "\\zeta", true); - defineSymbol(math, main, mathord, "η", "\\eta", true); - defineSymbol(math, main, mathord, "θ", "\\theta", true); - defineSymbol(math, main, mathord, "ι", "\\iota", true); - defineSymbol(math, main, mathord, "κ", "\\kappa", true); - defineSymbol(math, main, mathord, "λ", "\\lambda", true); - defineSymbol(math, main, mathord, "μ", "\\mu", true); - defineSymbol(math, main, mathord, "ν", "\\nu", true); - defineSymbol(math, main, mathord, "ξ", "\\xi", true); - defineSymbol(math, main, mathord, "ο", "\\omicron", true); - defineSymbol(math, main, mathord, "π", "\\pi", true); - defineSymbol(math, main, mathord, "ρ", "\\rho", true); - defineSymbol(math, main, mathord, "σ", "\\sigma", true); - defineSymbol(math, main, mathord, "τ", "\\tau", true); - defineSymbol(math, main, mathord, "υ", "\\upsilon", true); - defineSymbol(math, main, mathord, "ϕ", "\\phi", true); - defineSymbol(math, main, mathord, "χ", "\\chi", true); - defineSymbol(math, main, mathord, "ψ", "\\psi", true); - defineSymbol(math, main, mathord, "ω", "\\omega", true); - defineSymbol(math, main, mathord, "ε", "\\varepsilon", true); - defineSymbol(math, main, mathord, "ϑ", "\\vartheta", true); - defineSymbol(math, main, mathord, "ϖ", "\\varpi", true); - defineSymbol(math, main, mathord, "ϱ", "\\varrho", true); - defineSymbol(math, main, mathord, "ς", "\\varsigma", true); - defineSymbol(math, main, mathord, "φ", "\\varphi", true); - defineSymbol(math, main, bin, "∗", "*", true); - defineSymbol(math, main, bin, "+", "+"); - defineSymbol(math, main, bin, "−", "-", true); - defineSymbol(math, main, bin, "⋅", "\\cdot", true); - defineSymbol(math, main, bin, "∘", "\\circ", true); - defineSymbol(math, main, bin, "÷", "\\div", true); - defineSymbol(math, main, bin, "±", "\\pm", true); - defineSymbol(math, main, bin, "×", "\\times", true); - defineSymbol(math, main, bin, "∩", "\\cap", true); - defineSymbol(math, main, bin, "∪", "\\cup", true); - defineSymbol(math, main, bin, "∖", "\\setminus", true); - defineSymbol(math, main, bin, "∧", "\\land"); - defineSymbol(math, main, bin, "∨", "\\lor"); - defineSymbol(math, main, bin, "∧", "\\wedge", true); - defineSymbol(math, main, bin, "∨", "\\vee", true); - defineSymbol(math, main, textord, "√", "\\surd"); - defineSymbol(math, main, open, "⟨", "\\langle", true); - defineSymbol(math, main, open, "∣", "\\lvert"); - defineSymbol(math, main, open, "∥", "\\lVert"); - defineSymbol(math, main, close, "?", "?"); - defineSymbol(math, main, close, "!", "!"); - defineSymbol(math, main, close, "⟩", "\\rangle", true); - defineSymbol(math, main, close, "∣", "\\rvert"); - defineSymbol(math, main, close, "∥", "\\rVert"); - defineSymbol(math, main, rel, "=", "="); - defineSymbol(math, main, rel, ":", ":"); - defineSymbol(math, main, rel, "≈", "\\approx", true); - defineSymbol(math, main, rel, "≅", "\\cong", true); - defineSymbol(math, main, rel, "≥", "\\ge"); - defineSymbol(math, main, rel, "≥", "\\geq", true); - defineSymbol(math, main, rel, "←", "\\gets"); - defineSymbol(math, main, rel, ">", "\\gt", true); - defineSymbol(math, main, rel, "∈", "\\in", true); - defineSymbol(math, main, rel, "", "\\@not"); - defineSymbol(math, main, rel, "⊂", "\\subset", true); - defineSymbol(math, main, rel, "⊃", "\\supset", true); - defineSymbol(math, main, rel, "⊆", "\\subseteq", true); - defineSymbol(math, main, rel, "⊇", "\\supseteq", true); - defineSymbol(math, ams, rel, "⊈", "\\nsubseteq", true); - defineSymbol(math, ams, rel, "⊉", "\\nsupseteq", true); - defineSymbol(math, main, rel, "⊨", "\\models"); - defineSymbol(math, main, rel, "←", "\\leftarrow", true); - defineSymbol(math, main, rel, "≤", "\\le"); - defineSymbol(math, main, rel, "≤", "\\leq", true); - defineSymbol(math, main, rel, "<", "\\lt", true); - defineSymbol(math, main, rel, "→", "\\rightarrow", true); - defineSymbol(math, main, rel, "→", "\\to"); - defineSymbol(math, ams, rel, "≱", "\\ngeq", true); - defineSymbol(math, ams, rel, "≰", "\\nleq", true); - defineSymbol(math, main, spacing, "\xA0", "\\ "); - defineSymbol(math, main, spacing, "\xA0", "\\space"); - defineSymbol(math, main, spacing, "\xA0", "\\nobreakspace"); - defineSymbol(text$2, main, spacing, "\xA0", "\\ "); - defineSymbol(text$2, main, spacing, "\xA0", " "); - defineSymbol(text$2, main, spacing, "\xA0", "\\space"); - defineSymbol(text$2, main, spacing, "\xA0", "\\nobreakspace"); - defineSymbol(math, main, spacing, "", "\\nobreak"); - defineSymbol(math, main, spacing, "", "\\allowbreak"); - defineSymbol(math, main, punct, ",", ","); - defineSymbol(math, main, punct, ";", ";"); - defineSymbol(math, ams, bin, "⊼", "\\barwedge", true); - defineSymbol(math, ams, bin, "⊻", "\\veebar", true); - defineSymbol(math, main, bin, "⊙", "\\odot", true); - defineSymbol(math, main, bin, "⊕", "\\oplus", true); - defineSymbol(math, main, bin, "⊗", "\\otimes", true); - defineSymbol(math, main, textord, "∂", "\\partial", true); - defineSymbol(math, main, bin, "⊘", "\\oslash", true); - defineSymbol(math, ams, bin, "⊚", "\\circledcirc", true); - defineSymbol(math, ams, bin, "⊡", "\\boxdot", true); - defineSymbol(math, main, bin, "△", "\\bigtriangleup"); - defineSymbol(math, main, bin, "▽", "\\bigtriangledown"); - defineSymbol(math, main, bin, "†", "\\dagger"); - defineSymbol(math, main, bin, "⋄", "\\diamond"); - defineSymbol(math, main, bin, "⋆", "\\star"); - defineSymbol(math, main, bin, "◃", "\\triangleleft"); - defineSymbol(math, main, bin, "▹", "\\triangleright"); - defineSymbol(math, main, open, "{", "\\{"); - defineSymbol(text$2, main, textord, "{", "\\{"); - defineSymbol(text$2, main, textord, "{", "\\textbraceleft"); - defineSymbol(math, main, close, "}", "\\}"); - defineSymbol(text$2, main, textord, "}", "\\}"); - defineSymbol(text$2, main, textord, "}", "\\textbraceright"); - defineSymbol(math, main, open, "{", "\\lbrace"); - defineSymbol(math, main, close, "}", "\\rbrace"); - defineSymbol(math, main, open, "[", "\\lbrack", true); - defineSymbol(text$2, main, textord, "[", "\\lbrack", true); - defineSymbol(math, main, close, "]", "\\rbrack", true); - defineSymbol(text$2, main, textord, "]", "\\rbrack", true); - defineSymbol(math, main, open, "(", "\\lparen", true); - defineSymbol(math, main, close, ")", "\\rparen", true); - defineSymbol(text$2, main, textord, "<", "\\textless", true); - defineSymbol(text$2, main, textord, ">", "\\textgreater", true); - defineSymbol(math, main, open, "⌊", "\\lfloor", true); - defineSymbol(math, main, close, "⌋", "\\rfloor", true); - defineSymbol(math, main, open, "⌈", "\\lceil", true); - defineSymbol(math, main, close, "⌉", "\\rceil", true); - defineSymbol(math, main, textord, "\\", "\\backslash"); - defineSymbol(math, main, textord, "∣", "|"); - defineSymbol(math, main, textord, "∣", "\\vert"); - defineSymbol(text$2, main, textord, "|", "\\textbar", true); - defineSymbol(math, main, textord, "∥", "\\|"); - defineSymbol(math, main, textord, "∥", "\\Vert"); - defineSymbol(text$2, main, textord, "∥", "\\textbardbl"); - defineSymbol(text$2, main, textord, "~", "\\textasciitilde"); - defineSymbol(text$2, main, textord, "\\", "\\textbackslash"); - defineSymbol(text$2, main, textord, "^", "\\textasciicircum"); - defineSymbol(math, main, rel, "↑", "\\uparrow", true); - defineSymbol(math, main, rel, "⇑", "\\Uparrow", true); - defineSymbol(math, main, rel, "↓", "\\downarrow", true); - defineSymbol(math, main, rel, "⇓", "\\Downarrow", true); - defineSymbol(math, main, rel, "↕", "\\updownarrow", true); - defineSymbol(math, main, rel, "⇕", "\\Updownarrow", true); - defineSymbol(math, main, op, "∐", "\\coprod"); - defineSymbol(math, main, op, "⋁", "\\bigvee"); - defineSymbol(math, main, op, "⋀", "\\bigwedge"); - defineSymbol(math, main, op, "⨄", "\\biguplus"); - defineSymbol(math, main, op, "⋂", "\\bigcap"); - defineSymbol(math, main, op, "⋃", "\\bigcup"); - defineSymbol(math, main, op, "∫", "\\int"); - defineSymbol(math, main, op, "∫", "\\intop"); - defineSymbol(math, main, op, "∬", "\\iint"); - defineSymbol(math, main, op, "∭", "\\iiint"); - defineSymbol(math, main, op, "∏", "\\prod"); - defineSymbol(math, main, op, "∑", "\\sum"); - defineSymbol(math, main, op, "⨂", "\\bigotimes"); - defineSymbol(math, main, op, "⨁", "\\bigoplus"); - defineSymbol(math, main, op, "⨀", "\\bigodot"); - defineSymbol(math, main, op, "∮", "\\oint"); - defineSymbol(math, main, op, "∯", "\\oiint"); - defineSymbol(math, main, op, "∰", "\\oiiint"); - defineSymbol(math, main, op, "⨆", "\\bigsqcup"); - defineSymbol(math, main, op, "∫", "\\smallint"); - defineSymbol(text$2, main, inner, "…", "\\textellipsis"); - defineSymbol(math, main, inner, "…", "\\mathellipsis"); - defineSymbol(text$2, main, inner, "…", "\\ldots", true); - defineSymbol(math, main, inner, "…", "\\ldots", true); - defineSymbol(math, main, inner, "⋯", "\\@cdots", true); - defineSymbol(math, main, inner, "⋱", "\\ddots", true); - defineSymbol(math, main, textord, "⋮", "\\varvdots"); - defineSymbol(text$2, main, textord, "⋮", "\\varvdots"); - defineSymbol(math, main, accent, "ˊ", "\\acute"); - defineSymbol(math, main, accent, "ˋ", "\\grave"); - defineSymbol(math, main, accent, "¨", "\\ddot"); - defineSymbol(math, main, accent, "~", "\\tilde"); - defineSymbol(math, main, accent, "ˉ", "\\bar"); - defineSymbol(math, main, accent, "˘", "\\breve"); - defineSymbol(math, main, accent, "ˇ", "\\check"); - defineSymbol(math, main, accent, "^", "\\hat"); - defineSymbol(math, main, accent, "⃗", "\\vec"); - defineSymbol(math, main, accent, "˙", "\\dot"); - defineSymbol(math, main, accent, "˚", "\\mathring"); - defineSymbol(math, main, mathord, "", "\\@imath"); - defineSymbol(math, main, mathord, "", "\\@jmath"); - defineSymbol(math, main, textord, "ı", "ı"); - defineSymbol(math, main, textord, "ȷ", "ȷ"); - defineSymbol(text$2, main, textord, "ı", "\\i", true); - defineSymbol(text$2, main, textord, "ȷ", "\\j", true); - defineSymbol(text$2, main, textord, "ß", "\\ss", true); - defineSymbol(text$2, main, textord, "æ", "\\ae", true); - defineSymbol(text$2, main, textord, "œ", "\\oe", true); - defineSymbol(text$2, main, textord, "ø", "\\o", true); - defineSymbol(text$2, main, textord, "Æ", "\\AE", true); - defineSymbol(text$2, main, textord, "Œ", "\\OE", true); - defineSymbol(text$2, main, textord, "Ø", "\\O", true); - defineSymbol(text$2, main, accent, "ˊ", "\\'"); - defineSymbol(text$2, main, accent, "ˋ", "\\`"); - defineSymbol(text$2, main, accent, "ˆ", "\\^"); - defineSymbol(text$2, main, accent, "˜", "\\~"); - defineSymbol(text$2, main, accent, "ˉ", "\\="); - defineSymbol(text$2, main, accent, "˘", "\\u"); - defineSymbol(text$2, main, accent, "˙", "\\."); - defineSymbol(text$2, main, accent, "¸", "\\c"); - defineSymbol(text$2, main, accent, "˚", "\\r"); - defineSymbol(text$2, main, accent, "ˇ", "\\v"); - defineSymbol(text$2, main, accent, "¨", "\\\""); - defineSymbol(text$2, main, accent, "˝", "\\H"); - defineSymbol(text$2, main, accent, "◯", "\\textcircled"); - var ligatures = { - "--": true, - "---": true, - "``": true, - "''": true - }; - defineSymbol(text$2, main, textord, "–", "--", true); - defineSymbol(text$2, main, textord, "–", "\\textendash"); - defineSymbol(text$2, main, textord, "—", "---", true); - defineSymbol(text$2, main, textord, "—", "\\textemdash"); - defineSymbol(text$2, main, textord, "‘", "`", true); - defineSymbol(text$2, main, textord, "‘", "\\textquoteleft"); - defineSymbol(text$2, main, textord, "’", "'", true); - defineSymbol(text$2, main, textord, "’", "\\textquoteright"); - defineSymbol(text$2, main, textord, "“", "``", true); - defineSymbol(text$2, main, textord, "“", "\\textquotedblleft"); - defineSymbol(text$2, main, textord, "”", "''", true); - defineSymbol(text$2, main, textord, "”", "\\textquotedblright"); - defineSymbol(math, main, textord, "°", "\\degree", true); - defineSymbol(text$2, main, textord, "°", "\\degree"); - defineSymbol(text$2, main, textord, "°", "\\textdegree", true); - defineSymbol(math, main, textord, "£", "\\pounds"); - defineSymbol(math, main, textord, "£", "\\mathsterling", true); - defineSymbol(text$2, main, textord, "£", "\\pounds"); - defineSymbol(text$2, main, textord, "£", "\\textsterling", true); - defineSymbol(math, ams, textord, "✠", "\\maltese"); - defineSymbol(text$2, ams, textord, "✠", "\\maltese"); - var mathTextSymbols = "0123456789/@.\""; - for (var i = 0; i < mathTextSymbols.length; i++) { - var ch = mathTextSymbols.charAt(i); - defineSymbol(math, main, textord, ch, ch); - } - var textSymbols = "0123456789!@*()-=+\";:?/.,"; - for (var _i = 0; _i < textSymbols.length; _i++) { - var _ch = textSymbols.charAt(_i); - defineSymbol(text$2, main, textord, _ch, _ch); - } - var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - for (var _i2 = 0; _i2 < letters.length; _i2++) { - var _ch2 = letters.charAt(_i2); - defineSymbol(math, main, mathord, _ch2, _ch2); - defineSymbol(text$2, main, textord, _ch2, _ch2); - } - defineSymbol(math, ams, textord, "C", "ℂ"); - defineSymbol(text$2, ams, textord, "C", "ℂ"); - defineSymbol(math, ams, textord, "H", "ℍ"); - defineSymbol(text$2, ams, textord, "H", "ℍ"); - defineSymbol(math, ams, textord, "N", "ℕ"); - defineSymbol(text$2, ams, textord, "N", "ℕ"); - defineSymbol(math, ams, textord, "P", "ℙ"); - defineSymbol(text$2, ams, textord, "P", "ℙ"); - defineSymbol(math, ams, textord, "Q", "ℚ"); - defineSymbol(text$2, ams, textord, "Q", "ℚ"); - defineSymbol(math, ams, textord, "R", "ℝ"); - defineSymbol(text$2, ams, textord, "R", "ℝ"); - defineSymbol(math, ams, textord, "Z", "ℤ"); - defineSymbol(text$2, ams, textord, "Z", "ℤ"); - defineSymbol(math, main, mathord, "h", "ℎ"); - defineSymbol(text$2, main, mathord, "h", "ℎ"); - var wideChar; - for (var _i3 = 0; _i3 < letters.length; _i3++) { - var _ch3 = letters.charAt(_i3); - wideChar = String.fromCharCode(55349, 56320 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56372 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56424 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56580 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56684 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56736 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56788 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56840 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56944 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - if (_i3 < 26) { - wideChar = String.fromCharCode(55349, 56632 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56476 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - } - } - wideChar = String.fromCharCode(55349, 56668); - defineSymbol(math, main, mathord, "k", wideChar); - defineSymbol(text$2, main, textord, "k", wideChar); - for (var _i4 = 0; _i4 < 10; _i4++) { - var _ch4 = _i4.toString(); - wideChar = String.fromCharCode(55349, 57294 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57314 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57324 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57334 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - } - var extraLatin = "ÐÞþ"; - for (var _i5 = 0; _i5 < extraLatin.length; _i5++) { - var _ch5 = extraLatin.charAt(_i5); - defineSymbol(math, main, mathord, _ch5, _ch5); - defineSymbol(text$2, main, textord, _ch5, _ch5); - } - /** - * This file provides support for Unicode range U+1D400 to U+1D7FF, - * Mathematical Alphanumeric Symbols. - * - * Function wideCharacterFont takes a wide character as input and returns - * the font information necessary to render it properly. - */ - var boldUpright = { - mathClass: "mathbf", - textClass: "textbf", - font: "Main-Bold" - }; - var italic = { - mathClass: "mathnormal", - textClass: "textit", - font: "Math-Italic" - }; - var boldItalic = { - mathClass: "boldsymbol", - textClass: "boldsymbol", - font: "Main-BoldItalic" - }; - var script = { - mathClass: "mathscr", - textClass: "textscr", - font: "Script-Regular" - }; - var noFont = { - mathClass: "", - textClass: "", - font: "" - }; - var fraktur = { - mathClass: "mathfrak", - textClass: "textfrak", - font: "Fraktur-Regular" - }; - var doubleStruck = { - mathClass: "mathbb", - textClass: "textbb", - font: "AMS-Regular" - }; - var boldFraktur = { - mathClass: "mathboldfrak", - textClass: "textboldfrak", - font: "Fraktur-Regular" - }; - var sansSerif = { - mathClass: "mathsf", - textClass: "textsf", - font: "SansSerif-Regular" - }; - var boldSansSerif = { - mathClass: "mathboldsf", - textClass: "textboldsf", - font: "SansSerif-Bold" - }; - var italicSansSerif = { - mathClass: "mathitsf", - textClass: "textitsf", - font: "SansSerif-Italic" - }; - var monospace = { - mathClass: "mathtt", - textClass: "texttt", - font: "Typewriter-Regular" - }; - /** - * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf - * That document sorts characters into groups by font type, say bold or italic. - * - * In the arrays below, each object consists of three properties: - * * The CSS class of that group when in math mode. - * * The CSS class of that group when in text mode. - * * The font name, so that KaTeX can get font metrics. - */ - var wideLatinLetterData = [ - boldUpright, - boldUpright, - italic, - italic, - boldItalic, - boldItalic, - script, - noFont, - noFont, - noFont, - fraktur, - fraktur, - doubleStruck, - doubleStruck, - boldFraktur, - boldFraktur, - sansSerif, - sansSerif, - boldSansSerif, - boldSansSerif, - italicSansSerif, - italicSansSerif, - noFont, - noFont, - monospace, - monospace - ]; - var wideNumeralData = [ - boldUpright, - noFont, - sansSerif, - boldSansSerif, - monospace - ]; - var wideCharacterFont = (wideChar) => { - var H = wideChar.charCodeAt(0); - var L = wideChar.charCodeAt(1); - var codePoint = (H - 55296) * 1024 + (L - 56320) + 65536; - if (119808 <= codePoint && codePoint < 120484) return wideLatinLetterData[Math.floor((codePoint - 119808) / 26)]; - else if (120782 <= codePoint && codePoint <= 120831) return wideNumeralData[Math.floor((codePoint - 120782) / 10)]; - else if (codePoint === 120485 || codePoint === 120486) return wideLatinLetterData[0]; - else if (120486 < codePoint && codePoint < 120782) return noFont; - else throw new ParseError("Unsupported character: " + wideChar); - }; - function handleStrict(params) { - var strict = params.strict, errorCode = params.errorCode, errorMsg = params.errorMsg, token = params.token, report = params.report; - var behavior = strict; - if (typeof strict === "function") { - if (report) behavior = strict(errorCode, errorMsg, token); - else try { - behavior = strict(errorCode, errorMsg, token); - } catch (error) { - behavior = "error"; - } - } - switch (behavior) { - case true: - case "error": if (report) throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token); - else return true; - case false: - case "ignore": - if (!report) return false; - break; - default: - typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]")); - if (!report) return false; - } - } - /** - * This module contains general functions that can be used for building - * different kinds of domTree nodes in a consistent manner. - */ - /** - * Looks up the given symbol in fontMetrics, after applying any symbol - * replacements defined in symbol.js - */ - var lookupSymbol = function lookupSymbol(value, fontName, mode) { - if (symbols[mode][value]) { - var replacement = symbols[mode][value].replace; - if (replacement) value = replacement; - } - return { - value, - metrics: getCharacterMetrics(value, fontName, mode) - }; - }; - /** - * Makes a symbolNode after translation via the list of symbols in symbols.js. - * Correctly pulls out metrics for the character, and optionally takes a list of - * classes to be attached to the node. - * - * TODO: make argument order closer to makeSpan - * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which - * should if present come first in `classes`. - */ - var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) { - var lookup = lookupSymbol(value, fontName, mode); - var metrics = lookup.metrics; - value = lookup.value; - var symbolNode; - if (metrics) { - var italic = metrics.italic; - if (mode === "text" || options && options.font === "mathit") italic = 0; - symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes); - } else { - handleStrict({ - strict: options.strict, - errorCode: "symbolNotInFont", - errorMsg: "No character metrics for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'", - report: true - }); - symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes); - } - symbolNode.maxFontSize = options.sizeMultiplier; - if (options.style.isTight()) symbolNode.classes.push("mtight"); - var color = options.getColor(); - if (color) symbolNode.style.color = color; - return symbolNode; - }; - /** - * Makes a symbol in Main-Regular or AMS-Regular. - * Used for rel, bin, open, close, inner, and punct. - */ - var mathsym = function mathsym(value, mode, options, classes) { - if (classes === void 0) classes = []; - if (options.font === "boldsymbol" && lookupSymbol(value, "Main-Bold", mode).metrics) return makeSymbol(value, "Main-Bold", mode, options, classes.concat(["mathbf"])); - else if (value === "\\" || symbols[mode][value].font === "main") return makeSymbol(value, "Main-Regular", mode, options, classes); - else return makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"])); - }; - /** - * Determines which of the two font names (Main-Bold and Math-BoldItalic) and - * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol", - * depending on the symbol. Use this function instead of fontMap for font - * "boldsymbol". - */ - var boldSymbol = function boldSymbol(value, mode, type) { - if (type !== "textord" && lookupSymbol(value, "Math-BoldItalic", mode).metrics) return { - fontName: "Math-BoldItalic", - fontClass: "boldsymbol" - }; - else return { - fontName: "Main-Bold", - fontClass: "mathbf" - }; - }; - /** - * Makes either a mathord or textord in the correct font and color. - */ - var makeOrd = function makeOrd(group, options) { - var type = group.type === "mathord" ? "mathord" : "textord"; - var mode = group.mode; - var text = group.text; - var classes = ["mord"]; - var font = options.font, fontFamily = options.fontFamily, fontWeight = options.fontWeight, fontShape = options.fontShape; - var useFont = mode === "math" || mode === "text" && !!font; - var fontOrFamily = useFont ? font : fontFamily; - var wideFontName = ""; - var wideFontClass = ""; - if (text.charCodeAt(0) === 55349) { - var wideCharData = wideCharacterFont(text); - wideFontName = wideCharData.font; - wideFontClass = wideCharData[mode + "Class"]; - } - if (wideFontName) return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass)); - else if (fontOrFamily) { - var fontName; - var fontClasses; - if (fontOrFamily === "boldsymbol") { - var fontData = boldSymbol(text, mode, type); - fontName = fontData.fontName; - fontClasses = [fontData.fontClass]; - } else if (useFont) { - fontName = fontMap[font].fontName; - fontClasses = [font]; - } else { - fontName = retrieveTextFontName(fontFamily, fontWeight, fontShape); - fontClasses = [ - fontFamily, - fontWeight, - fontShape - ]; - } - if (lookupSymbol(text, fontName, mode).metrics) return makeSymbol(text, fontName, mode, options, classes.concat(fontClasses)); - else if (Object.prototype.hasOwnProperty.call(ligatures, text) && fontName.slice(0, 10) === "Typewriter") { - var parts = []; - for (var i = 0; i < text.length; i++) parts.push(makeSymbol(text[i], fontName, mode, options, classes.concat(fontClasses))); - return makeFragment(parts); - } - } - if (type === "mathord") return makeSymbol(text, "Math-Italic", mode, options, classes.concat(["mathnormal"])); - else if (type === "textord") { - var _font = symbols[mode][text] && symbols[mode][text].font; - if (_font === "ams") return makeSymbol(text, retrieveTextFontName("amsrm", fontWeight, fontShape), mode, options, classes.concat("amsrm", fontWeight, fontShape)); - else if (_font === "main" || !_font) return makeSymbol(text, retrieveTextFontName("textrm", fontWeight, fontShape), mode, options, classes.concat(fontWeight, fontShape)); - else { - var _fontName3 = retrieveTextFontName(_font, fontWeight, fontShape); - return makeSymbol(text, _fontName3, mode, options, classes.concat(_fontName3, fontWeight, fontShape)); - } - } else throw new Error("unexpected type: " + type + " in makeOrd"); - }; - /** - * Returns true if subsequent symbolNodes have the same classes, skew, maxFont, - * and styles. For mathnormal text, the left node must also have zero italic - * correction so we don't lose spacing between combined glyphs. - */ - var canCombine = (prev, next) => { - if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize || prev.italic !== 0 && prev.hasClass("mathnormal")) return false; - if (prev.classes.length === 1) { - var cls = prev.classes[0]; - if (cls === "mbin" || cls === "mord") return false; - } - for (var key of Object.keys(prev.style)) if (prev.style[key] !== next.style[key]) return false; - for (var _key of Object.keys(next.style)) if (prev.style[_key] !== next.style[_key]) return false; - return true; - }; - /** - * Combine consecutive domTree.symbolNodes into a single symbolNode. - * Note: this function mutates the argument. - */ - var tryCombineChars = (chars) => { - for (var i = 0; i < chars.length - 1; i++) { - var prev = chars[i]; - var next = chars[i + 1]; - if (prev instanceof SymbolNode && next instanceof SymbolNode && canCombine(prev, next)) { - prev.text += next.text; - prev.height = Math.max(prev.height, next.height); - prev.depth = Math.max(prev.depth, next.depth); - prev.italic = next.italic; - chars.splice(i + 1, 1); - i--; - } - } - return chars; - }; - /** - * Calculate the height, depth, and maxFontSize of an element based on its - * children. - */ - var sizeElementFromChildren = function sizeElementFromChildren(elem) { - var height = 0; - var depth = 0; - var maxFontSize = 0; - for (var i = 0; i < elem.children.length; i++) { - var child = elem.children[i]; - if (child.height > height) height = child.height; - if (child.depth > depth) depth = child.depth; - if (child.maxFontSize > maxFontSize) maxFontSize = child.maxFontSize; - } - elem.height = height; - elem.depth = depth; - elem.maxFontSize = maxFontSize; - }; - /** - * Makes a span with the given list of classes, list of children, and options. - * - * TODO(#953): Ensure that `options` is always provided (currently some call - * sites don't pass it) and make the type below mandatory. - * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which - * should if present come first in `classes`. - */ - var makeSpan = function makeSpan(classes, children, options, style) { - var span = new Span(classes, children, options, style); - sizeElementFromChildren(span); - return span; - }; - var makeSvgSpan = (classes, children, options, style) => new Span(classes, children, options, style); - var makeLineSpan = function makeLineSpan(className, options, thickness) { - var line = makeSpan([className], [], options); - line.height = Math.max(thickness || options.fontMetrics().defaultRuleThickness, options.minRuleThickness); - line.style.borderBottomWidth = makeEm(line.height); - line.maxFontSize = 1; - return line; - }; - /** - * Makes an anchor with the given href, list of classes, list of children, - * and options. - */ - var makeAnchor = function makeAnchor(href, classes, children, options) { - var anchor = new Anchor(href, classes, children, options); - sizeElementFromChildren(anchor); - return anchor; - }; - /** - * Makes a document fragment with the given list of children. - */ - var makeFragment = function makeFragment(children) { - var fragment = new DocumentFragment(children); - sizeElementFromChildren(fragment); - return fragment; - }; - /** - * Wraps group in a span if it's a document fragment, allowing to apply classes - * and styles - */ - var wrapFragment = function wrapFragment(group, options) { - if (group instanceof DocumentFragment) return makeSpan([], [group], options); - return group; - }; - var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) { - if (params.positionType === "individualShift") { - var oldChildren = params.children; - var children = [oldChildren[0]]; - var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth; - var currPos = _depth; - for (var i = 1; i < oldChildren.length; i++) { - var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth; - var size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth); - currPos = currPos + diff; - children.push({ - type: "kern", - size - }); - children.push(oldChildren[i]); - } - return { - children, - depth: _depth - }; - } - var depth; - if (params.positionType === "top") { - var bottom = params.positionData; - for (var _i = 0; _i < params.children.length; _i++) { - var child = params.children[_i]; - bottom -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth; - } - depth = bottom; - } else if (params.positionType === "bottom") depth = -params.positionData; - else { - var firstChild = params.children[0]; - if (firstChild.type !== "elem") throw new Error("First child must have type \"elem\"."); - if (params.positionType === "shift") depth = -firstChild.elem.depth - params.positionData; - else if (params.positionType === "firstBaseline") depth = -firstChild.elem.depth; - else throw new Error("Invalid positionType " + params.positionType + "."); - } - return { - children: params.children, - depth - }; - }; - /** - * Makes a vertical list by stacking elements and kerns on top of each other. - * Allows for many different ways of specifying the positioning method. - * - * See VListParam documentation above. - */ - var makeVList = function makeVList(params, options) { - var _getVListChildrenAndD = getVListChildrenAndDepth(params), children = _getVListChildrenAndD.children, depth = _getVListChildrenAndD.depth; - var pstrutSize = 0; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (child.type === "elem") { - var elem = child.elem; - pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height); - } - } - pstrutSize += 2; - var pstrut = makeSpan(["pstrut"], []); - pstrut.style.height = makeEm(pstrutSize); - var realChildren = []; - var minPos = depth; - var maxPos = depth; - var currPos = depth; - for (var _i2 = 0; _i2 < children.length; _i2++) { - var _child = children[_i2]; - if (_child.type === "kern") currPos += _child.size; - else { - var _elem = _child.elem; - var classes = _child.wrapperClasses || []; - var style = _child.wrapperStyle || {}; - var childWrap = makeSpan(classes, [pstrut, _elem], void 0, style); - childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth); - if (_child.marginLeft) childWrap.style.marginLeft = _child.marginLeft; - if (_child.marginRight) childWrap.style.marginRight = _child.marginRight; - realChildren.push(childWrap); - currPos += _elem.height + _elem.depth; - } - minPos = Math.min(minPos, currPos); - maxPos = Math.max(maxPos, currPos); - } - var vlist = makeSpan(["vlist"], realChildren); - vlist.style.height = makeEm(maxPos); - var rows; - if (minPos < 0) { - var depthStrut = makeSpan(["vlist"], [makeSpan([], [])]); - depthStrut.style.height = makeEm(-minPos); - rows = [makeSpan(["vlist-r"], [vlist, makeSpan(["vlist-s"], [new SymbolNode("​")])]), makeSpan(["vlist-r"], [depthStrut])]; - } else rows = [makeSpan(["vlist-r"], [vlist])]; - var vtable = makeSpan(["vlist-t"], rows); - if (rows.length === 2) vtable.classes.push("vlist-t2"); - vtable.height = maxPos; - vtable.depth = -minPos; - return vtable; - }; - var makeGlue = (measurement, options) => { - var rule = makeSpan(["mspace"], [], options); - var size = calculateSize(measurement, options); - rule.style.marginRight = makeEm(size); - return rule; - }; - var retrieveTextFontName = (fontFamily, fontWeight, fontShape) => { - var baseFontName; - var fontStylesName; - switch (fontFamily) { - case "amsrm": - baseFontName = "AMS"; - break; - case "textrm": - baseFontName = "Main"; - break; - case "textsf": - baseFontName = "SansSerif"; - break; - case "texttt": - baseFontName = "Typewriter"; - break; - default: baseFontName = fontFamily; - } - if (fontWeight === "textbf" && fontShape === "textit") fontStylesName = "BoldItalic"; - else if (fontWeight === "textbf") fontStylesName = "Bold"; - else if (fontShape === "textit") fontStylesName = "Italic"; - else fontStylesName = "Regular"; - return baseFontName + "-" + fontStylesName; - }; - /** - * Maps TeX font commands to objects containing: - * - variant: string used for "mathvariant" attribute in buildMathML.js - * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics - */ - var fontMap = { - "mathbf": { - variant: "bold", - fontName: "Main-Bold" - }, - "mathrm": { - variant: "normal", - fontName: "Main-Regular" - }, - "textit": { - variant: "italic", - fontName: "Main-Italic" - }, - "mathit": { - variant: "italic", - fontName: "Main-Italic" - }, - "mathnormal": { - variant: "italic", - fontName: "Math-Italic" - }, - "mathsfit": { - variant: "sans-serif-italic", - fontName: "SansSerif-Italic" - }, - "mathbb": { - variant: "double-struck", - fontName: "AMS-Regular" - }, - "mathcal": { - variant: "script", - fontName: "Caligraphic-Regular" - }, - "mathfrak": { - variant: "fraktur", - fontName: "Fraktur-Regular" - }, - "mathscr": { - variant: "script", - fontName: "Script-Regular" - }, - "mathsf": { - variant: "sans-serif", - fontName: "SansSerif-Regular" - }, - "mathtt": { - variant: "monospace", - fontName: "Typewriter-Regular" - } - }; - var svgData = { - vec: [ - "vec", - .471, - .714 - ], - oiintSize1: [ - "oiintSize1", - .957, - .499 - ], - oiintSize2: [ - "oiintSize2", - 1.472, - .659 - ], - oiiintSize1: [ - "oiiintSize1", - 1.304, - .499 - ], - oiiintSize2: [ - "oiiintSize2", - 1.98, - .659 - ] - }; - var staticSvg = function staticSvg(value, options) { - var _svgData$value = svgData[value], pathName = _svgData$value[0], width = _svgData$value[1], height = _svgData$value[2]; - var span = makeSvgSpan(["katex-overlay"], [new SvgNode([new PathNode(pathName)], { - "width": makeEm(width), - "height": makeEm(height), - "style": "width:" + makeEm(width), - "viewBox": "0 0 " + 1e3 * width + " " + 1e3 * height, - "preserveAspectRatio": "xMinYMin" - })], options); - span.height = height; - span.style.height = makeEm(height); - span.style.width = makeEm(width); - return span; - }; - /** - * Describes spaces between different classes of atoms. - */ - var thinspace = { - number: 3, - unit: "mu" - }; - var mediumspace = { - number: 4, - unit: "mu" - }; - var thickspace = { - number: 5, - unit: "mu" - }; - var spacings = { - mord: { - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - minner: thinspace - }, - mop: { - mord: thinspace, - mop: thinspace, - mrel: thickspace, - minner: thinspace - }, - mbin: { - mord: mediumspace, - mop: mediumspace, - mopen: mediumspace, - minner: mediumspace - }, - mrel: { - mord: thickspace, - mop: thickspace, - mopen: thickspace, - minner: thickspace - }, - mopen: {}, - mclose: { - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - minner: thinspace - }, - mpunct: { - mord: thinspace, - mop: thinspace, - mrel: thickspace, - mopen: thinspace, - mclose: thinspace, - mpunct: thinspace, - minner: thinspace - }, - minner: { - mord: thinspace, - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - mopen: thinspace, - mpunct: thinspace, - minner: thinspace - } - }; - var tightSpacings = { - mord: { mop: thinspace }, - mop: { - mord: thinspace, - mop: thinspace - }, - mbin: {}, - mrel: {}, - mopen: {}, - mclose: { mop: thinspace }, - mpunct: {}, - minner: { mop: thinspace } - }; - /** - * All registered functions. - * `functions.js` just exports this same dictionary again and makes it public. - * `Parser.js` requires this dictionary. - */ - var _functions = {}; - /** - * All HTML builders. Should be only used in the `define*` and the `build*ML` - * functions. - * - * Builders for different node types are stored side by side, but - * `HtmlBuilder<T>` is contravariant in `T`, so there is no single type - * argument that makes storing/retrieving them typecheck. `any` is used - * as an existential-quantifier escape hatch. - */ - var _htmlGroupBuilders = {}; - /** - * All MathML builders. Should be only used in the `define*` and the `build*ML` - * functions. See `_htmlGroupBuilders` above for the rationale behind `any`. - */ - var _mathmlGroupBuilders = {}; - function defineFunction(data) { - var type = data.type, names = data.names, htmlBuilder = data.htmlBuilder, mathmlBuilder = data.mathmlBuilder; - for (var i = 0; i < names.length; ++i) _functions[names[i]] = data; - if (type) { - if (htmlBuilder) _htmlGroupBuilders[type] = htmlBuilder; - if (mathmlBuilder) _mathmlGroupBuilders[type] = mathmlBuilder; - } - } - /** - * Use this to register only the HTML and MathML builders for a function (e.g. - * if the function's ParseNode is generated in Parser.js rather than via a - * stand-alone handler provided to `defineFunction`). - */ - function defineFunctionBuilders(_ref) { - var type = _ref.type, htmlBuilder = _ref.htmlBuilder, mathmlBuilder = _ref.mathmlBuilder; - if (htmlBuilder) _htmlGroupBuilders[type] = htmlBuilder; - if (mathmlBuilder) _mathmlGroupBuilders[type] = mathmlBuilder; - } - var normalizeArgument = function normalizeArgument(arg) { - return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg; - }; - var ordargument = function ordargument(arg) { - return arg.type === "ordgroup" ? arg.body : [arg]; - }; - /** - * This file does the main work of building a domTree structure from a parse - * tree. The entry point is the `buildHTML` function, which takes a parse tree. - * Then, the buildExpression, buildGroup, and various groupBuilders functions - * are called, to produce a final HTML tree. - */ - var binLeftCanceller = /* @__PURE__ */ new Set([ - "leftmost", - "mbin", - "mopen", - "mrel", - "mop", - "mpunct" - ]); - var binRightCanceller = /* @__PURE__ */ new Set([ - "rightmost", - "mrel", - "mclose", - "mpunct" - ]); - var styleMap$1 = { - "display": Style$1.DISPLAY, - "text": Style$1.TEXT, - "script": Style$1.SCRIPT, - "scriptscript": Style$1.SCRIPTSCRIPT - }; - var DomEnum = { - mord: "mord", - mop: "mop", - mbin: "mbin", - mrel: "mrel", - mopen: "mopen", - mclose: "mclose", - mpunct: "mpunct", - minner: "minner" - }; - /** - * Take a list of nodes, build them in order, and return a list of the built - * nodes. documentFragments are flattened into their contents, so the - * returned list contains no fragments. `isRealGroup` is true if `expression` - * is a real group (no atoms will be added on either side), as opposed to - * a partial group (e.g. one created by \color). `surrounding` is an array - * consisting type of nodes that will be added to the left and right. - */ - var buildExpression$1 = function buildExpression(expression, options, isRealGroup, surrounding) { - if (surrounding === void 0) surrounding = [null, null]; - var groups = []; - for (var i = 0; i < expression.length; i++) { - var output = buildGroup$1(expression[i], options); - if (output instanceof DocumentFragment) { - var children = output.children; - groups.push(...children); - } else groups.push(output); - } - tryCombineChars(groups); - if (!isRealGroup) return groups; - var glueOptions = options; - if (expression.length === 1) { - var node = expression[0]; - if (node.type === "sizing") glueOptions = options.havingSize(node.size); - else if (node.type === "styling") glueOptions = options.havingStyle(styleMap$1[node.style]); - } - var dummyPrev = makeSpan([surrounding[0] || "leftmost"], [], options); - var dummyNext = makeSpan([surrounding[1] || "rightmost"], [], options); - var isRoot = isRealGroup === "root"; - _traverseNonSpaceNodes(groups, (node, prev) => { - var prevType = prev.classes[0]; - var type = node.classes[0]; - if (prevType === "mbin" && binRightCanceller.has(type)) prev.classes[0] = "mord"; - else if (type === "mbin" && binLeftCanceller.has(prevType)) node.classes[0] = "mord"; - }, { node: dummyPrev }, dummyNext, isRoot); - _traverseNonSpaceNodes(groups, (node, prev) => { - var _tightSpacings$prevTy, _spacings$prevType; - var prevType = getTypeOfDomTree(prev); - var type = getTypeOfDomTree(node); - var space = prevType && type ? node.hasClass("mtight") ? (_tightSpacings$prevTy = tightSpacings[prevType]) == null ? void 0 : _tightSpacings$prevTy[type] : (_spacings$prevType = spacings[prevType]) == null ? void 0 : _spacings$prevType[type] : null; - if (space) return makeGlue(space, glueOptions); - }, { node: dummyPrev }, dummyNext, isRoot); - return groups; - }; - var _traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev, next, isRoot) { - if (next) nodes.push(next); - var i = 0; - for (; i < nodes.length; i++) { - var node = nodes[i]; - var partialGroup = checkPartialGroup(node); - if (partialGroup) { - _traverseNonSpaceNodes(partialGroup.children, callback, prev, null, isRoot); - continue; - } - var nonspace = !node.hasClass("mspace"); - if (nonspace) { - var result = callback(node, prev.node); - if (result) { - if (prev.insertAfter) prev.insertAfter(result); - else { - nodes.unshift(result); - i++; - } - } - } - if (nonspace) prev.node = node; - else if (isRoot && node.hasClass("katex-newline")) prev.node = makeSpan(["leftmost"]); - prev.insertAfter = ((index) => (n) => { - nodes.splice(index + 1, 0, n); - i++; - })(i); - } - if (next) nodes.pop(); - }; - var checkPartialGroup = function checkPartialGroup(node) { - if (node instanceof DocumentFragment || node instanceof Anchor || node instanceof Span && node.hasClass("enclosing")) return node; - return null; - }; - var _getOutermostNode = function getOutermostNode(node, side) { - var partialGroup = checkPartialGroup(node); - if (partialGroup) { - var children = partialGroup.children; - if (children.length) { - if (side === "right") return _getOutermostNode(children[children.length - 1], "right"); - else if (side === "left") return _getOutermostNode(children[0], "left"); - } - } - return node; - }; - var getTypeOfDomTree = function getTypeOfDomTree(node, side) { - if (!node) return null; - if (side) node = _getOutermostNode(node, side); - return DomEnum[node.classes[0]] || null; - }; - var makeNullDelimiter = function makeNullDelimiter(options, classes) { - var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses()); - return makeSpan(classes.concat(moreClasses)); - }; - /** - * buildGroup is the function that takes a group and calls the correct groupType - * function for it. It also handles the interaction of size and style changes - * between parents and children. - */ - var buildGroup$1 = function buildGroup(group, options, baseOptions) { - if (!group) return makeSpan(); - if (_htmlGroupBuilders[group.type]) { - var groupNode = _htmlGroupBuilders[group.type](group, options); - if (baseOptions && options.size !== baseOptions.size) { - groupNode = makeSpan(options.sizingClasses(baseOptions), [groupNode], options); - var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; - groupNode.height *= multiplier; - groupNode.depth *= multiplier; - } - return groupNode; - } else throw new ParseError("Got group of unknown type: '" + group.type + "'"); - }; - /** - * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`) - * into an unbreakable HTML node of class .katex-base, with proper struts to - * guarantee correct vertical extent. `buildHTML` calls this repeatedly to - * make up the entire expression as a sequence of unbreakable units. - */ - function buildHTMLUnbreakable(children, options) { - var body = makeSpan(["katex-base"], children, options); - var strut = makeSpan(["katex-strut"]); - strut.style.height = makeEm(body.height + body.depth); - if (body.depth) strut.style.verticalAlign = makeEm(-body.depth); - body.children.unshift(strut); - return body; - } - /** - * Take an entire parse tree, and build it into an appropriate set of HTML - * nodes. - */ - function buildHTML(tree, options) { - var tag = null; - if (tree.length === 1 && tree[0].type === "tag") { - tag = tree[0].tag; - tree = tree[0].body; - } - var expression = buildExpression$1(tree, options, "root"); - var eqnNum; - if (expression.length === 2 && expression[1].hasClass("katex-tag")) eqnNum = expression.pop(); - var children = []; - var parts = []; - for (var i = 0; i < expression.length; i++) { - parts.push(expression[i]); - if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) { - var nobreak = false; - while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("katex-newline")) { - i++; - parts.push(expression[i]); - if (expression[i].hasClass("nobreak")) nobreak = true; - } - if (!nobreak) { - children.push(buildHTMLUnbreakable(parts, options)); - parts = []; - } - } else if (expression[i].hasClass("katex-newline")) { - parts.pop(); - if (parts.length > 0) { - children.push(buildHTMLUnbreakable(parts, options)); - parts = []; - } - children.push(expression[i]); - } - } - if (parts.length > 0) children.push(buildHTMLUnbreakable(parts, options)); - var tagChild; - if (tag) { - tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options, true), options); - tagChild.classes = ["katex-tag"]; - children.push(tagChild); - } else if (eqnNum) children.push(eqnNum); - var htmlNode = makeSpan(["katex-html"], children); - htmlNode.setAttribute("aria-hidden", "true"); - if (tagChild) { - var strut = tagChild.children[0]; - strut.style.height = makeEm(htmlNode.height + htmlNode.depth); - if (htmlNode.depth) strut.style.verticalAlign = makeEm(-htmlNode.depth); - } - return htmlNode; - } - /** - * These objects store data about MathML nodes. This is the MathML equivalent - * of the types in domTree.js. Since MathML handles its own rendering, and - * since we're mainly using MathML to improve accessibility, we don't manage - * any of the styling state that the plain DOM nodes do. - * - * The `toNode` and `toMarkup` functions work similarly to how they do in - * domTree.js, creating namespaced DOM nodes and HTML text markup respectively. - */ - function newDocumentFragment(children) { - return new DocumentFragment(children); - } - /** - * This node represents a general purpose MathML node of any type. The - * constructor requires the type of node to create (for example, `"mo"` or - * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags). - */ - var MathNode = class { - constructor(type, children, classes) { - this.type = void 0; - this.attributes = void 0; - this.children = void 0; - this.classes = void 0; - this.type = type; - this.attributes = {}; - this.children = children || []; - this.classes = classes || []; - } - /** - * Sets an attribute on a MathML node. MathML depends on attributes to convey a - * semantic content, so this is used heavily. - */ - setAttribute(name, value) { - this.attributes[name] = value; - } - /** - * Gets an attribute on a MathML node. - */ - getAttribute(name) { - return this.attributes[name]; - } - /** - * Converts the math node into a MathML-namespaced DOM element. - */ - toNode() { - var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); - for (var _ref2 of Object.entries(this.attributes)) { - var attr = _ref2[0]; - var value = _ref2[1]; - node.setAttribute(attr, value); - } - if (this.classes.length > 0) node.className = createClass(this.classes); - for (var i = 0; i < this.children.length; i++) if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) { - var text = this.children[i].toText() + this.children[++i].toText(); - while (this.children[i + 1] instanceof TextNode) text += this.children[++i].toText(); - node.appendChild(new TextNode(text).toNode()); - } else node.appendChild(this.children[i].toNode()); - return node; - } - /** - * Converts the math node into an HTML markup string. - */ - toMarkup() { - var markup = "<" + this.type; - for (var _ref4 of Object.entries(this.attributes)) { - var attr = _ref4[0]; - var value = _ref4[1]; - markup += " " + attr + "=\""; - markup += escape(value); - markup += "\""; - } - if (this.classes.length > 0) markup += " class =\"" + escape(createClass(this.classes)) + "\""; - markup += ">"; - for (var i = 0; i < this.children.length; i++) markup += this.children[i].toMarkup(); - markup += "</" + this.type + ">"; - return markup; - } - /** - * Converts the math node into a string, similar to innerText, but escaped. - */ - toText() { - return this.children.map((child) => child.toText()).join(""); - } - }; - /** - * This node represents a piece of text. - */ - var TextNode = class { - constructor(text) { - this.text = void 0; - this.text = text; - } - /** - * Converts the text node into a DOM text node. - */ - toNode() { - return document.createTextNode(this.text); - } - /** - * Converts the text node into escaped HTML markup - * (representing the text itself). - */ - toMarkup() { - return escape(this.toText()); - } - /** - * Converts the text node into a string - * (representing the text itself). - */ - toText() { - return this.text; - } - }; - /** - * This node represents a space, but may render as <mspace.../> or as text, - * depending on the width. - */ - var SpaceNode = class { - /** - * Create a Space node with width given in CSS ems. - */ - constructor(width) { - this.width = void 0; - this.character = void 0; - this.width = width; - if (width >= .05555 && width <= .05556) this.character = " "; - else if (width >= .1666 && width <= .1667) this.character = " "; - else if (width >= .2222 && width <= .2223) this.character = " "; - else if (width >= .2777 && width <= .2778) this.character = "  "; - else if (width >= -.05556 && width <= -.05555) this.character = " ⁣"; - else if (width >= -.1667 && width <= -.1666) this.character = " ⁣"; - else if (width >= -.2223 && width <= -.2222) this.character = " ⁣"; - else if (width >= -.2778 && width <= -.2777) this.character = " ⁣"; - else this.character = null; - } - /** - * Converts the math node into a MathML-namespaced DOM element. - */ - toNode() { - if (this.character) return document.createTextNode(this.character); - else { - var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); - node.setAttribute("width", makeEm(this.width)); - return node; - } - } - /** - * Converts the math node into an HTML markup string. - */ - toMarkup() { - if (this.character) return "<mtext>" + this.character + "</mtext>"; - else return "<mspace width=\"" + makeEm(this.width) + "\"/>"; - } - /** - * Converts the math node into a string, similar to innerText. - */ - toText() { - if (this.character) return this.character; - else return " "; - } - }; - /** - * This file converts a parse tree into a corresponding MathML tree. The main - * entry point is the `buildMathML` function, which takes a parse tree from the - * parser. - */ - var noVariantSymbols = /* @__PURE__ */ new Set(["\\imath", "\\jmath"]); - var rowLikeTypes = /* @__PURE__ */ new Set(["mrow", "mtable"]); - /** - * Takes a symbol and converts it into a MathML text node after performing - * optional replacement from symbols.js. - */ - var makeText = function makeText(text, mode, options) { - var _options$fontFamily, _options$font; - if (symbols[mode][text] && symbols[mode][text].replace && text.charCodeAt(0) !== 55349 && !(Object.prototype.hasOwnProperty.call(ligatures, text) && ((options == null || (_options$fontFamily = options.fontFamily) == null ? void 0 : _options$fontFamily.slice(4, 6)) === "tt" || (options == null || (_options$font = options.font) == null ? void 0 : _options$font.slice(4, 6)) === "tt"))) text = symbols[mode][text].replace; - return new TextNode(text); - }; - /** - * Wrap the given array of nodes in an <mrow> node if needed, i.e., - * unless the array has length 1. Always returns a single node. - */ - var makeRow = function makeRow(body) { - if (body.length === 1) return body[0]; - else return new MathNode("mrow", body); - }; - var mathFontVariants = { - mathit: "italic", - boldsymbol: (group) => group.type === "textord" ? "bold" : "bold-italic", - mathbf: "bold", - mathbb: "double-struck", - mathsfit: "sans-serif-italic", - mathfrak: "fraktur", - mathscr: "script", - mathcal: "script", - mathsf: "sans-serif", - mathtt: "monospace" - }; - /** - * Returns the math variant as a string or null if none is required. - */ - var getVariant = (group, options) => { - if (group.mode === "text") { - if (options.fontFamily === "texttt") return "monospace"; - else if (options.fontFamily === "textsf") { - if (options.fontShape === "textit" && options.fontWeight === "textbf") return "sans-serif-bold-italic"; - else if (options.fontShape === "textit") return "sans-serif-italic"; - else if (options.fontWeight === "textbf") return "bold-sans-serif"; - else return "sans-serif"; - } else if (options.fontShape === "textit" && options.fontWeight === "textbf") return "bold-italic"; - else if (options.fontShape === "textit") return "italic"; - else if (options.fontWeight === "textbf") return "bold"; - } - var font = options.font; - if (!font || font === "mathnormal") return null; - var mode = group.mode; - var mathVariant = mathFontVariants[font]; - if (mathVariant) return typeof mathVariant === "function" ? mathVariant(group) : mathVariant; - var text = group.text; - if (noVariantSymbols.has(text)) return null; - if (symbols[mode][text]) { - var replacement = symbols[mode][text].replace; - if (replacement) text = replacement; - } - var fontName = fontMap[font].fontName; - if (getCharacterMetrics(text, fontName, mode)) return fontMap[font].variant; - return null; - }; - /** - * Check for <mi>.</mi> which is how a dot renders in MathML, - * or <mo separator="true" lspace="0em" rspace="0em">,</mo> - * which is how a braced comma {,} renders in MathML - */ - function isNumberPunctuation(group) { - if (!group) return false; - if (group.type === "mi" && group.children.length === 1) { - var child = group.children[0]; - return child instanceof TextNode && child.text === "."; - } else if (group.type === "mo" && group.children.length === 1 && group.getAttribute("separator") === "true" && group.getAttribute("lspace") === "0em" && group.getAttribute("rspace") === "0em") { - var _child = group.children[0]; - return _child instanceof TextNode && _child.text === ","; - } else return false; - } - /** - * Takes a list of nodes, builds them, and returns a list of the generated - * MathML nodes. Also combine consecutive <mtext> outputs into a single - * <mtext> tag. - */ - var buildExpression = function buildExpression(expression, options, isOrdgroup) { - if (expression.length === 1) { - var group = buildGroup(expression[0], options); - if (isOrdgroup && group instanceof MathNode && group.type === "mo") { - group.setAttribute("lspace", "0em"); - group.setAttribute("rspace", "0em"); - } - return [group]; - } - var groups = []; - var lastGroup; - for (var i = 0; i < expression.length; i++) { - var _group = buildGroup(expression[i], options); - if (_group instanceof MathNode && lastGroup instanceof MathNode) { - if (_group.type === "mtext" && lastGroup.type === "mtext" && _group.getAttribute("mathvariant") === lastGroup.getAttribute("mathvariant")) { - lastGroup.children.push(..._group.children); - continue; - } else if (_group.type === "mn" && lastGroup.type === "mn") { - lastGroup.children.push(..._group.children); - continue; - } else if (isNumberPunctuation(_group) && lastGroup.type === "mn") { - lastGroup.children.push(..._group.children); - continue; - } else if (_group.type === "mn" && isNumberPunctuation(lastGroup)) { - _group.children = [...lastGroup.children, ..._group.children]; - groups.pop(); - } else if ((_group.type === "msup" || _group.type === "msub") && _group.children.length >= 1 && (lastGroup.type === "mn" || isNumberPunctuation(lastGroup))) { - var base = _group.children[0]; - if (base instanceof MathNode && base.type === "mn") { - base.children = [...lastGroup.children, ...base.children]; - groups.pop(); - } - } else if (lastGroup.type === "mi" && lastGroup.children.length === 1) { - var lastChild = lastGroup.children[0]; - if (lastChild instanceof TextNode && lastChild.text === "̸" && (_group.type === "mo" || _group.type === "mi" || _group.type === "mn")) { - var child = _group.children[0]; - if (child instanceof TextNode && child.text.length > 0) { - child.text = child.text.slice(0, 1) + "̸" + child.text.slice(1); - groups.pop(); - } - } - } - } - groups.push(_group); - lastGroup = _group; - } - return groups; - }; - /** - * Equivalent to buildExpression, but wraps the elements in an <mrow> - * if there's more than one. Returns a single node instead of an array. - */ - var buildExpressionRow = function buildExpressionRow(expression, options, isOrdgroup) { - return makeRow(buildExpression(expression, options, isOrdgroup)); - }; - /** - * Takes a group from the parser and calls the appropriate groupBuilders function - * on it to produce a MathML node. - */ - var buildGroup = function buildGroup(group, options) { - if (!group) return new MathNode("mrow"); - if (_mathmlGroupBuilders[group.type]) return _mathmlGroupBuilders[group.type](group, options); - else throw new ParseError("Got group of unknown type: '" + group.type + "'"); - }; - /** - * Takes a full parse tree and settings and builds a MathML representation of - * it. In particular, we put the elements from building the parse tree into a - * <semantics> tag so we can also include that TeX source as an annotation. - * - * Note that we actually return a domTree element with a `<math>` inside it so - * we can do appropriate styling. - */ - function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) { - var expression = buildExpression(tree, options); - var wrapper; - if (expression.length === 1 && expression[0] instanceof MathNode && rowLikeTypes.has(expression[0].type)) wrapper = expression[0]; - else wrapper = new MathNode("mrow", expression); - var annotation = new MathNode("annotation", [new TextNode(texExpression)]); - annotation.setAttribute("encoding", "application/x-tex"); - var math = new MathNode("math", [new MathNode("semantics", [wrapper, annotation])]); - math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"); - if (isDisplayMode) math.setAttribute("display", "block"); - return makeSpan([forMathmlOnly ? "katex" : "katex-mathml"], [math]); - } - /** - * This file contains information about the options that the Parser carries - * around with it while parsing. Data is held in an `Options` object, and when - * recursing, a new `Options` object can be created with the `.with*` and - * `.reset` functions. - */ - var sizeStyleMap = [ - [ - 1, - 1, - 1 - ], - [ - 2, - 1, - 1 - ], - [ - 3, - 1, - 1 - ], - [ - 4, - 2, - 1 - ], - [ - 5, - 2, - 1 - ], - [ - 6, - 3, - 1 - ], - [ - 7, - 4, - 2 - ], - [ - 8, - 6, - 3 - ], - [ - 9, - 7, - 6 - ], - [ - 10, - 8, - 7 - ], - [ - 11, - 10, - 9 - ] - ]; - var sizeMultipliers = [ - .5, - .6, - .7, - .8, - .9, - 1, - 1.2, - 1.44, - 1.728, - 2.074, - 2.488 - ]; - var sizeAtStyle = function sizeAtStyle(size, style) { - return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1]; - }; - /** - * This is the main options class. It contains the current style, size, color, - * and font. - * - * Options objects should not be modified. To create a new Options with - * different properties, call a `.having*` method. - */ - var Options = class Options { - constructor(data) { - this.style = void 0; - this.color = void 0; - this.size = void 0; - this.textSize = void 0; - this.phantom = void 0; - this.font = void 0; - this.fontFamily = void 0; - this.fontWeight = void 0; - this.fontShape = void 0; - this.sizeMultiplier = void 0; - this.maxSize = void 0; - this.minRuleThickness = void 0; - this._fontMetrics = void 0; - this.strict = void 0; - this.style = data.style; - this.color = data.color; - this.size = data.size || Options.BASESIZE; - this.textSize = data.textSize || this.size; - this.phantom = !!data.phantom; - this.font = data.font || ""; - this.fontFamily = data.fontFamily || ""; - this.fontWeight = data.fontWeight || ""; - this.fontShape = data.fontShape || ""; - this.sizeMultiplier = sizeMultipliers[this.size - 1]; - this.maxSize = data.maxSize; - this.minRuleThickness = data.minRuleThickness; - this.strict = data.strict; - this._fontMetrics = void 0; - } - /** - * Returns a new options object with the same properties as "this". Properties - * from "extension" will be copied to the new options object. - */ - extend(extension) { - var data = { - style: this.style, - size: this.size, - textSize: this.textSize, - color: this.color, - phantom: this.phantom, - font: this.font, - fontFamily: this.fontFamily, - fontWeight: this.fontWeight, - fontShape: this.fontShape, - maxSize: this.maxSize, - minRuleThickness: this.minRuleThickness, - strict: this.strict - }; - Object.assign(data, extension); - return new Options(data); - } - /** - * Return an options object with the given style. If `this.style === style`, - * returns `this`. - */ - havingStyle(style) { - if (this.style === style) return this; - else return this.extend({ - style, - size: sizeAtStyle(this.textSize, style) - }); - } - /** - * Return an options object with a cramped version of the current style. If - * the current style is cramped, returns `this`. - */ - havingCrampedStyle() { - return this.havingStyle(this.style.cramp()); - } - /** - * Return an options object with the given size and in at least `\textstyle`. - * Returns `this` if appropriate. - */ - havingSize(size) { - if (this.size === size && this.textSize === size) return this; - else return this.extend({ - style: this.style.text(), - size, - textSize: size, - sizeMultiplier: sizeMultipliers[size - 1] - }); - } - /** - * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, - * changes to at least `\textstyle`. - */ - havingBaseStyle(style) { - style = style || this.style.text(); - var wantSize = sizeAtStyle(Options.BASESIZE, style); - if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) return this; - else return this.extend({ - style, - size: wantSize - }); - } - /** - * Remove the effect of sizing changes such as \Huge. - * Keep the effect of the current style, such as \scriptstyle. - */ - havingBaseSizing() { - var size; - switch (this.style.id) { - case 4: - case 5: - size = 3; - break; - case 6: - case 7: - size = 1; - break; - default: size = 6; - } - return this.extend({ - style: this.style.text(), - size - }); - } - /** - * Create a new options object with the given color. - */ - withColor(color) { - return this.extend({ color }); - } - /** - * Create a new options object with "phantom" set to true. - */ - withPhantom() { - return this.extend({ phantom: true }); - } - /** - * Creates a new options object with the given math font or old text font. - * @type {[type]} - */ - withFont(font) { - return this.extend({ font }); - } - /** - * Create a new options objects with the given fontFamily. - */ - withTextFontFamily(fontFamily) { - return this.extend({ - fontFamily, - font: "" - }); - } - /** - * Creates a new options object with the given font weight - */ - withTextFontWeight(fontWeight) { - return this.extend({ - fontWeight, - font: "" - }); - } - /** - * Creates a new options object with the given font weight - */ - withTextFontShape(fontShape) { - return this.extend({ - fontShape, - font: "" - }); - } - /** - * Return the CSS sizing classes required to switch from enclosing options - * `oldOptions` to `this`. Returns an array of classes. - */ - sizingClasses(oldOptions) { - if (oldOptions.size !== this.size) return [ - "katex-sizing", - "reset-size" + oldOptions.size, - "size" + this.size - ]; - else return []; - } - /** - * Return the CSS sizing classes required to switch to the base size. Like - * `this.havingSize(BASESIZE).sizingClasses(this)`. - */ - baseSizingClasses() { - if (this.size !== Options.BASESIZE) return [ - "katex-sizing", - "reset-size" + this.size, - "size" + Options.BASESIZE - ]; - else return []; - } - /** - * Return the font metrics for this size. - */ - fontMetrics() { - if (!this._fontMetrics) this._fontMetrics = getGlobalMetrics(this.size); - return this._fontMetrics; - } - /** - * Gets the CSS color of the current options object - */ - getColor() { - if (this.phantom) return "transparent"; - else return this.color; - } - }; - /** - * The base size index. - */ - Options.BASESIZE = 6; - var optionsFromSettings = (settings) => new Options({ - style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT, - maxSize: settings.maxSize, - minRuleThickness: settings.minRuleThickness, - strict: settings.strict - }); - var displayWrap = function displayWrap(node, settings) { - if (settings.displayMode) { - var classes = ["katex-display"]; - if (settings.leqno) classes.push("leqno"); - if (settings.fleqn) classes.push("fleqn"); - node = makeSpan(classes, [node]); - } - return node; - }; - var buildTree = function buildTree(tree, expression, settings) { - var options = optionsFromSettings(settings); - var katexNode; - if (settings.output === "mathml") return buildMathML(tree, expression, options, settings.displayMode, true); - else if (settings.output === "html") katexNode = makeSpan(["katex"], [buildHTML(tree, options)]); - else katexNode = makeSpan(["katex"], [buildMathML(tree, expression, options, settings.displayMode, false), buildHTML(tree, options)]); - return displayWrap(katexNode, settings); - }; - var buildHTMLTree = function buildHTMLTree(tree, settings) { - return displayWrap(makeSpan(["katex"], [buildHTML(tree, optionsFromSettings(settings))]), settings); - }; - /** - * This file provides support to buildMathML.js and buildHTML.js - * for stretchy wide elements rendered from SVG files - * and other CSS trickery. - */ - var stretchyCodePoint = { - widehat: "^", - widecheck: "ˇ", - widetilde: "~", - utilde: "~", - overleftarrow: "←", - underleftarrow: "←", - xleftarrow: "←", - overrightarrow: "→", - underrightarrow: "→", - xrightarrow: "→", - underbrace: "⏟", - overbrace: "⏞", - underbracket: "⎵", - overbracket: "⎴", - overgroup: "⏠", - undergroup: "⏡", - overleftrightarrow: "↔", - underleftrightarrow: "↔", - xleftrightarrow: "↔", - Overrightarrow: "⇒", - xRightarrow: "⇒", - overleftharpoon: "↼", - xleftharpoonup: "↼", - overrightharpoon: "⇀", - xrightharpoonup: "⇀", - xLeftarrow: "⇐", - xLeftrightarrow: "⇔", - xhookleftarrow: "↩", - xhookrightarrow: "↪", - xmapsto: "↦", - xrightharpoondown: "⇁", - xleftharpoondown: "↽", - xrightleftharpoons: "⇌", - xleftrightharpoons: "⇋", - xtwoheadleftarrow: "↞", - xtwoheadrightarrow: "↠", - xlongequal: "=", - xtofrom: "⇄", - xrightleftarrows: "⇄", - xrightequilibrium: "⇌", - xleftequilibrium: "⇋", - "\\cdrightarrow": "→", - "\\cdleftarrow": "←", - "\\cdlongequal": "=" - }; - var stretchyMathML = function stretchyMathML(label) { - var node = new MathNode("mo", [new TextNode(stretchyCodePoint[label.replace(/^\\/, "")])]); - node.setAttribute("stretchy", "true"); - return node; - }; - var katexImagesData = { - overrightarrow: [ - ["rightarrow"], - .888, - 522, - "xMaxYMin" - ], - overleftarrow: [ - ["leftarrow"], - .888, - 522, - "xMinYMin" - ], - underrightarrow: [ - ["rightarrow"], - .888, - 522, - "xMaxYMin" - ], - underleftarrow: [ - ["leftarrow"], - .888, - 522, - "xMinYMin" - ], - xrightarrow: [ - ["rightarrow"], - 1.469, - 522, - "xMaxYMin" - ], - "\\cdrightarrow": [ - ["rightarrow"], - 3, - 522, - "xMaxYMin" - ], - xleftarrow: [ - ["leftarrow"], - 1.469, - 522, - "xMinYMin" - ], - "\\cdleftarrow": [ - ["leftarrow"], - 3, - 522, - "xMinYMin" - ], - Overrightarrow: [ - ["doublerightarrow"], - .888, - 560, - "xMaxYMin" - ], - xRightarrow: [ - ["doublerightarrow"], - 1.526, - 560, - "xMaxYMin" - ], - xLeftarrow: [ - ["doubleleftarrow"], - 1.526, - 560, - "xMinYMin" - ], - overleftharpoon: [ - ["leftharpoon"], - .888, - 522, - "xMinYMin" - ], - xleftharpoonup: [ - ["leftharpoon"], - .888, - 522, - "xMinYMin" - ], - xleftharpoondown: [ - ["leftharpoondown"], - .888, - 522, - "xMinYMin" - ], - overrightharpoon: [ - ["rightharpoon"], - .888, - 522, - "xMaxYMin" - ], - xrightharpoonup: [ - ["rightharpoon"], - .888, - 522, - "xMaxYMin" - ], - xrightharpoondown: [ - ["rightharpoondown"], - .888, - 522, - "xMaxYMin" - ], - xlongequal: [ - ["longequal"], - .888, - 334, - "xMinYMin" - ], - "\\cdlongequal": [ - ["longequal"], - 3, - 334, - "xMinYMin" - ], - xtwoheadleftarrow: [ - ["twoheadleftarrow"], - .888, - 334, - "xMinYMin" - ], - xtwoheadrightarrow: [ - ["twoheadrightarrow"], - .888, - 334, - "xMaxYMin" - ], - overleftrightarrow: [ - ["leftarrow", "rightarrow"], - .888, - 522 - ], - overbrace: [ - [ - "leftbrace", - "midbrace", - "rightbrace" - ], - 1.6, - 548 - ], - underbrace: [ - [ - "leftbraceunder", - "midbraceunder", - "rightbraceunder" - ], - 1.6, - 548 - ], - underleftrightarrow: [ - ["leftarrow", "rightarrow"], - .888, - 522 - ], - xleftrightarrow: [ - ["leftarrow", "rightarrow"], - 1.75, - 522 - ], - xLeftrightarrow: [ - ["doubleleftarrow", "doublerightarrow"], - 1.75, - 560 - ], - xrightleftharpoons: [ - ["leftharpoondownplus", "rightharpoonplus"], - 1.75, - 716 - ], - xleftrightharpoons: [ - ["leftharpoonplus", "rightharpoondownplus"], - 1.75, - 716 - ], - xhookleftarrow: [ - ["leftarrow", "righthook"], - 1.08, - 522 - ], - xhookrightarrow: [ - ["lefthook", "rightarrow"], - 1.08, - 522 - ], - overlinesegment: [ - ["leftlinesegment", "rightlinesegment"], - .888, - 522 - ], - underlinesegment: [ - ["leftlinesegment", "rightlinesegment"], - .888, - 522 - ], - overbracket: [ - ["leftbracketover", "rightbracketover"], - 1.6, - 440 - ], - underbracket: [ - ["leftbracketunder", "rightbracketunder"], - 1.6, - 410 - ], - overgroup: [ - ["leftgroup", "rightgroup"], - .888, - 342 - ], - undergroup: [ - ["leftgroupunder", "rightgroupunder"], - .888, - 342 - ], - xmapsto: [ - ["leftmapsto", "rightarrow"], - 1.5, - 522 - ], - xtofrom: [ - ["leftToFrom", "rightToFrom"], - 1.75, - 528 - ], - xrightleftarrows: [ - ["baraboveleftarrow", "rightarrowabovebar"], - 1.75, - 901 - ], - xrightequilibrium: [ - ["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], - 1.75, - 716 - ], - xleftequilibrium: [ - ["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], - 1.75, - 716 - ] - }; - var wideAccentLabels = /* @__PURE__ */ new Set([ - "widehat", - "widecheck", - "widetilde", - "utilde" - ]); - var stretchySvg = function stretchySvg(group, options) { - function buildSvgSpan_() { - var viewBoxWidth = 4e5; - var label = group.label.slice(1); - if (wideAccentLabels.has(label) && "base" in group) { - var numChars = group.base.type === "ordgroup" ? group.base.body.length : 1; - var viewBoxHeight; - var pathName; - var _height; - if (numChars > 5) { - if (label === "widehat" || label === "widecheck") { - viewBoxHeight = 420; - viewBoxWidth = 2364; - _height = .42; - pathName = label + "4"; - } else { - viewBoxHeight = 312; - viewBoxWidth = 2340; - _height = .34; - pathName = "tilde4"; - } - } else { - var imgIndex = [ - 1, - 1, - 2, - 2, - 3, - 3 - ][numChars]; - if (label === "widehat" || label === "widecheck") { - viewBoxWidth = [ - 0, - 1062, - 2364, - 2364, - 2364 - ][imgIndex]; - viewBoxHeight = [ - 0, - 239, - 300, - 360, - 420 - ][imgIndex]; - _height = [ - 0, - .24, - .3, - .3, - .36, - .42 - ][imgIndex]; - pathName = label + imgIndex; - } else { - viewBoxWidth = [ - 0, - 600, - 1033, - 2339, - 2340 - ][imgIndex]; - viewBoxHeight = [ - 0, - 260, - 286, - 306, - 312 - ][imgIndex]; - _height = [ - 0, - .26, - .286, - .3, - .306, - .34 - ][imgIndex]; - pathName = "tilde" + imgIndex; - } - } - return { - span: makeSvgSpan([], [new SvgNode([new PathNode(pathName)], { - "width": "100%", - "height": makeEm(_height), - "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight, - "preserveAspectRatio": "none" - })], options), - minWidth: 0, - height: _height - }; - } else { - var spans = []; - var data = katexImagesData[label]; - if (!data) throw new Error("No SVG data for \"" + label + "\"."); - var paths = data[0], _minWidth = data[1], _viewBoxHeight = data[2]; - var _height2 = _viewBoxHeight / 1e3; - var numSvgChildren = paths.length; - var widthClasses; - var aligns; - if (numSvgChildren === 1) { - if (data.length !== 4) throw new Error("Expected 4-tuple for single-path SVG data \"" + label + "\"."); - widthClasses = ["hide-tail"]; - aligns = [data[3]]; - } else if (numSvgChildren === 2) { - widthClasses = ["halfarrow-left", "halfarrow-right"]; - aligns = ["xMinYMin", "xMaxYMin"]; - } else if (numSvgChildren === 3) { - widthClasses = [ - "brace-left", - "brace-center", - "brace-right" - ]; - aligns = [ - "xMinYMin", - "xMidYMin", - "xMaxYMin" - ]; - } else throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children."); - for (var i = 0; i < numSvgChildren; i++) { - var _svgNode = new SvgNode([new PathNode(paths[i])], { - "width": "400em", - "height": makeEm(_height2), - "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight, - "preserveAspectRatio": aligns[i] + " slice" - }); - var _span = makeSvgSpan([widthClasses[i]], [_svgNode], options); - if (numSvgChildren === 1) return { - span: _span, - minWidth: _minWidth, - height: _height2 - }; - else { - _span.style.height = makeEm(_height2); - spans.push(_span); - } - } - return { - span: makeSpan(["katex-stretchy"], spans, options), - minWidth: _minWidth, - height: _height2 - }; - } - } - var _buildSvgSpan_ = buildSvgSpan_(), span = _buildSvgSpan_.span, minWidth = _buildSvgSpan_.minWidth, height = _buildSvgSpan_.height; - span.height = height; - span.style.height = makeEm(height); - if (minWidth > 0) span.style.minWidth = makeEm(minWidth); - return span; - }; - var stretchyEnclose = function stretchyEnclose(inner, label, topPad, bottomPad, options) { - var img; - var totalHeight = inner.height + inner.depth + topPad + bottomPad; - if (/fbox|color|angl/.test(label)) { - img = makeSpan(["katex-stretchy", label], [], options); - if (label === "fbox") { - var color = options.color && options.getColor(); - if (color) img.style.borderColor = color; - } - } else { - var lines = []; - if (/^[bx]cancel$/.test(label)) lines.push(new LineNode({ - "x1": "0", - "y1": "0", - "x2": "100%", - "y2": "100%", - "stroke-width": "0.046em" - })); - if (/^x?cancel$/.test(label)) lines.push(new LineNode({ - "x1": "0", - "y1": "100%", - "x2": "100%", - "y2": "0", - "stroke-width": "0.046em" - })); - img = makeSvgSpan([], [new SvgNode(lines, { - "width": "100%", - "height": makeEm(totalHeight) - })], options); - } - img.height = totalHeight; - img.style.height = makeEm(totalHeight); - return img; - }; - /** - * Small module for atom-group constants and type guard. Kept separate from - * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can - * pull in `isAtom` without dragging in the ~870-line symbol tables. - */ - var atomList = [ - "bin", - "close", - "inner", - "open", - "punct", - "rel" - ]; - var nonAtomList = [ - "accent-token", - "mathord", - "op-token", - "spacing", - "textord" - ]; - var Atoms = new Set(atomList); - var NonAtoms = new Set(nonAtomList); - function isAtom(value) { - return Atoms.has(value); - } - /** - * Asserts that the node is of the given type and returns it with stricter - * typing. Throws if the node's type does not match. - */ - function assertNodeType(node, type) { - if (!node || node.type !== type) throw new Error("Expected node of type " + type + ", but got " + (node ? "node of type " + node.type : String(node))); - return node; - } - /** - * Returns the node more strictly typed iff it is of the given type. Otherwise, - * returns null. - */ - function assertSymbolNodeType(node) { - var typedNode = checkSymbolNodeType(node); - if (!typedNode) throw new Error("Expected node of symbol group type, but got " + (node ? "node of type " + node.type : String(node))); - return typedNode; - } - /** - * Returns the node more strictly typed if it is of the given type. Otherwise, - * returns null. - */ - function checkSymbolNodeType(node) { - if (node.type === "atom" || NonAtoms.has(node.type)) return node; - return null; - } - /** - * Returns the string spelled out by a group of plain characters, throwing the - * given ParseError if the group holds anything else. With allowSpaces, a - * literal space counts as a character; `~` and `\ ` do not. - */ - function assertCharacterGroup(group, errorMessage, allowSpaces) { - var text = ""; - for (var node of group.body) if (node.type === "textord") text += node.text; - else if (allowSpaces && node.type === "spacing" && node.text === " ") text += " "; - else throw new ParseError(errorMessage, group); - return text; - } - var getBaseSymbol = (group) => { - if (group instanceof SymbolNode) return group; - if (hasHtmlDomChildren(group) && group.children.length === 1) return getBaseSymbol(group.children[0]); - }; - var htmlBuilder$a = (grp, options) => { - var base; - var group; - var supSubGroup; - if (grp && grp.type === "supsub") { - group = assertNodeType(grp.base, "accent"); - base = group.base; - grp.base = base; - supSubGroup = assertSpan(buildGroup$1(grp, options)); - grp.base = group; - } else { - group = assertNodeType(grp, "accent"); - base = group.base; - } - var body = buildGroup$1(base, options.havingCrampedStyle()); - var mustShift = group.isShifty && isCharacterBox(base); - var skew = 0; - if (mustShift) { - var _getBaseSymbol$skew, _getBaseSymbol; - skew = (_getBaseSymbol$skew = (_getBaseSymbol = getBaseSymbol(body)) == null ? void 0 : _getBaseSymbol.skew) != null ? _getBaseSymbol$skew : 0; - } - var accentBelow = group.label === "\\c"; - var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight); - var accentBody; - if (!group.isStretchy) { - var accent; - var width; - if (group.label === "\\vec") { - accent = staticSvg("vec", options); - width = svgData.vec[1]; - } else { - accent = makeOrd({ - type: "textord", - mode: group.mode, - text: group.label - }, options); - accent = assertSymbolDomNode(accent); - accent.italic = 0; - width = accent.width; - if (accentBelow) clearance += accent.depth; - } - accentBody = makeSpan(["accent-body"], [accent]); - var accentFull = group.label === "\\textcircled"; - if (accentFull) { - accentBody.classes.push("accent-full"); - clearance = body.height; - } - var left = skew; - if (!accentFull) left -= width / 2; - accentBody.style.left = makeEm(left); - if (group.label === "\\textcircled") accentBody.style.top = ".2em"; - accentBody = makeVList({ - positionType: "firstBaseline", - children: [ - { - type: "elem", - elem: body - }, - { - type: "kern", - size: -clearance - }, - { - type: "elem", - elem: accentBody - } - ] - }); - } else { - accentBody = stretchySvg(group, options); - accentBody = makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: body - }, { - type: "elem", - elem: accentBody, - wrapperClasses: ["svg-align"], - wrapperStyle: skew > 0 ? { - width: "calc(100% - " + makeEm(2 * skew) + ")", - marginLeft: makeEm(2 * skew) - } : void 0 - }] - }); - } - var accentWrap = makeSpan(["mord", "katex-accent"], [accentBody], options); - if (supSubGroup) { - supSubGroup.children[0] = accentWrap; - supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height); - supSubGroup.classes[0] = "mord"; - return supSubGroup; - } else return accentWrap; - }; - var mathmlBuilder$9 = (group, options) => { - var accentNode = group.isStretchy ? stretchyMathML(group.label) : new MathNode("mo", [makeText(group.label, group.mode)]); - var node = new MathNode("mover", [buildGroup(group.base, options), accentNode]); - node.setAttribute("accent", "true"); - return node; - }; - var NON_STRETCHY_ACCENT_REGEX = new RegExp([ - "\\acute", - "\\grave", - "\\ddot", - "\\tilde", - "\\bar", - "\\breve", - "\\check", - "\\hat", - "\\vec", - "\\dot", - "\\mathring" - ].map((accent) => "\\" + accent).join("|")); - defineFunction({ - type: "accent", - names: [ - "\\acute", - "\\grave", - "\\ddot", - "\\tilde", - "\\bar", - "\\breve", - "\\check", - "\\hat", - "\\vec", - "\\dot", - "\\mathring", - "\\widecheck", - "\\widehat", - "\\widetilde", - "\\overrightarrow", - "\\overleftarrow", - "\\Overrightarrow", - "\\overleftrightarrow", - "\\overgroup", - "\\overlinesegment", - "\\overleftharpoon", - "\\overrightharpoon" - ], - numArgs: 1, - handler: (context, args) => { - var base = normalizeArgument(args[0]); - var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName); - var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck"; - return { - type: "accent", - mode: context.parser.mode, - label: context.funcName, - isStretchy, - isShifty, - base - }; - }, - htmlBuilder: htmlBuilder$a, - mathmlBuilder: mathmlBuilder$9 - }); - defineFunction({ - type: "accent", - names: [ - "\\'", - "\\`", - "\\^", - "\\~", - "\\=", - "\\u", - "\\.", - "\\\"", - "\\c", - "\\r", - "\\H", - "\\v", - "\\textcircled" - ], - numArgs: 1, - allowedInText: true, - allowedInMath: true, - argTypes: ["primitive"], - handler: (context, args) => { - var base = args[0]; - var mode = context.parser.mode; - if (mode === "math") { - handleStrict({ - strict: context.parser.settings.strict, - errorCode: "mathVsTextAccents", - errorMsg: "LaTeX's accent " + context.funcName + " works only in text mode", - report: true - }); - mode = "text"; - } - return { - type: "accent", - mode, - label: context.funcName, - isStretchy: false, - isShifty: true, - base - }; - } - }); - defineFunction({ - type: "accentUnder", - names: [ - "\\underleftarrow", - "\\underrightarrow", - "\\underleftrightarrow", - "\\undergroup", - "\\underlinesegment", - "\\utilde" - ], - numArgs: 1, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - var base = args[0]; - return { - type: "accentUnder", - mode: parser.mode, - label: funcName, - base - }; - }, - htmlBuilder: (group, options) => { - var innerGroup = buildGroup$1(group.base, options); - var accentBody = stretchySvg(group, options); - var kern = group.label === "\\utilde" ? .12 : 0; - return makeSpan(["mord", "accentunder"], [makeVList({ - positionType: "top", - positionData: innerGroup.height, - children: [ - { - type: "elem", - elem: accentBody, - wrapperClasses: ["svg-align"] - }, - { - type: "kern", - size: kern - }, - { - type: "elem", - elem: innerGroup - } - ] - })], options); - }, - mathmlBuilder: (group, options) => { - var accentNode = stretchyMathML(group.label); - var node = new MathNode("munder", [buildGroup(group.base, options), accentNode]); - node.setAttribute("accentunder", "true"); - return node; - } - }); - var paddedNode = (group) => { - var node = new MathNode("mpadded", group ? [group] : []); - node.setAttribute("width", "+0.6em"); - node.setAttribute("lspace", "0.3em"); - return node; - }; - defineFunction({ - type: "xArrow", - names: [ - "\\xleftarrow", - "\\xrightarrow", - "\\xLeftarrow", - "\\xRightarrow", - "\\xleftrightarrow", - "\\xLeftrightarrow", - "\\xhookleftarrow", - "\\xhookrightarrow", - "\\xmapsto", - "\\xrightharpoondown", - "\\xrightharpoonup", - "\\xleftharpoondown", - "\\xleftharpoonup", - "\\xrightleftharpoons", - "\\xleftrightharpoons", - "\\xlongequal", - "\\xtwoheadrightarrow", - "\\xtwoheadleftarrow", - "\\xtofrom", - "\\xrightleftarrows", - "\\xrightequilibrium", - "\\xleftequilibrium", - "\\\\cdrightarrow", - "\\\\cdleftarrow", - "\\\\cdlongequal" - ], - numArgs: 1, - numOptionalArgs: 1, - handler(_ref, args, optArgs) { - var parser = _ref.parser, funcName = _ref.funcName; - return { - type: "xArrow", - mode: parser.mode, - label: funcName, - body: args[0], - below: optArgs[0] - }; - }, - htmlBuilder(group, options) { - var style = options.style; - var newOptions = options.havingStyle(style.sup()); - var upperGroup = wrapFragment(buildGroup$1(group.body, newOptions, options), options); - var arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd"; - upperGroup.classes.push(arrowPrefix + "-arrow-pad"); - var lowerGroup; - if (group.below) { - newOptions = options.havingStyle(style.sub()); - lowerGroup = wrapFragment(buildGroup$1(group.below, newOptions, options), options); - lowerGroup.classes.push(arrowPrefix + "-arrow-pad"); - } - var arrowBody = stretchySvg(group, options); - var arrowShift = -options.fontMetrics().axisHeight + .5 * arrowBody.height; - var upperShift = -options.fontMetrics().axisHeight - .5 * arrowBody.height - .111; - if (upperGroup.depth > .25 || group.label === "\\xleftequilibrium") upperShift -= upperGroup.depth; - var vlist; - if (lowerGroup) { - var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + .5 * arrowBody.height + .111; - vlist = makeVList({ - positionType: "individualShift", - children: [ - { - type: "elem", - elem: upperGroup, - shift: upperShift - }, - { - type: "elem", - elem: arrowBody, - shift: arrowShift, - wrapperClasses: ["svg-align"] - }, - { - type: "elem", - elem: lowerGroup, - shift: lowerShift - } - ] - }); - } else vlist = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: upperGroup, - shift: upperShift - }, { - type: "elem", - elem: arrowBody, - shift: arrowShift, - wrapperClasses: ["svg-align"] - }] - }); - return makeSpan(["mrel", "x-arrow"], [vlist], options); - }, - mathmlBuilder(group, options) { - var arrowNode = stretchyMathML(group.label); - arrowNode.setAttribute("minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em"); - var node; - if (group.body) { - var upperNode = paddedNode(buildGroup(group.body, options)); - if (group.below) node = new MathNode("munderover", [ - arrowNode, - paddedNode(buildGroup(group.below, options)), - upperNode - ]); - else node = new MathNode("mover", [arrowNode, upperNode]); - } else if (group.below) node = new MathNode("munder", [arrowNode, paddedNode(buildGroup(group.below, options))]); - else { - node = paddedNode(); - node = new MathNode("mover", [arrowNode, node]); - } - return node; - } - }); - function htmlBuilder$9(group, options) { - var elements = buildExpression$1(group.body, options, true); - return makeSpan([group.mclass], elements, options); - } - function mathmlBuilder$8(group, options) { - var node; - var inner = buildExpression(group.body, options); - if (group.mclass === "minner") node = new MathNode("mpadded", inner); - else if (group.mclass === "mord") { - if (group.isCharacterBox) { - node = inner[0]; - node.type = "mi"; - } else node = new MathNode("mi", inner); - } else { - if (group.isCharacterBox) { - node = inner[0]; - node.type = "mo"; - } else node = new MathNode("mo", inner); - if (group.mclass === "mbin") { - node.attributes.lspace = "0.22em"; - node.attributes.rspace = "0.22em"; - } else if (group.mclass === "mpunct") { - node.attributes.lspace = "0em"; - node.attributes.rspace = "0.17em"; - } else if (group.mclass === "mopen" || group.mclass === "mclose") { - node.attributes.lspace = "0em"; - node.attributes.rspace = "0em"; - } - } - return node; - } - defineFunction({ - type: "mclass", - names: [ - "\\mathord", - "\\mathbin", - "\\mathrel", - "\\mathopen", - "\\mathclose", - "\\mathpunct", - "\\mathinner" - ], - numArgs: 1, - primitive: true, - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - var body = args[0]; - return { - type: "mclass", - mode: parser.mode, - mclass: "m" + funcName.slice(5), - body: ordargument(body), - isCharacterBox: isCharacterBox(body) - }; - }, - htmlBuilder: htmlBuilder$9, - mathmlBuilder: mathmlBuilder$8 - }); - var binrelClass = (arg) => { - var atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg; - if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) return "m" + atom.family; - else return "mord"; - }; - defineFunction({ - type: "mclass", - names: ["\\@binrel"], - numArgs: 2, - handler(_ref2, args) { - return { - type: "mclass", - mode: _ref2.parser.mode, - mclass: binrelClass(args[0]), - body: ordargument(args[1]), - isCharacterBox: isCharacterBox(args[1]) - }; - } - }); - defineFunction({ - type: "mclass", - names: [ - "\\stackrel", - "\\overset", - "\\underset" - ], - numArgs: 2, - handler(_ref3, args) { - var parser = _ref3.parser, funcName = _ref3.funcName; - var baseArg = args[1]; - var shiftedArg = args[0]; - var mclass; - if (funcName !== "\\stackrel") mclass = binrelClass(baseArg); - else mclass = "mrel"; - var baseOp = { - type: "op", - mode: baseArg.mode, - limits: true, - alwaysHandleSupSub: true, - parentIsSupSub: false, - symbol: false, - suppressBaseShift: funcName !== "\\stackrel", - body: ordargument(baseArg) - }; - var supsub = funcName === "\\underset" ? { - type: "supsub", - mode: shiftedArg.mode, - base: baseOp, - sub: shiftedArg - } : { - type: "supsub", - mode: shiftedArg.mode, - base: baseOp, - sup: shiftedArg - }; - return { - type: "mclass", - mode: parser.mode, - mclass, - body: [supsub], - isCharacterBox: isCharacterBox(supsub) - }; - } - }); - defineFunction({ - type: "pmb", - names: ["\\pmb"], - numArgs: 1, - allowedInText: true, - handler(_ref, args) { - return { - type: "pmb", - mode: _ref.parser.mode, - mclass: binrelClass(args[0]), - body: ordargument(args[0]) - }; - }, - htmlBuilder(group, options) { - var elements = buildExpression$1(group.body, options, true); - var node = makeSpan([group.mclass], elements, options); - node.style.textShadow = "0.02em 0.01em 0.04px"; - return node; - }, - mathmlBuilder(group, style) { - var node = new MathNode("mstyle", buildExpression(group.body, style)); - node.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"); - return node; - } - }); - var cdArrowFunctionName = { - ">": "\\\\cdrightarrow", - "<": "\\\\cdleftarrow", - "=": "\\\\cdlongequal", - "A": "\\uparrow", - "V": "\\downarrow", - "|": "\\Vert", - ".": "no arrow" - }; - var newCell = () => { - return { - type: "styling", - body: [], - mode: "math", - style: "display", - resetFont: true - }; - }; - var isStartOfArrow = (node) => { - return node.type === "textord" && node.text === "@"; - }; - var isLabelEnd = (node, endChar) => { - return (node.type === "mathord" || node.type === "atom") && node.text === endChar; - }; - function cdArrow(arrowChar, labels, parser) { - var funcName = cdArrowFunctionName[arrowChar]; - switch (funcName) { - case "\\\\cdrightarrow": - case "\\\\cdleftarrow": return parser.callFunction(funcName, [labels[0]], [labels[1]]); - case "\\uparrow": - case "\\downarrow": - var leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []); - var bareArrow = { - type: "atom", - text: funcName, - mode: "math", - family: "rel" - }; - var arrowGroup = { - type: "ordgroup", - mode: "math", - body: [ - leftLabel, - parser.callFunction("\\Big", [bareArrow], []), - parser.callFunction("\\\\cdright", [labels[1]], []) - ] - }; - return parser.callFunction("\\\\cdparent", [arrowGroup], []); - case "\\\\cdlongequal": return parser.callFunction("\\\\cdlongequal", [], []); - case "\\Vert": return parser.callFunction("\\Big", [{ - type: "textord", - text: "\\Vert", - mode: "math" - }], []); - default: return { - type: "textord", - text: " ", - mode: "math" - }; - } - } - function parseCD(parser) { - var parsedRows = []; - parser.gullet.beginGroup(); - parser.gullet.macros.set("\\cr", "\\\\\\relax"); - parser.gullet.beginGroup(); - while (true) { - parsedRows.push(parser.parseExpression(false, "\\\\")); - parser.gullet.endGroup(); - parser.gullet.beginGroup(); - var next = parser.fetch().text; - if (next === "&" || next === "\\\\") parser.consume(); - else if (next === "\\end") { - if (parsedRows[parsedRows.length - 1].length === 0) parsedRows.pop(); - break; - } else throw new ParseError("Expected \\\\ or \\cr or \\end", parser.nextToken); - } - var row = []; - var body = [row]; - for (var i = 0; i < parsedRows.length; i++) { - var rowNodes = parsedRows[i]; - var cell = newCell(); - for (var j = 0; j < rowNodes.length; j++) if (!isStartOfArrow(rowNodes[j])) cell.body.push(rowNodes[j]); - else { - row.push(cell); - j += 1; - var arrowChar = assertSymbolNodeType(rowNodes[j]).text; - var labels = new Array(2); - labels[0] = { - type: "ordgroup", - mode: "math", - body: [] - }; - labels[1] = { - type: "ordgroup", - mode: "math", - body: [] - }; - if ("=|.".includes(arrowChar)); - else if ("<>AV".includes(arrowChar)) for (var labelNum = 0; labelNum < 2; labelNum++) { - var inLabel = true; - for (var k = j + 1; k < rowNodes.length; k++) { - if (isLabelEnd(rowNodes[k], arrowChar)) { - inLabel = false; - j = k; - break; - } - if (isStartOfArrow(rowNodes[k])) throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k]); - labels[labelNum].body.push(rowNodes[k]); - } - if (inLabel) throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j]); - } - else throw new ParseError("Expected one of \"<>AV=|.\" after @", rowNodes[j]); - var wrappedArrow = { - type: "styling", - body: [cdArrow(arrowChar, labels, parser)], - mode: "math", - style: "display", - resetFont: true - }; - row.push(wrappedArrow); - cell = newCell(); - } - if (i % 2 === 0) row.push(cell); - else row.shift(); - row = []; - body.push(row); - } - parser.gullet.endGroup(); - parser.gullet.endGroup(); - return { - type: "array", - mode: "math", - body, - arraystretch: 1, - addJot: true, - rowGaps: [null], - cols: new Array(body[0].length).fill({ - type: "align", - align: "c", - pregap: .25, - postgap: .25 - }), - colSeparationType: "CD", - hLinesBeforeRow: new Array(body.length + 1).fill([]) - }; - } - defineFunction({ - type: "cdlabel", - names: ["\\\\cdleft", "\\\\cdright"], - numArgs: 1, - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - return { - type: "cdlabel", - mode: parser.mode, - side: funcName.slice(4), - label: args[0] - }; - }, - htmlBuilder(group, options) { - var newOptions = options.havingStyle(options.style.sup()); - var label = wrapFragment(buildGroup$1(group.label, newOptions, options), options); - label.classes.push("cd-label-" + group.side); - label.style.bottom = makeEm(.8 - label.depth); - label.height = 0; - label.depth = 0; - return label; - }, - mathmlBuilder(group, options) { - var label = new MathNode("mrow", [buildGroup(group.label, options)]); - label = new MathNode("mpadded", [label]); - label.setAttribute("width", "0"); - if (group.side === "left") label.setAttribute("lspace", "-1width"); - label.setAttribute("voffset", "0.7em"); - label = new MathNode("mstyle", [label]); - label.setAttribute("displaystyle", "false"); - label.setAttribute("scriptlevel", "1"); - return label; - } - }); - defineFunction({ - type: "cdlabelparent", - names: ["\\\\cdparent"], - numArgs: 1, - handler(_ref2, args) { - return { - type: "cdlabelparent", - mode: _ref2.parser.mode, - fragment: args[0] - }; - }, - htmlBuilder(group, options) { - var parent = wrapFragment(buildGroup$1(group.fragment, options), options); - parent.classes.push("cd-vert-arrow"); - return parent; - }, - mathmlBuilder(group, options) { - return new MathNode("mrow", [buildGroup(group.fragment, options)]); - } - }); - defineFunction({ - type: "textord", - names: ["\\@char"], - numArgs: 1, - allowedInText: true, - handler(_ref, args) { - var parser = _ref.parser; - var number = assertCharacterGroup(assertNodeType(args[0], "ordgroup"), "\\@char has non-numeric argument"); - var code = parseInt(number); - var text; - if (isNaN(code)) throw new ParseError("\\@char has non-numeric argument " + number); - else if (code < 0 || code > 1114111) throw new ParseError("\\@char with invalid code point " + number); - else if (code <= 65535) text = String.fromCharCode(code); - else { - code -= 65536; - text = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); - } - return { - type: "textord", - mode: parser.mode, - text - }; - } - }); - var htmlBuilder$8 = (group, options) => { - return makeFragment(buildExpression$1(group.body, options.withColor(group.color), false)); - }; - var mathmlBuilder$7 = (group, options) => { - var node = new MathNode("mstyle", buildExpression(group.body, options.withColor(group.color))); - node.setAttribute("mathcolor", group.color); - return node; - }; - defineFunction({ - type: "color", - names: ["\\textcolor"], - numArgs: 2, - allowedInText: true, - argTypes: ["color", "original"], - handler(_ref, args) { - var parser = _ref.parser; - var color = assertNodeType(args[0], "color-token").color; - var body = args[1]; - return { - type: "color", - mode: parser.mode, - color, - body: ordargument(body) - }; - }, - htmlBuilder: htmlBuilder$8, - mathmlBuilder: mathmlBuilder$7 - }); - defineFunction({ - type: "color", - names: ["\\color"], - numArgs: 1, - allowedInText: true, - argTypes: ["color"], - handler(_ref2, args) { - var parser = _ref2.parser, breakOnTokenText = _ref2.breakOnTokenText; - var color = assertNodeType(args[0], "color-token").color; - parser.gullet.macros.set("\\current@color", color); - var body = parser.parseExpression(true, breakOnTokenText); - return { - type: "color", - mode: parser.mode, - color, - body - }; - } - }); - defineFunction({ - type: "cr", - names: ["\\\\"], - numArgs: 0, - numOptionalArgs: 0, - allowedInText: true, - handler(_ref) { - var parser = _ref.parser; - var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null; - var newLine = !parser.settings.displayMode || !handleStrict({ - strict: parser.settings.strict, - errorCode: "newLineInDisplayMode", - errorMsg: "In LaTeX, \\\\ or \\newline does nothing in display mode", - report: false - }); - return { - type: "cr", - mode: parser.mode, - newLine, - size: size && assertNodeType(size, "size").value - }; - }, - htmlBuilder(group, options) { - var span = makeSpan(["mspace"], [], options); - if (group.newLine) { - span.classes.push("katex-newline"); - if (group.size) span.style.marginTop = makeEm(calculateSize(group.size, options)); - } - return span; - }, - mathmlBuilder(group, options) { - var node = new MathNode("mspace"); - if (group.newLine) { - node.setAttribute("linebreak", "newline"); - if (group.size) node.setAttribute("height", makeEm(calculateSize(group.size, options))); - } - return node; - } - }); - var globalMap = { - "\\global": "\\global", - "\\long": "\\\\globallong", - "\\\\globallong": "\\\\globallong", - "\\def": "\\gdef", - "\\gdef": "\\gdef", - "\\edef": "\\xdef", - "\\xdef": "\\xdef", - "\\let": "\\\\globallet", - "\\futurelet": "\\\\globalfuture" - }; - var checkControlSequence = (tok) => { - var name = tok.text; - if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) throw new ParseError("Expected a control sequence", tok); - return name; - }; - var getRHS = (parser) => { - var tok = parser.gullet.popToken(); - if (tok.text === "=") { - tok = parser.gullet.popToken(); - if (tok.text === " ") tok = parser.gullet.popToken(); - } - return tok; - }; - var letCommand = (parser, name, tok, global) => { - var macro = parser.gullet.macros.get(tok.text); - if (macro == null) { - tok.noexpand = true; - macro = { - tokens: [tok], - numArgs: 0, - unexpandable: !parser.gullet.isExpandable(tok.text) - }; - } - parser.gullet.macros.set(name, macro, global); - }; - defineFunction({ - type: "internal", - names: [ - "\\global", - "\\long", - "\\\\globallong" - ], - numArgs: 0, - allowedInText: true, - handler(_ref) { - var parser = _ref.parser, funcName = _ref.funcName; - parser.consumeSpaces(); - var token = parser.fetch(); - if (globalMap[token.text]) { - if (funcName === "\\global" || funcName === "\\\\globallong") token.text = globalMap[token.text]; - return assertNodeType(parser.parseFunction(), "internal"); - } - throw new ParseError("Invalid token after macro prefix", token); - } - }); - defineFunction({ - type: "internal", - names: [ - "\\def", - "\\gdef", - "\\edef", - "\\xdef" - ], - numArgs: 0, - allowedInText: true, - primitive: true, - handler(_ref2) { - var parser = _ref2.parser, funcName = _ref2.funcName; - var tok = parser.gullet.popToken(); - var name = tok.text; - if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) throw new ParseError("Expected a control sequence", tok); - var numArgs = 0; - var insert; - var delimiters = [[]]; - while (parser.gullet.future().text !== "{") { - tok = parser.gullet.popToken(); - if (tok.text === "#") { - if (parser.gullet.future().text === "{") { - insert = parser.gullet.future(); - delimiters[numArgs].push("{"); - break; - } - tok = parser.gullet.popToken(); - if (!/^[1-9]$/.test(tok.text)) throw new ParseError("Invalid argument number \"" + tok.text + "\""); - if (parseInt(tok.text) !== numArgs + 1) throw new ParseError("Argument number \"" + tok.text + "\" out of order"); - numArgs++; - delimiters.push([]); - } else if (tok.text === "EOF") throw new ParseError("Expected a macro definition"); - else delimiters[numArgs].push(tok.text); - } - var tokens = parser.gullet.consumeArg().tokens; - if (insert) tokens.unshift(insert); - if (funcName === "\\edef" || funcName === "\\xdef") { - tokens = parser.gullet.expandTokens(tokens); - tokens.reverse(); - } - parser.gullet.macros.set(name, { - tokens, - numArgs, - delimiters - }, funcName === globalMap[funcName]); - return { - type: "internal", - mode: parser.mode - }; - } - }); - defineFunction({ - type: "internal", - names: ["\\let", "\\\\globallet"], - numArgs: 0, - allowedInText: true, - primitive: true, - handler(_ref3) { - var parser = _ref3.parser, funcName = _ref3.funcName; - var name = checkControlSequence(parser.gullet.popToken()); - parser.gullet.consumeSpaces(); - letCommand(parser, name, getRHS(parser), funcName === "\\\\globallet"); - return { - type: "internal", - mode: parser.mode - }; - } - }); - defineFunction({ - type: "internal", - names: ["\\futurelet", "\\\\globalfuture"], - numArgs: 0, - allowedInText: true, - primitive: true, - handler(_ref4) { - var parser = _ref4.parser, funcName = _ref4.funcName; - var name = checkControlSequence(parser.gullet.popToken()); - var middle = parser.gullet.popToken(); - var tok = parser.gullet.popToken(); - letCommand(parser, name, tok, funcName === "\\\\globalfuture"); - parser.gullet.pushToken(tok); - parser.gullet.pushToken(middle); - return { - type: "internal", - mode: parser.mode - }; - } - }); - /** - * This file deals with creating delimiters of various sizes. The TeXbook - * discusses these routines on page 441-442, in the "Another subroutine sets box - * x to a specified variable delimiter" paragraph. - * - * There are three main routines here. `makeSmallDelim` makes a delimiter in the - * normal font, but in either text, script, or scriptscript style. - * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1, - * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of - * smaller pieces that are stacked on top of one another. - * - * The functions take a parameter `center`, which determines if the delimiter - * should be centered around the axis. - * - * Then, there are three exposed functions. `sizedDelim` makes a delimiter in - * one of the given sizes. This is used for things like `\bigl`. - * `customSizedDelim` makes a delimiter with a given total height+depth. It is - * called in places like `\sqrt`. `leftRightDelim` makes an appropriate - * delimiter which surrounds an expression of a given height an depth. It is - * used in `\left` and `\right`. - */ - /** - * Get the metrics for a given symbol and font, after transformation (i.e. - * after following replacement from symbols.js) - */ - var getMetrics = function getMetrics(symbol, font, mode) { - var metrics = getCharacterMetrics(symbols.math[symbol] && symbols.math[symbol].replace || symbol, font, mode); - if (!metrics) throw new Error("Unsupported symbol " + symbol + " and font size " + font + "."); - return metrics; - }; - /** - * Puts a delimiter span in a given style, and adds appropriate height, depth, - * and maxFontSizes. - */ - var styleWrap = function styleWrap(delim, toStyle, options, classes) { - var newOptions = options.havingBaseStyle(toStyle); - var span = makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options); - var delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier; - span.height *= delimSizeMultiplier; - span.depth *= delimSizeMultiplier; - span.maxFontSize = newOptions.sizeMultiplier; - return span; - }; - var centerSpan = function centerSpan(span, options, style) { - var newOptions = options.havingBaseStyle(style); - var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight; - span.classes.push("delimcenter"); - span.style.top = makeEm(shift); - span.height -= shift; - span.depth += shift; - }; - /** - * Makes a small delimiter. This is a delimiter that comes in the Main-Regular - * font, but is restyled to either be in textstyle, scriptstyle, or - * scriptscriptstyle. - */ - var makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) { - var span = styleWrap(makeSymbol(delim, "Main-Regular", mode, options), style, options, classes); - if (center) centerSpan(span, options, style); - return span; - }; - /** - * Builds a symbol in the given font size (note size is an integer) - */ - var mathrmSize = function mathrmSize(value, size, mode, options) { - return makeSymbol(value, "Size" + size + "-Regular", mode, options); - }; - /** - * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2, - * Size3, or Size4 fonts. It is always rendered in textstyle. - */ - var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) { - var inner = mathrmSize(delim, size, mode, options); - var span = styleWrap(makeSpan(["delimsizing", "size" + size], [inner], options), Style$1.TEXT, options, classes); - if (center) centerSpan(span, options, Style$1.TEXT); - return span; - }; - /** - * Make a span from a font glyph with the given offset and in the given font. - * This is used in makeStackedDelim to make the stacking pieces for the delimiter. - */ - var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode, options) { - var sizeClass; - if (font === "Size1-Regular") sizeClass = "delim-size1"; - else sizeClass = "delim-size4"; - return { - type: "elem", - elem: makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode, options)])]) - }; - }; - var makeInner = function makeInner(ch, height, options) { - var width = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4]; - var span = makeSvgSpan([], [new SvgNode([new PathNode("inner", innerPath(ch, Math.round(1e3 * height)))], { - "width": makeEm(width), - "height": makeEm(height), - "style": "width:" + makeEm(width), - "viewBox": "0 0 " + 1e3 * width + " " + Math.round(1e3 * height), - "preserveAspectRatio": "xMinYMin" - })], options); - span.height = height; - span.style.height = makeEm(height); - span.style.width = makeEm(width); - return { - type: "elem", - elem: span - }; - }; - var lapInEms = .008; - var lap = { - type: "kern", - size: -1 * lapInEms - }; - var verts = /* @__PURE__ */ new Set([ - "|", - "\\lvert", - "\\rvert", - "\\vert" - ]); - var doubleVerts = /* @__PURE__ */ new Set([ - "\\|", - "\\lVert", - "\\rVert", - "\\Vert" - ]); - /** - * Make a stacked delimiter out of a given delimiter, with the total height at - * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook. - */ - var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) { - var top; - var middle; - var repeat; - var bottom; - var svgLabel = ""; - var viewBoxWidth = 0; - top = repeat = bottom = delim; - middle = null; - var font = "Size1-Regular"; - if (delim === "\\uparrow") repeat = bottom = "⏐"; - else if (delim === "\\Uparrow") repeat = bottom = "‖"; - else if (delim === "\\downarrow") top = repeat = "⏐"; - else if (delim === "\\Downarrow") top = repeat = "‖"; - else if (delim === "\\updownarrow") { - top = "\\uparrow"; - repeat = "⏐"; - bottom = "\\downarrow"; - } else if (delim === "\\Updownarrow") { - top = "\\Uparrow"; - repeat = "‖"; - bottom = "\\Downarrow"; - } else if (verts.has(delim)) { - repeat = "∣"; - svgLabel = "vert"; - viewBoxWidth = 333; - } else if (doubleVerts.has(delim)) { - repeat = "∥"; - svgLabel = "doublevert"; - viewBoxWidth = 556; - } else if (delim === "[" || delim === "\\lbrack") { - top = "⎡"; - repeat = "⎢"; - bottom = "⎣"; - font = "Size4-Regular"; - svgLabel = "lbrack"; - viewBoxWidth = 667; - } else if (delim === "]" || delim === "\\rbrack") { - top = "⎤"; - repeat = "⎥"; - bottom = "⎦"; - font = "Size4-Regular"; - svgLabel = "rbrack"; - viewBoxWidth = 667; - } else if (delim === "\\lfloor" || delim === "⌊") { - repeat = top = "⎢"; - bottom = "⎣"; - font = "Size4-Regular"; - svgLabel = "lfloor"; - viewBoxWidth = 667; - } else if (delim === "\\lceil" || delim === "⌈") { - top = "⎡"; - repeat = bottom = "⎢"; - font = "Size4-Regular"; - svgLabel = "lceil"; - viewBoxWidth = 667; - } else if (delim === "\\rfloor" || delim === "⌋") { - repeat = top = "⎥"; - bottom = "⎦"; - font = "Size4-Regular"; - svgLabel = "rfloor"; - viewBoxWidth = 667; - } else if (delim === "\\rceil" || delim === "⌉") { - top = "⎤"; - repeat = bottom = "⎥"; - font = "Size4-Regular"; - svgLabel = "rceil"; - viewBoxWidth = 667; - } else if (delim === "(" || delim === "\\lparen") { - top = "⎛"; - repeat = "⎜"; - bottom = "⎝"; - font = "Size4-Regular"; - svgLabel = "lparen"; - viewBoxWidth = 875; - } else if (delim === ")" || delim === "\\rparen") { - top = "⎞"; - repeat = "⎟"; - bottom = "⎠"; - font = "Size4-Regular"; - svgLabel = "rparen"; - viewBoxWidth = 875; - } else if (delim === "\\{" || delim === "\\lbrace") { - top = "⎧"; - middle = "⎨"; - bottom = "⎩"; - repeat = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\}" || delim === "\\rbrace") { - top = "⎫"; - middle = "⎬"; - bottom = "⎭"; - repeat = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\lgroup" || delim === "⟮") { - top = "⎧"; - bottom = "⎩"; - repeat = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\rgroup" || delim === "⟯") { - top = "⎫"; - bottom = "⎭"; - repeat = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\lmoustache" || delim === "⎰") { - top = "⎧"; - bottom = "⎭"; - repeat = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\rmoustache" || delim === "⎱") { - top = "⎫"; - bottom = "⎩"; - repeat = "⎪"; - font = "Size4-Regular"; - } - var topMetrics = getMetrics(top, font, mode); - var topHeightTotal = topMetrics.height + topMetrics.depth; - var repeatMetrics = getMetrics(repeat, font, mode); - var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; - var bottomMetrics = getMetrics(bottom, font, mode); - var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; - var middleHeightTotal = 0; - var middleFactor = 1; - if (middle !== null) { - var middleMetrics = getMetrics(middle, font, mode); - middleHeightTotal = middleMetrics.height + middleMetrics.depth; - middleFactor = 2; - } - var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; - var realHeightTotal = minHeight + Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal))) * middleFactor * repeatHeightTotal; - var axisHeight = options.fontMetrics().axisHeight; - if (center) axisHeight *= options.sizeMultiplier; - var depth = realHeightTotal / 2 - axisHeight; - var stack = []; - if (svgLabel.length > 0) { - var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal; - var viewBoxHeight = Math.round(realHeightTotal * 1e3); - var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1e3)); - var path = new PathNode(svgLabel, pathStr); - var width = makeEm(viewBoxWidth / 1e3); - var height = makeEm(viewBoxHeight / 1e3); - var wrapper = makeSvgSpan([], [new SvgNode([path], { - "width": width, - "height": height, - "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight - })], options); - wrapper.height = viewBoxHeight / 1e3; - wrapper.style.width = width; - wrapper.style.height = height; - stack.push({ - type: "elem", - elem: wrapper - }); - } else { - stack.push(makeGlyphSpan(bottom, font, mode, options)); - stack.push(lap); - if (middle === null) { - var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms; - stack.push(makeInner(repeat, innerHeight, options)); - } else { - var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms; - stack.push(makeInner(repeat, _innerHeight, options)); - stack.push(lap); - stack.push(makeGlyphSpan(middle, font, mode, options)); - stack.push(lap); - stack.push(makeInner(repeat, _innerHeight, options)); - } - stack.push(lap); - stack.push(makeGlyphSpan(top, font, mode, options)); - } - var newOptions = options.havingBaseStyle(Style$1.TEXT); - return styleWrap(makeSpan(["delimsizing", "mult"], [makeVList({ - positionType: "bottom", - positionData: depth, - children: stack - })], newOptions), Style$1.TEXT, options, classes); - }; - var vbPad = 80; - var emPad = .08; - var sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, extraVinculum, options) { - return makeSvgSpan(["hide-tail"], [new SvgNode([new PathNode(sqrtName, sqrtPath(sqrtName, extraVinculum, viewBoxHeight))], { - "width": "400em", - "height": makeEm(height), - "viewBox": "0 0 400000 " + viewBoxHeight, - "preserveAspectRatio": "xMinYMin slice" - })], options); - }; - /** - * Make a sqrt image of the given height, - */ - var makeSqrtImage = function makeSqrtImage(height, options) { - var newOptions = options.havingBaseSizing(); - var delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions); - var sizeMultiplier = newOptions.sizeMultiplier; - var extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness); - var span; - var spanHeight; - var texHeight; - var viewBoxHeight; - var advanceWidth; - if (delim.type === "small") { - viewBoxHeight = 1e3 + 1e3 * extraVinculum + vbPad; - if (height < 1) sizeMultiplier = 1; - else if (height < 1.4) sizeMultiplier = .7; - spanHeight = (1 + extraVinculum + emPad) / sizeMultiplier; - texHeight = (1 + extraVinculum) / sizeMultiplier; - span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options); - span.style.minWidth = "0.853em"; - advanceWidth = .833 / sizeMultiplier; - } else if (delim.type === "large") { - viewBoxHeight = (1e3 + vbPad) * sizeToMaxHeight[delim.size]; - texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier; - spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier; - span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options); - span.style.minWidth = "1.02em"; - advanceWidth = 1 / sizeMultiplier; - } else { - spanHeight = height + extraVinculum + emPad; - texHeight = height + extraVinculum; - viewBoxHeight = Math.floor(1e3 * height + extraVinculum) + vbPad; - span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options); - span.style.minWidth = "0.742em"; - advanceWidth = 1.056; - } - span.height = texHeight; - span.style.height = makeEm(spanHeight); - return { - span, - advanceWidth, - ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier - }; - }; - var stackLargeDelimiters = /* @__PURE__ */ new Set([ - "(", - "\\lparen", - ")", - "\\rparen", - "[", - "\\lbrack", - "]", - "\\rbrack", - "\\{", - "\\lbrace", - "\\}", - "\\rbrace", - "\\lfloor", - "\\rfloor", - "⌊", - "⌋", - "\\lceil", - "\\rceil", - "⌈", - "⌉", - "\\surd" - ]); - var stackAlwaysDelimiters = /* @__PURE__ */ new Set([ - "\\uparrow", - "\\downarrow", - "\\updownarrow", - "\\Uparrow", - "\\Downarrow", - "\\Updownarrow", - "|", - "\\|", - "\\vert", - "\\Vert", - "\\lvert", - "\\rvert", - "\\lVert", - "\\rVert", - "\\lgroup", - "\\rgroup", - "⟮", - "⟯", - "\\lmoustache", - "\\rmoustache", - "⎰", - "⎱" - ]); - var stackNeverDelimiters = /* @__PURE__ */ new Set([ - "<", - ">", - "\\langle", - "\\rangle", - "/", - "\\backslash", - "\\lt", - "\\gt" - ]); - var sizeToMaxHeight = [ - 0, - 1.2, - 1.8, - 2.4, - 3 - ]; - /** - * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4. - */ - var makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) { - if (delim === "<" || delim === "\\lt" || delim === "⟨") delim = "\\langle"; - else if (delim === ">" || delim === "\\gt" || delim === "⟩") delim = "\\rangle"; - if (stackLargeDelimiters.has(delim) || stackNeverDelimiters.has(delim)) return makeLargeDelim(delim, size, false, options, mode, classes); - else if (stackAlwaysDelimiters.has(delim)) return makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes); - else throw new ParseError("Illegal delimiter: '" + delim + "'"); - }; - var stackNeverDelimiterSequence = [ - { - type: "small", - style: Style$1.SCRIPTSCRIPT - }, - { - type: "small", - style: Style$1.SCRIPT - }, - { - type: "small", - style: Style$1.TEXT - }, - { - type: "large", - size: 1 - }, - { - type: "large", - size: 2 - }, - { - type: "large", - size: 3 - }, - { - type: "large", - size: 4 - } - ]; - var stackAlwaysDelimiterSequence = [ - { - type: "small", - style: Style$1.SCRIPTSCRIPT - }, - { - type: "small", - style: Style$1.SCRIPT - }, - { - type: "small", - style: Style$1.TEXT - }, - { type: "stack" } - ]; - var stackLargeDelimiterSequence = [ - { - type: "small", - style: Style$1.SCRIPTSCRIPT - }, - { - type: "small", - style: Style$1.SCRIPT - }, - { - type: "small", - style: Style$1.TEXT - }, - { - type: "large", - size: 1 - }, - { - type: "large", - size: 2 - }, - { - type: "large", - size: 3 - }, - { - type: "large", - size: 4 - }, - { type: "stack" } - ]; - /** - * Get the font used in a delimiter based on what kind of delimiter it is. - * TODO(#963) Use more specific font family return type once that is introduced. - */ - var delimTypeToFont = function delimTypeToFont(type) { - if (type.type === "small") return "Main-Regular"; - else if (type.type === "large") return "Size" + type.size + "-Regular"; - else if (type.type === "stack") return "Size4-Regular"; - else { - var delimKind = type.type; - throw new Error("Add support for delim type '" + delimKind + "' here."); - } - }; - /** - * Traverse a sequence of types of delimiters to decide what kind of delimiter - * should be used to create a delimiter of the given height+depth. - */ - var traverseSequence = function traverseSequence(delim, height, sequence, options) { - for (var i = Math.min(2, 3 - options.style.size); i < sequence.length; i++) { - var delimType = sequence[i]; - if (delimType.type === "stack") break; - var metrics = getMetrics(delim, delimTypeToFont(delimType), "math"); - var heightDepth = metrics.height + metrics.depth; - if (delimType.type === "small") { - var newOptions = options.havingBaseStyle(delimType.style); - heightDepth *= newOptions.sizeMultiplier; - } - if (heightDepth > height) return delimType; - } - return sequence[sequence.length - 1]; - }; - /** - * Make a delimiter of a given height+depth, with optional centering. Here, we - * traverse the sequences, and create a delimiter that the sequence tells us to. - */ - var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) { - if (delim === "<" || delim === "\\lt" || delim === "⟨") delim = "\\langle"; - else if (delim === ">" || delim === "\\gt" || delim === "⟩") delim = "\\rangle"; - var sequence; - if (stackNeverDelimiters.has(delim)) sequence = stackNeverDelimiterSequence; - else if (stackLargeDelimiters.has(delim)) sequence = stackLargeDelimiterSequence; - else sequence = stackAlwaysDelimiterSequence; - var delimType = traverseSequence(delim, height, sequence, options); - if (delimType.type === "small") return makeSmallDelim(delim, delimType.style, center, options, mode, classes); - else if (delimType.type === "large") return makeLargeDelim(delim, delimType.size, center, options, mode, classes); - else return makeStackedDelim(delim, height, center, options, mode, classes); - }; - /** - * Make a delimiter for use with `\left` and `\right`, given a height and depth - * of an expression that the delimiters surround. - */ - var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) { - var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier; - var delimiterFactor = 901; - var delimiterExtend = 5 / options.fontMetrics().ptPerEm; - var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight); - return makeCustomSizedDelim(delim, Math.max(maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend), true, options, mode, classes); - }; - var delimiterSizes = { - "\\bigl": { - mclass: "mopen", - size: 1 - }, - "\\Bigl": { - mclass: "mopen", - size: 2 - }, - "\\biggl": { - mclass: "mopen", - size: 3 - }, - "\\Biggl": { - mclass: "mopen", - size: 4 - }, - "\\bigr": { - mclass: "mclose", - size: 1 - }, - "\\Bigr": { - mclass: "mclose", - size: 2 - }, - "\\biggr": { - mclass: "mclose", - size: 3 - }, - "\\Biggr": { - mclass: "mclose", - size: 4 - }, - "\\bigm": { - mclass: "mrel", - size: 1 - }, - "\\Bigm": { - mclass: "mrel", - size: 2 - }, - "\\biggm": { - mclass: "mrel", - size: 3 - }, - "\\Biggm": { - mclass: "mrel", - size: 4 - }, - "\\big": { - mclass: "mord", - size: 1 - }, - "\\Big": { - mclass: "mord", - size: 2 - }, - "\\bigg": { - mclass: "mord", - size: 3 - }, - "\\Bigg": { - mclass: "mord", - size: 4 - } - }; - var delimiters = /* @__PURE__ */ new Set([ - "(", - "\\lparen", - ")", - "\\rparen", - "[", - "\\lbrack", - "]", - "\\rbrack", - "\\{", - "\\lbrace", - "\\}", - "\\rbrace", - "\\lfloor", - "\\rfloor", - "⌊", - "⌋", - "\\lceil", - "\\rceil", - "⌈", - "⌉", - "<", - ">", - "\\langle", - "⟨", - "\\rangle", - "⟩", - "\\lt", - "\\gt", - "\\lvert", - "\\rvert", - "\\lVert", - "\\rVert", - "\\lgroup", - "\\rgroup", - "⟮", - "⟯", - "\\lmoustache", - "\\rmoustache", - "⎰", - "⎱", - "/", - "\\backslash", - "|", - "\\vert", - "\\|", - "\\Vert", - "\\uparrow", - "\\Uparrow", - "\\downarrow", - "\\Downarrow", - "\\updownarrow", - "\\Updownarrow", - "." - ]); - function isMiddleDelimNode(node) { - return "isMiddle" in node; - } - function checkDelimiter(delim, context) { - var symDelim = checkSymbolNodeType(delim); - if (symDelim && delimiters.has(symDelim.text)) return symDelim; - else if (symDelim) throw new ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim); - else throw new ParseError("Invalid delimiter type '" + delim.type + "'", delim); - } - defineFunction({ - type: "delimsizing", - names: [ - "\\bigl", - "\\Bigl", - "\\biggl", - "\\Biggl", - "\\bigr", - "\\Bigr", - "\\biggr", - "\\Biggr", - "\\bigm", - "\\Bigm", - "\\biggm", - "\\Biggm", - "\\big", - "\\Big", - "\\bigg", - "\\Bigg" - ], - numArgs: 1, - argTypes: ["primitive"], - handler: (context, args) => { - var delim = checkDelimiter(normalizeArgument(args[0]), context); - return { - type: "delimsizing", - mode: context.parser.mode, - size: delimiterSizes[context.funcName].size, - mclass: delimiterSizes[context.funcName].mclass, - delim: delim.text - }; - }, - htmlBuilder: (group, options) => { - if (group.delim === ".") return makeSpan([group.mclass]); - return makeSizedDelim(group.delim, group.size, options, group.mode, [group.mclass]); - }, - mathmlBuilder: (group) => { - var children = []; - if (group.delim !== ".") children.push(makeText(group.delim, group.mode)); - var node = new MathNode("mo", children); - if (group.mclass === "mopen" || group.mclass === "mclose") node.setAttribute("fence", "true"); - else node.setAttribute("fence", "false"); - node.setAttribute("stretchy", "true"); - var size = makeEm(sizeToMaxHeight[group.size]); - node.setAttribute("minsize", size); - node.setAttribute("maxsize", size); - return node; - } - }); - function assertParsed(group) { - if (!group.body) throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); - } - defineFunction({ - type: "leftright-right", - names: ["\\right"], - numArgs: 1, - primitive: true, - handler: (context, args) => { - var color = context.parser.gullet.macros.get("\\current@color"); - if (color && typeof color !== "string") throw new ParseError("\\current@color set to non-string in \\right"); - return { - type: "leftright-right", - mode: context.parser.mode, - delim: checkDelimiter(args[0], context).text, - color - }; - } - }); - defineFunction({ - type: "leftright", - names: ["\\left"], - numArgs: 1, - primitive: true, - handler: (context, args) => { - var delim = checkDelimiter(args[0], context); - var parser = context.parser; - ++parser.leftrightDepth; - var body = parser.parseExpression(false); - --parser.leftrightDepth; - parser.expect("\\right", false); - var right = assertNodeType(parser.parseFunction(), "leftright-right"); - return { - type: "leftright", - mode: parser.mode, - body, - left: delim.text, - right: right.delim, - rightColor: right.color - }; - }, - htmlBuilder: (group, options) => { - assertParsed(group); - var inner = buildExpression$1(group.body, options, true, ["mopen", "mclose"]); - var innerHeight = 0; - var innerDepth = 0; - var hadMiddle = false; - for (var i = 0; i < inner.length; i++) { - var node = inner[i]; - if (isMiddleDelimNode(node)) hadMiddle = true; - else { - innerHeight = Math.max(inner[i].height, innerHeight); - innerDepth = Math.max(inner[i].depth, innerDepth); - } - } - innerHeight *= options.sizeMultiplier; - innerDepth *= options.sizeMultiplier; - var leftDelim; - if (group.left === ".") leftDelim = makeNullDelimiter(options, ["mopen"]); - else leftDelim = makeLeftRightDelim(group.left, innerHeight, innerDepth, options, group.mode, ["mopen"]); - inner.unshift(leftDelim); - if (hadMiddle) for (var _i = 1; _i < inner.length; _i++) { - var middleDelim = inner[_i]; - if (isMiddleDelimNode(middleDelim)) { - var isMiddle = middleDelim.isMiddle; - inner[_i] = makeLeftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []); - } - } - var rightDelim; - if (group.right === ".") rightDelim = makeNullDelimiter(options, ["mclose"]); - else { - var colorOptions = group.rightColor ? options.withColor(group.rightColor) : options; - rightDelim = makeLeftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, ["mclose"]); - } - inner.push(rightDelim); - return makeSpan(["minner"], inner, options); - }, - mathmlBuilder: (group, options) => { - assertParsed(group); - var inner = buildExpression(group.body, options); - if (group.left !== ".") { - var leftNode = new MathNode("mo", [makeText(group.left, group.mode)]); - leftNode.setAttribute("fence", "true"); - inner.unshift(leftNode); - } - if (group.right !== ".") { - var rightNode = new MathNode("mo", [makeText(group.right, group.mode)]); - rightNode.setAttribute("fence", "true"); - if (group.rightColor) rightNode.setAttribute("mathcolor", group.rightColor); - inner.push(rightNode); - } - return makeRow(inner); - } - }); - defineFunction({ - type: "middle", - names: ["\\middle"], - numArgs: 1, - primitive: true, - handler: (context, args) => { - var delim = checkDelimiter(args[0], context); - if (!context.parser.leftrightDepth) throw new ParseError("\\middle without preceding \\left", delim); - return { - type: "middle", - mode: context.parser.mode, - delim: delim.text - }; - }, - htmlBuilder: (group, options) => { - var middleDelim; - if (group.delim === ".") middleDelim = makeNullDelimiter(options, []); - else { - middleDelim = makeSizedDelim(group.delim, 1, options, group.mode, []); - middleDelim.isMiddle = { - delim: group.delim, - options - }; - } - return middleDelim; - }, - mathmlBuilder: (group, options) => { - var middleNode = new MathNode("mo", [group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode)]); - middleNode.setAttribute("fence", "true"); - middleNode.setAttribute("lspace", "0.05em"); - middleNode.setAttribute("rspace", "0.05em"); - return middleNode; - } - }); - var htmlBuilder$7 = (group, options) => { - var inner = wrapFragment(buildGroup$1(group.body, options), options); - var label = group.label.slice(1); - var scale = options.sizeMultiplier; - var img; - var imgShift; - var isSingleChar = isCharacterBox(group.body); - if (label === "sout") { - img = makeSpan(["katex-stretchy", "katex-sout"]); - img.height = options.fontMetrics().defaultRuleThickness / scale; - imgShift = -.5 * options.fontMetrics().xHeight; - } else if (label === "phase") { - var lineWeight = calculateSize({ - number: .6, - unit: "pt" - }, options); - var clearance = calculateSize({ - number: .35, - unit: "ex" - }, options); - var newOptions = options.havingBaseSizing(); - scale = scale / newOptions.sizeMultiplier; - var angleHeight = inner.height + inner.depth + lineWeight + clearance; - inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight); - var viewBoxHeight = Math.floor(1e3 * angleHeight * scale); - img = makeSvgSpan(["hide-tail"], [new SvgNode([new PathNode("phase", phasePath(viewBoxHeight))], { - "width": "400em", - "height": makeEm(viewBoxHeight / 1e3), - "viewBox": "0 0 400000 " + viewBoxHeight, - "preserveAspectRatio": "xMinYMin slice" - })], options); - img.style.height = makeEm(angleHeight); - imgShift = inner.depth + lineWeight + clearance; - } else { - if (/cancel/.test(label)) { - if (!isSingleChar) inner.classes.push("cancel-pad"); - } else if (label === "angl") inner.classes.push("anglpad"); - else inner.classes.push("boxpad"); - var topPad; - var bottomPad; - var ruleThickness = 0; - if (/box/.test(label)) { - ruleThickness = Math.max(options.fontMetrics().fboxrule, options.minRuleThickness); - topPad = options.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness); - bottomPad = topPad; - } else if (label === "angl") { - ruleThickness = Math.max(options.fontMetrics().defaultRuleThickness, options.minRuleThickness); - topPad = 4 * ruleThickness; - bottomPad = Math.max(0, .25 - inner.depth); - } else { - topPad = isSingleChar ? .2 : 0; - bottomPad = topPad; - } - img = stretchyEnclose(inner, label, topPad, bottomPad, options); - if (/fbox|boxed|fcolorbox/.test(label)) { - img.style.borderStyle = "solid"; - img.style.borderWidth = makeEm(ruleThickness); - } else if (label === "angl" && ruleThickness !== .049) { - img.style.borderTopWidth = makeEm(ruleThickness); - img.style.borderRightWidth = makeEm(ruleThickness); - } - imgShift = inner.depth + bottomPad; - if (group.backgroundColor) { - img.style.backgroundColor = group.backgroundColor; - if (group.borderColor) img.style.borderColor = group.borderColor; - } - } - var vlist; - if (group.backgroundColor) vlist = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: img, - shift: imgShift - }, { - type: "elem", - elem: inner, - shift: 0 - }] - }); - else { - var classes = /cancel|phase/.test(label) ? ["svg-align"] : []; - vlist = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: inner, - shift: 0 - }, { - type: "elem", - elem: img, - shift: imgShift, - wrapperClasses: classes - }] - }); - } - if (/cancel/.test(label)) { - vlist.height = inner.height; - vlist.depth = inner.depth; - } - if (/cancel/.test(label) && !isSingleChar) return makeSpan(["mord", "cancel-lap"], [vlist], options); - else return makeSpan(["mord"], [vlist], options); - }; - var mathmlBuilder$6 = (group, options) => { - var fboxsep; - var node = new MathNode(group.label.includes("colorbox") ? "mpadded" : "menclose", [buildGroup(group.body, options)]); - switch (group.label) { - case "\\cancel": - node.setAttribute("notation", "updiagonalstrike"); - break; - case "\\bcancel": - node.setAttribute("notation", "downdiagonalstrike"); - break; - case "\\phase": - node.setAttribute("notation", "phasorangle"); - break; - case "\\sout": - node.setAttribute("notation", "horizontalstrike"); - break; - case "\\fbox": - node.setAttribute("notation", "box"); - break; - case "\\angl": - node.setAttribute("notation", "actuarial"); - break; - case "\\fcolorbox": - case "\\colorbox": - fboxsep = options.fontMetrics().fboxsep * options.fontMetrics().ptPerEm; - node.setAttribute("width", "+" + 2 * fboxsep + "pt"); - node.setAttribute("height", "+" + 2 * fboxsep + "pt"); - node.setAttribute("lspace", fboxsep + "pt"); - node.setAttribute("voffset", fboxsep + "pt"); - if (group.label === "\\fcolorbox") { - var thk = Math.max(options.fontMetrics().fboxrule, options.minRuleThickness); - node.setAttribute("style", "border: " + makeEm(thk) + " solid " + group.borderColor); - } - break; - case "\\xcancel": node.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); - } - if (group.backgroundColor) node.setAttribute("mathbackground", group.backgroundColor); - return node; - }; - defineFunction({ - type: "enclose", - names: ["\\colorbox"], - numArgs: 2, - allowedInText: true, - argTypes: ["color", "hbox"], - handler(_ref, args, optArgs) { - var parser = _ref.parser, funcName = _ref.funcName; - var color = assertNodeType(args[0], "color-token").color; - var body = args[1]; - return { - type: "enclose", - mode: parser.mode, - label: funcName, - backgroundColor: color, - body - }; - }, - htmlBuilder: htmlBuilder$7, - mathmlBuilder: mathmlBuilder$6 - }); - defineFunction({ - type: "enclose", - names: ["\\fcolorbox"], - numArgs: 3, - allowedInText: true, - argTypes: [ - "color", - "color", - "hbox" - ], - handler(_ref2, args, optArgs) { - var parser = _ref2.parser, funcName = _ref2.funcName; - var borderColor = assertNodeType(args[0], "color-token").color; - var backgroundColor = assertNodeType(args[1], "color-token").color; - var body = args[2]; - return { - type: "enclose", - mode: parser.mode, - label: funcName, - backgroundColor, - borderColor, - body - }; - } - }); - defineFunction({ - type: "enclose", - names: ["\\fbox"], - numArgs: 1, - argTypes: ["hbox"], - allowedInText: true, - handler(_ref3, args) { - return { - type: "enclose", - mode: _ref3.parser.mode, - label: "\\fbox", - body: args[0] - }; - } - }); - defineFunction({ - type: "enclose", - names: [ - "\\cancel", - "\\bcancel", - "\\xcancel", - "\\phase" - ], - numArgs: 1, - handler(_ref4, args) { - var parser = _ref4.parser, funcName = _ref4.funcName; - var body = args[0]; - return { - type: "enclose", - mode: parser.mode, - label: funcName, - body - }; - } - }); - defineFunction({ - type: "enclose", - names: ["\\sout"], - numArgs: 1, - allowedInText: true, - handler(_ref5, args) { - var parser = _ref5.parser, funcName = _ref5.funcName; - if (parser.mode === "math") handleStrict({ - strict: parser.settings.strict, - errorCode: "mathVsSout", - errorMsg: "LaTeX's \\sout works only in text mode", - report: true - }); - var body = args[0]; - return { - type: "enclose", - mode: parser.mode, - label: funcName, - body - }; - } - }); - defineFunction({ - type: "enclose", - names: ["\\angl"], - numArgs: 1, - argTypes: ["hbox"], - allowedInText: false, - handler(_ref6, args) { - return { - type: "enclose", - mode: _ref6.parser.mode, - label: "\\angl", - body: args[0] - }; - } - }); - /** - * All registered environments. - * `environments.js` exports this same dictionary again and makes it public. - * `Parser.js` requires this dictionary via `environments.js`. - */ - var _environments = {}; - function defineEnvironment(_ref) { - var type = _ref.type, names = _ref.names, props = _ref.props, handler = _ref.handler, htmlBuilder = _ref.htmlBuilder, mathmlBuilder = _ref.mathmlBuilder; - var data = { - type, - numArgs: props.numArgs || 0, - allowedInText: false, - numOptionalArgs: 0, - handler - }; - for (var i = 0; i < names.length; ++i) _environments[names[i]] = data; - if (htmlBuilder) _htmlGroupBuilders[type] = htmlBuilder; - if (mathmlBuilder) _mathmlGroupBuilders[type] = mathmlBuilder; - } - /** - * All registered global/built-in macros. - * `macros.js` exports this same dictionary again and makes it public. - * `Parser.js` requires this dictionary via `macros.js`. - */ - var _macros = {}; - function defineMacro(name, body) { - _macros[name] = body; - } - /** - * Lexing or parsing positional information for error reporting. - * This object is immutable. - */ - var SourceLocation = class SourceLocation { - constructor(lexer, start, end) { - this.lexer = void 0; - this.start = void 0; - this.end = void 0; - this.lexer = lexer; - this.start = start; - this.end = end; - } - /** - * Merges two `SourceLocation`s from location providers, given they are - * provided in order of appearance. - * - Returns the first one's location if only the first is provided. - * - Returns a merged range of the first and the last if both are provided - * and their lexers match. - * - Otherwise, returns null. - */ - static range(first, second) { - if (!second) return first && first.loc; - else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) return null; - else return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end); - } - }; - /** - * The resulting token returned from `lex`. - * - * It consists of the token text plus some position information. - * The position information is essentially a range in an input string, - * but instead of referencing the bare input string, we refer to the lexer. - * That way it is possible to attach extra metadata to the input string, - * like for example a file name or similar. - * - * The position information is optional, so it is OK to construct synthetic - * tokens if appropriate. Not providing available position information may - * lead to degraded error reporting, though. - */ - var Token = class Token { - constructor(text, loc) { - this.text = void 0; - this.loc = void 0; - this.noexpand = void 0; - this.treatAsRelax = void 0; - this.text = text; - this.loc = loc; - } - /** - * Given a pair of tokens (this and endToken), compute a `Token` encompassing - * the whole input range enclosed by these two. - */ - range(endToken, text) { - return new Token(text, SourceLocation.range(this, endToken)); - } - }; - function getHLines(parser) { - var hlineInfo = []; - parser.consumeSpaces(); - var nxt = parser.fetch().text; - if (nxt === "\\relax") { - parser.consume(); - parser.consumeSpaces(); - nxt = parser.fetch().text; - } - while (nxt === "\\hline" || nxt === "\\hdashline") { - parser.consume(); - hlineInfo.push(nxt === "\\hdashline"); - parser.consumeSpaces(); - nxt = parser.fetch().text; - } - return hlineInfo; - } - var validateAmsEnvironmentContext = (context) => { - if (!context.parser.settings.displayMode) throw new ParseError("{" + context.envName + "} can be used only in display mode."); - }; - var gatherEnvironments = /* @__PURE__ */ new Set(["gather", "gather*"]); - function getAutoTag(name) { - if (!name.includes("ed")) return !name.includes("*"); - } - /** - * Parse the body of the environment, with rows delimited by \\ and - * columns delimited by &, and create a nested list in row-major order - * with one group per cell. If given an optional argument style - * ("text", "display", etc.), then each cell is cast into that style. - */ - function parseArray(parser, _ref, style) { - var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter, addJot = _ref.addJot, cols = _ref.cols, arraystretch = _ref.arraystretch, colSeparationType = _ref.colSeparationType, autoTag = _ref.autoTag, singleRow = _ref.singleRow, emptySingleRow = _ref.emptySingleRow, maxNumCols = _ref.maxNumCols, leqno = _ref.leqno; - parser.gullet.beginGroup(); - if (!singleRow) parser.gullet.macros.set("\\cr", "\\\\\\relax"); - if (!arraystretch) { - var stretch = parser.gullet.expandMacroAsText("\\arraystretch"); - if (stretch == null) arraystretch = 1; - else { - arraystretch = parseFloat(stretch); - if (!arraystretch || arraystretch < 0) throw new ParseError("Invalid \\arraystretch: " + stretch); - } - } - parser.gullet.beginGroup(); - var row = []; - var body = [row]; - var rowGaps = []; - var hLinesBeforeRow = []; - var tags = autoTag != null ? [] : void 0; - function beginRow() { - if (autoTag) parser.gullet.macros.set("\\@eqnsw", "1", true); - } - function endRow() { - if (tags) { - if (parser.gullet.macros.get("\\df@tag")) { - tags.push(parser.subparse([new Token("\\df@tag")])); - parser.gullet.macros.set("\\df@tag", void 0, true); - } else tags.push(Boolean(autoTag) && parser.gullet.macros.get("\\@eqnsw") === "1"); - } - } - beginRow(); - hLinesBeforeRow.push(getHLines(parser)); - while (true) { - var cellBody = parser.parseExpression(false, singleRow ? "\\end" : "\\\\"); - parser.gullet.endGroup(); - parser.gullet.beginGroup(); - var cell = { - type: "ordgroup", - mode: parser.mode, - body: cellBody - }; - if (style) cell = { - type: "styling", - mode: parser.mode, - style, - resetFont: true, - body: [cell] - }; - row.push(cell); - var next = parser.fetch().text; - if (next === "&") { - if (maxNumCols && row.length === maxNumCols) { - if (singleRow || colSeparationType) throw new ParseError("Too many tab characters: &", parser.nextToken); - else handleStrict({ - strict: parser.settings.strict, - errorCode: "textEnv", - errorMsg: "Too few columns specified in the {array} column argument.", - report: true - }); - } - parser.consume(); - } else if (next === "\\end") { - endRow(); - if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow) && !Array.isArray(tags == null ? void 0 : tags[tags.length - 1]) && !(autoTag && (tags == null ? void 0 : tags[tags.length - 1]) === true)) body.pop(); - if (hLinesBeforeRow.length < body.length + 1) hLinesBeforeRow.push([]); - break; - } else if (next === "\\\\") { - parser.consume(); - var size = void 0; - if (parser.gullet.future().text !== " ") size = parser.parseSizeGroup(true); - rowGaps.push(size ? size.value : null); - endRow(); - hLinesBeforeRow.push(getHLines(parser)); - row = []; - body.push(row); - beginRow(); - } else throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser.nextToken); - } - parser.gullet.endGroup(); - parser.gullet.endGroup(); - return { - type: "array", - mode: parser.mode, - addJot, - arraystretch, - body, - cols, - rowGaps, - hskipBeforeAndAfter, - hLinesBeforeRow, - colSeparationType, - tags, - leqno - }; - } - function dCellStyle(envName) { - if (envName.slice(0, 1) === "d") return "display"; - else return "text"; - } - var htmlBuilder$6 = function htmlBuilder(group, options) { - var r; - var c; - var nr = group.body.length; - var hLinesBeforeRow = group.hLinesBeforeRow; - var nc = 0; - var body = new Array(nr); - var hlines = []; - var ruleThickness = Math.max(options.fontMetrics().arrayRuleWidth, options.minRuleThickness); - var pt = 1 / options.fontMetrics().ptPerEm; - var arraycolsep = 5 * pt; - if (group.colSeparationType && group.colSeparationType === "small") arraycolsep = .2778 * (options.havingStyle(Style$1.SCRIPT).sizeMultiplier / options.sizeMultiplier); - var baselineskip = group.colSeparationType === "CD" ? calculateSize({ - number: 3, - unit: "ex" - }, options) : 12 * pt; - var jot = 3 * pt; - var arrayskip = group.arraystretch * baselineskip; - var arstrutHeight = .7 * arrayskip; - var arstrutDepth = .3 * arrayskip; - var totalHeight = 0; - function setHLinePos(hlinesInGap) { - for (var i = 0; i < hlinesInGap.length; ++i) { - if (i > 0) totalHeight += .25; - hlines.push({ - pos: totalHeight, - isDashed: hlinesInGap[i] - }); - } - } - setHLinePos(hLinesBeforeRow[0]); - for (r = 0; r < group.body.length; ++r) { - var inrow = group.body[r]; - var height = arstrutHeight; - var depth = arstrutDepth; - if (nc < inrow.length) nc = inrow.length; - var outrow = { - cells: new Array(inrow.length), - height: 0, - depth: 0, - pos: 0 - }; - for (c = 0; c < inrow.length; ++c) { - var elt = buildGroup$1(inrow[c], options); - if (depth < elt.depth) depth = elt.depth; - if (height < elt.height) height = elt.height; - outrow.cells[c] = elt; - } - var rowGap = group.rowGaps[r]; - var gap = 0; - if (rowGap) { - gap = calculateSize(rowGap, options); - if (gap > 0) { - gap += arstrutDepth; - if (depth < gap) depth = gap; - gap = 0; - } - } - if (group.addJot && r < group.body.length - 1) depth += jot; - outrow.height = height; - outrow.depth = depth; - totalHeight += height; - outrow.pos = totalHeight; - totalHeight += depth + gap; - body[r] = outrow; - setHLinePos(hLinesBeforeRow[r + 1]); - } - var offset = totalHeight / 2 + options.fontMetrics().axisHeight; - var colDescriptions = group.cols || []; - var cols = []; - var colSep; - var colDescrNum; - var tagSpans = []; - if (group.tags && group.tags.some((tag) => tag)) for (r = 0; r < nr; ++r) { - var rw = body[r]; - var shift = rw.pos - offset; - var tag = group.tags[r]; - var tagSpan = void 0; - if (tag === true) tagSpan = makeSpan(["eqn-num"], [], options); - else if (tag === false) tagSpan = makeSpan([], [], options); - else tagSpan = makeSpan([], buildExpression$1(tag, options, true), options); - tagSpan.depth = rw.depth; - tagSpan.height = rw.height; - tagSpans.push({ - type: "elem", - elem: tagSpan, - shift - }); - } - for (c = 0, colDescrNum = 0; c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) { - var _colDescr3; - var colDescr = colDescriptions[colDescrNum]; - var firstSeparator = true; - while (((_colDescr = colDescr) == null ? void 0 : _colDescr.type) === "separator") { - var _colDescr; - if (!firstSeparator) { - colSep = makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(options.fontMetrics().doubleRuleSep); - cols.push(colSep); - } - if (colDescr.separator === "|" || colDescr.separator === ":") { - var lineType = colDescr.separator === "|" ? "solid" : "dashed"; - var separator = makeSpan(["vertical-separator"], [], options); - separator.style.height = makeEm(totalHeight); - separator.style.borderRightWidth = makeEm(ruleThickness); - separator.style.borderRightStyle = lineType; - separator.style.margin = "0 " + makeEm(-ruleThickness / 2); - var _shift = totalHeight - offset; - if (_shift) separator.style.verticalAlign = makeEm(-_shift); - cols.push(separator); - } else throw new ParseError("Invalid separator type: " + colDescr.separator); - colDescrNum++; - colDescr = colDescriptions[colDescrNum]; - firstSeparator = false; - } - if (c >= nc) continue; - var sepwidth = void 0; - if (c > 0 || group.hskipBeforeAndAfter) { - var _colDescr$pregap, _colDescr2; - sepwidth = (_colDescr$pregap = (_colDescr2 = colDescr) == null ? void 0 : _colDescr2.pregap) != null ? _colDescr$pregap : arraycolsep; - if (sepwidth !== 0) { - colSep = makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(sepwidth); - cols.push(colSep); - } - } - var colElems = []; - for (r = 0; r < nr; ++r) { - var row = body[r]; - var elem = row.cells[c]; - if (!elem) continue; - var _shift2 = row.pos - offset; - elem.depth = row.depth; - elem.height = row.height; - colElems.push({ - type: "elem", - elem, - shift: _shift2 - }); - } - var colVList = makeVList({ - positionType: "individualShift", - children: colElems - }); - var colSpan = makeSpan(["col-align-" + (((_colDescr3 = colDescr) == null ? void 0 : _colDescr3.align) || "c")], [colVList]); - cols.push(colSpan); - if (c < nc - 1 || group.hskipBeforeAndAfter) { - var _colDescr$postgap, _colDescr4; - sepwidth = (_colDescr$postgap = (_colDescr4 = colDescr) == null ? void 0 : _colDescr4.postgap) != null ? _colDescr$postgap : arraycolsep; - if (sepwidth !== 0) { - colSep = makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(sepwidth); - cols.push(colSep); - } - } - } - var tableBody = makeSpan(["mtable"], cols); - if (hlines.length > 0) { - var line = makeLineSpan("katex-hline", options, ruleThickness); - var dashes = makeLineSpan("katex-hdashline", options, ruleThickness); - var vListElems = [{ - type: "elem", - elem: tableBody, - shift: 0 - }]; - while (hlines.length > 0) { - var hline = hlines.pop(); - var lineShift = hline.pos - offset; - if (hline.isDashed) vListElems.push({ - type: "elem", - elem: dashes, - shift: lineShift - }); - else vListElems.push({ - type: "elem", - elem: line, - shift: lineShift - }); - } - tableBody = makeVList({ - positionType: "individualShift", - children: vListElems - }); - } - if (tagSpans.length === 0) return makeSpan(["mord"], [tableBody], options); - else { - var tagCol = makeSpan(["katex-tag"], [makeVList({ - positionType: "individualShift", - children: tagSpans - })], options); - return makeFragment([tableBody, tagCol]); - } - }; - var alignMap = { - c: "center ", - l: "left ", - r: "right " - }; - var mathmlBuilder$5 = function mathmlBuilder(group, options) { - var tbl = []; - var glue = new MathNode("mtd", [], ["mtr-glue"]); - var tag = new MathNode("mtd", [], ["mml-eqn-num"]); - for (var i = 0; i < group.body.length; i++) { - var rw = group.body[i]; - var row = []; - for (var j = 0; j < rw.length; j++) row.push(new MathNode("mtd", [buildGroup(rw[j], options)])); - if (group.tags && group.tags[i]) { - row.unshift(glue); - row.push(glue); - if (group.leqno) row.unshift(tag); - else row.push(tag); - } - tbl.push(new MathNode("mtr", row)); - } - var table = new MathNode("mtable", tbl); - var gap = group.arraystretch === .5 ? .1 : .16 + group.arraystretch - 1 + (group.addJot ? .09 : 0); - table.setAttribute("rowspacing", makeEm(gap)); - var menclose = ""; - var align = ""; - if (group.cols && group.cols.length > 0) { - var cols = group.cols; - var columnLines = ""; - var prevTypeWasAlign = false; - var iStart = 0; - var iEnd = cols.length; - if (cols[0].type === "separator") { - menclose += "top "; - iStart = 1; - } - if (cols[cols.length - 1].type === "separator") { - menclose += "bottom "; - iEnd -= 1; - } - for (var _i = iStart; _i < iEnd; _i++) { - var col = cols[_i]; - if (col.type === "align") { - align += alignMap[col.align]; - if (prevTypeWasAlign) columnLines += "none "; - prevTypeWasAlign = true; - } else if (col.type === "separator") { - if (prevTypeWasAlign) { - columnLines += col.separator === "|" ? "solid " : "dashed "; - prevTypeWasAlign = false; - } - } - } - table.setAttribute("columnalign", align.trim()); - if (/[sd]/.test(columnLines)) table.setAttribute("columnlines", columnLines.trim()); - } - if (group.colSeparationType === "align") { - var _cols = group.cols || []; - var spacing = ""; - for (var _i2 = 1; _i2 < _cols.length; _i2++) spacing += _i2 % 2 ? "0em " : "1em "; - table.setAttribute("columnspacing", spacing.trim()); - } else if (group.colSeparationType === "alignat" || group.colSeparationType === "gather") table.setAttribute("columnspacing", "0em"); - else if (group.colSeparationType === "small") table.setAttribute("columnspacing", "0.2778em"); - else if (group.colSeparationType === "CD") table.setAttribute("columnspacing", "0.5em"); - else table.setAttribute("columnspacing", "1em"); - var rowLines = ""; - var hlines = group.hLinesBeforeRow; - menclose += hlines[0].length > 0 ? "left " : ""; - menclose += hlines[hlines.length - 1].length > 0 ? "right " : ""; - for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) rowLines += hlines[_i3].length === 0 ? "none " : hlines[_i3][0] ? "dashed " : "solid "; - if (/[sd]/.test(rowLines)) table.setAttribute("rowlines", rowLines.trim()); - if (menclose !== "") { - table = new MathNode("menclose", [table]); - table.setAttribute("notation", menclose.trim()); - } - if (group.arraystretch && group.arraystretch < 1) { - table = new MathNode("mstyle", [table]); - table.setAttribute("scriptlevel", "1"); - } - return table; - }; - var alignedHandler = function alignedHandler(context, args) { - if (!context.envName.includes("ed")) validateAmsEnvironmentContext(context); - var cols = []; - var isSplit = context.envName === "split"; - var res = parseArray(context.parser, { - cols, - addJot: true, - autoTag: isSplit ? void 0 : getAutoTag(context.envName), - emptySingleRow: true, - colSeparationType: context.envName.includes("at") ? "alignat" : "align", - maxNumCols: isSplit ? 2 : void 0, - leqno: context.parser.settings.leqno - }, "display"); - var numMaths = 0; - var numCols = 0; - var emptyGroup = { - type: "ordgroup", - mode: context.mode, - body: [] - }; - if (args[0] && args[0].type === "ordgroup") { - var message = "Number of columns should be a positive integer"; - var numColumns = assertCharacterGroup(args[0], message); - if (!/^[0-9]+$/.test(numColumns) || Number(numColumns) < 1) throw new ParseError(message, args[0]); - numMaths = Number(numColumns); - numCols = numMaths * 2; - } - var isAligned = !numCols; - res.body.forEach(function(row) { - for (var i = 1; i < row.length; i += 2) assertNodeType(assertNodeType(row[i], "styling").body[0], "ordgroup").body.unshift(emptyGroup); - if (!isAligned) { - var curMaths = row.length / 2; - if (numMaths < curMaths) throw new ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]); - } else if (numCols < row.length) numCols = row.length; - }); - for (var i = 0; i < numCols; ++i) { - var align = "r"; - var pregap = 0; - if (i % 2 === 1) align = "l"; - else if (i > 0 && isAligned) pregap = 1; - cols[i] = { - type: "align", - align, - pregap, - postgap: 0 - }; - } - res.colSeparationType = isAligned ? "align" : "alignat"; - return res; - }; - defineEnvironment({ - type: "array", - names: ["array", "darray"], - props: { numArgs: 1 }, - handler(context, args) { - var cols = (checkSymbolNodeType(args[0]) ? [args[0]] : assertNodeType(args[0], "ordgroup").body).map(function(nde) { - var ca = assertSymbolNodeType(nde).text; - if ("lcr".includes(ca)) return { - type: "align", - align: ca - }; - else if (ca === "|") return { - type: "separator", - separator: "|" - }; - else if (ca === ":") return { - type: "separator", - separator: ":" - }; - throw new ParseError("Unknown column alignment: " + ca, nde); - }); - var res = { - cols, - hskipBeforeAndAfter: true, - maxNumCols: cols.length - }; - return parseArray(context.parser, res, dCellStyle(context.envName)); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: [ - "matrix", - "pmatrix", - "bmatrix", - "Bmatrix", - "vmatrix", - "Vmatrix", - "matrix*", - "pmatrix*", - "bmatrix*", - "Bmatrix*", - "vmatrix*", - "Vmatrix*" - ], - props: { numArgs: 0 }, - handler(context) { - var delimiters = { - "matrix": null, - "pmatrix": ["(", ")"], - "bmatrix": ["[", "]"], - "Bmatrix": ["\\{", "\\}"], - "vmatrix": ["|", "|"], - "Vmatrix": ["\\Vert", "\\Vert"] - }[context.envName.replace("*", "")]; - var colAlign = "c"; - var payload = { - hskipBeforeAndAfter: false, - cols: [{ - type: "align", - align: colAlign - }] - }; - if (context.envName.charAt(context.envName.length - 1) === "*") { - var parser = context.parser; - parser.consumeSpaces(); - if (parser.fetch().text === "[") { - parser.consume(); - parser.consumeSpaces(); - colAlign = parser.fetch().text; - if (!"lcr".includes(colAlign)) throw new ParseError("Expected l or c or r", parser.nextToken); - parser.consume(); - parser.consumeSpaces(); - parser.expect("]"); - parser.consume(); - payload.cols = [{ - type: "align", - align: colAlign - }]; - } - } - var res = parseArray(context.parser, payload, dCellStyle(context.envName)); - var numCols = Math.max(0, ...res.body.map((row) => row.length)); - res.cols = new Array(numCols).fill({ - type: "align", - align: colAlign - }); - return delimiters ? { - type: "leftright", - mode: context.mode, - body: [res], - left: delimiters[0], - right: delimiters[1], - rightColor: void 0 - } : res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["smallmatrix"], - props: { numArgs: 0 }, - handler(context) { - var res = parseArray(context.parser, { arraystretch: .5 }, "script"); - res.colSeparationType = "small"; - return res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["subarray"], - props: { numArgs: 1 }, - handler(context, args) { - var cols = (checkSymbolNodeType(args[0]) ? [args[0]] : assertNodeType(args[0], "ordgroup").body).map(function(nde) { - var ca = assertSymbolNodeType(nde).text; - if ("lc".includes(ca)) return { - type: "align", - align: ca - }; - throw new ParseError("Unknown column alignment: " + ca, nde); - }); - if (cols.length > 1) throw new ParseError("{subarray} can contain only one column"); - var payload = { - cols, - hskipBeforeAndAfter: false, - arraystretch: .5 - }; - var res = parseArray(context.parser, payload, "script"); - if (res.body.length > 0 && res.body[0].length > 1) throw new ParseError("{subarray} can contain only one column"); - return res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: [ - "cases", - "dcases", - "rcases", - "drcases" - ], - props: { numArgs: 0 }, - handler(context) { - var res = parseArray(context.parser, { - arraystretch: 1.2, - cols: [{ - type: "align", - align: "l", - pregap: 0, - postgap: 1 - }, { - type: "align", - align: "l", - pregap: 0, - postgap: 0 - }] - }, dCellStyle(context.envName)); - return { - type: "leftright", - mode: context.mode, - body: [res], - left: context.envName.includes("r") ? "." : "\\{", - right: context.envName.includes("r") ? "\\}" : ".", - rightColor: void 0 - }; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: [ - "align", - "align*", - "aligned", - "split" - ], - props: { numArgs: 0 }, - handler: alignedHandler, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: [ - "gathered", - "gather", - "gather*" - ], - props: { numArgs: 0 }, - handler(context) { - if (gatherEnvironments.has(context.envName)) validateAmsEnvironmentContext(context); - var res = { - cols: [{ - type: "align", - align: "c" - }], - addJot: true, - colSeparationType: "gather", - autoTag: getAutoTag(context.envName), - emptySingleRow: true, - leqno: context.parser.settings.leqno - }; - return parseArray(context.parser, res, "display"); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: [ - "alignat", - "alignat*", - "alignedat" - ], - props: { numArgs: 1 }, - handler: alignedHandler, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["equation", "equation*"], - props: { numArgs: 0 }, - handler(context) { - validateAmsEnvironmentContext(context); - var res = { - autoTag: getAutoTag(context.envName), - emptySingleRow: true, - singleRow: true, - maxNumCols: 1, - leqno: context.parser.settings.leqno - }; - return parseArray(context.parser, res, "display"); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["CD"], - props: { numArgs: 0 }, - handler(context) { - validateAmsEnvironmentContext(context); - return parseCD(context.parser); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}"); - defineMacro("\\notag", "\\nonumber"); - defineFunction({ - type: "text", - names: ["\\hline", "\\hdashline"], - numArgs: 0, - allowedInText: true, - allowedInMath: true, - handler(context, args) { - throw new ParseError(context.funcName + " valid only within array environment"); - } - }); - var environments = _environments; - defineFunction({ - type: "environment", - names: ["\\begin", "\\end"], - numArgs: 1, - argTypes: ["text"], - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - var nameGroup = args[0]; - if (nameGroup.type !== "ordgroup") throw new ParseError("Invalid environment name", nameGroup); - var envName = assertCharacterGroup(nameGroup, "Environment name should contain only text characters and spaces", true); - if (funcName === "\\begin") { - if (!Object.prototype.hasOwnProperty.call(environments, envName)) throw new ParseError("No such environment: " + envName, nameGroup); - var env = environments[envName]; - var _parser$parseArgument = parser.parseArguments("\\begin{" + envName + "}", env), _args = _parser$parseArgument.args, optArgs = _parser$parseArgument.optArgs; - var context = { - mode: parser.mode, - envName, - parser - }; - var result = env.handler(context, _args, optArgs); - parser.expect("\\end", false); - var endNameToken = parser.nextToken; - var end = assertNodeType(parser.parseFunction(), "environment"); - if (end.name !== envName) throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end.name + "}", endNameToken); - return result; - } - return { - type: "environment", - mode: parser.mode, - name: envName, - nameGroup - }; - } - }); - var htmlBuilder$5 = (group, options) => { - var font = group.font; - var newOptions = options.withFont(font); - return buildGroup$1(group.body, newOptions); - }; - var mathmlBuilder$4 = (group, options) => { - var font = group.font; - var newOptions = options.withFont(font); - return buildGroup(group.body, newOptions); - }; - var fontAliases = { - "\\Bbb": "\\mathbb", - "\\bold": "\\mathbf", - "\\frak": "\\mathfrak" - }; - defineFunction({ - type: "font", - names: [ - "\\mathrm", - "\\mathit", - "\\mathbf", - "\\mathnormal", - "\\mathsfit", - "\\mathbb", - "\\mathcal", - "\\mathfrak", - "\\mathscr", - "\\mathsf", - "\\mathtt", - "\\Bbb", - "\\bold", - "\\frak" - ], - numArgs: 1, - allowedInArgument: true, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - var body = normalizeArgument(args[0]); - var func = funcName in fontAliases ? fontAliases[funcName] : funcName; - return { - type: "font", - mode: parser.mode, - font: func.slice(1), - body - }; - }, - htmlBuilder: htmlBuilder$5, - mathmlBuilder: mathmlBuilder$4 - }); - defineFunction({ - type: "mclass", - names: ["\\boldsymbol", "\\bm"], - numArgs: 1, - handler: (_ref2, args) => { - var parser = _ref2.parser; - var body = args[0]; - return { - type: "mclass", - mode: parser.mode, - mclass: binrelClass(body), - body: [{ - type: "font", - mode: parser.mode, - font: "boldsymbol", - body - }], - isCharacterBox: isCharacterBox(body) - }; - } - }); - defineFunction({ - type: "font", - names: [ - "\\rm", - "\\sf", - "\\tt", - "\\bf", - "\\it", - "\\cal" - ], - numArgs: 0, - allowedInText: true, - handler: (_ref3, args) => { - var parser = _ref3.parser, funcName = _ref3.funcName, breakOnTokenText = _ref3.breakOnTokenText; - var mode = parser.mode; - var body = parser.parseExpression(true, breakOnTokenText); - return { - type: "font", - mode, - font: "math" + funcName.slice(1), - body: { - type: "ordgroup", - mode: parser.mode, - body - } - }; - } - }); - var htmlBuilder$4 = (group, options) => { - var style = options.style; - var nstyle = style.fracNum(); - var dstyle = style.fracDen(); - var newOptions = options.havingStyle(nstyle); - var numerm = buildGroup$1(group.numer, newOptions, options); - if (group.continued) { - var hStrut = 8.5 / options.fontMetrics().ptPerEm; - var dStrut = 3.5 / options.fontMetrics().ptPerEm; - numerm.height = numerm.height < hStrut ? hStrut : numerm.height; - numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth; - } - newOptions = options.havingStyle(dstyle); - var denomm = buildGroup$1(group.denom, newOptions, options); - var rule; - var ruleWidth; - var ruleSpacing; - if (group.hasBarLine) { - if (group.barSize) { - ruleWidth = calculateSize(group.barSize, options); - rule = makeLineSpan("frac-line", options, ruleWidth); - } else rule = makeLineSpan("frac-line", options); - ruleWidth = rule.height; - ruleSpacing = rule.height; - } else { - rule = null; - ruleWidth = 0; - ruleSpacing = options.fontMetrics().defaultRuleThickness; - } - var numShift; - var clearance; - var denomShift; - if (style.size === Style$1.DISPLAY.size) { - numShift = options.fontMetrics().num1; - if (ruleWidth > 0) clearance = 3 * ruleSpacing; - else clearance = 7 * ruleSpacing; - denomShift = options.fontMetrics().denom1; - } else { - if (ruleWidth > 0) { - numShift = options.fontMetrics().num2; - clearance = ruleSpacing; - } else { - numShift = options.fontMetrics().num3; - clearance = 3 * ruleSpacing; - } - denomShift = options.fontMetrics().denom2; - } - var frac; - if (!rule) { - var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); - if (candidateClearance < clearance) { - numShift += .5 * (clearance - candidateClearance); - denomShift += .5 * (clearance - candidateClearance); - } - frac = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: denomm, - shift: denomShift - }, { - type: "elem", - elem: numerm, - shift: -numShift - }] - }); - } else { - var axisHeight = options.fontMetrics().axisHeight; - if (numShift - numerm.depth - (axisHeight + .5 * ruleWidth) < clearance) numShift += clearance - (numShift - numerm.depth - (axisHeight + .5 * ruleWidth)); - if (axisHeight - .5 * ruleWidth - (denomm.height - denomShift) < clearance) denomShift += clearance - (axisHeight - .5 * ruleWidth - (denomm.height - denomShift)); - var midShift = -(axisHeight - .5 * ruleWidth); - frac = makeVList({ - positionType: "individualShift", - children: [ - { - type: "elem", - elem: denomm, - shift: denomShift - }, - { - type: "elem", - elem: rule, - shift: midShift - }, - { - type: "elem", - elem: numerm, - shift: -numShift - } - ] - }); - } - newOptions = options.havingStyle(style); - frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier; - frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier; - var delimSize; - if (style.size === Style$1.DISPLAY.size) delimSize = options.fontMetrics().delim1; - else if (style.size === Style$1.SCRIPTSCRIPT.size) delimSize = options.havingStyle(Style$1.SCRIPT).fontMetrics().delim2; - else delimSize = options.fontMetrics().delim2; - var leftDelim; - var rightDelim; - if (group.leftDelim == null) leftDelim = makeNullDelimiter(options, ["mopen"]); - else leftDelim = makeCustomSizedDelim(group.leftDelim, delimSize, true, options.havingStyle(style), group.mode, ["mopen"]); - if (group.continued) rightDelim = makeSpan([]); - else if (group.rightDelim == null) rightDelim = makeNullDelimiter(options, ["mclose"]); - else rightDelim = makeCustomSizedDelim(group.rightDelim, delimSize, true, options.havingStyle(style), group.mode, ["mclose"]); - return makeSpan(["mord"].concat(newOptions.sizingClasses(options)), [ - leftDelim, - makeSpan(["mfrac"], [frac]), - rightDelim - ], options); - }; - var mathmlBuilder$3 = (group, options) => { - var node = new MathNode("mfrac", [buildGroup(group.numer, options), buildGroup(group.denom, options)]); - if (!group.hasBarLine) node.setAttribute("linethickness", "0px"); - else if (group.barSize) { - var ruleWidth = calculateSize(group.barSize, options); - node.setAttribute("linethickness", makeEm(ruleWidth)); - } - if (group.leftDelim != null || group.rightDelim != null) { - var withDelims = []; - if (group.leftDelim != null) { - var leftOp = new MathNode("mo", [new TextNode(group.leftDelim.replace("\\", ""))]); - leftOp.setAttribute("fence", "true"); - withDelims.push(leftOp); - } - withDelims.push(node); - if (group.rightDelim != null) { - var rightOp = new MathNode("mo", [new TextNode(group.rightDelim.replace("\\", ""))]); - rightOp.setAttribute("fence", "true"); - withDelims.push(rightOp); - } - return makeRow(withDelims); - } - return node; - }; - var wrapWithStyle = (frac, style) => { - if (!style) return frac; - return { - type: "styling", - mode: frac.mode, - style, - body: [frac] - }; - }; - defineFunction({ - type: "genfrac", - names: [ - "\\cfrac", - "\\dfrac", - "\\frac", - "\\tfrac", - "\\dbinom", - "\\binom", - "\\tbinom", - "\\\\atopfrac", - "\\\\bracefrac", - "\\\\brackfrac" - ], - numArgs: 2, - allowedInArgument: true, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - var numer = args[0]; - var denom = args[1]; - var hasBarLine; - var leftDelim = null; - var rightDelim = null; - switch (funcName) { - case "\\cfrac": - case "\\dfrac": - case "\\frac": - case "\\tfrac": - hasBarLine = true; - break; - case "\\\\atopfrac": - hasBarLine = false; - break; - case "\\dbinom": - case "\\binom": - case "\\tbinom": - hasBarLine = false; - leftDelim = "("; - rightDelim = ")"; - break; - case "\\\\bracefrac": - hasBarLine = false; - leftDelim = "\\{"; - rightDelim = "\\}"; - break; - case "\\\\brackfrac": - hasBarLine = false; - leftDelim = "["; - rightDelim = "]"; - break; - default: throw new Error("Unrecognized genfrac command"); - } - var continued = funcName === "\\cfrac"; - var style = null; - if (continued || funcName.startsWith("\\d")) style = "display"; - else if (funcName.startsWith("\\t")) style = "text"; - return wrapWithStyle({ - type: "genfrac", - mode: parser.mode, - numer, - denom, - continued, - hasBarLine, - leftDelim, - rightDelim, - barSize: null - }, style); - }, - htmlBuilder: htmlBuilder$4, - mathmlBuilder: mathmlBuilder$3 - }); - defineFunction({ - type: "infix", - names: [ - "\\over", - "\\choose", - "\\atop", - "\\brace", - "\\brack" - ], - numArgs: 0, - infix: true, - handler(_ref2) { - var parser = _ref2.parser, funcName = _ref2.funcName, token = _ref2.token; - var replaceWith; - switch (funcName) { - case "\\over": - replaceWith = "\\frac"; - break; - case "\\choose": - replaceWith = "\\binom"; - break; - case "\\atop": - replaceWith = "\\\\atopfrac"; - break; - case "\\brace": - replaceWith = "\\\\bracefrac"; - break; - case "\\brack": - replaceWith = "\\\\brackfrac"; - break; - default: throw new Error("Unrecognized infix genfrac command"); - } - return { - type: "infix", - mode: parser.mode, - replaceWith, - token - }; - } - }); - var stylArray = [ - "display", - "text", - "script", - "scriptscript" - ]; - var delimFromValue = function delimFromValue(delimString) { - var delim = null; - if (delimString.length > 0) { - delim = delimString; - delim = delim === "." ? null : delim; - } - return delim; - }; - defineFunction({ - type: "genfrac", - names: ["\\genfrac"], - numArgs: 6, - allowedInArgument: true, - argTypes: [ - "math", - "math", - "size", - "text", - "math", - "math" - ], - handler(_ref3, args) { - var parser = _ref3.parser; - var numer = args[4]; - var denom = args[5]; - var leftNode = normalizeArgument(args[0]); - var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null; - var rightNode = normalizeArgument(args[1]); - var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null; - var barNode = assertNodeType(args[2], "size"); - var hasBarLine; - var barSize = null; - if (barNode.isBlank) hasBarLine = true; - else { - barSize = barNode.value; - hasBarLine = barSize.number > 0; - } - var size = null; - var styl = args[3]; - if (styl.type === "ordgroup") { - if (styl.body.length > 0) { - var textOrd = assertNodeType(styl.body[0], "textord"); - size = stylArray[Number(textOrd.text)]; - } - } else { - styl = assertNodeType(styl, "textord"); - size = stylArray[Number(styl.text)]; - } - return wrapWithStyle({ - type: "genfrac", - mode: parser.mode, - numer, - denom, - continued: false, - hasBarLine, - barSize, - leftDelim, - rightDelim - }, size); - } - }); - defineFunction({ - type: "infix", - names: ["\\above"], - numArgs: 1, - argTypes: ["size"], - infix: true, - handler(_ref4, args) { - var parser = _ref4.parser; - _ref4.funcName; - var token = _ref4.token; - return { - type: "infix", - mode: parser.mode, - replaceWith: "\\\\abovefrac", - size: assertNodeType(args[0], "size").value, - token - }; - } - }); - defineFunction({ - type: "genfrac", - names: ["\\\\abovefrac"], - numArgs: 3, - argTypes: [ - "math", - "size", - "math" - ], - handler: (_ref5, args) => { - var parser = _ref5.parser; - _ref5.funcName; - var numer = args[0]; - var barSize = assertNodeType(args[1], "infix").size; - if (!barSize) throw new Error("\\\\abovefrac expected size, but got " + String(barSize)); - var denom = args[2]; - var hasBarLine = barSize.number > 0; - return { - type: "genfrac", - mode: parser.mode, - numer, - denom, - continued: false, - hasBarLine, - barSize, - leftDelim: null, - rightDelim: null - }; - } - }); - var htmlBuilder$3 = (grp, options) => { - var style = options.style; - var supSubGroup; - var group; - if (grp.type === "supsub") { - supSubGroup = grp.sup ? buildGroup$1(grp.sup, options.havingStyle(style.sup()), options) : buildGroup$1(grp.sub, options.havingStyle(style.sub()), options); - group = assertNodeType(grp.base, "horizBrace"); - } else group = assertNodeType(grp, "horizBrace"); - var body = buildGroup$1(group.base, options.havingBaseStyle(Style$1.DISPLAY)); - var braceBody = stretchySvg(group, options); - var vlist; - if (group.isOver) vlist = makeVList({ - positionType: "firstBaseline", - children: [ - { - type: "elem", - elem: body - }, - { - type: "kern", - size: .1 - }, - { - type: "elem", - elem: braceBody, - wrapperClasses: ["svg-align"] - } - ] - }); - else vlist = makeVList({ - positionType: "bottom", - positionData: body.depth + .1 + braceBody.height, - children: [ - { - type: "elem", - elem: braceBody, - wrapperClasses: ["svg-align"] - }, - { - type: "kern", - size: .1 - }, - { - type: "elem", - elem: body - } - ] - }); - if (supSubGroup) { - var vSpan = makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options); - if (group.isOver) vlist = makeVList({ - positionType: "firstBaseline", - children: [ - { - type: "elem", - elem: vSpan - }, - { - type: "kern", - size: .2 - }, - { - type: "elem", - elem: supSubGroup - } - ] - }); - else vlist = makeVList({ - positionType: "bottom", - positionData: vSpan.depth + .2 + supSubGroup.height + supSubGroup.depth, - children: [ - { - type: "elem", - elem: supSubGroup - }, - { - type: "kern", - size: .2 - }, - { - type: "elem", - elem: vSpan - } - ] - }); - } - return makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options); - }; - var mathmlBuilder$2 = (group, options) => { - var accentNode = stretchyMathML(group.label); - return new MathNode(group.isOver ? "mover" : "munder", [buildGroup(group.base, options), accentNode]); - }; - defineFunction({ - type: "horizBrace", - names: [ - "\\overbrace", - "\\underbrace", - "\\overbracket", - "\\underbracket" - ], - numArgs: 1, - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - return { - type: "horizBrace", - mode: parser.mode, - label: funcName, - isOver: funcName.includes("\\over"), - base: args[0] - }; - }, - htmlBuilder: htmlBuilder$3, - mathmlBuilder: mathmlBuilder$2 - }); - defineFunction({ - type: "href", - names: ["\\href"], - numArgs: 2, - argTypes: ["url", "original"], - allowedInText: true, - handler: (_ref, args) => { - var parser = _ref.parser; - var body = args[1]; - var href = assertNodeType(args[0], "url").url; - if (!parser.settings.isTrusted({ - command: "\\href", - url: href - })) return parser.formatUnsupportedCmd("\\href"); - return { - type: "href", - mode: parser.mode, - href, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options) => { - var elements = buildExpression$1(group.body, options, false); - return makeAnchor(group.href, [], elements, options); - }, - mathmlBuilder: (group, options) => { - var math = buildExpressionRow(group.body, options); - if (!(math instanceof MathNode)) math = new MathNode("mrow", [math]); - math.setAttribute("href", group.href); - return math; - } - }); - defineFunction({ - type: "href", - names: ["\\url"], - numArgs: 1, - argTypes: ["url"], - allowedInText: true, - handler: (_ref2, args) => { - var parser = _ref2.parser; - var href = assertNodeType(args[0], "url").url; - if (!parser.settings.isTrusted({ - command: "\\url", - url: href - })) return parser.formatUnsupportedCmd("\\url"); - var chars = []; - for (var i = 0; i < href.length; i++) { - var c = href[i]; - if (c === "~") c = "\\textasciitilde"; - chars.push({ - type: "textord", - mode: "text", - text: c - }); - } - var body = { - type: "text", - mode: parser.mode, - font: "\\texttt", - body: chars - }; - return { - type: "href", - mode: parser.mode, - href, - body: ordargument(body) - }; - } - }); - defineFunction({ - type: "hbox", - names: ["\\hbox"], - numArgs: 1, - argTypes: ["text"], - allowedInText: true, - primitive: true, - handler(_ref, args) { - return { - type: "hbox", - mode: _ref.parser.mode, - body: ordargument(args[0]) - }; - }, - htmlBuilder(group, options) { - return makeFragment(buildExpression$1(group.body, options.withFont(""), false)); - }, - mathmlBuilder(group, options) { - return new MathNode("mrow", buildExpression(group.body, options.withFont(""))); - } - }); - defineFunction({ - type: "html", - names: [ - "\\htmlClass", - "\\htmlId", - "\\htmlStyle", - "\\htmlData" - ], - numArgs: 2, - argTypes: ["raw", "original"], - allowedInText: true, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - _ref.token; - var value = assertNodeType(args[0], "raw").string; - var body = args[1]; - if (parser.settings.strict) handleStrict({ - strict: parser.settings.strict, - errorCode: "htmlExtension", - errorMsg: "HTML extension is disabled on strict mode", - report: true - }); - var trustContext; - var attributes = {}; - switch (funcName) { - case "\\htmlClass": - attributes.class = value; - trustContext = { - command: "\\htmlClass", - class: value - }; - break; - case "\\htmlId": - attributes.id = value; - trustContext = { - command: "\\htmlId", - id: value - }; - break; - case "\\htmlStyle": - attributes.style = value; - trustContext = { - command: "\\htmlStyle", - style: value - }; - break; - case "\\htmlData": - var ESCAPED_COMMA = "{,}"; - var data = []; - var current = ""; - for (var i = 0; i < value.length; i++) if (value.startsWith(ESCAPED_COMMA, i)) { - current += ","; - i += ESCAPED_COMMA.length - 1; - } else if (value[i] === ",") { - data.push(current); - current = ""; - } else current += value[i]; - data.push(current); - for (var _i = 0; _i < data.length; _i++) { - var item = data[_i]; - var firstEquals = item.indexOf("="); - if (firstEquals < 0) throw new ParseError("\\htmlData key/value '" + item + "' missing equals sign"); - var key = item.slice(0, firstEquals); - var _value = item.slice(firstEquals + 1); - attributes["data-" + key.trim()] = _value; - } - trustContext = { - command: "\\htmlData", - attributes - }; - break; - default: throw new Error("Unrecognized html command"); - } - if (!parser.settings.isTrusted(trustContext)) return parser.formatUnsupportedCmd(funcName); - return { - type: "html", - mode: parser.mode, - attributes, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options) => { - var elements = buildExpression$1(group.body, options, false); - var classes = ["enclosing"]; - if (group.attributes.class) classes.push(...group.attributes.class.trim().split(/\s+/)); - var span = makeSpan(classes, elements, options); - for (var _ref3 of Object.entries(group.attributes)) { - var attr = _ref3[0]; - var value = _ref3[1]; - if (attr !== "class") span.setAttribute(attr, value); - } - return span; - }, - mathmlBuilder: (group, options) => { - return buildExpressionRow(group.body, options); - } - }); - defineFunction({ - type: "htmlmathml", - names: ["\\html@mathml"], - numArgs: 2, - allowedInArgument: true, - allowedInText: true, - handler: (_ref, args) => { - return { - type: "htmlmathml", - mode: _ref.parser.mode, - html: ordargument(args[0]), - mathml: ordargument(args[1]) - }; - }, - htmlBuilder: (group, options) => { - return makeFragment(buildExpression$1(group.html, options, false)); - }, - mathmlBuilder: (group, options) => { - return buildExpressionRow(group.mathml, options); - } - }); - var sizeData = function sizeData(str) { - if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) return { - number: +str, - unit: "bp" - }; - else { - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str); - if (!match) throw new ParseError("Invalid size: '" + str + "' in \\includegraphics"); - var data = { - number: +(match[1] + match[2]), - unit: match[3] - }; - if (!validUnit(data)) throw new ParseError("Invalid unit: '" + data.unit + "' in \\includegraphics."); - return data; - } - }; - defineFunction({ - type: "includegraphics", - names: ["\\includegraphics"], - numArgs: 1, - numOptionalArgs: 1, - argTypes: ["raw", "url"], - allowedInText: false, - handler: (_ref, args, optArgs) => { - var parser = _ref.parser; - var width = { - number: 0, - unit: "em" - }; - var height = { - number: .9, - unit: "em" - }; - var totalheight = { - number: 0, - unit: "em" - }; - var alt = ""; - if (optArgs[0]) { - var attributes = assertNodeType(optArgs[0], "raw").string.split(","); - for (var i = 0; i < attributes.length; i++) { - var keyVal = attributes[i].split("="); - if (keyVal.length === 2) { - var str = keyVal[1].trim(); - switch (keyVal[0].trim()) { - case "alt": - alt = str; - break; - case "width": - width = sizeData(str); - break; - case "height": - height = sizeData(str); - break; - case "totalheight": - totalheight = sizeData(str); - break; - default: throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics."); - } - } - } - } - var src = assertNodeType(args[0], "url").url; - if (alt === "") { - alt = src; - alt = alt.replace(/^.*[\\/]/, ""); - alt = alt.substring(0, alt.lastIndexOf(".")); - } - if (!parser.settings.isTrusted({ - command: "\\includegraphics", - url: src - })) return parser.formatUnsupportedCmd("\\includegraphics"); - return { - type: "includegraphics", - mode: parser.mode, - alt, - width, - height, - totalheight, - src - }; - }, - htmlBuilder: (group, options) => { - var height = calculateSize(group.height, options); - var depth = 0; - if (group.totalheight.number > 0) depth = calculateSize(group.totalheight, options) - height; - var width = 0; - if (group.width.number > 0) width = calculateSize(group.width, options); - var style = { height: makeEm(height + depth) }; - if (width > 0) style.width = makeEm(width); - if (depth > 0) style.verticalAlign = makeEm(-depth); - var node = new Img(group.src, group.alt, style); - node.height = height; - node.depth = depth; - return node; - }, - mathmlBuilder: (group, options) => { - var node = new MathNode("mglyph", []); - node.setAttribute("alt", group.alt); - var height = calculateSize(group.height, options); - var depth = 0; - if (group.totalheight.number > 0) { - depth = calculateSize(group.totalheight, options) - height; - node.setAttribute("valign", makeEm(-depth)); - } - node.setAttribute("height", makeEm(height + depth)); - if (group.width.number > 0) { - var width = calculateSize(group.width, options); - node.setAttribute("width", makeEm(width)); - } - node.setAttribute("src", group.src); - return node; - } - }); - defineFunction({ - type: "kern", - names: [ - "\\kern", - "\\mkern", - "\\hskip", - "\\mskip" - ], - numArgs: 1, - argTypes: ["size"], - primitive: true, - allowedInText: true, - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - var size = assertNodeType(args[0], "size"); - if (parser.settings.strict) { - var mathFunction = funcName[1] === "m"; - var muUnit = size.value.unit === "mu"; - if (mathFunction) { - if (!muUnit) handleStrict({ - strict: parser.settings.strict, - errorCode: "mathVsTextUnits", - errorMsg: "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"), - report: true - }); - if (parser.mode !== "math") handleStrict({ - strict: parser.settings.strict, - errorCode: "mathVsTextUnits", - errorMsg: "LaTeX's " + funcName + " works only in math mode", - report: true - }); - } else if (muUnit) handleStrict({ - strict: parser.settings.strict, - errorCode: "mathVsTextUnits", - errorMsg: "LaTeX's " + funcName + " doesn't support mu units", - report: true - }); - } - return { - type: "kern", - mode: parser.mode, - dimension: size.value - }; - }, - htmlBuilder(group, options) { - return makeGlue(group.dimension, options); - }, - mathmlBuilder(group, options) { - return new SpaceNode(calculateSize(group.dimension, options)); - } - }); - defineFunction({ - type: "lap", - names: [ - "\\mathllap", - "\\mathrlap", - "\\mathclap" - ], - numArgs: 1, - allowedInText: true, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - var body = args[0]; - return { - type: "lap", - mode: parser.mode, - alignment: funcName.slice(5), - body - }; - }, - htmlBuilder: (group, options) => { - var inner; - if (group.alignment === "clap") { - inner = makeSpan([], [buildGroup$1(group.body, options)]); - inner = makeSpan(["katex-inner"], [inner], options); - } else inner = makeSpan(["katex-inner"], [buildGroup$1(group.body, options)]); - var fix = makeSpan(["katex-fix"], []); - var node = makeSpan([group.alignment], [inner, fix], options); - var strut = makeSpan(["katex-strut"]); - strut.style.height = makeEm(node.height + node.depth); - if (node.depth) strut.style.verticalAlign = makeEm(-node.depth); - node.children.unshift(strut); - node = makeSpan(["katex-thinbox"], [node], options); - return makeSpan(["mord", "katex-vbox"], [node], options); - }, - mathmlBuilder: (group, options) => { - var node = new MathNode("mpadded", [buildGroup(group.body, options)]); - if (group.alignment !== "rlap") { - var offset = group.alignment === "llap" ? "-1" : "-0.5"; - node.setAttribute("lspace", offset + "width"); - } - node.setAttribute("width", "0px"); - return node; - } - }); - defineFunction({ - type: "styling", - names: ["\\(", "$"], - numArgs: 0, - allowedInText: true, - allowedInMath: false, - handler(_ref, args) { - var funcName = _ref.funcName, parser = _ref.parser; - var outerMode = parser.mode; - parser.switchMode("math"); - var close = funcName === "\\(" ? "\\)" : "$"; - var body = parser.parseExpression(false, close); - parser.expect(close); - parser.switchMode(outerMode); - return { - type: "styling", - mode: parser.mode, - style: "text", - resetFont: true, - body - }; - } - }); - defineFunction({ - type: "text", - names: ["\\)", "\\]"], - numArgs: 0, - allowedInText: true, - allowedInMath: false, - handler(context, args) { - throw new ParseError("Mismatched " + context.funcName); - } - }); - var chooseMathStyle = (group, options) => { - switch (options.style.size) { - case Style$1.DISPLAY.size: return group.display; - case Style$1.TEXT.size: return group.text; - case Style$1.SCRIPT.size: return group.script; - case Style$1.SCRIPTSCRIPT.size: return group.scriptscript; - default: return group.text; - } - }; - defineFunction({ - type: "mathchoice", - names: ["\\mathchoice"], - numArgs: 4, - primitive: true, - handler: (_ref, args) => { - return { - type: "mathchoice", - mode: _ref.parser.mode, - display: ordargument(args[0]), - text: ordargument(args[1]), - script: ordargument(args[2]), - scriptscript: ordargument(args[3]) - }; - }, - htmlBuilder: (group, options) => { - return makeFragment(buildExpression$1(chooseMathStyle(group, options), options, false)); - }, - mathmlBuilder: (group, options) => { - return buildExpressionRow(chooseMathStyle(group, options), options); - } - }); - var assembleSupSub = (base, supGroup, subGroup, options, style, slant, baseShift) => { - base = makeSpan([], [base]); - var subIsSingleCharacter = subGroup && isCharacterBox(subGroup); - var sub; - var sup; - if (supGroup) { - var elem = buildGroup$1(supGroup, options.havingStyle(style.sup()), options); - sup = { - elem, - kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth) - }; - } - if (subGroup) { - var _elem = buildGroup$1(subGroup, options.havingStyle(style.sub()), options); - sub = { - elem: _elem, - kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - _elem.height) - }; - } - var finalGroup; - if (sup && sub) finalGroup = makeVList({ - positionType: "bottom", - positionData: options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift, - children: [ - { - type: "kern", - size: options.fontMetrics().bigOpSpacing5 - }, - { - type: "elem", - elem: sub.elem, - marginLeft: makeEm(-slant) - }, - { - type: "kern", - size: sub.kern - }, - { - type: "elem", - elem: base - }, - { - type: "kern", - size: sup.kern - }, - { - type: "elem", - elem: sup.elem, - marginLeft: makeEm(slant) - }, - { - type: "kern", - size: options.fontMetrics().bigOpSpacing5 - } - ] - }); - else if (sub) finalGroup = makeVList({ - positionType: "top", - positionData: base.height - baseShift, - children: [ - { - type: "kern", - size: options.fontMetrics().bigOpSpacing5 - }, - { - type: "elem", - elem: sub.elem, - marginLeft: makeEm(-slant) - }, - { - type: "kern", - size: sub.kern - }, - { - type: "elem", - elem: base - } - ] - }); - else if (sup) finalGroup = makeVList({ - positionType: "bottom", - positionData: base.depth + baseShift, - children: [ - { - type: "elem", - elem: base - }, - { - type: "kern", - size: sup.kern - }, - { - type: "elem", - elem: sup.elem, - marginLeft: makeEm(slant) - }, - { - type: "kern", - size: options.fontMetrics().bigOpSpacing5 - } - ] - }); - else return base; - var parts = [finalGroup]; - if (sub && slant !== 0 && !subIsSingleCharacter) { - var spacer = makeSpan(["mspace"], [], options); - spacer.style.marginRight = makeEm(slant); - parts.unshift(spacer); - } - return makeSpan(["mop", "op-limits"], parts, options); - }; - var noSuccessor = /* @__PURE__ */ new Set(["\\smallint"]); - var htmlBuilder$2 = (grp, options) => { - var supGroup; - var subGroup; - var hasLimits = false; - var group; - if (grp.type === "supsub") { - supGroup = grp.sup; - subGroup = grp.sub; - group = assertNodeType(grp.base, "op"); - hasLimits = true; - } else group = assertNodeType(grp, "op"); - var style = options.style; - var large = false; - if (style.size === Style$1.DISPLAY.size && group.symbol && !noSuccessor.has(group.name)) large = true; - var base; - var symbolItalic; - if (group.symbol) { - var fontName = large ? "Size2-Regular" : "Size1-Regular"; - var stash = ""; - if (group.name === "\\oiint" || group.name === "\\oiiint") { - stash = group.name.slice(1); - group.name = stash === "oiint" ? "\\iint" : "\\iiint"; - } - base = makeSymbol(group.name, fontName, "math", options, [ - "mop", - "op-symbol", - large ? "large-op" : "small-op" - ]); - symbolItalic = base.italic; - if (stash.length > 0) { - var oval = staticSvg(stash + "Size" + (large ? "2" : "1"), options); - base = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: base, - shift: 0 - }, { - type: "elem", - elem: oval, - shift: large ? .08 : 0 - }] - }); - group.name = "\\" + stash; - base.classes.unshift("mop"); - base.italic = symbolItalic; - } - } else if (group.body) { - var inner = buildExpression$1(group.body, options, true); - if (inner.length === 1 && inner[0] instanceof SymbolNode) { - base = inner[0]; - base.classes[0] = "mop"; - } else base = makeSpan(["mop"], inner, options); - } else { - var output = []; - for (var i = 1; i < group.name.length; i++) output.push(mathsym(group.name[i], group.mode, options)); - base = makeSpan(["mop"], output, options); - } - var baseShift = 0; - var slant = 0; - if ((base instanceof SymbolNode || group.name === "\\oiint" || group.name === "\\oiiint") && !group.suppressBaseShift) { - var _base$italic; - baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight; - slant = (_base$italic = base.italic) != null ? _base$italic : 0; - } - if (hasLimits) return assembleSupSub(base, supGroup, subGroup, options, style, slant, baseShift); - else { - if (baseShift) { - base.style.position = "relative"; - base.style.top = makeEm(baseShift); - } - return base; - } - }; - var mathmlBuilder$1 = (group, options) => { - var node; - if (group.symbol) { - node = new MathNode("mo", [makeText(group.name, group.mode)]); - if (noSuccessor.has(group.name)) node.setAttribute("largeop", "false"); - } else if (group.body) node = new MathNode("mo", buildExpression(group.body, options)); - else { - node = new MathNode("mi", [new TextNode(group.name.slice(1))]); - var operator = new MathNode("mo", [makeText("⁡", "text")]); - if (group.parentIsSupSub) node = new MathNode("mrow", [node, operator]); - else node = newDocumentFragment([node, operator]); - } - return node; - }; - var singleCharBigOps = { - "∏": "\\prod", - "∐": "\\coprod", - "∑": "\\sum", - "⋀": "\\bigwedge", - "⋁": "\\bigvee", - "⋂": "\\bigcap", - "⋃": "\\bigcup", - "⨀": "\\bigodot", - "⨁": "\\bigoplus", - "⨂": "\\bigotimes", - "⨄": "\\biguplus", - "⨆": "\\bigsqcup" - }; - defineFunction({ - type: "op", - names: [ - "\\coprod", - "\\bigvee", - "\\bigwedge", - "\\biguplus", - "\\bigcap", - "\\bigcup", - "\\intop", - "\\prod", - "\\sum", - "\\bigotimes", - "\\bigoplus", - "\\bigodot", - "\\bigsqcup", - "\\smallint", - "∏", - "∐", - "∑", - "⋀", - "⋁", - "⋂", - "⋃", - "⨀", - "⨁", - "⨂", - "⨄", - "⨆" - ], - numArgs: 0, - handler: (_ref, args) => { - var parser = _ref.parser; - var fName = _ref.funcName; - if (fName.length === 1) fName = singleCharBigOps[fName]; - return { - type: "op", - mode: parser.mode, - limits: true, - parentIsSupSub: false, - symbol: true, - name: fName - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - defineFunction({ - type: "op", - names: ["\\mathop"], - numArgs: 1, - primitive: true, - handler: (_ref2, args) => { - var parser = _ref2.parser; - var body = args[0]; - return { - type: "op", - mode: parser.mode, - limits: false, - parentIsSupSub: false, - symbol: false, - body: ordargument(body) - }; - } - }); - var singleCharIntegrals = { - "∫": "\\int", - "∬": "\\iint", - "∭": "\\iiint", - "∮": "\\oint", - "∯": "\\oiint", - "∰": "\\oiiint" - }; - defineFunction({ - type: "op", - names: [ - "\\arcsin", - "\\arccos", - "\\arctan", - "\\arctg", - "\\arcctg", - "\\arg", - "\\ch", - "\\cos", - "\\cosec", - "\\cosh", - "\\cot", - "\\cotg", - "\\coth", - "\\csc", - "\\ctg", - "\\cth", - "\\deg", - "\\dim", - "\\exp", - "\\hom", - "\\ker", - "\\lg", - "\\ln", - "\\log", - "\\sec", - "\\sin", - "\\sinh", - "\\sh", - "\\tan", - "\\tanh", - "\\tg", - "\\th" - ], - numArgs: 0, - handler(_ref3) { - var parser = _ref3.parser, funcName = _ref3.funcName; - return { - type: "op", - mode: parser.mode, - limits: false, - parentIsSupSub: false, - symbol: false, - name: funcName - }; - } - }); - defineFunction({ - type: "op", - names: [ - "\\det", - "\\gcd", - "\\inf", - "\\lim", - "\\max", - "\\min", - "\\Pr", - "\\sup" - ], - numArgs: 0, - handler(_ref4) { - var parser = _ref4.parser, funcName = _ref4.funcName; - return { - type: "op", - mode: parser.mode, - limits: true, - parentIsSupSub: false, - symbol: false, - name: funcName - }; - } - }); - defineFunction({ - type: "op", - names: [ - "\\int", - "\\iint", - "\\iiint", - "\\oint", - "\\oiint", - "\\oiiint", - "∫", - "∬", - "∭", - "∮", - "∯", - "∰" - ], - numArgs: 0, - allowedInArgument: true, - handler(_ref5) { - var parser = _ref5.parser; - var fName = _ref5.funcName; - if (fName.length === 1) fName = singleCharIntegrals[fName]; - return { - type: "op", - mode: parser.mode, - limits: false, - parentIsSupSub: false, - symbol: true, - name: fName - }; - } - }); - var htmlBuilder$1 = (grp, options) => { - var supGroup; - var subGroup; - var hasLimits = false; - var group; - if (grp.type === "supsub") { - supGroup = grp.sup; - subGroup = grp.sub; - group = assertNodeType(grp.base, "operatorname"); - hasLimits = true; - } else group = assertNodeType(grp, "operatorname"); - var base; - if (group.body.length > 0) { - var expression = buildExpression$1(group.body.map((child) => { - var childText = "text" in child ? child.text : void 0; - if (typeof childText === "string") return { - type: "textord", - mode: child.mode, - text: childText - }; - else return child; - }), options.withFont("mathrm"), true); - for (var i = 0; i < expression.length; i++) { - var child = expression[i]; - if (child instanceof SymbolNode) child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); - } - base = makeSpan(["mop"], expression, options); - } else base = makeSpan(["mop"], [], options); - if (hasLimits) return assembleSupSub(base, supGroup, subGroup, options, options.style, 0, 0); - else return base; - }; - var mathmlBuilder = (group, options) => { - var expression = buildExpression(group.body, options.withFont("mathrm")); - var isAllString = true; - for (var i = 0; i < expression.length; i++) { - var node = expression[i]; - if (node instanceof SpaceNode); - else if (node instanceof MathNode) switch (node.type) { - case "mi": - case "mn": - case "mspace": - case "mtext": break; - case "mo": - var child = node.children[0]; - if (node.children.length === 1 && child instanceof TextNode) child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); - else isAllString = false; - break; - default: isAllString = false; - } - else isAllString = false; - } - if (isAllString) expression = [new TextNode(expression.map((node) => node.toText()).join(""))]; - var identifier = new MathNode("mi", expression); - identifier.setAttribute("mathvariant", "normal"); - var operator = new MathNode("mo", [makeText("⁡", "text")]); - if (group.parentIsSupSub) return new MathNode("mrow", [identifier, operator]); - else return newDocumentFragment([identifier, operator]); - }; - defineFunction({ - type: "operatorname", - names: ["\\operatorname@", "\\operatornamewithlimits"], - numArgs: 1, - handler: (_ref, args) => { - var parser = _ref.parser, funcName = _ref.funcName; - var body = args[0]; - return { - type: "operatorname", - mode: parser.mode, - body: ordargument(body), - alwaysHandleSupSub: funcName === "\\operatornamewithlimits", - limits: false, - parentIsSupSub: false - }; - }, - htmlBuilder: htmlBuilder$1, - mathmlBuilder - }); - defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"); - defineFunctionBuilders({ - type: "ordgroup", - htmlBuilder(group, options) { - if (group.semisimple) return makeFragment(buildExpression$1(group.body, options, false)); - return makeSpan(["mord"], buildExpression$1(group.body, options, true), options); - }, - mathmlBuilder(group, options) { - return buildExpressionRow(group.body, options, true); - } - }); - defineFunction({ - type: "overline", - names: ["\\overline"], - numArgs: 1, - handler(_ref, args) { - var parser = _ref.parser; - var body = args[0]; - return { - type: "overline", - mode: parser.mode, - body - }; - }, - htmlBuilder(group, options) { - var innerGroup = buildGroup$1(group.body, options.havingCrampedStyle()); - var line = makeLineSpan("overline-line", options); - var defaultRuleThickness = options.fontMetrics().defaultRuleThickness; - return makeSpan(["mord", "katex-overline"], [makeVList({ - positionType: "firstBaseline", - children: [ - { - type: "elem", - elem: innerGroup - }, - { - type: "kern", - size: 3 * defaultRuleThickness - }, - { - type: "elem", - elem: line - }, - { - type: "kern", - size: defaultRuleThickness - } - ] - })], options); - }, - mathmlBuilder(group, options) { - var operator = new MathNode("mo", [new TextNode("‾")]); - operator.setAttribute("stretchy", "true"); - var node = new MathNode("mover", [buildGroup(group.body, options), operator]); - node.setAttribute("accent", "true"); - return node; - } - }); - defineFunction({ - type: "phantom", - names: ["\\phantom"], - numArgs: 1, - allowedInText: true, - handler: (_ref, args) => { - var parser = _ref.parser; - var body = args[0]; - return { - type: "phantom", - mode: parser.mode, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options) => { - return makeFragment(buildExpression$1(group.body, options.withPhantom(), false)); - }, - mathmlBuilder: (group, options) => { - return new MathNode("mphantom", buildExpression(group.body, options)); - } - }); - defineMacro("\\hphantom", "\\smash{\\phantom{#1}}"); - defineFunction({ - type: "vphantom", - names: ["\\vphantom"], - numArgs: 1, - allowedInText: true, - handler: (_ref2, args) => { - var parser = _ref2.parser; - var body = args[0]; - return { - type: "vphantom", - mode: parser.mode, - body - }; - }, - htmlBuilder: (group, options) => { - return makeSpan(["mord", "rlap"], [makeSpan(["katex-inner"], [buildGroup$1(group.body, options.withPhantom())]), makeSpan(["katex-fix"], [])], options); - }, - mathmlBuilder: (group, options) => { - var node = new MathNode("mpadded", [new MathNode("mphantom", buildExpression(ordargument(group.body), options))]); - node.setAttribute("width", "0px"); - return node; - } - }); - defineFunction({ - type: "raisebox", - names: ["\\raisebox"], - numArgs: 2, - argTypes: ["size", "hbox"], - allowedInText: true, - handler(_ref, args) { - var parser = _ref.parser; - var amount = assertNodeType(args[0], "size").value; - var body = args[1]; - return { - type: "raisebox", - mode: parser.mode, - dy: amount, - body - }; - }, - htmlBuilder(group, options) { - var body = buildGroup$1(group.body, options); - return makeVList({ - positionType: "shift", - positionData: -calculateSize(group.dy, options), - children: [{ - type: "elem", - elem: body - }] - }); - }, - mathmlBuilder(group, options) { - var node = new MathNode("mpadded", [buildGroup(group.body, options)]); - var dy = group.dy.number + group.dy.unit; - node.setAttribute("voffset", dy); - return node; - } - }); - var handler = (_ref, args) => { - return { - type: "reflectbox", - mode: _ref.parser.mode, - body: args[0] - }; - }; - defineFunction({ - type: "reflectbox", - names: ["\\reflectbox"], - numArgs: 1, - argTypes: ["hbox"], - allowedInText: true, - handler, - htmlBuilder(group, options) { - return makeSpan(["mord", "reflectbox"], [buildGroup$1(group.body, options)], options); - }, - mathmlBuilder(group, options) { - return buildGroup(group.body, options); - } - }); - defineFunction({ - type: "reflectbox", - names: ["\\mathreflectbox"], - numArgs: 1, - argTypes: ["math"], - handler - }); - defineFunction({ - type: "internal", - names: ["\\relax"], - numArgs: 0, - allowedInText: true, - allowedInArgument: true, - handler(_ref) { - return { - type: "internal", - mode: _ref.parser.mode - }; - } - }); - defineFunction({ - type: "rule", - names: ["\\rule"], - numArgs: 2, - numOptionalArgs: 1, - allowedInText: true, - allowedInMath: true, - argTypes: [ - "size", - "size", - "size" - ], - handler(_ref, args, optArgs) { - var parser = _ref.parser; - var shift = optArgs[0]; - var width = assertNodeType(args[0], "size"); - var height = assertNodeType(args[1], "size"); - return { - type: "rule", - mode: parser.mode, - shift: shift && assertNodeType(shift, "size").value, - width: width.value, - height: height.value - }; - }, - htmlBuilder(group, options) { - var rule = makeSpan(["mord", "katex-rule"], [], options); - var width = calculateSize(group.width, options); - var height = calculateSize(group.height, options); - var shift = group.shift ? calculateSize(group.shift, options) : 0; - rule.style.borderRightWidth = makeEm(width); - rule.style.borderTopWidth = makeEm(height); - rule.style.bottom = makeEm(shift); - rule.width = width; - rule.height = height + shift; - rule.depth = -shift; - rule.maxFontSize = height * 1.125 * options.sizeMultiplier; - return rule; - }, - mathmlBuilder(group, options) { - var width = calculateSize(group.width, options); - var height = calculateSize(group.height, options); - var shift = group.shift ? calculateSize(group.shift, options) : 0; - var color = options.color && options.getColor() || "black"; - var rule = new MathNode("mspace"); - rule.setAttribute("mathbackground", color); - rule.setAttribute("width", makeEm(width)); - rule.setAttribute("height", makeEm(height)); - var wrapper = new MathNode("mpadded", [rule]); - if (shift >= 0) wrapper.setAttribute("height", makeEm(shift)); - else { - wrapper.setAttribute("height", makeEm(shift)); - wrapper.setAttribute("depth", makeEm(-shift)); - } - wrapper.setAttribute("voffset", makeEm(shift)); - return wrapper; - } - }); - function sizingGroup(value, options, baseOptions) { - var inner = buildExpression$1(value, options, false); - var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; - for (var i = 0; i < inner.length; i++) { - var pos = inner[i].classes.indexOf("katex-sizing"); - if (pos < 0) Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions)); - else if (inner[i].classes[pos + 1] === "reset-size" + options.size) inner[i].classes[pos + 1] = "reset-size" + baseOptions.size; - inner[i].height *= multiplier; - inner[i].depth *= multiplier; - } - return makeFragment(inner); - } - var sizeFuncs = [ - "\\tiny", - "\\sixptsize", - "\\scriptsize", - "\\footnotesize", - "\\small", - "\\normalsize", - "\\large", - "\\Large", - "\\LARGE", - "\\huge", - "\\Huge" - ]; - var htmlBuilder = (group, options) => { - var newOptions = options.havingSize(group.size); - return sizingGroup(group.body, newOptions, options); - }; - defineFunction({ - type: "sizing", - names: sizeFuncs, - numArgs: 0, - allowedInText: true, - handler: (_ref, args) => { - var breakOnTokenText = _ref.breakOnTokenText, funcName = _ref.funcName, parser = _ref.parser; - var body = parser.parseExpression(false, breakOnTokenText); - return { - type: "sizing", - mode: parser.mode, - size: sizeFuncs.indexOf(funcName) + 1, - body - }; - }, - htmlBuilder, - mathmlBuilder: (group, options) => { - var newOptions = options.havingSize(group.size); - var node = new MathNode("mstyle", buildExpression(group.body, newOptions)); - node.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier)); - return node; - } - }); - defineFunction({ - type: "smash", - names: ["\\smash"], - numArgs: 1, - numOptionalArgs: 1, - allowedInText: true, - handler: (_ref, args, optArgs) => { - var parser = _ref.parser; - var smashHeight = false; - var smashDepth = false; - var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup"); - if (tbArg) { - var letter; - for (var i = 0; i < tbArg.body.length; ++i) { - var node = tbArg.body[i]; - letter = assertSymbolNodeType(node).text; - if (letter === "t") smashHeight = true; - else if (letter === "b") smashDepth = true; - else { - smashHeight = false; - smashDepth = false; - break; - } - } - } else { - smashHeight = true; - smashDepth = true; - } - var body = args[0]; - return { - type: "smash", - mode: parser.mode, - body, - smashHeight, - smashDepth - }; - }, - htmlBuilder: (group, options) => { - var node = makeSpan([], [buildGroup$1(group.body, options)]); - if (!group.smashHeight && !group.smashDepth) return node; - if (group.smashHeight) node.height = 0; - if (group.smashDepth) node.depth = 0; - if (group.smashHeight && group.smashDepth) return makeSpan(["mord", "katex-smash"], [node], options); - if (node.children) for (var i = 0; i < node.children.length; i++) { - if (group.smashHeight) node.children[i].height = 0; - if (group.smashDepth) node.children[i].depth = 0; - } - return makeSpan(["mord"], [makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: node - }] - })], options); - }, - mathmlBuilder: (group, options) => { - var node = new MathNode("mpadded", [buildGroup(group.body, options)]); - if (group.smashHeight) node.setAttribute("height", "0px"); - if (group.smashDepth) node.setAttribute("depth", "0px"); - return node; - } - }); - defineFunction({ - type: "sqrt", - names: ["\\sqrt"], - numArgs: 1, - numOptionalArgs: 1, - handler(_ref, args, optArgs) { - var parser = _ref.parser; - var index = optArgs[0]; - var body = args[0]; - return { - type: "sqrt", - mode: parser.mode, - body, - index - }; - }, - htmlBuilder(group, options) { - var inner = buildGroup$1(group.body, options.havingCrampedStyle()); - if (inner.height === 0) inner.height = options.fontMetrics().xHeight; - inner = wrapFragment(inner, options); - var theta = options.fontMetrics().defaultRuleThickness; - var phi = theta; - if (options.style.id < Style$1.TEXT.id) phi = options.fontMetrics().xHeight; - var lineClearance = theta + phi / 4; - var _makeSqrtImage = makeSqrtImage(inner.height + inner.depth + lineClearance + theta, options), img = _makeSqrtImage.span, ruleWidth = _makeSqrtImage.ruleWidth, advanceWidth = _makeSqrtImage.advanceWidth; - var delimDepth = img.height - ruleWidth; - if (delimDepth > inner.height + inner.depth + lineClearance) lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2; - var imgShift = img.height - inner.height - lineClearance - ruleWidth; - inner.style.paddingLeft = makeEm(advanceWidth); - var body = makeVList({ - positionType: "firstBaseline", - children: [ - { - type: "elem", - elem: inner, - wrapperClasses: ["svg-align"] - }, - { - type: "kern", - size: -(inner.height + imgShift) - }, - { - type: "elem", - elem: img - }, - { - type: "kern", - size: ruleWidth - } - ] - }); - if (!group.index) return makeSpan(["mord", "sqrt"], [body], options); - else { - var newOptions = options.havingStyle(Style$1.SCRIPTSCRIPT); - var rootm = buildGroup$1(group.index, newOptions, options); - return makeSpan(["mord", "sqrt"], [makeSpan(["katex-root"], [makeVList({ - positionType: "shift", - positionData: -(.6 * (body.height - body.depth)), - children: [{ - type: "elem", - elem: rootm - }] - })]), body], options); - } - }, - mathmlBuilder(group, options) { - var body = group.body, index = group.index; - return index ? new MathNode("mroot", [buildGroup(body, options), buildGroup(index, options)]) : new MathNode("msqrt", [buildGroup(body, options)]); - } - }); - var styleMap = { - "display": Style$1.DISPLAY, - "text": Style$1.TEXT, - "script": Style$1.SCRIPT, - "scriptscript": Style$1.SCRIPTSCRIPT - }; - function isStyleStr(s) { - return s in styleMap; - } - defineFunction({ - type: "styling", - names: [ - "\\displaystyle", - "\\textstyle", - "\\scriptstyle", - "\\scriptscriptstyle" - ], - numArgs: 0, - allowedInText: true, - primitive: true, - handler(_ref, args) { - var breakOnTokenText = _ref.breakOnTokenText, funcName = _ref.funcName, parser = _ref.parser; - var body = parser.parseExpression(true, breakOnTokenText); - var style = funcName.slice(1, funcName.length - 5); - if (!isStyleStr(style)) throw new Error("Unknown style: " + style); - return { - type: "styling", - mode: parser.mode, - style, - body - }; - }, - htmlBuilder(group, options) { - var newStyle = styleMap[group.style]; - var newOptions = options.havingStyle(newStyle); - if (group.resetFont) newOptions = newOptions.withFont(""); - return sizingGroup(group.body, newOptions, options); - }, - mathmlBuilder(group, options) { - var newStyle = styleMap[group.style]; - var newOptions = options.havingStyle(newStyle); - if (group.resetFont) newOptions = newOptions.withFont(""); - var node = new MathNode("mstyle", buildExpression(group.body, newOptions)); - var attr = { - "display": ["0", "true"], - "text": ["0", "false"], - "script": ["1", "false"], - "scriptscript": ["2", "false"] - }[group.style]; - node.setAttribute("scriptlevel", attr[0]); - node.setAttribute("displaystyle", attr[1]); - return node; - } - }); - /** - * Sometimes, groups perform special rules when they have superscripts or - * subscripts attached to them. This function lets the `supsub` group know that - * Sometimes, groups perform special rules when they have superscripts or - * its inner element should handle the superscripts and subscripts instead of - * handling them itself. - */ - var htmlBuilderDelegate = function htmlBuilderDelegate(group, options) { - var base = group.base; - if (!base) return null; - else if (base.type === "op") return base.limits && (options.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub) ? htmlBuilder$2 : null; - else if (base.type === "operatorname") return base.alwaysHandleSupSub && (options.style.size === Style$1.DISPLAY.size || base.limits) ? htmlBuilder$1 : null; - else if (base.type === "accent") return isCharacterBox(base.base) ? htmlBuilder$a : null; - else if (base.type === "horizBrace") return !group.sub === base.isOver ? htmlBuilder$3 : null; - else return null; - }; - defineFunctionBuilders({ - type: "supsub", - htmlBuilder(group, options) { - var builderDelegate = htmlBuilderDelegate(group, options); - if (builderDelegate) return builderDelegate(group, options); - var valueBase = group.base, valueSup = group.sup, valueSub = group.sub; - var base = buildGroup$1(valueBase, options); - var supm; - var subm; - var metrics = options.fontMetrics(); - var supShift = 0; - var subShift = 0; - var isCharBox = valueBase && isCharacterBox(valueBase); - if (valueSup) { - var newOptions = options.havingStyle(options.style.sup()); - supm = buildGroup$1(valueSup, newOptions, options); - if (!isCharBox) supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier; - } - if (valueSub) { - var _newOptions = options.havingStyle(options.style.sub()); - subm = buildGroup$1(valueSub, _newOptions, options); - if (!isCharBox) subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options.sizeMultiplier; - } - var minSupShift; - if (options.style === Style$1.DISPLAY) minSupShift = metrics.sup1; - else if (options.style.cramped) minSupShift = metrics.sup3; - else minSupShift = metrics.sup2; - var multiplier = options.sizeMultiplier; - var marginRight = makeEm(.5 / metrics.ptPerEm / multiplier); - var marginLeft = null; - if (subm) { - var isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint"); - if (base instanceof SymbolNode || isOiint) { - var _base$italic; - marginLeft = makeEm(-((_base$italic = base.italic) != null ? _base$italic : 0)); - } - } - var supsub; - if (supm && subm) { - supShift = Math.max(supShift, minSupShift, supm.depth + .25 * metrics.xHeight); - subShift = Math.max(subShift, metrics.sub2); - var maxWidth = 4 * metrics.defaultRuleThickness; - if (supShift - supm.depth - (subm.height - subShift) < maxWidth) { - subShift = maxWidth - (supShift - supm.depth) + subm.height; - var psi = .8 * metrics.xHeight - (supShift - supm.depth); - if (psi > 0) { - supShift += psi; - subShift -= psi; - } - } - supsub = makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: subm, - shift: subShift, - marginRight, - marginLeft - }, { - type: "elem", - elem: supm, - shift: -supShift, - marginRight - }] - }); - } else if (subm) { - subShift = Math.max(subShift, metrics.sub1, subm.height - .8 * metrics.xHeight); - supsub = makeVList({ - positionType: "shift", - positionData: subShift, - children: [{ - type: "elem", - elem: subm, - marginLeft, - marginRight - }] - }); - } else if (supm) { - supShift = Math.max(supShift, minSupShift, supm.depth + .25 * metrics.xHeight); - supsub = makeVList({ - positionType: "shift", - positionData: -supShift, - children: [{ - type: "elem", - elem: supm, - marginRight - }] - }); - } else throw new Error("supsub must have either sup or sub."); - return makeSpan([getTypeOfDomTree(base, "right") || "mord"], [base, makeSpan(["msupsub"], [supsub])], options); - }, - mathmlBuilder(group, options) { - var isBrace = false; - var isOver; - var isSup; - if (group.base && group.base.type === "horizBrace") { - isSup = !!group.sup; - if (isSup === group.base.isOver) { - isBrace = true; - isOver = group.base.isOver; - } - } - if (group.base && (group.base.type === "op" || group.base.type === "operatorname")) group.base.parentIsSupSub = true; - var children = [buildGroup(group.base, options)]; - if (group.sub) children.push(buildGroup(group.sub, options)); - if (group.sup) children.push(buildGroup(group.sup, options)); - var nodeType; - if (isBrace) nodeType = isOver ? "mover" : "munder"; - else if (!group.sub) { - var base = group.base; - if (base && base.type === "op" && base.limits && (options.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) nodeType = "mover"; - else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options.style === Style$1.DISPLAY)) nodeType = "mover"; - else nodeType = "msup"; - } else if (!group.sup) { - var _base = group.base; - if (_base && _base.type === "op" && _base.limits && (options.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) nodeType = "munder"; - else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options.style === Style$1.DISPLAY)) nodeType = "munder"; - else nodeType = "msub"; - } else { - var _base2 = group.base; - if (_base2 && _base2.type === "op" && _base2.limits && options.style === Style$1.DISPLAY) nodeType = "munderover"; - else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options.style === Style$1.DISPLAY || _base2.limits)) nodeType = "munderover"; - else nodeType = "msubsup"; - } - return new MathNode(nodeType, children); - } - }); - defineFunctionBuilders({ - type: "atom", - htmlBuilder(group, options) { - return mathsym(group.text, group.mode, options, ["m" + group.family]); - }, - mathmlBuilder(group, options) { - var node = new MathNode("mo", [makeText(group.text, group.mode)]); - if (group.family === "bin") { - var variant = getVariant(group, options); - if (variant === "bold-italic") node.setAttribute("mathvariant", variant); - } else if (group.family === "punct") node.setAttribute("separator", "true"); - else if (group.family === "open" || group.family === "close") node.setAttribute("stretchy", "false"); - return node; - } - }); - var defaultVariant = { - "mi": "italic", - "mn": "normal", - "mtext": "normal" - }; - defineFunctionBuilders({ - type: "mathord", - htmlBuilder(group, options) { - return makeOrd(group, options); - }, - mathmlBuilder(group, options) { - var node = new MathNode("mi", [makeText(group.text, group.mode, options)]); - var variant = getVariant(group, options) || "italic"; - if (variant !== defaultVariant[node.type]) node.setAttribute("mathvariant", variant); - return node; - } - }); - defineFunctionBuilders({ - type: "textord", - htmlBuilder(group, options) { - return makeOrd(group, options); - }, - mathmlBuilder(group, options) { - var text = makeText(group.text, group.mode, options); - var variant = getVariant(group, options) || "normal"; - var node; - if (group.mode === "text") node = new MathNode("mtext", [text]); - else if (/[0-9]/.test(group.text)) node = new MathNode("mn", [text]); - else if (group.text === "\\prime") node = new MathNode("mo", [text]); - else node = new MathNode("mi", [text]); - if (variant !== defaultVariant[node.type]) node.setAttribute("mathvariant", variant); - return node; - } - }); - var cssSpace = /* @__PURE__ */ new Map([["\\nobreak", "nobreak"], ["\\allowbreak", "allowbreak"]]); - var regularSpace = /* @__PURE__ */ new Map([ - [" ", {}], - ["\\ ", {}], - ["~", { className: "nobreak" }], - ["\\space", {}], - ["\\nobreakspace", { className: "nobreak" }] - ]); - defineFunctionBuilders({ - type: "spacing", - htmlBuilder(group, options) { - var regularSpaceItem = regularSpace.get(group.text); - var cssSpaceClass = cssSpace.get(group.text); - if (regularSpaceItem) { - var className = regularSpaceItem.className || ""; - if (group.mode === "text") { - var ord = makeOrd(group, options); - ord.classes.push(className); - return ord; - } else return makeSpan(["mspace", className], [mathsym(group.text, group.mode, options)], options); - } else if (cssSpaceClass) return makeSpan(["mspace", cssSpaceClass], [], options); - else throw new ParseError("Unknown type of space \"" + group.text + "\""); - }, - mathmlBuilder(group, options) { - var node; - if (regularSpace.has(group.text)) node = new MathNode("mtext", [new TextNode("\xA0")]); - else if (cssSpace.has(group.text)) return new MathNode("mspace"); - else throw new ParseError("Unknown type of space \"" + group.text + "\""); - return node; - } - }); - var pad = () => { - var padNode = new MathNode("mtd", []); - padNode.setAttribute("width", "50%"); - return padNode; - }; - defineFunctionBuilders({ - type: "tag", - mathmlBuilder(group, options) { - var table = new MathNode("mtable", [new MathNode("mtr", [ - pad(), - new MathNode("mtd", [buildExpressionRow(group.body, options)]), - pad(), - new MathNode("mtd", [buildExpressionRow(group.tag, options)]) - ])]); - table.setAttribute("width", "100%"); - return table; - } - }); - var textFontFamilies = { - "\\text": void 0, - "\\textrm": "textrm", - "\\textsf": "textsf", - "\\texttt": "texttt", - "\\textnormal": "textrm" - }; - var textFontWeights = { - "\\textbf": "textbf", - "\\textmd": "textmd" - }; - var textFontShapes = { - "\\textit": "textit", - "\\textup": "textup" - }; - var optionsWithFont = (group, options) => { - var font = group.font; - if (!font) return options; - else if (textFontFamilies[font]) return options.withTextFontFamily(textFontFamilies[font]); - else if (textFontWeights[font]) return options.withTextFontWeight(textFontWeights[font]); - else if (font === "\\emph") return options.fontShape === "textit" ? options.withTextFontShape("textup") : options.withTextFontShape("textit"); - return options.withTextFontShape(textFontShapes[font]); - }; - defineFunction({ - type: "text", - names: [ - "\\text", - "\\textrm", - "\\textsf", - "\\texttt", - "\\textnormal", - "\\textbf", - "\\textmd", - "\\textit", - "\\textup", - "\\emph" - ], - numArgs: 1, - argTypes: ["text"], - allowedInArgument: true, - allowedInText: true, - handler(_ref, args) { - var parser = _ref.parser, funcName = _ref.funcName; - var body = args[0]; - return { - type: "text", - mode: parser.mode, - body: ordargument(body), - font: funcName - }; - }, - htmlBuilder(group, options) { - var newOptions = optionsWithFont(group, options); - return makeSpan(["mord", "text"], buildExpression$1(group.body, newOptions, true), newOptions); - }, - mathmlBuilder(group, options) { - var newOptions = optionsWithFont(group, options); - return buildExpressionRow(group.body, newOptions); - } - }); - defineFunction({ - type: "underline", - names: ["\\underline"], - numArgs: 1, - allowedInText: true, - handler(_ref, args) { - return { - type: "underline", - mode: _ref.parser.mode, - body: args[0] - }; - }, - htmlBuilder(group, options) { - var innerGroup = buildGroup$1(group.body, options); - var line = makeLineSpan("underline-line", options); - var defaultRuleThickness = options.fontMetrics().defaultRuleThickness; - return makeSpan(["mord", "katex-underline"], [makeVList({ - positionType: "top", - positionData: innerGroup.height, - children: [ - { - type: "kern", - size: defaultRuleThickness - }, - { - type: "elem", - elem: line - }, - { - type: "kern", - size: 3 * defaultRuleThickness - }, - { - type: "elem", - elem: innerGroup - } - ] - })], options); - }, - mathmlBuilder(group, options) { - var operator = new MathNode("mo", [new TextNode("‾")]); - operator.setAttribute("stretchy", "true"); - var node = new MathNode("munder", [buildGroup(group.body, options), operator]); - node.setAttribute("accentunder", "true"); - return node; - } - }); - defineFunction({ - type: "vcenter", - names: ["\\vcenter"], - numArgs: 1, - argTypes: ["original"], - allowedInText: false, - handler(_ref, args) { - return { - type: "vcenter", - mode: _ref.parser.mode, - body: args[0] - }; - }, - htmlBuilder(group, options) { - var body = buildGroup$1(group.body, options); - var axisHeight = options.fontMetrics().axisHeight; - return makeVList({ - positionType: "shift", - positionData: .5 * (body.height - axisHeight - (body.depth + axisHeight)), - children: [{ - type: "elem", - elem: body - }] - }); - }, - mathmlBuilder(group, options) { - return new MathNode("mrow", [new MathNode("mpadded", [buildGroup(group.body, options)], ["vcenter"])]); - } - }); - defineFunction({ - type: "verb", - names: ["\\verb"], - numArgs: 0, - allowedInText: true, - handler(context, args, optArgs) { - throw new ParseError("\\verb ended by end of line instead of matching delimiter"); - }, - htmlBuilder(group, options) { - var text = makeVerb(group); - var body = []; - var newOptions = options.havingStyle(options.style.text()); - for (var i = 0; i < text.length; i++) { - var c = text[i]; - if (c === "~") c = "\\textasciitilde"; - body.push(makeSymbol(c, "Typewriter-Regular", group.mode, newOptions, ["mord", "texttt"])); - } - return makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), tryCombineChars(body), newOptions); - }, - mathmlBuilder(group, options) { - var node = new MathNode("mtext", [new TextNode(makeVerb(group))]); - node.setAttribute("mathvariant", "monospace"); - return node; - } - }); - /** - * Converts verb group into body string. - * - * \verb* replaces each space with an open box \u2423 - * \verb replaces each space with a no-break space \xA0 - */ - var makeVerb = (group) => group.body.replace(/ /g, group.star ? "␣" : "\xA0"); - /** Include this to ensure that all functions are defined. */ - var functions = _functions; - /** - * The Lexer class handles tokenizing the input in various ways. Since our - * parser expects us to be able to backtrack, the lexer allows lexing from any - * given starting point. - * - * Its main exposed function is the `lex` function, which takes a position to - * lex from and a type of token to lex. It defers to the appropriate `_innerLex` - * function. - * - * The various `_innerLex` functions perform the actual lexing of different - * kinds. - */ - var spaceRegexString = "[ \r\n ]"; - var controlWordRegexString = "\\\\[a-zA-Z@]+"; - var controlSymbolRegexString = "\\\\[^\ud800-\udfff]"; - var controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*"; - var controlSpaceRegexString = "\\\\(\n|[ \r ]+\n?)[ \r ]*"; - var combiningDiacriticalMarkString = "[̀-ͯ]"; - var combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"); - var tokenRegexString = "(" + spaceRegexString + "+)|" + (controlSpaceRegexString + "|") + "([!-\\[\\]-‧‪-퟿豈-￿]" + (combiningDiacriticalMarkString + "*") + "|[\ud800-\udbff][\udc00-\udfff]" + (combiningDiacriticalMarkString + "*") + "|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + ("|" + controlWordWhitespaceRegexString) + ("|" + controlSymbolRegexString + ")"); - /** Main Lexer class */ - var Lexer = class { - constructor(input, settings) { - this.input = void 0; - this.settings = void 0; - this.tokenRegex = void 0; - this.catcodes = void 0; - this.input = input; - this.settings = settings; - this.tokenRegex = new RegExp(tokenRegexString, "g"); - this.catcodes = { - "%": 14, - "~": 13 - }; - } - setCatcode(char, code) { - this.catcodes[char] = code; - } - /** - * This function lexes a single token. - */ - lex() { - var input = this.input; - var pos = this.tokenRegex.lastIndex; - if (pos === input.length) return new Token("EOF", new SourceLocation(this, pos, pos)); - var match = this.tokenRegex.exec(input); - if (match === null || match.index !== pos) throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1))); - var text = match[6] || match[3] || (match[2] ? "\\ " : " "); - if (this.catcodes[text] === 14) { - var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex); - if (nlIndex === -1) { - this.tokenRegex.lastIndex = input.length; - handleStrict({ - strict: this.settings.strict, - errorCode: "commentAtEnd", - errorMsg: "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)", - report: true - }); - } else this.tokenRegex.lastIndex = nlIndex + 1; - return this.lex(); - } - return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex)); - } - }; - /** - * A `Namespace` refers to a space of nameable things like macros or lengths, - * which can be `set` either globally or local to a nested group, using an - * undo stack similar to how TeX implements this functionality. - * Performance-wise, `get` and local `set` take constant time, while global - * `set` takes time proportional to the depth of group nesting. - */ - var Namespace = class { - /** - * Both arguments are optional. The first argument is an object of - * built-in mappings which never change. The second argument is an object - * of initial (global-level) mappings, which will constantly change - * according to any global/top-level `set`s done. - */ - constructor(builtins, globalMacros) { - if (builtins === void 0) builtins = {}; - if (globalMacros === void 0) globalMacros = {}; - this.current = void 0; - this.builtins = void 0; - this.undefStack = void 0; - this.current = globalMacros; - this.builtins = builtins; - this.undefStack = []; - } - /** - * Start a new nested group, affecting future local `set`s. - */ - beginGroup() { - this.undefStack.push({}); - } - /** - * End current nested group, restoring values before the group began. - */ - endGroup() { - if (this.undefStack.length === 0) throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug"); - var undefs = this.undefStack.pop(); - for (var key of Object.keys(undefs)) if (undefs[key] === void 0) delete this.current[key]; - else this.current[key] = undefs[key]; - } - /** - * Ends all currently nested groups (if any), restoring values before the - * groups began. Useful in case of an error in the middle of parsing. - */ - endGroups() { - while (this.undefStack.length > 0) this.endGroup(); - } - /** - * Detect whether `name` has a definition. Equivalent to - * `get(name) != null`. - */ - has(name) { - return Object.prototype.hasOwnProperty.call(this.current, name) || Object.prototype.hasOwnProperty.call(this.builtins, name); - } - /** - * Get the current value of a name, or `undefined` if there is no value. - * - * Note: Do not use `if (namespace.get(...))` to detect whether a macro - * is defined, as the definition may be the empty string which evaluates - * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or - * `if (namespace.has(...))`. - */ - get(name) { - if (Object.prototype.hasOwnProperty.call(this.current, name)) return this.current[name]; - else if (Object.prototype.hasOwnProperty.call(this.builtins, name)) return this.builtins[name]; - else return; - } - /** - * Set the current value of a name, and optionally set it globally too. - * Local set() sets the current value and (when appropriate) adds an undo - * operation to the undo stack. Global set() may change the undo - * operation at every level, so takes time linear in their number. - * A value of undefined means to delete existing definitions. - */ - set(name, value, global) { - if (global === void 0) global = false; - if (global) { - for (var i = 0; i < this.undefStack.length; i++) delete this.undefStack[i][name]; - if (this.undefStack.length > 0) this.undefStack[this.undefStack.length - 1][name] = value; - } else { - var top = this.undefStack[this.undefStack.length - 1]; - if (top && !Object.prototype.hasOwnProperty.call(top, name)) top[name] = Object.prototype.hasOwnProperty.call(this.current, name) ? this.current[name] : void 0; - } - if (value == null) delete this.current[name]; - else this.current[name] = value; - } - }; - /** - * Predefined macros for KaTeX. - * This can be used to define some commands in terms of others. - */ - var macros = _macros; - defineMacro("\\noexpand", function(context) { - var t = context.popToken(); - if (context.isExpandable(t.text)) { - t.noexpand = true; - t.treatAsRelax = true; - } - return { - tokens: [t], - numArgs: 0 - }; - }); - defineMacro("\\expandafter", function(context) { - var t = context.popToken(); - context.expandOnce(true); - return { - tokens: [t], - numArgs: 0 - }; - }); - defineMacro("\\@firstoftwo", function(context) { - return { - tokens: context.consumeArgs(2)[0], - numArgs: 0 - }; - }); - defineMacro("\\@secondoftwo", function(context) { - return { - tokens: context.consumeArgs(2)[1], - numArgs: 0 - }; - }); - defineMacro("\\@ifnextchar", function(context) { - var args = context.consumeArgs(3); - context.consumeSpaces(); - var nextToken = context.future(); - if (args[0].length === 1 && args[0][0].text === nextToken.text) return { - tokens: args[1], - numArgs: 0 - }; - else return { - tokens: args[2], - numArgs: 0 - }; - }); - defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"); - defineMacro("\\TextOrMath", function(context) { - var args = context.consumeArgs(2); - if (context.mode === "text") return { - tokens: args[0], - numArgs: 0 - }; - else return { - tokens: args[1], - numArgs: 0 - }; - }); - var digitToNumber = { - "0": 0, - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - "a": 10, - "A": 10, - "b": 11, - "B": 11, - "c": 12, - "C": 12, - "d": 13, - "D": 13, - "e": 14, - "E": 14, - "f": 15, - "F": 15 - }; - defineMacro("\\char", function(context) { - var token = context.popToken(); - var base; - var number = 0; - if (token.text === "'") { - base = 8; - token = context.popToken(); - } else if (token.text === "\"") { - base = 16; - token = context.popToken(); - } else if (token.text === "`") { - token = context.popToken(); - if (token.text[0] === "\\") number = token.text.charCodeAt(1); - else if (token.text === "EOF") throw new ParseError("\\char` missing argument"); - else number = token.text.charCodeAt(0); - } else base = 10; - if (base) { - number = digitToNumber[token.text]; - if (number == null || number >= base) throw new ParseError("Invalid base-" + base + " digit " + token.text); - var digit; - while ((digit = digitToNumber[context.future().text]) != null && digit < base) { - number *= base; - number += digit; - context.popToken(); - } - } - return "\\@char{" + number + "}"; - }); - var newcommand = (context, existsOK, nonexistsOK, skipIfExists) => { - var arg = context.consumeArg().tokens; - if (arg.length !== 1) throw new ParseError("\\newcommand's first argument must be a macro name"); - var name = arg[0].text; - var exists = context.isDefined(name); - if (exists && !existsOK) throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand")); - if (!exists && !nonexistsOK) throw new ParseError("\\renewcommand{" + name + "} when command " + name + " does not yet exist; use \\newcommand"); - var numArgs = 0; - arg = context.consumeArg().tokens; - if (arg.length === 1 && arg[0].text === "[") { - var argText = ""; - var token = context.expandNextToken(); - while (token.text !== "]" && token.text !== "EOF") { - argText += token.text; - token = context.expandNextToken(); - } - if (!argText.match(/^\s*[0-9]+\s*$/)) throw new ParseError("Invalid number of arguments: " + argText); - numArgs = parseInt(argText); - arg = context.consumeArg().tokens; - } - if (!(exists && skipIfExists)) context.macros.set(name, { - tokens: arg, - numArgs - }); - return ""; - }; - defineMacro("\\newcommand", (context) => newcommand(context, false, true, false)); - defineMacro("\\renewcommand", (context) => newcommand(context, true, false, false)); - defineMacro("\\providecommand", (context) => newcommand(context, true, true, true)); - defineMacro("\\message", (context) => { - var arg = context.consumeArgs(1)[0]; - console.log(arg.reverse().map((token) => token.text).join("")); - return ""; - }); - defineMacro("\\errmessage", (context) => { - var arg = context.consumeArgs(1)[0]; - console.error(arg.reverse().map((token) => token.text).join("")); - return ""; - }); - defineMacro("\\show", (context) => { - var tok = context.popToken(); - var name = tok.text; - console.log(tok, context.macros.get(name), functions[name], symbols.math[name], symbols.text[name]); - return ""; - }); - defineMacro("\\bgroup", "{"); - defineMacro("\\egroup", "}"); - defineMacro("~", "\\nobreakspace"); - defineMacro("\\lq", "`"); - defineMacro("\\rq", "'"); - defineMacro("\\aa", "\\r a"); - defineMacro("\\AA", "\\r A"); - defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"); - defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"); - defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"); - defineMacro("ℬ", "\\mathscr{B}"); - defineMacro("ℰ", "\\mathscr{E}"); - defineMacro("ℱ", "\\mathscr{F}"); - defineMacro("ℋ", "\\mathscr{H}"); - defineMacro("ℐ", "\\mathscr{I}"); - defineMacro("ℒ", "\\mathscr{L}"); - defineMacro("ℳ", "\\mathscr{M}"); - defineMacro("ℛ", "\\mathscr{R}"); - defineMacro("ℭ", "\\mathfrak{C}"); - defineMacro("ℌ", "\\mathfrak{H}"); - defineMacro("ℨ", "\\mathfrak{Z}"); - defineMacro("\\Bbbk", "\\Bbb{k}"); - defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); - defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); - defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); - defineMacro("\\mathstrut", "\\vphantom{(}"); - defineMacro("\\underbar", "\\underline{\\text{#1}}"); - defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char\"338}"); - defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"); - defineMacro("\\ne", "\\neq"); - defineMacro("≠", "\\neq"); - defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"); - defineMacro("∉", "\\notin"); - defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"); - defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"); - defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"); - defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"); - defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"); - defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"); - defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"); - defineMacro("⟂", "\\perp"); - defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}"); - defineMacro("∌", "\\notni"); - defineMacro("⌜", "\\ulcorner"); - defineMacro("⌝", "\\urcorner"); - defineMacro("⌞", "\\llcorner"); - defineMacro("⌟", "\\lrcorner"); - defineMacro("©", "\\copyright"); - defineMacro("®", "\\textregistered"); - defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}"); - defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}"); - defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}"); - defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}"); - defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}"); - defineMacro("⋮", "\\vdots"); - defineMacro("\\varGamma", "\\mathit{\\Gamma}"); - defineMacro("\\varDelta", "\\mathit{\\Delta}"); - defineMacro("\\varTheta", "\\mathit{\\Theta}"); - defineMacro("\\varLambda", "\\mathit{\\Lambda}"); - defineMacro("\\varXi", "\\mathit{\\Xi}"); - defineMacro("\\varPi", "\\mathit{\\Pi}"); - defineMacro("\\varSigma", "\\mathit{\\Sigma}"); - defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"); - defineMacro("\\varPhi", "\\mathit{\\Phi}"); - defineMacro("\\varPsi", "\\mathit{\\Psi}"); - defineMacro("\\varOmega", "\\mathit{\\Omega}"); - defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"); - defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"); - defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); - defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"); - defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"); - defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); - defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"); - defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}"); - var dotsByToken = { - ",": "\\dotsc", - "\\not": "\\dotsb", - "+": "\\dotsb", - "=": "\\dotsb", - "<": "\\dotsb", - ">": "\\dotsb", - "-": "\\dotsb", - "*": "\\dotsb", - ":": "\\dotsb", - "\\DOTSB": "\\dotsb", - "\\coprod": "\\dotsb", - "\\bigvee": "\\dotsb", - "\\bigwedge": "\\dotsb", - "\\biguplus": "\\dotsb", - "\\bigcap": "\\dotsb", - "\\bigcup": "\\dotsb", - "\\prod": "\\dotsb", - "\\sum": "\\dotsb", - "\\bigotimes": "\\dotsb", - "\\bigoplus": "\\dotsb", - "\\bigodot": "\\dotsb", - "\\bigsqcup": "\\dotsb", - "\\And": "\\dotsb", - "\\longrightarrow": "\\dotsb", - "\\Longrightarrow": "\\dotsb", - "\\longleftarrow": "\\dotsb", - "\\Longleftarrow": "\\dotsb", - "\\longleftrightarrow": "\\dotsb", - "\\Longleftrightarrow": "\\dotsb", - "\\mapsto": "\\dotsb", - "\\longmapsto": "\\dotsb", - "\\hookrightarrow": "\\dotsb", - "\\doteq": "\\dotsb", - "\\mathbin": "\\dotsb", - "\\mathrel": "\\dotsb", - "\\relbar": "\\dotsb", - "\\Relbar": "\\dotsb", - "\\xrightarrow": "\\dotsb", - "\\xleftarrow": "\\dotsb", - "\\DOTSI": "\\dotsi", - "\\int": "\\dotsi", - "\\oint": "\\dotsi", - "\\iint": "\\dotsi", - "\\iiint": "\\dotsi", - "\\iiiint": "\\dotsi", - "\\idotsint": "\\dotsi", - "\\DOTSX": "\\dotsx" - }; - var dotsbGroups = /* @__PURE__ */ new Set(["bin", "rel"]); - defineMacro("\\dots", function(context) { - var thedots = "\\dotso"; - var next = context.expandAfterFuture().text; - if (next in dotsByToken) thedots = dotsByToken[next]; - else if (next.slice(0, 4) === "\\not") thedots = "\\dotsb"; - else if (next in symbols.math) { - if (dotsbGroups.has(symbols.math[next].group)) thedots = "\\dotsb"; - } - return thedots; - }); - var spaceAfterDots = { - ")": true, - "]": true, - "\\rbrack": true, - "\\}": true, - "\\rbrace": true, - "\\rangle": true, - "\\rceil": true, - "\\rfloor": true, - "\\rgroup": true, - "\\rmoustache": true, - "\\right": true, - "\\bigr": true, - "\\biggr": true, - "\\Bigr": true, - "\\Biggr": true, - "$": true, - ";": true, - ".": true, - ",": true - }; - defineMacro("\\dotso", function(context) { - if (context.future().text in spaceAfterDots) return "\\ldots\\,"; - else return "\\ldots"; - }); - defineMacro("\\dotsc", function(context) { - var next = context.future().text; - if (next in spaceAfterDots && next !== ",") return "\\ldots\\,"; - else return "\\ldots"; - }); - defineMacro("\\cdots", function(context) { - if (context.future().text in spaceAfterDots) return "\\@cdots\\,"; - else return "\\@cdots"; - }); - defineMacro("\\dotsb", "\\cdots"); - defineMacro("\\dotsm", "\\cdots"); - defineMacro("\\dotsi", "\\!\\cdots"); - defineMacro("\\dotsx", "\\ldots\\,"); - defineMacro("\\DOTSI", "\\relax"); - defineMacro("\\DOTSB", "\\relax"); - defineMacro("\\DOTSX", "\\relax"); - defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"); - defineMacro("\\,", "\\tmspace+{3mu}{.1667em}"); - defineMacro("\\thinspace", "\\,"); - defineMacro("\\>", "\\mskip{4mu}"); - defineMacro("\\:", "\\tmspace+{4mu}{.2222em}"); - defineMacro("\\medspace", "\\:"); - defineMacro("\\;", "\\tmspace+{5mu}{.2777em}"); - defineMacro("\\thickspace", "\\;"); - defineMacro("\\!", "\\tmspace-{3mu}{.1667em}"); - defineMacro("\\negthinspace", "\\!"); - defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}"); - defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}"); - defineMacro("\\enspace", "\\kern.5em "); - defineMacro("\\enskip", "\\hskip.5em\\relax"); - defineMacro("\\quad", "\\hskip1em\\relax"); - defineMacro("\\qquad", "\\hskip2em\\relax"); - defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren"); - defineMacro("\\tag@paren", "\\tag@literal{({#1})}"); - defineMacro("\\tag@literal", (context) => { - if (context.macros.get("\\df@tag")) throw new ParseError("Multiple \\tag"); - return "\\gdef\\df@tag{\\text{#1}}"; - }); - defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"); - defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"); - defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}"); - defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"); - defineMacro("\\newline", "\\\\\\relax"); - defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}"); - var latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - .7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]); - defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); - defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); - defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace"); - defineMacro("\\@hspace", "\\hskip #1\\relax"); - defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax"); - defineMacro("\\ordinarycolon", ":"); - defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"); - defineMacro("\\dblcolon", "\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char\"2237}}"); - defineMacro("\\coloneqq", "\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char\"2254}}"); - defineMacro("\\Coloneqq", "\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char\"2237\\char\"3d}}"); - defineMacro("\\coloneq", "\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char\"3a\\char\"2212}}"); - defineMacro("\\Coloneq", "\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char\"2237\\char\"2212}}"); - defineMacro("\\eqqcolon", "\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char\"2255}}"); - defineMacro("\\Eqqcolon", "\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char\"3d\\char\"2237}}"); - defineMacro("\\eqcolon", "\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char\"2239}}"); - defineMacro("\\Eqcolon", "\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char\"2212\\char\"2237}}"); - defineMacro("\\colonapprox", "\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char\"3a\\char\"2248}}"); - defineMacro("\\Colonapprox", "\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char\"2237\\char\"2248}}"); - defineMacro("\\colonsim", "\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char\"3a\\char\"223c}}"); - defineMacro("\\Colonsim", "\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char\"2237\\char\"223c}}"); - defineMacro("∷", "\\dblcolon"); - defineMacro("∹", "\\eqcolon"); - defineMacro("≔", "\\coloneqq"); - defineMacro("≕", "\\eqqcolon"); - defineMacro("⩴", "\\Coloneqq"); - defineMacro("\\ratio", "\\vcentcolon"); - defineMacro("\\coloncolon", "\\dblcolon"); - defineMacro("\\colonequals", "\\coloneqq"); - defineMacro("\\coloncolonequals", "\\Coloneqq"); - defineMacro("\\equalscolon", "\\eqqcolon"); - defineMacro("\\equalscoloncolon", "\\Eqqcolon"); - defineMacro("\\colonminus", "\\coloneq"); - defineMacro("\\coloncolonminus", "\\Coloneq"); - defineMacro("\\minuscolon", "\\eqcolon"); - defineMacro("\\minuscoloncolon", "\\Eqcolon"); - defineMacro("\\coloncolonapprox", "\\Colonapprox"); - defineMacro("\\coloncolonsim", "\\Colonsim"); - defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); - defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"); - defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); - defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"); - defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"); - defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}"); - defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}"); - defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}"); - defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}"); - defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}"); - defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}"); - defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}"); - defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}"); - defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}"); - defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}"); - defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}"); - defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}"); - defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{≰}"); - defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}"); - defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}"); - defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}"); - defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}"); - defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}"); - defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}"); - defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}"); - defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}"); - defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}"); - defineMacro("\\imath", "\\html@mathml{\\@imath}{ı}"); - defineMacro("\\jmath", "\\html@mathml{\\@jmath}{ȷ}"); - defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"); - defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"); - defineMacro("⟦", "\\llbracket"); - defineMacro("⟧", "\\rrbracket"); - defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"); - defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"); - defineMacro("↤", "\\mapsfrom"); - defineMacro("\\mapsfrom", "\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"); - defineMacro("⦃", "\\lBrace"); - defineMacro("⦄", "\\rBrace"); - defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"); - defineMacro("⦵", "\\minuso"); - defineMacro("\\darr", "\\downarrow"); - defineMacro("\\dArr", "\\Downarrow"); - defineMacro("\\Darr", "\\Downarrow"); - defineMacro("\\lang", "\\langle"); - defineMacro("\\rang", "\\rangle"); - defineMacro("\\uarr", "\\uparrow"); - defineMacro("\\uArr", "\\Uparrow"); - defineMacro("\\Uarr", "\\Uparrow"); - defineMacro("\\N", "\\mathbb{N}"); - defineMacro("\\R", "\\mathbb{R}"); - defineMacro("\\Z", "\\mathbb{Z}"); - defineMacro("\\alef", "\\aleph"); - defineMacro("\\alefsym", "\\aleph"); - defineMacro("\\Alpha", "\\mathrm{A}"); - defineMacro("\\Beta", "\\mathrm{B}"); - defineMacro("\\bull", "\\bullet"); - defineMacro("\\Chi", "\\mathrm{X}"); - defineMacro("\\clubs", "\\clubsuit"); - defineMacro("\\cnums", "\\mathbb{C}"); - defineMacro("\\Complex", "\\mathbb{C}"); - defineMacro("\\Dagger", "\\ddagger"); - defineMacro("\\diamonds", "\\diamondsuit"); - defineMacro("\\empty", "\\emptyset"); - defineMacro("\\Epsilon", "\\mathrm{E}"); - defineMacro("\\Eta", "\\mathrm{H}"); - defineMacro("\\exist", "\\exists"); - defineMacro("\\harr", "\\leftrightarrow"); - defineMacro("\\hArr", "\\Leftrightarrow"); - defineMacro("\\Harr", "\\Leftrightarrow"); - defineMacro("\\hearts", "\\heartsuit"); - defineMacro("\\image", "\\Im"); - defineMacro("\\infin", "\\infty"); - defineMacro("\\Iota", "\\mathrm{I}"); - defineMacro("\\isin", "\\in"); - defineMacro("\\Kappa", "\\mathrm{K}"); - defineMacro("\\larr", "\\leftarrow"); - defineMacro("\\lArr", "\\Leftarrow"); - defineMacro("\\Larr", "\\Leftarrow"); - defineMacro("\\lrarr", "\\leftrightarrow"); - defineMacro("\\lrArr", "\\Leftrightarrow"); - defineMacro("\\Lrarr", "\\Leftrightarrow"); - defineMacro("\\Mu", "\\mathrm{M}"); - defineMacro("\\natnums", "\\mathbb{N}"); - defineMacro("\\Nu", "\\mathrm{N}"); - defineMacro("\\Omicron", "\\mathrm{O}"); - defineMacro("\\plusmn", "\\pm"); - defineMacro("\\rarr", "\\rightarrow"); - defineMacro("\\rArr", "\\Rightarrow"); - defineMacro("\\Rarr", "\\Rightarrow"); - defineMacro("\\real", "\\Re"); - defineMacro("\\reals", "\\mathbb{R}"); - defineMacro("\\Reals", "\\mathbb{R}"); - defineMacro("\\Rho", "\\mathrm{P}"); - defineMacro("\\sdot", "\\cdot"); - defineMacro("\\sect", "\\S"); - defineMacro("\\spades", "\\spadesuit"); - defineMacro("\\sub", "\\subset"); - defineMacro("\\sube", "\\subseteq"); - defineMacro("\\supe", "\\supseteq"); - defineMacro("\\Tau", "\\mathrm{T}"); - defineMacro("\\thetasym", "\\vartheta"); - defineMacro("\\weierp", "\\wp"); - defineMacro("\\Zeta", "\\mathrm{Z}"); - defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}"); - defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}"); - defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits"); - defineMacro("\\bra", "\\mathinner{\\langle{#1}|}"); - defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}"); - defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); - defineMacro("\\Bra", "\\left\\langle#1\\right|"); - defineMacro("\\Ket", "\\left|#1\\right\\rangle"); - var braketHelper = (one) => (context) => { - var left = context.consumeArg().tokens; - var middle = context.consumeArg().tokens; - var middleDouble = context.consumeArg().tokens; - var right = context.consumeArg().tokens; - var oldMiddle = context.macros.get("|"); - var oldMiddleDouble = context.macros.get("\\|"); - context.macros.beginGroup(); - var midMacro = (double) => (context) => { - if (one) { - context.macros.set("|", oldMiddle); - if (middleDouble.length) context.macros.set("\\|", oldMiddleDouble); - } - var doubled = double; - if (!double && middleDouble.length) { - if (context.future().text === "|") { - context.popToken(); - doubled = true; - } - } - return { - tokens: doubled ? middleDouble : middle, - numArgs: 0 - }; - }; - context.macros.set("|", midMacro(false)); - if (middleDouble.length) context.macros.set("\\|", midMacro(true)); - var arg = context.consumeArg().tokens; - var expanded = context.expandTokens([ - ...right, - ...arg, - ...left - ]); - context.macros.endGroup(); - return { - tokens: expanded.reverse(), - numArgs: 0 - }; - }; - defineMacro("\\bra@ket", braketHelper(false)); - defineMacro("\\bra@set", braketHelper(true)); - defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"); - defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"); - defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); - defineMacro("\\angln", "{\\angl n}"); - defineMacro("\\blue", "\\textcolor{##6495ed}{#1}"); - defineMacro("\\orange", "\\textcolor{##ffa500}{#1}"); - defineMacro("\\pink", "\\textcolor{##ff00af}{#1}"); - defineMacro("\\red", "\\textcolor{##df0030}{#1}"); - defineMacro("\\green", "\\textcolor{##28ae7b}{#1}"); - defineMacro("\\gray", "\\textcolor{gray}{#1}"); - defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}"); - defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}"); - defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}"); - defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}"); - defineMacro("\\blueD", "\\textcolor{##11accd}{#1}"); - defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}"); - defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}"); - defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}"); - defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}"); - defineMacro("\\tealD", "\\textcolor{##01a995}{#1}"); - defineMacro("\\tealE", "\\textcolor{##208170}{#1}"); - defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}"); - defineMacro("\\greenB", "\\textcolor{##8af281}{#1}"); - defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}"); - defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}"); - defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}"); - defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}"); - defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}"); - defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}"); - defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}"); - defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}"); - defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}"); - defineMacro("\\redB", "\\textcolor{##ff8482}{#1}"); - defineMacro("\\redC", "\\textcolor{##f9685d}{#1}"); - defineMacro("\\redD", "\\textcolor{##e84d39}{#1}"); - defineMacro("\\redE", "\\textcolor{##bc2612}{#1}"); - defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}"); - defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}"); - defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}"); - defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}"); - defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}"); - defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}"); - defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}"); - defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}"); - defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}"); - defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}"); - defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}"); - defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}"); - defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}"); - defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}"); - defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}"); - defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}"); - defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}"); - defineMacro("\\grayE", "\\textcolor{##babec2}{#1}"); - defineMacro("\\grayF", "\\textcolor{##888d93}{#1}"); - defineMacro("\\grayG", "\\textcolor{##626569}{#1}"); - defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}"); - defineMacro("\\grayI", "\\textcolor{##21242c}{#1}"); - defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}"); - defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}"); - /** - * This file contains the “gullet” where macros are expanded - * until only non-macro tokens remain. - */ - var implicitCommands = { - "^": true, - "_": true, - "\\limits": true, - "\\nolimits": true - }; - var MacroExpander = class { - constructor(input, settings, mode) { - this.settings = void 0; - this.expansionCount = void 0; - this.lexer = void 0; - this.macros = void 0; - this.stack = void 0; - this.mode = void 0; - this.settings = settings; - this.expansionCount = 0; - this.feed(input); - this.macros = new Namespace(macros, settings.macros); - this.mode = mode; - this.stack = []; - } - /** - * Feed a new input string to the same MacroExpander - * (with existing macros etc.). - */ - feed(input) { - this.lexer = new Lexer(input, this.settings); - } - /** - * Switches between "text" and "math" modes. - */ - switchMode(newMode) { - this.mode = newMode; - } - /** - * Start a new group nesting within all namespaces. - */ - beginGroup() { - this.macros.beginGroup(); - } - /** - * End current group nesting within all namespaces. - */ - endGroup() { - this.macros.endGroup(); - } - /** - * Ends all currently nested groups (if any), restoring values before the - * groups began. Useful in case of an error in the middle of parsing. - */ - endGroups() { - this.macros.endGroups(); - } - /** - * Returns the topmost token on the stack, without expanding it. - * Similar in behavior to TeX's `\futurelet`. - */ - future() { - if (this.stack.length === 0) this.pushToken(this.lexer.lex()); - return this.stack[this.stack.length - 1]; - } - /** - * Remove and return the next unexpanded token. - */ - popToken() { - this.future(); - return this.stack.pop(); - } - /** - * Add a given token to the token stack. In particular, this get be used - * to put back a token returned from one of the other methods. - */ - pushToken(token) { - this.stack.push(token); - } - /** - * Append an array of tokens to the token stack. - */ - pushTokens(tokens) { - this.stack.push(...tokens); - } - /** - * Find an macro argument without expanding tokens and append the array of - * tokens to the token stack. Uses Token as a container for the result. - */ - scanArgument(isOptional) { - var start; - var end; - var tokens; - if (isOptional) { - this.consumeSpaces(); - if (this.future().text !== "[") return null; - start = this.popToken(); - var _this$consumeArg = this.consumeArg(["]"]); - tokens = _this$consumeArg.tokens; - end = _this$consumeArg.end; - } else { - var _this$consumeArg2 = this.consumeArg(); - tokens = _this$consumeArg2.tokens; - start = _this$consumeArg2.start; - end = _this$consumeArg2.end; - } - this.pushToken(new Token("EOF", end.loc)); - this.pushTokens(tokens); - return new Token("", SourceLocation.range(start, end)); - } - /** - * Consume all following space tokens, without expansion. - */ - consumeSpaces() { - for (;;) if (this.future().text === " ") this.stack.pop(); - else break; - } - /** - * Consume an argument from the token stream, and return the resulting array - * of tokens and start/end token. - */ - consumeArg(delims) { - var tokens = []; - var isDelimited = delims && delims.length > 0; - if (!isDelimited) this.consumeSpaces(); - var start = this.future(); - var tok; - var depth = 0; - var match = 0; - do { - tok = this.popToken(); - tokens.push(tok); - if (tok.text === "{") ++depth; - else if (tok.text === "}") { - --depth; - if (depth === -1) throw new ParseError("Extra }", tok); - } else if (tok.text === "EOF") throw new ParseError("Unexpected end of input in a macro argument, expected '" + (delims && isDelimited ? delims[match] : "}") + "'", tok); - if (delims && isDelimited) { - if ((depth === 0 || depth === 1 && delims[match] === "{") && tok.text === delims[match]) { - ++match; - if (match === delims.length) { - tokens.splice(-match, match); - break; - } - } else match = 0; - } - } while (depth !== 0 || isDelimited); - if (start.text === "{" && tokens[tokens.length - 1].text === "}") { - tokens.pop(); - tokens.shift(); - } - tokens.reverse(); - return { - tokens, - start, - end: tok - }; - } - /** - * Consume the specified number of (delimited) arguments from the token - * stream and return the resulting array of arguments. - */ - consumeArgs(numArgs, delimiters) { - if (delimiters) { - if (delimiters.length !== numArgs + 1) throw new ParseError("The length of delimiters doesn't match the number of args!"); - var delims = delimiters[0]; - for (var i = 0; i < delims.length; i++) { - var tok = this.popToken(); - if (delims[i] !== tok.text) throw new ParseError("Use of the macro doesn't match its definition", tok); - } - } - var args = []; - for (var _i = 0; _i < numArgs; _i++) args.push(this.consumeArg(delimiters && delimiters[_i + 1]).tokens); - return args; - } - /** - * Increment `expansionCount` by the specified amount. - * Throw an error if it exceeds `maxExpand`. - */ - countExpansion(amount) { - this.expansionCount += amount; - if (this.expansionCount > this.settings.maxExpand) throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting"); - } - /** - * Expand the next token only once if possible. - * - * If the token is expanded, the resulting tokens will be pushed onto - * the stack in reverse order, and the number of such tokens will be - * returned. This number might be zero or positive. - * - * If not, the return value is `false`, and the next token remains at the - * top of the stack. - * - * In either case, the next token will be on the top of the stack, - * or the stack will be empty (in case of empty expansion - * and no other tokens). - * - * Used to implement `expandAfterFuture` and `expandNextToken`. - * - * If expandableOnly, only expandable tokens are expanded and - * an undefined control sequence results in an error. - */ - expandOnce(expandableOnly) { - var topToken = this.popToken(); - var name = topToken.text; - var expansion = !topToken.noexpand ? this._getExpansion(name) : null; - if (expansion == null || expandableOnly && expansion.unexpandable) { - if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) throw new ParseError("Undefined control sequence: " + name); - this.pushToken(topToken); - return false; - } - this.countExpansion(1); - var tokens = expansion.tokens; - var args = this.consumeArgs(expansion.numArgs, expansion.delimiters); - if (expansion.numArgs) { - tokens = tokens.slice(); - for (var i = tokens.length - 1; i >= 0; --i) { - var tok = tokens[i]; - if (tok.text === "#") { - if (i === 0) throw new ParseError("Incomplete placeholder at end of macro body", tok); - tok = tokens[--i]; - if (tok.text === "#") tokens.splice(i + 1, 1); - else if (/^[1-9]$/.test(tok.text)) tokens.splice(i, 2, ...args[+tok.text - 1]); - else throw new ParseError("Not a valid argument number", tok); - } - } - } - this.pushTokens(tokens); - return tokens.length; - } - /** - * Expand the next token only once (if possible), and return the resulting - * top token on the stack (without removing anything from the stack). - * Similar in behavior to TeX's `\expandafter\futurelet`. - * Equivalent to expandOnce() followed by future(). - */ - expandAfterFuture() { - this.expandOnce(); - return this.future(); - } - /** - * Recursively expand first token, then return first non-expandable token. - */ - expandNextToken() { - for (;;) if (this.expandOnce() === false) { - var token = this.stack.pop(); - if (token.treatAsRelax) token.text = "\\relax"; - return token; - } - } - /** - * Fully expand the given macro name and return the resulting list of - * tokens, or return `undefined` if no such macro is defined. - */ - expandMacro(name) { - return this.macros.has(name) ? this.expandTokens([new Token(name)]) : void 0; - } - /** - * Fully expand the given token stream and return the resulting list of - * tokens. Note that the input tokens are in reverse order, but the - * output tokens are in forward order. - */ - expandTokens(tokens) { - var output = []; - var oldStackLength = this.stack.length; - this.pushTokens(tokens); - while (this.stack.length > oldStackLength) if (this.expandOnce(true) === false) { - var token = this.stack.pop(); - if (token.treatAsRelax) { - token.noexpand = false; - token.treatAsRelax = false; - } - output.push(token); - } - this.countExpansion(output.length); - return output; - } - /** - * Fully expand the given macro name and return the result as a string, - * or return `undefined` if no such macro is defined. - */ - expandMacroAsText(name) { - var tokens = this.expandMacro(name); - if (tokens) return tokens.map((token) => token.text).join(""); - else return tokens; - } - /** - * Returns the expanded macro as a reversed array of tokens and a macro - * argument count. Or returns `null` if no such macro. - */ - _getExpansion(name) { - var definition = this.macros.get(name); - if (definition == null) return definition; - if (name.length === 1) { - var catcode = this.lexer.catcodes[name]; - if (catcode != null && catcode !== 13) return; - } - var expansion = typeof definition === "function" ? definition(this) : definition; - if (typeof expansion === "string") { - var numArgs = 0; - if (expansion.includes("#")) { - var stripped = expansion.replace(/##/g, ""); - while (stripped.includes("#" + (numArgs + 1))) ++numArgs; - } - var bodyLexer = new Lexer(expansion, this.settings); - var tokens = []; - var tok = bodyLexer.lex(); - while (tok.text !== "EOF") { - tokens.push(tok); - tok = bodyLexer.lex(); - } - tokens.reverse(); - return { - tokens, - numArgs - }; - } - return expansion; - } - /** - * Determine whether a command is currently "defined" (has some - * functionality), meaning that it's a macro (in the current group), - * a function, a symbol, or one of the special commands listed in - * `implicitCommands`. - */ - isDefined(name) { - return this.macros.has(name) || Object.prototype.hasOwnProperty.call(functions, name) || Object.prototype.hasOwnProperty.call(symbols.math, name) || Object.prototype.hasOwnProperty.call(symbols.text, name) || Object.prototype.hasOwnProperty.call(implicitCommands, name); - } - /** - * Determine whether a command is expandable. - */ - isExpandable(name) { - var macro = this.macros.get(name); - if (macro != null) return typeof macro === "string" || typeof macro === "function" || !macro.unexpandable; - return Object.prototype.hasOwnProperty.call(functions, name) && !functions[name].primitive; - } - }; - var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; - var uSubsAndSups = Object.freeze({ - "₊": "+", - "₋": "-", - "₌": "=", - "₍": "(", - "₎": ")", - "₀": "0", - "₁": "1", - "₂": "2", - "₃": "3", - "₄": "4", - "₅": "5", - "₆": "6", - "₇": "7", - "₈": "8", - "₉": "9", - "ₐ": "a", - "ₑ": "e", - "ₕ": "h", - "ᵢ": "i", - "ⱼ": "j", - "ₖ": "k", - "ₗ": "l", - "ₘ": "m", - "ₙ": "n", - "ₒ": "o", - "ₚ": "p", - "ᵣ": "r", - "ₛ": "s", - "ₜ": "t", - "ᵤ": "u", - "ᵥ": "v", - "ₓ": "x", - "ᵦ": "β", - "ᵧ": "γ", - "ᵨ": "ρ", - "ᵩ": "ϕ", - "ᵪ": "χ", - "⁺": "+", - "⁻": "-", - "⁼": "=", - "⁽": "(", - "⁾": ")", - "⁰": "0", - "¹": "1", - "²": "2", - "³": "3", - "⁴": "4", - "⁵": "5", - "⁶": "6", - "⁷": "7", - "⁸": "8", - "⁹": "9", - "ᴬ": "A", - "ᴮ": "B", - "ᴰ": "D", - "ᴱ": "E", - "ᴳ": "G", - "ᴴ": "H", - "ᴵ": "I", - "ᴶ": "J", - "ᴷ": "K", - "ᴸ": "L", - "ᴹ": "M", - "ᴺ": "N", - "ᴼ": "O", - "ᴾ": "P", - "ᴿ": "R", - "ᵀ": "T", - "ᵁ": "U", - "ⱽ": "V", - "ᵂ": "W", - "ᵃ": "a", - "ᵇ": "b", - "ᶜ": "c", - "ᵈ": "d", - "ᵉ": "e", - "ᶠ": "f", - "ᵍ": "g", - "ʰ": "h", - "ⁱ": "i", - "ʲ": "j", - "ᵏ": "k", - "ˡ": "l", - "ᵐ": "m", - "ⁿ": "n", - "ᵒ": "o", - "ᵖ": "p", - "ʳ": "r", - "ˢ": "s", - "ᵗ": "t", - "ᵘ": "u", - "ᵛ": "v", - "ʷ": "w", - "ˣ": "x", - "ʸ": "y", - "ᶻ": "z", - "ᵝ": "β", - "ᵞ": "γ", - "ᵟ": "δ", - "ᵠ": "ϕ", - "ᵡ": "χ", - "ᶿ": "θ" - }); - var unicodeAccents = { - "́": { - "text": "\\'", - "math": "\\acute" - }, - "̀": { - "text": "\\`", - "math": "\\grave" - }, - "̈": { - "text": "\\\"", - "math": "\\ddot" - }, - "̃": { - "text": "\\~", - "math": "\\tilde" - }, - "̄": { - "text": "\\=", - "math": "\\bar" - }, - "̆": { - "text": "\\u", - "math": "\\breve" - }, - "̌": { - "text": "\\v", - "math": "\\check" - }, - "̂": { - "text": "\\^", - "math": "\\hat" - }, - "̇": { - "text": "\\.", - "math": "\\dot" - }, - "̊": { - "text": "\\r", - "math": "\\mathring" - }, - "̋": { "text": "\\H" }, - "̧": { "text": "\\c" } - }; - var unicodeSymbols = { - "á": "á", - "à": "à", - "ä": "ä", - "ǟ": "ǟ", - "ã": "ã", - "ā": "ā", - "ă": "ă", - "ắ": "ắ", - "ằ": "ằ", - "ẵ": "ẵ", - "ǎ": "ǎ", - "â": "â", - "ấ": "ấ", - "ầ": "ầ", - "ẫ": "ẫ", - "ȧ": "ȧ", - "ǡ": "ǡ", - "å": "å", - "ǻ": "ǻ", - "ḃ": "ḃ", - "ć": "ć", - "ḉ": "ḉ", - "č": "č", - "ĉ": "ĉ", - "ċ": "ċ", - "ç": "ç", - "ď": "ď", - "ḋ": "ḋ", - "ḑ": "ḑ", - "é": "é", - "è": "è", - "ë": "ë", - "ẽ": "ẽ", - "ē": "ē", - "ḗ": "ḗ", - "ḕ": "ḕ", - "ĕ": "ĕ", - "ḝ": "ḝ", - "ě": "ě", - "ê": "ê", - "ế": "ế", - "ề": "ề", - "ễ": "ễ", - "ė": "ė", - "ȩ": "ȩ", - "ḟ": "ḟ", - "ǵ": "ǵ", - "ḡ": "ḡ", - "ğ": "ğ", - "ǧ": "ǧ", - "ĝ": "ĝ", - "ġ": "ġ", - "ģ": "ģ", - "ḧ": "ḧ", - "ȟ": "ȟ", - "ĥ": "ĥ", - "ḣ": "ḣ", - "ḩ": "ḩ", - "í": "í", - "ì": "ì", - "ï": "ï", - "ḯ": "ḯ", - "ĩ": "ĩ", - "ī": "ī", - "ĭ": "ĭ", - "ǐ": "ǐ", - "î": "î", - "ǰ": "ǰ", - "ĵ": "ĵ", - "ḱ": "ḱ", - "ǩ": "ǩ", - "ķ": "ķ", - "ĺ": "ĺ", - "ľ": "ľ", - "ļ": "ļ", - "ḿ": "ḿ", - "ṁ": "ṁ", - "ń": "ń", - "ǹ": "ǹ", - "ñ": "ñ", - "ň": "ň", - "ṅ": "ṅ", - "ņ": "ņ", - "ó": "ó", - "ò": "ò", - "ö": "ö", - "ȫ": "ȫ", - "õ": "õ", - "ṍ": "ṍ", - "ṏ": "ṏ", - "ȭ": "ȭ", - "ō": "ō", - "ṓ": "ṓ", - "ṑ": "ṑ", - "ŏ": "ŏ", - "ǒ": "ǒ", - "ô": "ô", - "ố": "ố", - "ồ": "ồ", - "ỗ": "ỗ", - "ȯ": "ȯ", - "ȱ": "ȱ", - "ő": "ő", - "ṕ": "ṕ", - "ṗ": "ṗ", - "ŕ": "ŕ", - "ř": "ř", - "ṙ": "ṙ", - "ŗ": "ŗ", - "ś": "ś", - "ṥ": "ṥ", - "š": "š", - "ṧ": "ṧ", - "ŝ": "ŝ", - "ṡ": "ṡ", - "ş": "ş", - "ẗ": "ẗ", - "ť": "ť", - "ṫ": "ṫ", - "ţ": "ţ", - "ú": "ú", - "ù": "ù", - "ü": "ü", - "ǘ": "ǘ", - "ǜ": "ǜ", - "ǖ": "ǖ", - "ǚ": "ǚ", - "ũ": "ũ", - "ṹ": "ṹ", - "ū": "ū", - "ṻ": "ṻ", - "ŭ": "ŭ", - "ǔ": "ǔ", - "û": "û", - "ů": "ů", - "ű": "ű", - "ṽ": "ṽ", - "ẃ": "ẃ", - "ẁ": "ẁ", - "ẅ": "ẅ", - "ŵ": "ŵ", - "ẇ": "ẇ", - "ẘ": "ẘ", - "ẍ": "ẍ", - "ẋ": "ẋ", - "ý": "ý", - "ỳ": "ỳ", - "ÿ": "ÿ", - "ỹ": "ỹ", - "ȳ": "ȳ", - "ŷ": "ŷ", - "ẏ": "ẏ", - "ẙ": "ẙ", - "ź": "ź", - "ž": "ž", - "ẑ": "ẑ", - "ż": "ż", - "Á": "Á", - "À": "À", - "Ä": "Ä", - "Ǟ": "Ǟ", - "Ã": "Ã", - "Ā": "Ā", - "Ă": "Ă", - "Ắ": "Ắ", - "Ằ": "Ằ", - "Ẵ": "Ẵ", - "Ǎ": "Ǎ", - "Â": "Â", - "Ấ": "Ấ", - "Ầ": "Ầ", - "Ẫ": "Ẫ", - "Ȧ": "Ȧ", - "Ǡ": "Ǡ", - "Å": "Å", - "Ǻ": "Ǻ", - "Ḃ": "Ḃ", - "Ć": "Ć", - "Ḉ": "Ḉ", - "Č": "Č", - "Ĉ": "Ĉ", - "Ċ": "Ċ", - "Ç": "Ç", - "Ď": "Ď", - "Ḋ": "Ḋ", - "Ḑ": "Ḑ", - "É": "É", - "È": "È", - "Ë": "Ë", - "Ẽ": "Ẽ", - "Ē": "Ē", - "Ḗ": "Ḗ", - "Ḕ": "Ḕ", - "Ĕ": "Ĕ", - "Ḝ": "Ḝ", - "Ě": "Ě", - "Ê": "Ê", - "Ế": "Ế", - "Ề": "Ề", - "Ễ": "Ễ", - "Ė": "Ė", - "Ȩ": "Ȩ", - "Ḟ": "Ḟ", - "Ǵ": "Ǵ", - "Ḡ": "Ḡ", - "Ğ": "Ğ", - "Ǧ": "Ǧ", - "Ĝ": "Ĝ", - "Ġ": "Ġ", - "Ģ": "Ģ", - "Ḧ": "Ḧ", - "Ȟ": "Ȟ", - "Ĥ": "Ĥ", - "Ḣ": "Ḣ", - "Ḩ": "Ḩ", - "Í": "Í", - "Ì": "Ì", - "Ï": "Ï", - "Ḯ": "Ḯ", - "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ẅ", - "Ŵ": "Ŵ", - "Ẇ": "Ẇ", - "Ẍ": "Ẍ", - "Ẋ": "Ẋ", - "Ý": "Ý", - "Ỳ": "Ỳ", - "Ÿ": "Ÿ", - "Ỹ": "Ỹ", - "Ȳ": "Ȳ", - "Ŷ": "Ŷ", - "Ẏ": "Ẏ", - "Ź": "Ź", - "Ž": "Ž", - "Ẑ": "Ẑ", - "Ż": "Ż", - "ά": "ά", - "ὰ": "ὰ", - "ᾱ": "ᾱ", - "ᾰ": "ᾰ", - "έ": "έ", - "ὲ": "ὲ", - "ή": "ή", - "ὴ": "ὴ", - "ί": "ί", - "ὶ": "ὶ", - "ϊ": "ϊ", - "ΐ": "ΐ", - "ῒ": "ῒ", - "ῑ": "ῑ", - "ῐ": "ῐ", - "ό": "ό", - "ὸ": "ὸ", - "ύ": "ύ", - "ὺ": "ὺ", - "ϋ": "ϋ", - "ΰ": "ΰ", - "ῢ": "ῢ", - "ῡ": "ῡ", - "ῠ": "ῠ", - "ώ": "ώ", - "ὼ": "ὼ", - "Ύ": "Ύ", - "Ὺ": "Ὺ", - "Ϋ": "Ϋ", - "Ῡ": "Ῡ", - "Ῠ": "Ῠ", - "Ώ": "Ώ", - "Ὼ": "Ὼ" - }; - /** - * This file contains the parser used to parse out a TeX expression from the - * input. Since TeX isn't context-free, standard parsers don't work particularly - * well. - * - * The strategy of this parser is as such: - * - * The main functions (the `.parse...` ones) take a position in the current - * parse string to parse tokens from. The lexer (found in Lexer.js, stored at - * this.gullet.lexer) also supports pulling out tokens at arbitrary places. When - * individual tokens are needed at a position, the lexer is called to pull out a - * token, which is then used. - * - * The parser has a property called "mode" indicating the mode that - * the parser is currently in. Currently it has to be one of "math" or - * "text", which denotes whether the current environment is a math-y - * one or a text-y one (e.g. inside \text). Currently, this serves to - * limit the functions which can be used in text mode. - * - * The main functions then return an object which contains the useful data that - * was parsed at its given point, and a new position at the end of the parsed - * data. The main functions can call each other and continue the parsing by - * using the returned position as a new starting point. - * - * There are also extra `.handle...` functions, which pull out some reused - * functionality into self-contained functions. - * - * The functions return ParseNodes. - */ - var Parser = class Parser { - constructor(input, settings) { - this.mode = void 0; - this.gullet = void 0; - this.settings = void 0; - this.leftrightDepth = void 0; - this.nextToken = void 0; - this.mode = "math"; - this.gullet = new MacroExpander(input, settings, this.mode); - this.settings = settings; - this.leftrightDepth = 0; - this.nextToken = null; - } - /** - * Checks a result to make sure it has the right type, and throws an - * appropriate error otherwise. - */ - expect(text, consume) { - if (consume === void 0) consume = true; - if (this.fetch().text !== text) throw new ParseError("Expected '" + text + "', got '" + this.fetch().text + "'", this.fetch()); - if (consume) this.consume(); - } - /** - * Discards the current lookahead token, considering it consumed. - */ - consume() { - this.nextToken = null; - } - /** - * Return the current lookahead token, or if there isn't one (at the - * beginning, or if the previous lookahead token was consume()d), - * fetch the next token as the new lookahead token and return it. - */ - fetch() { - if (this.nextToken == null) this.nextToken = this.gullet.expandNextToken(); - return this.nextToken; - } - /** - * Switches between "text" and "math" modes. - */ - switchMode(newMode) { - this.mode = newMode; - this.gullet.switchMode(newMode); - } - /** - * Main parsing function, which parses an entire input. - */ - parse() { - if (!this.settings.globalGroup) this.gullet.beginGroup(); - if (this.settings.colorIsTextColor) this.gullet.macros.set("\\color", "\\textcolor"); - try { - var parse = this.parseExpression(false); - this.expect("EOF"); - if (!this.settings.globalGroup) this.gullet.endGroup(); - return parse; - } finally { - this.gullet.endGroups(); - } - } - /** - * Fully parse a separate sequence of tokens as a separate job. - * Tokens should be specified in reverse order, as in a MacroDefinition. - */ - subparse(tokens) { - var oldToken = this.nextToken; - this.consume(); - this.gullet.pushToken(new Token("}")); - this.gullet.pushTokens(tokens); - var parse = this.parseExpression(false); - this.expect("}"); - this.nextToken = oldToken; - return parse; - } - /** - * Parses an "expression", which is a list of atoms. - * - * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This - * happens when functions have higher precedence than infix - * nodes in implicit parses. - * - * `breakOnTokenText`: The text of the token that the expression should end - * with, or `null` if something else should end the - * expression. - */ - parseExpression(breakOnInfix, breakOnTokenText) { - var body = []; - while (true) { - if (this.mode === "math") this.consumeSpaces(); - var lex = this.fetch(); - if (Parser.endOfExpression.has(lex.text)) break; - if (breakOnTokenText && lex.text === breakOnTokenText) break; - if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) break; - var atom = this.parseAtom(breakOnTokenText); - if (!atom) break; - else if (atom.type === "internal") continue; - body.push(atom); - } - if (this.mode === "text") this.formLigatures(body); - return this.handleInfixNodes(body); - } - /** - * Rewrites infix operators such as \over with corresponding commands such - * as \frac. - * - * There can only be one infix operator per group. If there's more than one - * then the expression is ambiguous. This can be resolved by adding {}. - */ - handleInfixNodes(body) { - var overIndex = -1; - var funcName; - for (var i = 0; i < body.length; i++) { - var node = body[i]; - if (node.type === "infix") { - if (overIndex !== -1) throw new ParseError("only one infix operator per group", node.token); - overIndex = i; - funcName = node.replaceWith; - } - } - if (overIndex !== -1 && funcName) { - var numerNode; - var denomNode; - var numerBody = body.slice(0, overIndex); - var denomBody = body.slice(overIndex + 1); - if (numerBody.length === 1 && numerBody[0].type === "ordgroup") numerNode = numerBody[0]; - else numerNode = { - type: "ordgroup", - mode: this.mode, - body: numerBody - }; - if (denomBody.length === 1 && denomBody[0].type === "ordgroup") denomNode = denomBody[0]; - else denomNode = { - type: "ordgroup", - mode: this.mode, - body: denomBody - }; - var _node; - if (funcName === "\\\\abovefrac") _node = this.callFunction(funcName, [ - numerNode, - body[overIndex], - denomNode - ], []); - else _node = this.callFunction(funcName, [numerNode, denomNode], []); - return [_node]; - } else return body; - } - /** - * Handle a subscript or superscript with nice errors. - */ - handleSupSubscript(name) { - var symbolToken = this.fetch(); - var symbol = symbolToken.text; - this.consume(); - this.consumeSpaces(); - var group; - do { - var _group; - group = this.parseGroup(name); - } while (((_group = group) == null ? void 0 : _group.type) === "internal"); - if (!group) throw new ParseError("Expected group after '" + symbol + "'", symbolToken); - return group; - } - /** - * Converts the textual input of an unsupported command into a text node - * contained within a color node whose color is determined by errorColor - */ - formatUnsupportedCmd(text) { - var textordArray = []; - for (var i = 0; i < text.length; i++) textordArray.push({ - type: "textord", - mode: "text", - text: text[i] - }); - var textNode = { - type: "text", - mode: this.mode, - body: textordArray - }; - return { - type: "color", - mode: this.mode, - color: this.settings.errorColor, - body: [textNode] - }; - } - /** - * Parses a group with optional super/subscripts. - */ - parseAtom(breakOnTokenText) { - var base = this.parseGroup("atom", breakOnTokenText); - if ((base == null ? void 0 : base.type) === "internal") return base; - if (this.mode === "text") return base; - var superscript; - var subscript; - while (true) { - this.consumeSpaces(); - var lex = this.fetch(); - if (lex.text === "\\limits" || lex.text === "\\nolimits") { - if (base && base.type === "op") { - base.limits = lex.text === "\\limits"; - base.alwaysHandleSupSub = true; - } else if (base && base.type === "operatorname") { - if (base.alwaysHandleSupSub) base.limits = lex.text === "\\limits"; - } else throw new ParseError("Limit controls must follow a math operator", lex); - this.consume(); - } else if (lex.text === "^") { - if (superscript) throw new ParseError("Double superscript", lex); - superscript = this.handleSupSubscript("superscript"); - } else if (lex.text === "_") { - if (subscript) throw new ParseError("Double subscript", lex); - subscript = this.handleSupSubscript("subscript"); - } else if (lex.text === "'") { - if (superscript) throw new ParseError("Double superscript", lex); - var prime = { - type: "textord", - mode: this.mode, - text: "\\prime" - }; - var primes = [prime]; - this.consume(); - while (this.fetch().text === "'") { - primes.push(prime); - this.consume(); - } - if (this.fetch().text === "^") primes.push(this.handleSupSubscript("superscript")); - superscript = { - type: "ordgroup", - mode: this.mode, - body: primes - }; - } else if (uSubsAndSups[lex.text]) { - var isSub = unicodeSubRegEx.test(lex.text); - var subsupTokens = []; - subsupTokens.push(new Token(uSubsAndSups[lex.text])); - this.consume(); - while (true) { - var token = this.fetch().text; - if (!uSubsAndSups[token]) break; - if (unicodeSubRegEx.test(token) !== isSub) break; - subsupTokens.unshift(new Token(uSubsAndSups[token])); - this.consume(); - } - var body = this.subparse(subsupTokens); - if (isSub) subscript = { - type: "ordgroup", - mode: "math", - body - }; - else superscript = { - type: "ordgroup", - mode: "math", - body - }; - } else break; - } - if (superscript && subscript) return { - type: "supsub", - mode: this.mode, - base, - sup: superscript, - sub: subscript - }; - else if (superscript) return { - type: "supsub", - mode: this.mode, - base, - sup: superscript - }; - else if (subscript) return { - type: "supsub", - mode: this.mode, - base, - sub: subscript - }; - else return base; - } - /** - * Parses an entire function, including its base and all of its arguments. - */ - parseFunction(breakOnTokenText, name) { - var token = this.fetch(); - var func = token.text; - var funcData = functions[func]; - if (!funcData) return null; - this.consume(); - if (name && name !== "atom" && !funcData.allowedInArgument) throw new ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token); - else if (this.mode === "text" && !funcData.allowedInText) throw new ParseError("Can't use function '" + func + "' in text mode", token); - else if (this.mode === "math" && funcData.allowedInMath === false) throw new ParseError("Can't use function '" + func + "' in math mode", token); - var _this$parseArguments = this.parseArguments(func, funcData), args = _this$parseArguments.args, optArgs = _this$parseArguments.optArgs; - return this.callFunction(func, args, optArgs, token, breakOnTokenText); - } - /** - * Call a function handler with a suitable context and arguments. - */ - callFunction(name, args, optArgs, token, breakOnTokenText) { - var context = { - funcName: name, - parser: this, - token, - breakOnTokenText - }; - var func = functions[name]; - if (func && func.handler) return func.handler(context, args, optArgs); - else throw new ParseError("No function handler for " + name); - } - /** - * Parses the arguments of a function or environment - */ - parseArguments(func, funcData) { - var _funcData$numOptional; - var numOptionalArgs = (_funcData$numOptional = funcData.numOptionalArgs) != null ? _funcData$numOptional : 0; - var totalArgs = funcData.numArgs + numOptionalArgs; - if (totalArgs === 0) return { - args: [], - optArgs: [] - }; - var args = []; - var optArgs = []; - for (var i = 0; i < totalArgs; i++) { - var _funcData$argTypes; - var argType = (_funcData$argTypes = funcData.argTypes) == null ? void 0 : _funcData$argTypes[i]; - var isOptional = i < numOptionalArgs; - if ("primitive" in funcData && funcData.primitive && argType == null || funcData.type === "sqrt" && i === 1 && optArgs[0] == null) argType = "primitive"; - var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional); - if (isOptional) optArgs.push(arg); - else if (arg != null) args.push(arg); - else throw new ParseError("Null argument, please report this as a bug"); - } - return { - args, - optArgs - }; - } - /** - * Parses a group when the mode is changing. - */ - parseGroupOfType(name, type, optional) { - switch (type) { - case "color": return this.parseColorGroup(optional); - case "size": return this.parseSizeGroup(optional); - case "url": return this.parseUrlGroup(optional); - case "math": - case "text": return this.parseArgumentGroup(optional, type); - case "hbox": - var group = this.parseArgumentGroup(optional, "text"); - return group != null ? { - type: "styling", - mode: group.mode, - body: [group], - style: "text", - resetFont: true - } : null; - case "raw": - this.gullet.consumeSpaces(); - var percentCatcode = this.gullet.lexer.catcodes["%"]; - this.gullet.lexer.setCatcode("%", 12); - var token = this.parseStringGroup(optional); - this.gullet.lexer.setCatcode("%", percentCatcode); - return token != null ? { - type: "raw", - mode: "text", - string: token.text - } : null; - case "primitive": - if (optional) throw new ParseError("A primitive argument cannot be optional"); - var _group2 = this.parseGroup(name); - if (_group2 == null) throw new ParseError("Expected group as " + name, this.fetch()); - return _group2; - case "original": - case void 0: return this.parseArgumentGroup(optional); - default: throw new ParseError("Unknown group type as " + name, this.fetch()); - } - } - /** - * Discard any space tokens, fetching the next non-space token. - */ - consumeSpaces() { - while (this.fetch().text === " ") this.consume(); - } - /** - * Parses a group, essentially returning the string formed by the - * brace-enclosed tokens plus some position information. - */ - parseStringGroup(optional) { - var argToken = this.gullet.scanArgument(optional); - if (argToken == null) return null; - var str = ""; - var nextToken; - while ((nextToken = this.fetch()).text !== "EOF") { - str += nextToken.text; - this.consume(); - } - this.consume(); - argToken.text = str; - return argToken; - } - /** - * Parses a regex-delimited group: the largest sequence of tokens - * whose concatenated strings match `regex`. Returns the string - * formed by the tokens plus some position information. - */ - parseRegexGroup(regex, modeName) { - var firstToken = this.fetch(); - var lastToken = firstToken; - var str = ""; - var nextToken; - while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str + nextToken.text)) { - lastToken = nextToken; - str += lastToken.text; - this.consume(); - } - if (str === "") throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken); - return firstToken.range(lastToken, str); - } - /** - * Parses a color description. - */ - parseColorGroup(optional) { - var res = this.parseStringGroup(optional); - if (res == null) return null; - var match = /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(res.text); - if (!match) throw new ParseError("Invalid color: '" + res.text + "'", res); - var color = match[0]; - if (/^[0-9a-f]{6}$/i.test(color)) color = "#" + color; - return { - type: "color-token", - mode: this.mode, - color - }; - } - /** - * Parses a size specification, consisting of magnitude and unit. - */ - parseSizeGroup(optional) { - var res; - var isBlank = false; - this.gullet.consumeSpaces(); - if (!optional && this.gullet.future().text !== "{") res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size"); - else res = this.parseStringGroup(optional); - if (!res) return null; - if (!optional && res.text.length === 0) { - res.text = "0pt"; - isBlank = true; - } - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); - if (!match) throw new ParseError("Invalid size: '" + res.text + "'", res); - var data = { - number: +(match[1] + match[2]), - unit: match[3] - }; - if (!validUnit(data)) throw new ParseError("Invalid unit: '" + data.unit + "'", res); - return { - type: "size", - mode: this.mode, - value: data, - isBlank - }; - } - /** - * Parses an URL, checking escaped letters and allowed protocols, - * and setting the catcode of % as an active character (as in \hyperref). - */ - parseUrlGroup(optional) { - var percentCatcode = this.gullet.lexer.catcodes["%"]; - var tildeCatcode = this.gullet.lexer.catcodes["~"]; - this.gullet.lexer.setCatcode("%", 13); - this.gullet.lexer.setCatcode("~", 12); - var res = this.parseStringGroup(optional); - this.gullet.lexer.setCatcode("%", percentCatcode); - this.gullet.lexer.setCatcode("~", tildeCatcode); - if (res == null) return null; - var url = res.text.replace(/\\([#$%&~_^{}])/g, "$1"); - return { - type: "url", - mode: this.mode, - url - }; - } - /** - * Parses an argument with the mode specified. - */ - parseArgumentGroup(optional, mode) { - var argToken = this.gullet.scanArgument(optional); - if (argToken == null) return null; - var outerMode = this.mode; - if (mode) this.switchMode(mode); - this.gullet.beginGroup(); - var expression = this.parseExpression(false, "EOF"); - this.expect("EOF"); - this.gullet.endGroup(); - var result = { - type: "ordgroup", - mode: this.mode, - loc: argToken.loc, - body: expression - }; - if (mode) this.switchMode(outerMode); - return result; - } - /** - * Parses an ordinary group, which is either a single nucleus (like "x") - * or an expression in braces (like "{x+y}") or an implicit group, a group - * that starts at the current position, and ends right before a higher explicit - * group ends, or at EOF. - */ - parseGroup(name, breakOnTokenText) { - var firstToken = this.fetch(); - var text = firstToken.text; - var result; - if (text === "{" || text === "\\begingroup") { - this.consume(); - var groupEnd = text === "{" ? "}" : "\\endgroup"; - this.gullet.beginGroup(); - var expression = this.parseExpression(false, groupEnd); - var lastToken = this.fetch(); - this.expect(groupEnd); - this.gullet.endGroup(); - result = { - type: "ordgroup", - mode: this.mode, - loc: SourceLocation.range(firstToken, lastToken), - body: expression, - semisimple: text === "\\begingroup" || void 0 - }; - } else { - result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol(); - if (result == null && text[0] === "\\" && !Object.prototype.hasOwnProperty.call(implicitCommands, text)) { - if (this.settings.throwOnError) throw new ParseError("Undefined control sequence: " + text, firstToken); - result = this.formatUnsupportedCmd(text); - this.consume(); - } - } - return result; - } - /** - * Form ligature-like combinations of characters for text mode. - * This includes inputs like "--", "---", "``" and "''". - * The result will simply replace multiple textord nodes with a single - * character in each value by a single textord node having multiple - * characters in its value. The representation is still ASCII source. - * The group will be modified in place. - */ - formLigatures(group) { - var n = group.length - 1; - for (var i = 0; i < n; ++i) { - var a = group[i]; - if (a.type !== "textord") continue; - var v = a.text; - var next = group[i + 1]; - if (!next || next.type !== "textord") continue; - if (v === "-" && next.text === "-") { - var afterNext = group[i + 2]; - if (i + 1 < n && afterNext && afterNext.type === "textord" && afterNext.text === "-") { - group.splice(i, 3, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, afterNext), - text: "---" - }); - n -= 2; - } else { - group.splice(i, 2, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, next), - text: "--" - }); - n -= 1; - } - } - if ((v === "'" || v === "`") && next.text === v) { - group.splice(i, 2, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, next), - text: v + v - }); - n -= 1; - } - } - } - /** - * Parse a single symbol out of the string. Here, we handle single character - * symbols and special functions like \verb. - */ - parseSymbol() { - var nucleus = this.fetch(); - var text = nucleus.text; - if (/^\\verb[^a-zA-Z]/.test(text)) { - this.consume(); - var arg = text.slice(5); - var star = arg.charAt(0) === "*"; - if (star) arg = arg.slice(1); - if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) throw new ParseError("\\verb assertion failed --\n please report what input caused this bug"); - arg = arg.slice(1, -1); - return { - type: "verb", - mode: "text", - body: arg, - star - }; - } - if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text[0]) && !symbols[this.mode][text[0]]) { - if (this.settings.strict && this.mode === "math") handleStrict({ - strict: this.settings.strict, - errorCode: "unicodeTextInMathMode", - errorMsg: "Accented Unicode text character \"" + text[0] + "\" used in math mode", - report: true, - token: nucleus - }); - text = unicodeSymbols[text[0]] + text.slice(1); - } - var match = combiningDiacriticalMarksEndRegex.exec(text); - if (match) { - text = text.substring(0, match.index); - if (text === "i") text = "ı"; - else if (text === "j") text = "ȷ"; - } - var symbol; - if (symbols[this.mode][text]) { - if (this.settings.strict && this.mode === "math" && extraLatin.includes(text)) handleStrict({ - strict: this.settings.strict, - errorCode: "unicodeTextInMathMode", - errorMsg: "Latin-1/Unicode text character \"" + text[0] + "\" used in math mode", - report: true, - token: nucleus - }); - var group = symbols[this.mode][text].group; - var loc = SourceLocation.range(nucleus); - var s; - if (isAtom(group)) s = { - type: "atom", - mode: this.mode, - family: group, - loc, - text - }; - else s = { - type: group, - mode: this.mode, - loc, - text - }; - symbol = s; - } else if (text.charCodeAt(0) >= 128) { - if (this.settings.strict) { - if (!supportedCodepoint(text.charCodeAt(0))) handleStrict({ - strict: this.settings.strict, - errorCode: "unknownSymbol", - errorMsg: "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"), - report: true, - token: nucleus - }); - else if (this.mode === "math") handleStrict({ - strict: this.settings.strict, - errorCode: "unicodeTextInMathMode", - errorMsg: "Unicode text character \"" + text[0] + "\" used in math mode", - report: true, - token: nucleus - }); - } - symbol = { - type: "textord", - mode: "text", - loc: SourceLocation.range(nucleus), - text - }; - } else return null; - this.consume(); - if (match) for (var i = 0; i < match[0].length; i++) { - var accent = match[0][i]; - if (!unicodeAccents[accent]) throw new ParseError("Unknown accent ' " + accent + "'", nucleus); - var command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text; - if (!command) throw new ParseError("Accent " + accent + " unsupported in " + this.mode + " mode", nucleus); - symbol = { - type: "accent", - mode: this.mode, - loc: SourceLocation.range(nucleus), - label: command, - isStretchy: false, - isShifty: true, - base: symbol - }; - } - return symbol; - } - }; - Parser.endOfExpression = /* @__PURE__ */ new Set([ - "}", - "\\endgroup", - "\\end", - "\\right", - "&" - ]); - /** - * Parses an expression using a Parser, then returns the parsed result. - */ - var parseTree = function parseTree(toParse, settings) { - if (!(typeof toParse === "string" || toParse instanceof String)) throw new TypeError("KaTeX can only parse string typed expression"); - var parser = new Parser(toParse, settings); - delete parser.gullet.macros.current["\\df@tag"]; - var tree = parser.parse(); - delete parser.gullet.macros.current["\\current@color"]; - delete parser.gullet.macros.current["\\color"]; - if (parser.gullet.macros.get("\\df@tag")) { - if (!settings.displayMode) throw new ParseError("\\tag works only in display equations"); - tree = [{ - type: "tag", - mode: "text", - body: tree, - tag: parser.subparse([new Token("\\df@tag")]) - }]; - } - return tree; - }; - /** - * Parse and build an expression, and place that expression in the DOM node - * given. - */ - var render = function render(expression, baseNode, options) { - baseNode.textContent = ""; - var node = renderToDomTree(expression, options).toNode(); - baseNode.appendChild(node); - }; - if (typeof document !== "undefined") { - if (document.compatMode !== "CSS1Compat") { - typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."); - render = function render() { - throw new ParseError("KaTeX doesn't work in quirks mode."); - }; - } - } - /** - * Parse and build an expression, and return the markup for that. - */ - var renderToString = function renderToString(expression, options) { - return renderToDomTree(expression, options).toMarkup(); - }; - /** - * Parse an expression and return the parse tree. - */ - var generateParseTree = function generateParseTree(expression, options) { - return parseTree(expression, new Settings(options)); - }; - /** - * If the given error is a KaTeX ParseError and options.throwOnError is false, - * renders the invalid LaTeX as a span with hover title giving the KaTeX - * error message. Otherwise, simply throws the error. - */ - var renderError = function renderError(error, expression, options) { - if (options.throwOnError || !(error instanceof ParseError)) throw error; - var node = makeSpan(["katex-error"], [new SymbolNode(expression)]); - node.setAttribute("title", error.toString()); - node.setAttribute("style", "color:" + options.errorColor); - return node; - }; - /** - * Generates and returns the katex build tree. This is used for advanced - * use cases (like rendering to custom output). - */ - var renderToDomTree = function renderToDomTree(expression, options) { - var settings = new Settings(options); - try { - return buildTree(parseTree(expression, settings), expression, settings); - } catch (error) { - return renderError(error, expression, settings); - } - }; - var katex = { - /** - * Current KaTeX version - */ - version: "0.19.1", - /** - * Renders the given LaTeX into an HTML+MathML combination, and adds - * it as a child to the specified DOM node. - */ - render, - /** - * Renders the given LaTeX into an HTML+MathML combination string, - * for sending to the client. - */ - renderToString, - /** - * KaTeX error, usually during parsing. - */ - ParseError, - /** - * The schema of Settings - */ - SETTINGS_SCHEMA, - /** - * Parses the given LaTeX into KaTeX's internal parse tree structure, - * without rendering to HTML or MathML. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __parse: generateParseTree, - /** - * Renders the given LaTeX into an HTML+MathML internal DOM tree - * representation, without flattening that representation to a string. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __renderToDomTree: renderToDomTree, - /** - * Renders the given LaTeX into an HTML internal DOM tree representation, - * without MathML and without flattening that representation to a string. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __renderToHTMLTree: function renderToHTMLTree(expression, options) { - var settings = new Settings(options); - try { - return buildHTMLTree(parseTree(expression, settings), settings); - } catch (error) { - return renderError(error, expression, settings); - } - }, - /** - * extends internal font metrics object with a new object - * each key in the new object represents a font name - */ - __setFontMetrics: setFontMetrics, - /** - * adds a new symbol to builtin symbols table - */ - __defineSymbol: defineSymbol, - /** - * adds a new function to builtin function list, - * which directly produce parse tree elements - * and have their own html/mathml builders - */ - __defineFunction: defineFunction, - /** - * adds a new macro to builtin macro list - */ - __defineMacro: defineMacro, - /** - * Expose the dom tree node types, which can be useful for type checking nodes. - * - * NOTE: These methods are not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __domTree: { - Span, - Anchor, - SymbolNode, - SvgNode, - PathNode, - LineNode - } - }; - // src/client/markdown/katex.tsx - /** - * TeX-to-React via KaTeX, replicating the rehype-katex pipeline this renderer - * replaced: the same three-arm error chain (strict render, `strict: 'ignore'` - * retry, error span) and a DOM-identical element tree, so settled math keeps - * its exact markup. KaTeX emits an HTML string; the browser's own HTML parser - * (`DOMParser`, applying the spec's SVG/MathML foreign-content attribute - * adjustments KaTeX output relies on) turns it into a tree this module maps - * onto React elements — KaTeX output is a static span/MathML/SVG vocabulary - * with no raw user HTML, the same trust shiki's tree gets in CodeBlock. - * - * React 18 has no MathML support, so the `.katex-mathml` subtree's elements - * land in the HTML namespace — exactly as they did under the replaced - * hast-util-to-jsx-runtime pipeline. The visual arm is the `.katex-html` - * span tree; the MathML arm serves assistive technology, which reads it by - * tag name regardless of namespace. - */ - /** - * Convert one inline `style` attribute string into React's style object. - * KaTeX emits only plain kebab-case declarations (no custom properties and no - * nameless declarations), so camel-casing the property is the whole mapping. - */ - function styleObject(css) { - const style = {}; - for (const declaration of css.split(";")) { - const colon = declaration.indexOf(":"); - if (colon === -1) continue; - const key = declaration.slice(0, colon).trim().replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()); - style[key] = declaration.slice(colon + 1).trim(); - } - return style; - } - /** Map one parsed DOM node onto a React element (text nodes pass through). */ - function domToReact(node, key) { - if (node.nodeType === Node.TEXT_NODE) return node.textContent; - /* v8 ignore next 2 -- KaTeX output holds only elements and text; other - node kinds cannot appear in its serialized vocabulary. */ - if (node.nodeType !== Node.ELEMENT_NODE) return null; - const element = node; - const props = { key }; - for (const attribute of element.attributes) if (attribute.name === "class") props["className"] = attribute.value; - else if (attribute.name === "style") props["style"] = styleObject(attribute.value); - else props[attribute.name] = attribute.value; - const children = [...element.childNodes].map(domToReact); - return children.length === 0 ? (0, react.createElement)(element.localName, props) : (0, react.createElement)(element.localName, props, ...children); - } - /** - * Render TeX source to React elements through KaTeX. - * @param value - The TeX source (math node value; fenced `math` blocks append - * their trailing newline to match the replaced pipeline's text extraction). - * @param displayMode - Display (block) versus inline rendering. - * @returns KaTeX's element tree, or the error span when the source does not - * parse (colored with KaTeX's stock `errorColor`, matching rehype-katex). - */ - function renderTexToReact(value, displayMode) { - let html; - try { - html = katex.renderToString(value, { - displayMode, - throwOnError: true - }); - } catch (error) { - try { - html = katex.renderToString(value, { - displayMode, - strict: "ignore", - throwOnError: false - }); - } catch { - /* v8 ignore next 8 */ - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: "katex-error", - style: { color: "#cc0000" }, - title: String(error), - children: value - }); - } - } - return [...new DOMParser().parseFromString(html, "text/html").body.childNodes].map(domToReact); - } - // \0dshx-css-module:src/client/markdown/MarkdownText.module.css.mjs - const css$6 = ".mFG9SG_markdown{overflow-wrap:anywhere;min-width:0;font:var(--dsw-font-markdown-base);color:var(--dsw-alias-label-primary)}.mFG9SG_markdown strong{font-weight:600}.mFG9SG_markdown h1{font:var(--dsw-font-markdown-h1);margin:32px 0 16px}.mFG9SG_markdown h2{font:var(--dsw-font-markdown-h2);margin:32px 0 16px}.mFG9SG_markdown h3{font:var(--dsw-font-markdown-h3);margin:32px 0 16px}.mFG9SG_markdown h4{font:var(--dsw-font-markdown-h4);margin:16px 0}.mFG9SG_markdown :where(h5,h6){font:var(--dsw-font-markdown-base-strong);margin:16px 0}.mFG9SG_markdown :where(h1,h2,h3,h4,h5,h6) strong{font-weight:inherit}.mFG9SG_markdown p{margin:16px 0}.mFG9SG_markdown :where(h4,h5,h6)+:where(ul,ol){margin-top:8px}.mFG9SG_markdown :where(h4,h5,h6):has(+:where(ul,ol)){margin-bottom:8px}.mFG9SG_markdown a{color:var(--dsw-alias-state-business-primary);transition:box-shadow var(--ds-transition-duration) var(--ds-ease-in-out);border:2px solid #fff0;border-width:2px 3px;margin-left:-3px;margin-right:-3px;text-decoration:none;position:relative}.mFG9SG_markdown a:hover,.mFG9SG_markdown a:focus{-webkit-text-decoration:underline var(--dsw-alias-state-business-primary);text-decoration:underline var(--dsw-alias-state-business-primary);outline:none}.mFG9SG_markdown a:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-state-business-primary)}.mFG9SG_markdown :where(ul,ol){margin:16px 0;padding-left:18px}.mFG9SG_markdown li:not(:first-child){margin-top:6px}.mFG9SG_markdown li>:where(ul,ol){margin-top:4px}.mFG9SG_markdown li::marker{color:var(--dsw-alias-label-secondary);line-height:28px}.mFG9SG_markdown :where(ul,ol) ol{padding-left:0;list-style-position:inside}.mFG9SG_markdown :where(ul,ol) ol li p{display:inline}.mFG9SG_markdown li>p{margin:8px 0}.mFG9SG_markdown li>:first-child{margin-top:0}.mFG9SG_markdown li>:last-child:not(.md-code-block){margin-bottom:0}.mFG9SG_markdown hr{background:var(--dsw-alias-border-l2);border:none;height:1px;margin:32px 0;display:block}.mFG9SG_markdown blockquote{border-left:2px solid var(--dsw-alias-label-caption);margin:16px 0 0;padding-left:14px}.mFG9SG_markdown pre{font-family:var(--ds-font-family-code);margin:16px 0;overflow:auto}.mFG9SG_markdown :not(pre)>code{box-sizing:border-box;font:var(--dsw-font-markdown-code);font-family:var(--ds-font-family-code);background-color:var(--dsw-alias-markdown-inline-code);border-radius:6px;align-items:center;padding:0 5px;display:inline-flex;font-size:.875em!important}.mFG9SG_markdown :where(h1,h2,h3,h4,h5,h6) code{font:inherit;font-family:var(--ds-font-family-code)}.mFG9SG_markdown .katex-display{max-width:100%;overflow:auto hidden}.mFG9SG_markdown input[type=checkbox]{accent-color:var(--dsw-alias-label-secondary);margin:0 8px 0 0}.mFG9SG_tableScroll{overscroll-behavior-x:contain;max-width:100%;overflow-x:auto}.mFG9SG_tableScroll.md-table-wide{padding-bottom:var(--dsh-scrollbar-width,8px);overflow-x:hidden}:is(.mFG9SG_tableScroll.md-table-wide:hover,.mFG9SG_tableScroll.md-table-wide:focus-visible){padding-bottom:0;overflow-x:auto}.mFG9SG_tableScroll:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-state-business-primary);outline:none}.mFG9SG_tableScroll table{border-collapse:collapse;width:max-content;max-width:max-content}.mFG9SG_tableFill table{width:100%;max-width:none}.mFG9SG_tableScroll th{text-align:start;border-bottom:1px solid var(--dsw-alias-border-l3);font:var(--dsw-font-markdown-table-head);border-top:none;min-width:100px;max-width:min(30vw,320px);padding:10px 16px}.mFG9SG_tableScroll td{border-bottom:1px solid var(--dsw-alias-border-l2);font:var(--dsw-font-markdown-table);min-width:100px;max-width:min(30vw,320px);padding:10px 16px}.mFG9SG_tableScroll th:first-child,.mFG9SG_tableScroll td:first-child{padding-left:0}.mFG9SG_tableScroll td:last-child{padding-right:0}.mFG9SG_tableScroll table code{font-size:13px}.mFG9SG_markdown>:first-child,.mFG9SG_markdown p:first-child{margin-top:0!important}.mFG9SG_markdown>:last-child,.mFG9SG_markdown p:last-child{margin-bottom:0!important}.mFG9SG_imageAlt{color:var(--dsw-alias-label-tertiary);font-style:italic}.mFG9SG_image{background:var(--dsw-alias-bg-base);object-fit:contain;border-radius:8px;width:auto;max-width:100%;height:auto;margin:0;display:block}.mFG9SG_fileMention{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:none;margin:0;padding:0;text-decoration:none}.mFG9SG_fileMention:hover,.mFG9SG_fileMention:focus{-webkit-text-decoration:underline var(--dsw-alias-state-business-primary);text-decoration:underline var(--dsw-alias-state-business-primary);text-underline-offset:3px;outline:none}"; - const tagId$6 = "dsh-better-chat/MarkdownText.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$6; - tag.textContent = css$6; - document.head.appendChild(tag); - } - var MarkdownText_module_css_default = { - "fileMention": "mFG9SG_fileMention", - "image": "mFG9SG_image", - "imageAlt": "mFG9SG_imageAlt", - "markdown": "mFG9SG_markdown", - "tableFill": "mFG9SG_tableFill", - "tableScroll": "mFG9SG_tableScroll" - }; - // src/client/markdown/render.tsx - /** - * Direct mdast→React markdown renderer. Replaces the react-markdown / - * remark-rehype pipeline with one switch over parsed nodes so streaming can - * cache frozen blocks as React elements; the rendered DOM is pinned - * byte-for-byte by `tests/fixtures/markdown-dom` and must not drift. - * - * Untrusted-output policy (unchanged from the replaced pipeline): link and - * image destinations pass a protocol allowlist, images additionally require - * absolute HTTP(S), raw HTML renders as literal text (no HTML enters the - * DOM), and KaTeX runs without trusted commands. Fragment-anchor URLs fail - * the allowlist, so footnote references and back-references render as plain - * text rather than in-page links. - * - * Merge-extensible node unions fall through the documented default (render - * nothing) rather than ending in assertNever: grammars registered elsewhere - * may add node types this renderer has no mapping for. - */ - function sanitizeUrl(url) { - try { - switch (new URL(url).protocol) { - case "http:": - case "https:": - case "mailto:": return url; - default: return ""; - } - } catch { - return ""; - } - } - function remoteImageUrl(url) { - try { - const protocol = new URL(url).protocol; - return protocol === "http:" || protocol === "https:" ? url : void 0; - } catch { - return; - } - } - /** - * Create an empty {@link ReferenceTargets}. - * @returns Fresh empty maps. - */ - function createReferenceTargets() { - return { - definitions: /* @__PURE__ */ new Map(), - footnotes: /* @__PURE__ */ new Map() - }; - } - /** - * Record every definition and footnote definition under `nodes` into - * `targets`, depth-first, keeping the first definition per identifier. - * @param nodes - Subtrees to walk (top-level blocks or any nested children). - * @param targets - Accumulator, typically shared across incremental segments. - */ - function collectReferenceTargets(nodes, targets) { - for (const node of nodes) { - if (node.type === "definition") { - const id = node.identifier.toUpperCase(); - if (!targets.definitions.has(id)) targets.definitions.set(id, node); - } else if (node.type === "footnoteDefinition") { - const id = node.identifier.toUpperCase(); - if (!targets.footnotes.has(id)) targets.footnotes.set(id, node); - } - if ("children" in node) collectReferenceTargets(node.children, targets); - } - } - /** - * Render top-level blocks. Nodes that render nothing (definitions, unmapped - * types) are dropped rather than kept as null placeholders, matching the - * replaced pipeline's child lists so separator newlines land identically. - * @param blocks - Blocks with their stream-stable render keys. - * @param context - The pass state; footnote numbering mutates in document order. - * @returns One React node per rendered block. - */ - function renderBlocks(blocks, context) { - return blocks.map((block) => renderNode(block.node, block.key, { - ...context, - sourceOffset: block.key - (block.node.position?.start.offset ?? block.key) - })).filter((element) => element !== null); - } - /** - * Interleave the newline text nodes the replaced pipeline emitted between - * block-level children. They are invisible between elements but coalesce - * into adjacent literal raw-HTML text, where the DOM parity fixtures pin - * them. - * @param elements - Rendered block children with empty renders already dropped. - * @param edges - Also emit the leading and trailing newline (hast's loose wrap). - * @returns The interleaved children. - */ - function wrapBlockChildren(elements, edges) { - const wrapped = []; - for (const element of elements) { - if (edges || wrapped.length > 0) wrapped.push("\n"); - wrapped.push(element); - } - if (edges && elements.length > 0) wrapped.push("\n"); - return wrapped; - } - /** Render container children into {@link BlockEntry} values, dropping empty renders. */ - function renderBlockEntries(blocks, context) { - const entries = []; - for (const [index, block] of blocks.entries()) if (block.type === "paragraph") entries.push({ paragraph: renderChildren(block.children, context) }); - else { - const element = renderNode(block, index, context); - if (element !== null) entries.push({ element }); - } - return entries; - } - function renderChildren(nodes, context) { - return nodes.map((node, index) => renderNode(node, index, context)); - } - function renderNode(node, key, context) { - switch (node.type) { - case "text": return context.renderText ? context.renderText(node.value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0)) : node.value; - case "paragraph": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: renderChildren(node.children, context) }, key); - case "heading": return (0, react.createElement)(`h${node.depth}`, { key }, ...renderChildren(node.children, context)); - case "blockquote": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("blockquote", { children: wrapBlockChildren(renderChildren(node.children, { - ...context, - inBlockquote: true - }).filter((child) => child !== null), true) }, key); - case "thematicBreak": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {}, key); - case "break": return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}), "\n"] }, key); - case "strong": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: renderChildren(node.children, context) }, key); - case "emphasis": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("em", { children: renderChildren(node.children, context) }, key); - case "delete": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("del", { children: renderChildren(node.children, context) }, key); - case "inlineCode": { - const value = node.value.replace(/\r?\n|\r/g, " "); - const content = context.renderText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: context.renderText(value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0), true) }) : value; - const href = inlineCodeHttpUrl(value); - if (href !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: renderSafeLink(href, [content], "link") }, key); - const mention = context.inLink === true ? void 0 : context.fileMentions?.resolve(value); - if (mention !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: MarkdownText_module_css_default.fileMention, - title: mention.title, - "aria-label": mention.label, - onClick: mention.open, - children: content - }) }, key); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: content }, key); - } - case "html": return context.renderText ? context.renderText(node.value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0)) : node.value; - case "code": { - const code = renderCode(node, key, context); - return context.renderAtom ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: context.renderAtom(code, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0)) }, key) : code; - } - case "math": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderTexToReact(node.value, true) }, key); - case "inlineMath": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderTexToReact(node.value, false) }, key); - case "list": return renderList(node, key, context); - case "listItem": return renderListItem(node, listItemLoose(node), key, context); - case "table": return renderTable(node, key, context); - case "link": return renderAnchor(node.url, renderChildren(node.children, { - ...context, - inLink: true - }), key); - case "linkReference": return renderLinkReference(node, key, context); - case "image": return renderImage(node.url, node.alt ?? "", key, context); - case "imageReference": return renderImageReference(node, key, context); - case "footnoteReference": return renderFootnoteReference(node, key, context); - case "definition": - case "footnoteDefinition": return null; - default: return null; - } - } - function renderCode(node, key, context) { - const language = node.lang ?? void 0; - if (node.value === "") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { className: language === void 0 ? void 0 : `language-${language}` }) }, key); - const lang = language === void 0 ? void 0 : /^[\w-]+/.exec(language)?.[0]; - if (isMcpAppCodeBlock(node.lang, node.meta, node.value)) { - const title = extractMcpAppTitle(node.meta, node.value); - const initialHeight = extractMcpAppHeight(node.meta); - if (context.streaming) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamingMcpAppPlaceholder, { title }, key); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(McpAppCodeBlock, { - html: node.value, - title, - initialHeight - }, key); - } - if (!context.streaming && lang === "math") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderTexToReact(`${node.value}\n`, true) }, key); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.CodeBlock, { - code: `${node.value}\n`, - lang: context.streaming ? void 0 : lang, - copyLabel: context.codeLabels?.copyLabel ?? "复制代码", - copiedLabel: context.codeLabels?.copiedLabel ?? "已复制" - }, key); - } - /** A list is loose when it or any of its items is spread; every item then keeps its paragraphs. */ - function listLoose(list) { - return (list.spread ?? false) || list.children.some(listItemLoose); - } - function listItemLoose(item) { - return item.spread ?? item.children.length > 1; - } - function renderList(node, key, context) { - const loose = listLoose(node); - const properties = {}; - if (typeof node.start === "number" && node.start !== 1) properties.start = node.start; - if (node.children.some((item) => typeof item.checked === "boolean")) properties.className = "contains-task-list"; - return (0, react.createElement)(node.ordered === true ? "ol" : "ul", { - key, - ...properties - }, ...node.children.map((item, index) => renderListItem(item, loose, index, context))); - } - function renderListItem(item, loose, key, context) { - const entries = renderBlockEntries(item.children, context); - const task = typeof item.checked === "boolean"; - if (task) { - const checkbox = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", { - type: "checkbox", - checked: item.checked === true, - disabled: true - }, "task-checkbox"); - const head = entries[0]; - if (head !== void 0 && "paragraph" in head) head.paragraph = head.paragraph.length > 0 ? [ - checkbox, - " ", - ...head.paragraph - ] : [checkbox]; - else entries.unshift({ paragraph: [checkbox] }); - } - const parts = []; - for (const [index, entry] of entries.entries()) { - const isParagraph = "paragraph" in entry; - if (loose || index !== 0 || !isParagraph) parts.push("\n"); - if (!isParagraph) parts.push(entry.element); - else if (loose) parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: entry.paragraph }, `p-${index}`)); - else parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: entry.paragraph }, `p-${index}`)); - } - const tail = entries[entries.length - 1]; - if (tail !== void 0 && (loose || !("paragraph" in tail))) parts.push("\n"); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { - className: task ? "task-list-item" : void 0, - children: parts - }, key); - } - function renderTable(node, key, context) { - const align = node.align ?? null; - const [headRow, ...bodyRows] = node.children; - const wide = (align === null ? headRow?.children.length ?? 0 : align.length) >= 4 && context.inBlockquote !== true; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: clsx(MarkdownText_module_css_default.tableScroll, wide ? "md-table-wide" : MarkdownText_module_css_default.tableFill), - tabIndex: wide ? 0 : void 0, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", { children: [headRow !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: renderTableRow(headRow, "th", align, 0, context) }), bodyRows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: bodyRows.map((row, index) => renderTableRow(row, "td", align, index + 1, context)) })] }) - }, key); - } - function renderTableRow(row, cellTag, align, key, context) { - const length = align === null ? row.children.length : align.length; - const cells = []; - for (let index = 0; index < length; index++) { - const cell = row.children[index]; - const alignValue = align?.[index]; - cells.push((0, react.createElement)(cellTag, { - key: index, - style: alignValue == null ? void 0 : { textAlign: alignValue } - }, ...cell === void 0 ? [] : renderChildren(cell.children, context))); - } - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: cells }, key); - } - /** Anchor over an already-authored href: allowlisted or unwrapped, external links get the safe attributes. */ - function renderSafeLink(href, children, key) { - const safeHref = sanitizeUrl(href); - if (safeHref === "") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children }, key); - const external = ["http:", "https:"].includes(new URL(safeHref).protocol); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { - href: safeHref, - ...external ? { - target: "_blank", - rel: "noopener noreferrer" - } : {}, - children - }, key); - } - /** Anchor over a parsed markdown destination, which hast normalized before the allowlist saw it. */ - function renderAnchor(url, children, key) { - return renderSafeLink(normalizeUri(url), children, key); - } - /** - * The complete inline-code value when it is exactly an absolute HTTP(S) URL - * (no surrounding whitespace); anything else stays inert code. - */ - function inlineCodeHttpUrl(value) { - if (value.trim() !== value) return void 0; - try { - const protocol = new URL(value).protocol; - return protocol === "http:" || protocol === "https:" ? value : void 0; - } catch { - return; - } - } - function renderImage(url, alt, key, context) { - const remote = remoteImageUrl(sanitizeUrl(normalizeUri(url))); - const rewritten = remote === void 0 ? context.pathImages?.resolve(url) : void 0; - let imageSrc = remote; - if (rewritten !== void 0) try { - const parsed = new URL(rewritten); - if ([ - "http:", - "https:", - "blob:", - "data:" - ].includes(parsed.protocol) || rewritten.startsWith("dsh-app://app/api/file?")) imageSrc = rewritten; - } catch {} - if (imageSrc === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: MarkdownText_module_css_default.imageAlt, - children: alt - }, key); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownImage, { - src: imageSrc, - alt, - destination: url - }, `${key}:${imageSrc}`); - } - function MarkdownImage({ src, alt, destination }) { - const [failed, setFailed] = (0, react.useState)(false); - if (failed) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: MarkdownText_module_css_default.imageAlt, - children: alt || destination - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", { - className: MarkdownText_module_css_default.image, - src, - alt, - onError: () => { - setFailed(true); - }, - loading: "lazy", - decoding: "async", - referrerPolicy: "no-referrer" - }); - } - /** The bracketed source text a reference reverts to when its definition is missing. */ - function referenceSuffix(node) { - if (node.referenceType === "collapsed") return "][]"; - if (node.referenceType === "full") return `][${node.label ?? node.identifier}]`; - return "]"; - } - function renderLinkReference(node, key, context) { - const definition = context.targets.definitions.get(node.identifier.toUpperCase()); - if (definition === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [ - "[", - renderChildren(node.children, context), - referenceSuffix(node) - ] }, key); - return renderAnchor(definition.url, renderChildren(node.children, { - ...context, - inLink: true - }), key); - } - function renderImageReference(node, key, context) { - const definition = context.targets.definitions.get(node.identifier.toUpperCase()); - if (definition === void 0) return `![${node.alt ?? ""}${referenceSuffix(node)}`; - return renderImage(definition.url, node.alt ?? "", key, context); - } - function renderFootnoteReference(node, key, context) { - const id = node.identifier.toUpperCase(); - const seen = context.footnoteCounts.get(id); - if (seen === void 0) context.footnoteOrder.push(id); - context.footnoteCounts.set(id, (seen ?? 0) + 1); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("sup", { children: String(context.footnoteOrder.indexOf(id) + 1) }, key); - } - /** - * Render the trailing footnote section for every footnote referenced during - * the pass, in first-reference order, with one plain-text back-reference - * marker per rendered reference. - * @param context - The pass state after all blocks rendered. - * @returns The section, or null when no referenced footnote has a definition. - */ - function renderFootnoteSection(context) { - const items = []; - for (const id of context.footnoteOrder) { - const definition = context.targets.footnotes.get(id); - if (definition === void 0) continue; - const count = context.footnoteCounts.get(id) ?? 0; - const backrefs = []; - for (let reference = 1; reference <= count; reference++) { - if (backrefs.length > 0) backrefs.push(" "); - backrefs.push("↩"); - if (reference > 1) backrefs.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("sup", { children: String(reference) }, `re-${reference}`)); - } - const entries = renderBlockEntries(definition.children, context); - const tail = entries[entries.length - 1]; - const body = entries.map((entry, index) => "paragraph" in entry ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [entry.paragraph, entry === tail && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", backrefs] })] }, `p-${index}`) : entry.element); - if (tail === void 0 || !("paragraph" in tail)) body.push(...backrefs); - items.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { - id: `user-content-fn-${normalizeUri(id.toLowerCase())}`, - children: wrapBlockChildren(body, true) - }, id)); - } - if (items.length === 0) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { - "data-footnotes": true, - className: "footnotes", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { - id: "footnote-label", - className: "sr-only", - children: "Footnotes" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", { children: items })] - }, "footnotes"); - } - // src/client/markdown/MarkdownText.tsx - /** - * Untrusted assistant-Markdown renderer over the direct mdast pipeline: - * `parse.ts` grammars, the incremental streaming parser, and `render.tsx`. - * While a message streams, all but the trailing two blocks freeze as cached - * React elements and only the source tail behind them re-parses per chunk, - * so per-chunk work tracks the tail size instead of the whole reply. Frozen - * blocks keep their source-offset keys when they cross the freeze boundary, - * so React reconciles instead of remounting. Known deviation while - * streaming: a reference-style link or footnote whose definition sits on the - * other side of the freeze boundary renders literally until the settled - * full parse self-heals it. - */ - /** One settled full render: parse with math, resolve references, append the footnote section. */ - function renderSettled(text, codeLabels, fileMentions, pathImages, renderText, renderAtom) { - const root = parseGfmWithMath(text); - const targets = createReferenceTargets(); - collectReferenceTargets(root.children, targets); - const context = { - renderText, - renderAtom, - streaming: false, - codeLabels, - fileMentions, - pathImages, - targets, - footnoteOrder: [], - footnoteCounts: /* @__PURE__ */ new Map() - }; - const blocks = wrapBlockChildren(renderBlocks(root.children.map((node, index) => ({ - node, - key: node.position?.start.offset ?? -(index + 1) - })), context), false); - const section = renderFootnoteSection(context); - return section === null ? blocks : [ - ...blocks, - "\n", - section - ]; - } - /** - * Streaming render state for one growing message: the incremental parser, - * the frozen blocks' cached elements, and the reference/footnote state their - * rendering consumed (footnote numbering assigned to frozen references is - * final, so the tail continues from a copy of it each frame). - */ - var StreamingRenderer = class { - codeLabels; - renderText; - renderAtom; - pathImages; - parser = new IncrementalMarkdownParser(parseGfm); - generation = -1; - frozenCount = 0; - frozenElements = []; - frozenTargets = createReferenceTargets(); - frozenFootnoteOrder = []; - frozenFootnoteCounts = /* @__PURE__ */ new Map(); - lastText = null; - lastRendered = []; - /** @param codeLabels - Fence copy labels baked into cached elements; the owner replaces the renderer when they change. */ - constructor(codeLabels, renderText, renderAtom, pathImages) { - this.codeLabels = codeLabels; - this.renderText = renderText; - this.renderAtom = renderAtom; - this.pathImages = pathImages; - } - /** - * Render the current accumulated text. Idempotent per text value, so React - * may re-execute the calling render freely. - * @param text - The full accumulated markdown source. - * @returns Frozen elements, re-rendered tail, and the footnote section. - */ - render(text) { - if (text === this.lastText) return this.lastRendered; - const { frozen, tail, generation } = this.parser.update(text); - if (generation !== this.generation) { - this.generation = generation; - this.frozenCount = 0; - this.frozenElements = []; - this.frozenTargets = createReferenceTargets(); - this.frozenFootnoteOrder = []; - this.frozenFootnoteCounts = /* @__PURE__ */ new Map(); - } - const newlyFrozen = frozen.slice(this.frozenCount); - collectReferenceTargets(newlyFrozen.map((block) => block.node), this.frozenTargets); - const frameTargets = { - definitions: new Map(this.frozenTargets.definitions), - footnotes: new Map(this.frozenTargets.footnotes) - }; - collectReferenceTargets(tail.map((block) => block.node), frameTargets); - if (newlyFrozen.length > 0) { - const frozenContext = { - renderText: this.renderText, - renderAtom: this.renderAtom, - streaming: true, - codeLabels: this.codeLabels, - fileMentions: void 0, - pathImages: this.pathImages, - targets: frameTargets, - footnoteOrder: this.frozenFootnoteOrder, - footnoteCounts: this.frozenFootnoteCounts - }; - const batch = [...this.frozenElements]; - for (const element of renderBlocks(newlyFrozen, frozenContext)) { - if (batch.length > 0) batch.push("\n"); - batch.push(element); - } - this.frozenElements = batch; - this.frozenCount = frozen.length; - } - const tailContext = { - renderText: this.renderText, - renderAtom: this.renderAtom, - streaming: true, - codeLabels: this.codeLabels, - fileMentions: void 0, - pathImages: this.pathImages, - targets: frameTargets, - footnoteOrder: [...this.frozenFootnoteOrder], - footnoteCounts: new Map(this.frozenFootnoteCounts) - }; - const children = [...this.frozenElements]; - for (const element of renderBlocks(tail, tailContext)) { - if (children.length > 0) children.push("\n"); - children.push(element); - } - const section = renderFootnoteSection(tailContext); - if (section !== null) children.push("\n", section); - this.lastText = text; - this.lastRendered = children; - return this.lastRendered; - } - }; - /** - * Render untrusted assistant-authored Markdown as semantic React elements. - * @param props - Markdown source text preserved by the session projection; - * `streaming` renders fences and TeX plain (highlighting and KaTeX land on - * the finalize swap) and parses incrementally across chunks; `codeLabels` - * forwards localized copy-button labels to fence CodeBlocks — pass a - * reference-stable object (memoized per locale revision), because a new - * identity discards the streaming render cache mid-message. `fileMentions` - * links inline-code tokens its resolver recognizes as real files; this is - * the single streaming gate — it applies to settled renders only, because a - * streaming message's vocabulary is not final and frozen cached elements - * must not bake in handlers that could go stale. - * @returns A GFM document with TeX math rendered through KaTeX; raw HTML, - * relative links, and unsafe protocols are disabled, while absolute HTTP(S) - * images render directly. - */ - const MarkdownText$2 = (0, react.memo)(function MarkdownText({ text, streaming = false, codeLabels, fileMentions, pathImages, renderText, renderAtom }) { - const streamRef = (0, react.useRef)(null); - const streamImagesRef = (0, react.useRef)(pathImages); - const streamLabelsRef = (0, react.useRef)(codeLabels); - const children = (0, react.useMemo)(() => { - if (!streaming) { - streamRef.current = null; - return renderSettled(text, codeLabels, fileMentions, pathImages, renderText, renderAtom); - } - if (streamRef.current === null || streamLabelsRef.current !== codeLabels || streamImagesRef.current !== pathImages) { - streamRef.current = new StreamingRenderer(codeLabels, renderText, renderAtom, pathImages); - streamLabelsRef.current = codeLabels; - streamImagesRef.current = pathImages; - } - return streamRef.current.render(text); - }, [ - text, - streaming, - codeLabels, - fileMentions, - pathImages, - renderText, - renderAtom - ]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: MarkdownText_module_css_default.markdown, - children - }); - }); - // src/client/platform-media.ts - /** Web or Desktop file route. Authorization stays Host-side. */ - function localPathMediaUrl(protocol, origin, value) { - if (!value.startsWith("/") || value.startsWith("//")) return void 0; - if (protocol === "http:" || protocol === "https:") return `${origin}/api/file?path=${encodeURIComponent(value)}`; - if (protocol === "dsh-app:" && origin === "dsh-app://app") return `dsh-app://app/api/file?path=${encodeURIComponent(value)}`; - } - const readerPathImages = { resolve: (value) => typeof window === "undefined" ? void 0 : localPathMediaUrl(window.location.protocol, window.location.origin, value) }; - // \0dshx-css-module:src/client/Reader.module.css.mjs - const css$5 = ".Nr89iW_root{color:var(--dsw-alias-label-primary);padding:16px calc(var(--dsh-composer-side-clearance,16px) + 16px) 24px;overflow-anchor:auto;--reader-lane-block:max(40px, calc(40px + var(--dsh-content-font-delta,0px)));--reader-lane-plate:linear-gradient(var(--dsw-alias-bg-base), var(--dsw-alias-bg-base)), linear-gradient(var(--dsw-alias-bg-layer-1,transparent), var(--dsw-alias-bg-layer-1,transparent));flex:none;min-width:0;font-family:inherit;font-size:16px;line-height:28px;container-type:inline-size}.Nr89iW_column{max-width:var(--dsh-chat-content-width,748px);flex-direction:column;gap:22px;width:100%;min-width:0;margin:0 auto;display:flex}.Nr89iW_column:focus,.Nr89iW_column:focus-visible{outline:none}.Nr89iW_toolbar{min-height:32px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-base);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:flex-end;align-items:center;gap:6px;padding:0;font-size:12px;display:flex;position:sticky;top:0}.Nr89iW_turnProcessSticky{background:var(--dsw-alias-bg-base);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);align-items:center;min-height:32px;display:flex;position:sticky}.Nr89iW_turnProcessSticky .Nr89iW_disclosureButton{min-height:32px}.Nr89iW_textButton,.Nr89iW_historyButton,.Nr89iW_iconButton,.Nr89iW_jump,.Nr89iW_disclosureButton,.Nr89iW_imageOpen,.Nr89iW_dialogClose{font:inherit;cursor:pointer}.Nr89iW_textButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;background:0 0;border:0;border-radius:6px;padding:2px 6px}.Nr89iW_textButton:hover,.Nr89iW_iconButton:hover,.Nr89iW_disclosureButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_root button:focus-visible,.Nr89iW_root summary:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:3px}.Nr89iW_turn,.Nr89iW_turnStickyRegion{flex-direction:column;gap:14px;min-width:0;display:flex}.Nr89iW_turnStickyLanes{top:var(--reader-toolbar-height,var(--reader-lane-block,40px));z-index:6;flex-direction:column;min-width:0;display:flex;position:sticky}.Nr89iW_turn+.Nr89iW_turn,.Nr89iW_retiringContent+.Nr89iW_retiringContent>.Nr89iW_turn{margin-top:12px}.Nr89iW_userCluster{flex-direction:column;align-self:stretch;align-items:flex-end;gap:8px;width:100%;min-width:0;max-width:100%;margin-bottom:4px;display:flex}.Nr89iW_userCluster>[data-slot]>*{box-sizing:border-box;align-self:stretch;width:100%;min-width:0;max-width:100%}.Nr89iW_userImages{flex-direction:column;align-self:flex-end;align-items:flex-end;width:fit-content;min-width:0;max-width:100%;display:flex}.Nr89iW_userImages .Nr89iW_imageFigure{align-self:flex-end}.Nr89iW_user{width:fit-content;max-width:min(calc(var(--dsh-chat-content-width,748px) * .702), 82%);border-radius:var(--dsw-radius-xl,22px);background:var(--dsw-specific-bubble);color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;box-sizing:border-box;align-self:flex-end;margin-left:auto;padding:10px 16px;font-weight:400}.Nr89iW_user .Nr89iW_blocks{gap:10px}.Nr89iW_answer{overflow-wrap:anywhere;flex-direction:column;min-width:0;display:flex}.Nr89iW_readingText{min-width:0}.Nr89iW_reasonPlain{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;color:inherit}.Nr89iW_readingText button{min-width:24px;min-height:24px}.Nr89iW_streamWord{display:inline-block}.Nr89iW_streamInlineWord{display:inline}.Nr89iW_streamWord,.Nr89iW_streamInlineWord,.Nr89iW_streamAtom{opacity:1;filter:none}.Nr89iW_streamAtom{min-width:0}@media (prefers-reduced-motion:reduce){.Nr89iW_streamWord,.Nr89iW_streamInlineWord,.Nr89iW_streamAtom{opacity:1!important;filter:none!important}}.Nr89iW_retiringContent{min-width:0}.Nr89iW_retiringContent[data-reader-retiring=retiring]{overflow:hidden}.Nr89iW_mainFlow,.Nr89iW_blocks{flex-direction:column;gap:16px;min-width:0;display:flex}.Nr89iW_mainFlow:empty,.Nr89iW_blocks:empty{display:none}.Nr89iW_blocks>:first-child{margin-top:0}.Nr89iW_blocks>:last-child{margin-bottom:0}.Nr89iW_blocks .md-table-wide{max-width:100%}.Nr89iW_disclosure{min-width:0}.Nr89iW_disclosureButton{max-width:100%;min-height:32px;color:var(--dsw-alias-label-tertiary);font-size:calc(14px + var(--dsh-content-font-delta,0px));line-height:calc(24px + var(--dsh-content-font-delta,0px));text-align:left;background:0 0;border:0;border-radius:7px;align-items:center;gap:6px;margin-left:-6px;padding:4px 6px;font-weight:400;display:inline-flex}.Nr89iW_disclosure[data-reader-status-only]{align-items:center;min-height:32px;display:flex}.Nr89iW_statusText{min-width:0;max-width:100%;font-size:calc(14px + var(--dsh-content-font-delta,0px));line-height:calc(24px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-secondary);font-weight:400;display:inline-flex}.Nr89iW_srOnly{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.Nr89iW_think{--think-swap:.15s;--think-gap:50ms;--think-distance:8px;--think-blur:2px;--think-shimmer:2s;--think-base:var(--dsw-alias-label-secondary);--think-highlight:var(--dsw-alias-label-primary);--think-ease:ease-in-out;text-align:left;max-width:100%;display:inline-block;position:relative}.Nr89iW_thinkSizer{visibility:hidden;white-space:nowrap;display:block}.Nr89iW_thinkText{color:var(--think-base);white-space:nowrap;text-overflow:ellipsis;filter:blur();opacity:1;transition:transform var(--think-swap) var(--think-ease), filter var(--think-swap) var(--think-ease), opacity var(--think-swap) var(--think-ease);display:block;position:absolute;top:0;left:0;right:0;overflow:hidden;transform:translateY(0)}.Nr89iW_think[data-reader-status-phase=running] .Nr89iW_thinkText[data-reader-status-copy=current]{transition-delay:var(--think-gap)}.Nr89iW_think:not([data-reader-status-phase=idle]) .Nr89iW_thinkText{will-change:transform, filter, opacity}@supports (background-clip:text){.Nr89iW_think[data-active=true] .Nr89iW_thinkText:before{content:attr(data-text);pointer-events:none;background-image:linear-gradient(90deg, transparent 0%, transparent 40%, var(--think-highlight) 50%, transparent 60%, transparent 100%);color:#0000;-webkit-text-fill-color:transparent;animation:Nr89iW_thinkShimmer var(--think-shimmer) linear infinite;background-repeat:no-repeat;background-size:400% 100%;background-clip:text;position:absolute;inset:0}}@keyframes Nr89iW_thinkShimmer{0%{background-position:100% 0}to{background-position:0 0}}.Nr89iW_thinkText.Nr89iW_isExit{transform:translateY(calc(var(--think-distance) * -1));filter:blur(var(--think-blur));opacity:0}.Nr89iW_thinkText.Nr89iW_isEnterStart{transform:translateY(var(--think-distance));filter:blur(var(--think-blur));opacity:0;transition:none}[data-motion=off] .Nr89iW_thinkText{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}[data-motion=off] .Nr89iW_thinkText[data-reader-status-copy=outgoing],[data-motion=off] .Nr89iW_thinkText:before{display:none!important}@media (prefers-reduced-motion:reduce),(forced-colors:active){.Nr89iW_thinkText{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}.Nr89iW_thinkText[data-reader-status-copy=outgoing],.Nr89iW_thinkText:before{display:none!important}}.Nr89iW_processMeta{opacity:0;grid-template-rows:0fr;transition:grid-template-rows .26s cubic-bezier(.22,1,.36,1),opacity .16s ease-out;display:grid}.Nr89iW_processMeta[data-open=true]{opacity:1;grid-template-rows:1fr}.Nr89iW_processMetaInner{min-height:0;overflow:hidden}.Nr89iW_processMetaLine{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:baseline;gap:8px;padding:8px 0 0 16px;font-size:12px;line-height:20px;display:flex}.Nr89iW_processMetaLine .Nr89iW_meta{color:inherit}.Nr89iW_chevron{stroke:currentColor;fill:none;stroke-width:1.4px;stroke-linecap:round;stroke-linejoin:round;flex:none;transition:transform .26s cubic-bezier(.22,1,.36,1)}.Nr89iW_chevron[data-open=true]{transform:rotate(90deg)}.Nr89iW_disclosureBody{transform-origin:top;will-change:height, opacity, transform;height:0;overflow:hidden}.Nr89iW_processContents{border-left:1px solid var(--dsw-alias-border-l2);padding:3px 0 2px var(--reader-gutter,16px);margin:0 0 0 var(--reader-rail,6px);color:var(--dsw-alias-label-secondary);font-size:14px;line-height:24px;display:flow-root}.Nr89iW_processContents>:last-child{margin-bottom:0}.Nr89iW_processSeamRow{min-height:40px;margin-left:var(--reader-rail,6px);padding-left:var(--reader-gutter,16px);border-left:1px solid var(--dsw-alias-border-l2);box-sizing:border-box;align-items:center;display:flex}.Nr89iW_processSeamRow>.Nr89iW_disclosure{align-items:center;min-height:24px;display:flex}.Nr89iW_processSeamRow .Nr89iW_disclosureButton{min-height:24px;color:var(--dsw-alias-label-tertiary);padding-block:2px;font-size:12px;line-height:20px}.Nr89iW_flowCell:has(>.Nr89iW_flowCellInner>[data-reader-seam-after])>.Nr89iW_flowCellInner{padding-bottom:0}.Nr89iW_processFrame{min-width:0}.Nr89iW_toolActivity{min-width:0;color:var(--dsw-alias-label-secondary)}.Nr89iW_nativeToolRow{min-width:0}.Nr89iW_rowSeparator{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.Nr89iW_nativeToolSummary{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:1;font-size:14px;line-height:24px;overflow:hidden}.Nr89iW_nativeToolRow:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:3px;border-radius:4px}.Nr89iW_toolHeading{width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:11px;grid-template-columns:20px minmax(0,1fr) auto;align-items:start;gap:10px;padding:10px 14px 4px;display:grid}.Nr89iW_toolHeading:hover{background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_toolHeading:focus-visible{outline-offset:-3px!important}.Nr89iW_toolGlyph{height:22px;color:var(--dsw-alias-label-secondary);justify-content:center;align-items:center;display:flex}.Nr89iW_toolHeadingCopy{flex-direction:column;gap:3px;min-width:0;display:flex}.Nr89iW_toolTitle{overflow-wrap:anywhere;font-size:13px;font-weight:500;line-height:22px}.Nr89iW_toolTarget{-webkit-line-clamp:2;overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:19px;display:-webkit-box;overflow:hidden}.Nr89iW_toolHeadingState{min-height:22px;color:var(--dsw-alias-label-secondary);align-items:center;gap:7px;display:flex}.Nr89iW_diffStat{font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";white-space:nowrap;flex:none;gap:6px;margin-left:8px;font-size:11px;line-height:18px;display:inline-flex}.Nr89iW_diffAdded{color:var(--dsw-alias-state-success-primary,#2f9e63)}.Nr89iW_diffRemoved{color:var(--dsw-alias-state-error-primary,#d1483c)}.Nr89iW_summaryRow{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;max-width:100%;display:flex}.Nr89iW_summaryRow>.Nr89iW_diffStatRoot{flex:none;margin-left:auto}.Nr89iW_summaryRow>:first-child{min-width:0}.Nr89iW_diffStatRoot{flex:none;position:relative}.Nr89iW_diffStatButton{cursor:pointer;font:inherit;font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";color:var(--dsw-alias-label-secondary);background:0 0;border:1px solid #0000;border-radius:6px;align-items:center;gap:6px;padding:2px 8px;font-size:11px;line-height:16px;transition:background .12s,border-color .12s;display:inline-flex}.Nr89iW_diffStatButton:hover,.Nr89iW_diffStatButton:focus-visible,.Nr89iW_diffStatButton[aria-expanded=true]{background:var(--dsw-alias-bg-module-platform,#7f7f7f1a);border-color:var(--dsw-alias-border-l2,#7f7f7f47)}.Nr89iW_diffStatButton:focus-visible{outline:none}.Nr89iW_diffStatButton[aria-expanded=true] .Nr89iW_diffCaret{opacity:1}.Nr89iW_diffOverlayRow{box-sizing:border-box;flex:100%;width:100%;min-width:0;max-width:100%;margin-top:6px}.Nr89iW_diffOverlay{box-sizing:border-box;background:var(--dsw-alias-bg-module-platform,#7f7f7f14);border:1px solid var(--dsw-alias-border-l2,#80808038);border-radius:10px;flex-direction:column;width:100%;min-width:0;max-width:100%;padding:8px;display:flex;overflow:hidden}.Nr89iW_diffTabs{scrollbar-width:thin;flex-wrap:nowrap;gap:6px;max-width:100%;margin-bottom:4px;padding-bottom:6px;display:flex;overflow-x:auto}.Nr89iW_diffTab{text-overflow:ellipsis;white-space:nowrap;cursor:pointer;max-width:220px;font:inherit;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-base,#fffc);border:1px solid var(--dsw-alias-border-l2,#80808033);border-radius:6px;flex:none;padding:3px 10px;font-size:11px;line-height:16px;transition:all .12s;overflow:hidden}.Nr89iW_diffTab:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.Nr89iW_diffTab[data-active]{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-state-business-primary,#1e90ff);background:var(--dsw-alias-bg-base);font-weight:500}.Nr89iW_diffScrollArea{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border:1px solid var(--dsw-alias-border-l2,#80808026);background:var(--dsw-alias-markdown-code-block,#0000000a);border-radius:8px;max-height:420px;overflow:auto}.Nr89iW_diffScrollArea [data-diff]{background:0 0!important;border-radius:0!important;margin:0!important}.Nr89iW_diffCaret{opacity:.6;flex:none;width:10px;font-size:10px}.Nr89iW_diffPath{text-overflow:ellipsis;white-space:nowrap;text-align:left;direction:rtl;flex:auto;min-width:0;overflow:hidden}.Nr89iW_diffStat{font-variant-numeric:tabular-nums;flex:none;gap:6px;font-size:11px;display:inline-flex}.Nr89iW_diffHunkBody{flex-direction:column;gap:4px;padding:2px 7px 7px 25px;display:flex}.Nr89iW_diffLines{font-size:11px;line-height:1.55;font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);white-space:pre;border-radius:6px;margin:0;padding:6px 8px;overflow-x:auto}.Nr89iW_diffLines[data-side=removed]{background:#d1483c1f}.Nr89iW_diffLines[data-side=added]{background:#2f9e631f}.Nr89iW_diffLineRemoved,.Nr89iW_diffLineAdded{display:block}.Nr89iW_diffLineRemoved{color:var(--dsw-alias-state-error-primary,#d1483c)}.Nr89iW_diffLineAdded{color:var(--dsw-alias-state-success-primary,#2f9e63)}.Nr89iW_diffEmpty{color:var(--dsw-alias-label-secondary);margin:0;padding:2px 0;font-size:11px}.Nr89iW_nativeToolSummary[data-running]{background-image:linear-gradient(90deg, currentColor 0%, currentColor 35%, color-mix(in srgb, currentColor 35%, transparent) 50%, currentColor 65%, currentColor 100%);-webkit-text-fill-color:transparent;background-position:100% 0;background-repeat:no-repeat;background-size:300% 100%;background-clip:text;animation:1.6s linear infinite Nr89iW_readerStepShimmer}@keyframes Nr89iW_readerStepShimmer{to{background-position:0 0}}.Nr89iW_toolElapsed[data-slow]{opacity:1;color:var(--dsw-alias-state-warning-primary,#d8862c);font-weight:500}.Nr89iW_toolElapsed{opacity:.72;font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";white-space:nowrap;flex:none;margin-left:8px;font-size:11px;line-height:18px}[data-motion=off] .Nr89iW_nativeToolSummary[data-running]{-webkit-text-fill-color:currentColor;background-image:none;animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_nativeToolSummary[data-running]{-webkit-text-fill-color:currentColor;background-image:none;animation:none!important}}.Nr89iW_toolState{white-space:nowrap;flex:none;margin-left:8px;font-size:11px;line-height:18px}.Nr89iW_toolState[data-phase=preparing],.Nr89iW_toolState[data-phase=running]{color:var(--dsw-alias-state-business-primary)}.Nr89iW_toolState[data-phase=preparing]:before,.Nr89iW_toolState[data-phase=running]:before{content:\"\";vertical-align:middle;background:currentColor;border-radius:50%;width:6px;height:6px;margin-right:6px;animation:1.4s ease-in-out infinite Nr89iW_readerRunningGlow;display:inline-block}@keyframes Nr89iW_readerRunningGlow{0%{box-shadow:0 0 0 0 color-mix(in srgb, currentColor 60%, transparent);opacity:1}70%{opacity:.7;box-shadow:0 0 0 7px #0000}to{opacity:1;box-shadow:0 0 #0000}}[data-motion=off] .Nr89iW_toolState[data-phase=preparing]:before,[data-motion=off] .Nr89iW_toolState[data-phase=running]:before{animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_toolState[data-phase=preparing]:before,.Nr89iW_toolState[data-phase=running]:before{animation:none!important}}.Nr89iW_toolState[data-phase=failed]{color:var(--dsw-alias-state-error-primary)}.Nr89iW_toolState[data-phase=interrupted]{color:inherit;opacity:.7}.Nr89iW_toolLedger{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:10px 14px 0;font-size:11px;line-height:18px;display:flex}.Nr89iW_toolEngine{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.Nr89iW_toolDetails{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;min-width:0;margin:6px 0 0 22px;overflow:hidden}.Nr89iW_toolTabs{align-items:center;gap:15px;padding:0 14px;display:flex}.Nr89iW_toolTabs>button{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;padding:10px 1px 8px;font-size:12px;line-height:20px}.Nr89iW_toolTabs>button[aria-selected=true]{color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsw-alias-state-business-primary)}.Nr89iW_toolPanel{flex-direction:column;gap:12px;min-width:0;padding:12px 14px 14px;font-size:13px;line-height:22px;display:flex}.Nr89iW_toolPanel:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-3px}.Nr89iW_toolDetailNote{color:var(--dsw-alias-label-secondary);margin:0 0 9px;font-size:12px;line-height:20px}.Nr89iW_toolRawLabel{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;font-weight:500}.Nr89iW_toolRaw{background:var(--dsw-alias-bg-module-platform);max-height:400px;color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:8px;margin:0;padding:12px;font:12px/20px ui-monospace,SFMono-Regular,Menlo,monospace;overflow:auto}.Nr89iW_systemPrompt{background:var(--dsw-alias-bg-module-platform);max-height:320px;color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:8px;margin:0;padding:12px;font:12px/20px ui-monospace,SFMono-Regular,Menlo,monospace;overflow:auto}.Nr89iW_commandInput{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.Nr89iW_toolReceipt .Nr89iW_blocks,.Nr89iW_toolDocument .Nr89iW_blocks{font-size:13px;line-height:22px}.Nr89iW_toolChildren{margin:0 14px 12px var(--reader-rail,6px);padding-left:var(--reader-gutter,16px);border-left:1px solid var(--dsw-alias-border-l2);flex-direction:column;gap:9px;display:flex}@container (width<=420px){.Nr89iW_toolHeading{grid-template-columns:16px minmax(0,1fr) auto;gap:7px;padding:11px 10px 6px}.Nr89iW_toolHeadingState{gap:4px}.Nr89iW_toolLedger{padding-left:33px;padding-right:10px}.Nr89iW_toolPanel{padding:10px}}@media (pointer:coarse){.Nr89iW_toolTabs>button{min-height:44px}}.Nr89iW_reasonCard{--reason-preview-height:224px;--reason-hold:.84s;--reason-step:.5s;--reason-lines:2;--reason-fade:28px;--reason-ease:cubic-bezier(.22, 1, .36, 1);border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);min-width:0;scroll-margin-block:16px calc(var(--dsh-composer-height,152px) + 16px);border-radius:12px;position:relative;overflow:hidden}.Nr89iW_reasonHeading{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;padding:10px 16px 0;font-size:12px;line-height:20px;display:flex}.Nr89iW_reasonCard[data-overflow=false][data-expanded=false]{background:0 0;border-color:#0000;border-radius:0}.Nr89iW_reasonCard[data-overflow=false][data-expanded=false] .Nr89iW_reasonHeading{padding:0}.Nr89iW_reasonCard[data-overflow=false][data-expanded=false] .Nr89iW_reasonText{padding:4px 0 0 22px}.Nr89iW_reasonLabel{font-weight:500}.Nr89iW_reasonViewport{max-height:var(--reason-preview-height);scroll-behavior:auto;overflow-anchor:none;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l1) transparent;position:relative;overflow:auto}.Nr89iW_reasonCard[data-expanded=true] .Nr89iW_reasonViewport{max-height:min(60vh, 560px, var(--reason-reading-height,560px))}.Nr89iW_reasonViewport[data-edges=both],.Nr89iW_reasonCard[data-following=true][data-overflow=true] .Nr89iW_reasonViewport{-webkit-mask-image:linear-gradient(transparent 0, black var(--reason-fade), black calc(100% - var(--reason-fade)), transparent 100%);mask-image:linear-gradient(transparent 0, black var(--reason-fade), black calc(100% - var(--reason-fade)), transparent 100%)}.Nr89iW_reasonViewport[data-edges=top]{-webkit-mask-image:linear-gradient(transparent 0, black var(--reason-fade), black 100%);mask-image:linear-gradient(transparent 0, black var(--reason-fade), black 100%)}.Nr89iW_reasonViewport[data-edges=bottom]{-webkit-mask-image:linear-gradient(black 0, black calc(100% - var(--reason-fade)), transparent 100%);mask-image:linear-gradient(black 0, black calc(100% - var(--reason-fade)), transparent 100%)}.Nr89iW_reasonCard[data-expanded=true] .Nr89iW_reasonViewport{mask-image:none}.Nr89iW_reasonViewport:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-3px}.Nr89iW_reasonTrack{position:relative;transform:translateY(0)}.Nr89iW_reasonCard[data-following=true] .Nr89iW_reasonTrack{will-change:transform}.Nr89iW_reasonText{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;padding:8px 16px 16px;font-size:14px;line-height:24px}.Nr89iW_reasonText .Nr89iW_readingText>div{font-size:inherit;line-height:inherit;color:inherit}.Nr89iW_reasonFooter{color:var(--dsw-alias-label-secondary);justify-content:space-between;align-items:center;gap:8px;padding:2px 10px 8px;font-size:12px;line-height:20px;display:flex}.Nr89iW_reasonAction{min-height:28px;color:inherit;font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;gap:5px;padding:4px 6px;display:inline-flex}.Nr89iW_reasonAction:hover{background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_reasonAction:disabled{cursor:default;opacity:.65}.Nr89iW_reasonAction svg{fill:none;stroke:currentColor;stroke-width:1.3px;stroke-linecap:round;stroke-linejoin:round;flex:none}.Nr89iW_reasonCaption{padding-left:6px}@container (width<=480px){.Nr89iW_reasonCard{--reason-preview-height:192px}}@media (pointer:coarse){.Nr89iW_reasonAction{min-height:44px}}@media (prefers-reduced-motion:reduce){.Nr89iW_reasonTrack{will-change:auto!important;transition:none!important;transform:none!important}}@media (forced-colors:active){.Nr89iW_reasonViewport{mask-image:none!important}}.Nr89iW_processItem,.Nr89iW_tool{min-width:0;margin:0 0 18px}.Nr89iW_processLabel{color:var(--dsw-alias-label-tertiary);align-items:baseline;gap:12px;margin:0 0 6px;font-size:12px;line-height:20px;display:flex}.Nr89iW_processFootnote{color:var(--dsw-alias-label-tertiary);margin:14px 0 0;font-size:12px;line-height:20px}.Nr89iW_detail{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:22px}.Nr89iW_detail>summary{cursor:pointer;padding:3px 0}.Nr89iW_detail[open]>summary{margin-bottom:8px}.Nr89iW_tool>.Nr89iW_tool{margin:10px 0 0 12px}.Nr89iW_meta{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px}.Nr89iW_stopped{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-tertiary);border-radius:6px;align-self:flex-start;margin-top:12px;padding:0 6px;font-size:11px;line-height:18px}.Nr89iW_compactionRow{box-sizing:border-box;flex-direction:column;align-items:center;width:100%;margin:16px 0;display:flex}.Nr89iW_compactionLine{width:100%;color:var(--dsw-alias-label-tertiary);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;gap:12px;font-size:11px;line-height:18px;display:flex}.Nr89iW_compactionLine:before,.Nr89iW_compactionLine:after{content:\"\";background:var(--dsw-alias-border-l1);opacity:.7;flex:1;height:1px}.Nr89iW_compactionRow>.Nr89iW_compactionLine{animation:.52s cubic-bezier(.4,0,.2,1) both Nr89iW_compactionLineIn}.Nr89iW_compactionRow>.Nr89iW_compactionLine>.Nr89iW_compactionPill{animation:.42s cubic-bezier(.34,1.4,.64,1) .12s both Nr89iW_compactionPillIn}.Nr89iW_compactionRow>.Nr89iW_compactionLine .Nr89iW_compactionIcon{animation:.9s cubic-bezier(.4,0,.2,1) .2s both Nr89iW_compactionDial}@keyframes Nr89iW_compactionLineIn{0%{opacity:0;transform:scaleX(.6)}to{opacity:1;transform:scaleX(1)}}@keyframes Nr89iW_compactionPillIn{0%{opacity:0;transform:translateY(-6px)scale(.94)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes Nr89iW_compactionDial{0%{opacity:0;transform:rotate(-140deg)}to{opacity:.7;transform:rotate(0)}}[data-motion=off] .Nr89iW_compactionRow>.Nr89iW_compactionLine,[data-motion=off] .Nr89iW_compactionRow>.Nr89iW_compactionLine>.Nr89iW_compactionPill,[data-motion=off] .Nr89iW_compactionRow>.Nr89iW_compactionLine .Nr89iW_compactionIcon{animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_compactionRow>.Nr89iW_compactionLine,.Nr89iW_compactionRow>.Nr89iW_compactionLine>.Nr89iW_compactionPill,.Nr89iW_compactionRow>.Nr89iW_compactionLine .Nr89iW_compactionIcon{animation:none!important}}.Nr89iW_compactionPill{background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);border-radius:12px;align-items:center;gap:6px;padding:2px 10px;font-family:inherit;font-size:11px;line-height:18px;display:inline-flex}.Nr89iW_compactionButton{cursor:pointer;transition:color .14s,border-color .14s,background-color .14s}.Nr89iW_compactionButton:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_compactionIcon{opacity:.7;flex:none;width:12px;height:12px}.Nr89iW_compactionToggle{opacity:.8;margin-left:2px;font-size:10px}.Nr89iW_compactionSummaryBox{background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);width:100%;max-width:680px;color:var(--dsw-alias-label-secondary);box-sizing:border-box;border-radius:8px;margin-top:10px;padding:12px 16px;font-size:12px;line-height:20px}.Nr89iW_compactionSummaryHeader{color:var(--dsw-alias-label-tertiary);border-bottom:1px dashed var(--dsw-alias-border-l1);margin-bottom:8px;padding-bottom:4px;font-size:11px;font-weight:500}.Nr89iW_notice,.Nr89iW_error,.Nr89iW_attention{overflow-wrap:anywhere;border-radius:10px;padding:12px 14px;font-size:13px;line-height:20px}.Nr89iW_notice{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2)}.Nr89iW_error{color:var(--dsw-alias-label-primary);background:#ef44440f;border:1px solid #ef444438;align-items:flex-start;gap:10px;display:flex}.Nr89iW_errorIcon{color:#ef4444;flex:none;width:16px;height:16px;margin-top:2px}.Nr89iW_errorCopy{flex:1;min-width:0}.Nr89iW_errorTitle{color:#dc2626;align-items:center;gap:8px;margin-bottom:2px;font-weight:500;display:flex}.Nr89iW_errorMessage{color:var(--dsw-alias-label-secondary);word-break:break-word;margin:0;font-size:12px;line-height:18px}.Nr89iW_errorCode{color:#dc2626;background:#ef44441f;border-radius:4px;padding:1px 5px;font-family:inherit;font-size:11px}.Nr89iW_attention{border:1px solid var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base);flex-direction:column;gap:3px;display:flex}.Nr89iW_attention span{color:var(--dsw-alias-label-secondary)}.Nr89iW_unknown{background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:12px 14px;font-size:13px;line-height:22px}.Nr89iW_unknown p{margin:0 0 6px}.Nr89iW_historyButton{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0;border-radius:8px;align-self:center;padding:4px 12px;font-size:12px}.Nr89iW_historyButton:disabled{opacity:.55;cursor:default}.Nr89iW_empty{color:var(--dsw-alias-label-tertiary);text-align:center;padding:40px 0}.Nr89iW_answerActions{align-items:center;gap:8px;min-height:28px;margin:13px 0 0 -6px;display:flex}.Nr89iW_userActions{align-items:center;gap:8px;min-height:28px;display:flex}.Nr89iW_messageClock{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13px;line-height:24px}.Nr89iW_iconButton{color:var(--dsw-alias-label-tertiary);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.Nr89iW_iconButton svg{fill:none;stroke:currentColor;stroke-width:1.2px;stroke-linecap:round;stroke-linejoin:round}.Nr89iW_imageFigure{box-sizing:border-box;align-self:flex-start;width:min(100%,360px);max-width:100%;margin:0}.Nr89iW_imageFrame{background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);box-sizing:border-box;border-radius:12px;max-width:100%;min-height:96px;max-height:440px;position:relative;overflow:hidden}.Nr89iW_imageOpen{background:0 0;border:0;width:100%;height:100%;padding:0;display:flex;position:absolute;inset:0}.Nr89iW_imageOpen img{object-fit:contain;opacity:0;width:100%;height:100%;transition:opacity .2s cubic-bezier(.4,0,.2,1);display:block}.Nr89iW_imageOpen img[data-ready=true]{opacity:1}.Nr89iW_pendingImage{object-fit:contain;width:100%;max-width:100%;height:100%;display:block}.Nr89iW_imagePlaceholder{color:var(--dsw-alias-label-tertiary);pointer-events:none;flex-direction:column;justify-content:center;align-items:center;gap:8px;font-size:13px;display:flex;position:absolute;inset:0}.Nr89iW_imagePlaceholder button{pointer-events:auto}.Nr89iW_imageFigure figcaption{color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;margin-top:6px;font-size:12px;line-height:20px}.Nr89iW_imageDialog{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);border-radius:16px;max-width:90vw;max-height:90vh;padding:38px 20px 20px}.Nr89iW_imageDialog::backdrop{background:var(--dsw-alias-bg-mask-photo)}.Nr89iW_imageDialog img{object-fit:contain;max-width:82vw;max-height:75vh;display:block}.Nr89iW_dialogClose{color:inherit;background:0 0;border:0;border-radius:8px;width:32px;height:32px;font-size:24px;position:absolute;top:4px;right:8px}.Nr89iW_jumpDock{bottom:calc(var(--dsh-composer-height,152px) + 16px);z-index:8;pointer-events:none;justify-content:flex-end;height:0;display:flex;position:sticky}.Nr89iW_deliverablesRoot{grid-template-columns:max-content minmax(0,1fr);align-items:start;column-gap:10px;margin-top:14px;font-size:13px;line-height:22px;display:grid}.Nr89iW_deliverablesLabel{color:var(--dsw-alias-label-tertiary);grid-area:1/1;padding-top:2px;font-size:12px;font-weight:500}.Nr89iW_deliverablesLane{grid-area:1/2;min-width:0}.Nr89iW_deliverablesRow{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.Nr89iW_deliverableChip{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary);border-radius:6px;align-items:center;font-size:12px;line-height:20px;transition:border-color .16s,background-color .16s,color .16s;display:inline-flex;overflow:hidden}.Nr89iW_deliverableChip:hover{border-color:var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-module-platform);box-shadow:0 1px 4px var(--dsw-alias-border-l1)}.Nr89iW_deliverableChip[data-status=opened]{color:#059669;background:#10b9811f;border-color:#10b981}.Nr89iW_chipMain{max-width:220px;color:inherit;font:inherit;cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:5px;padding:3px 6px 3px 8px;display:inline-flex}.Nr89iW_chipMain:hover{color:var(--dsw-alias-label-primary)}.Nr89iW_deliverableIcon,.Nr89iW_statusIcon{opacity:.8;flex:none;width:13px;height:13px}.Nr89iW_statusIcon{color:#10b981}.Nr89iW_deliverableName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Nr89iW_chipActions{opacity:.65;border-left:1px solid #0000;align-items:center;gap:2px;padding-right:4px;transition:opacity .15s,border-left-color .15s;display:inline-flex}.Nr89iW_deliverableChip:hover .Nr89iW_chipActions{opacity:1;border-left-color:var(--dsw-alias-border-l2)}.Nr89iW_chipActionBtn{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:0;transition:color .12s,background-color .12s;display:inline-flex}.Nr89iW_chipActionBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_actionIcon{width:12px;height:12px}.Nr89iW_deliverablesMore{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:12px}.Nr89iW_deliverablesShowFolder{color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:5px;align-items:center;gap:4px;padding:2px 7px;font-size:12px;transition:all .15s;display:inline-flex}.Nr89iW_deliverablesShowFolder:hover{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l2)}.Nr89iW_deliverablesShowFolder[data-status=opened]{color:#10b981;background:#10b98114;border-color:#10b9814d}.Nr89iW_morphCluster{flex-direction:column;width:100%;min-width:0;display:flex}.Nr89iW_morphDrawer{transform-origin:top;will-change:height, opacity, transform;height:0;overflow:hidden}.Nr89iW_liveFoldImpact{animation:.18s cubic-bezier(.2,0,0,1) both Nr89iW_liveFoldElastic}@keyframes Nr89iW_liveFoldElastic{0%{transform:scale(1)}50%{transform:scale(1.015)}to{transform:scale(1)}}.Nr89iW_liveFoldContainer{top:calc(var(--reader-toolbar-height,var(--reader-lane-block,40px)) + var(--reader-status-height,var(--reader-lane-block,40px)) + var(--reader-summary-height,var(--reader-lane-block,40px)));z-index:4;background:var(--dsw-alias-bg-base);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);transform-origin:0;will-change:transform, opacity;margin-bottom:6px;padding:4px 0;animation:.32s cubic-bezier(.16,1,.3,1) both Nr89iW_liveFoldPulse;position:sticky}@keyframes Nr89iW_liveFoldPulse{0%{opacity:.8;transform:translateY(-4px)scale(.98)}50%{opacity:1;transform:translateY(0)scale(1.02)}to{opacity:1;transform:translateY(0)scale(1)}}[data-motion=off] .Nr89iW_liveFoldContainer{animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_liveFoldContainer{animation:none!important}}.Nr89iW_priorFoldDrawer{flex-direction:column;gap:14px;width:100%;min-width:0;display:flex}.Nr89iW_jump{width:34px;height:34px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-button-floating-fill,var(--dsw-alias-bg-base));box-shadow:var(--dsw-elevation-panel,0 2px 8px var(--dsw-alias-border-l1));pointer-events:auto;border:0;border-radius:100px;flex:none;justify-content:center;align-items:center;margin-top:-34px;padding:0;display:flex}.Nr89iW_jump:hover{background:var(--dsw-alias-button-floating-hover,var(--dsw-alias-interactive-bg-hover))}.Nr89iW_foldSummary{text-overflow:ellipsis;align-items:baseline;max-width:100%;display:inline-flex;overflow:hidden;white-space:nowrap!important}.Nr89iW_foldSummaryPart{flex:none;align-items:baseline;display:inline-flex;white-space:nowrap!important}.Nr89iW_numberRollRoot{vertical-align:baseline;line-height:inherit;font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";text-align:center;flex-shrink:0;justify-content:center;min-width:1.45em;display:inline-flex;position:relative;overflow:hidden;white-space:nowrap!important}.Nr89iW_numberRollSizer{visibility:hidden;-webkit-user-select:none;user-select:none;pointer-events:none;line-height:inherit;white-space:nowrap}.Nr89iW_numberRollDigit{line-height:inherit;white-space:nowrap;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.Nr89iW_numberRollExit{animation:.24s cubic-bezier(.16,1,.3,1) forwards Nr89iW_numberRollOut}.Nr89iW_numberRollEnter{animation:.24s cubic-bezier(.16,1,.3,1) forwards Nr89iW_numberRollIn}@keyframes Nr89iW_numberRollOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-100%)}}@keyframes Nr89iW_numberRollIn{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}[data-motion=off] .Nr89iW_chevron,[data-motion=off] .Nr89iW_imageOpen img,[data-motion=off] .Nr89iW_processMeta,[data-motion=off] .Nr89iW_numberRollDigit{transition:none!important;animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_chevron,.Nr89iW_imageOpen img,.Nr89iW_processMeta,.Nr89iW_numberRollDigit{transition:none!important;animation:none!important}}.Nr89iW_turnStatus{white-space:nowrap;flex:none;align-self:flex-start;align-items:center;height:26px;margin:4px 0 12px;padding:0 4px;font-size:14px;line-height:22px;display:inline-flex}.Nr89iW_turnStatusLabel{background:linear-gradient(90deg, var(--dsw-static-deepseek-500,#4d6bfe) 0%, var(--dsw-static-deepseek-500,#4d6bfe) 40%, var(--dsw-static-deepseek-200,#a8c7fa) 50%, var(--dsw-static-deepseek-500,#4d6bfe) 60%, var(--dsw-static-deepseek-500,#4d6bfe) 100%);color:#0000;-webkit-text-fill-color:transparent;background-position:100% 0;background-size:250% 100%;background-clip:text;font-weight:500;animation:1.8s linear infinite Nr89iW_dsh-turn-status-shimmer}.Nr89iW_waitClock{flex:none;align-items:center;margin-left:8px;display:inline-flex}.Nr89iW_waitSeconds{font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";color:var(--dsw-alias-label-caption,#86909c);font-size:13px;font-weight:400}.Nr89iW_waitOvertime{color:var(--dsw-alias-state-warning-primary,#d8862c);background:color-mix(in srgb, var(--dsw-alias-state-warning-primary,#d8862c) 16%, transparent);border-radius:5px;margin-left:8px;padding:0 6px;font-size:11px;line-height:16px}.Nr89iW_turnStatusClock{font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";color:var(--dsw-alias-label-caption,#86868b);-webkit-text-fill-color:var(--dsw-alias-label-caption,#86868b);margin-left:8px;font-size:13px;font-weight:400}@keyframes Nr89iW_dsh-turn-status-shimmer{to{background-position:0 0}}[data-motion=off] .Nr89iW_turnStatusLabel{color:var(--dsw-static-deepseek-500,#4d6bfe)!important;-webkit-text-fill-color:var(--dsw-static-deepseek-500,#4d6bfe)!important;animation:none!important}@media (prefers-reduced-motion:reduce){.Nr89iW_turnStatusLabel{color:var(--dsw-static-deepseek-500,#4d6bfe)!important;-webkit-text-fill-color:var(--dsw-static-deepseek-500,#4d6bfe)!important;animation:none!important}}@media (pointer:coarse){.Nr89iW_disclosureButton{min-height:44px}}@media (max-width:600px){.Nr89iW_root{padding-inline:20px}.Nr89iW_column{gap:18px}.Nr89iW_toolbar{font-size:11px}}.Nr89iW_choreographedFlow{overflow-anchor:none;flex-direction:column;min-width:0;display:flex}.Nr89iW_flowCell{min-width:0;display:flow-root;overflow:clip}.Nr89iW_flowCell[hidden]{display:none}.Nr89iW_flowCellInner{flex-direction:column;min-width:0;padding-bottom:16px;display:flex}.Nr89iW_flowCellInner:empty{padding-bottom:0}.Nr89iW_choreographedFlow[data-reader-transition=collapse] .Nr89iW_flowCell *{animation-play-state:paused!important}.Nr89iW_numberRollExit,.Nr89iW_numberRollEnter{animation-duration:.16s}.Nr89iW_foldSummary{align-items:baseline;display:inline-flex;white-space:nowrap!important;flex-wrap:nowrap!important}.Nr89iW_toolbar{box-sizing:border-box;width:100%;max-width:100%;min-height:var(--reader-lane-block,40px);z-index:7;-webkit-backdrop-filter:none;backdrop-filter:none;border-bottom:0;align-self:stretch}.Nr89iW_turnProcessSticky{box-sizing:border-box;width:calc(100% - var(--reader-control-width,148px));top:var(--reader-toolbar-height,var(--reader-lane-block,40px));min-height:var(--reader-lane-block,40px);z-index:6;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:0 -14px 0 var(--dsw-alias-bg-base), var(--reader-control-width,148px) 0 0 var(--dsw-alias-bg-base), 0 -14px 0 var(--dsw-alias-bg-layer-1,transparent), var(--reader-control-width,148px) 0 0 var(--dsw-alias-bg-layer-1,transparent), 0 -14px 0 Canvas, var(--reader-control-width,148px) 0 0 Canvas;background-clip:padding-box;border-bottom:1px solid #0000;padding-right:0}.Nr89iW_turnStickyLanes .Nr89iW_turnProcessSticky,.Nr89iW_turnStickyLanes .Nr89iW_closedProcessSummary{z-index:auto;position:static;top:auto}.Nr89iW_flowCell[data-flow-summary],.Nr89iW_closedProcessSummary{top:calc(var(--reader-toolbar-height,var(--reader-lane-block,40px)) + var(--reader-status-height,var(--reader-lane-block,40px)));z-index:5;box-sizing:border-box;min-height:var(--reader-lane-block,40px);background:var(--dsw-alias-bg-base);border-bottom:0;padding-block:4px;position:sticky;overflow:visible}.Nr89iW_root .md-code-block{z-index:0}.Nr89iW_turnStickyRegion:has(>.Nr89iW_turnStickyLanes>.Nr89iW_closedProcessSummary),.Nr89iW_turnStickyRegion:has(.Nr89iW_flowCell[data-flow-summary]){--reader-code-summary-height:var(--reader-summary-height,var(--reader-lane-block,40px))}.Nr89iW_root .md-code-block>:has(+[data-code-block-content]){top:calc(max(var(--reader-toolbar-height,40px), var(--reader-status-height,0px)) + var(--reader-status-height,0px) + var(--reader-code-summary-height,0px))}.Nr89iW_flowCell[data-flow-summary]{box-shadow:0 -16px 0 var(--dsw-alias-bg-base), 0 -16px 0 var(--dsw-alias-bg-layer-1,transparent), 0 -16px 0 Canvas}.Nr89iW_closedProcessSummary{box-shadow:0 -14px 0 var(--dsw-alias-bg-base), 0 -14px 0 var(--dsw-alias-bg-layer-1,transparent), 0 -14px 0 Canvas}.Nr89iW_foldControl{background:var(--dsw-alias-bg-module-platform);border-radius:8px;align-items:center;gap:0;padding:2px;display:inline-flex}.Nr89iW_foldStop{color:var(--dsw-alias-label-secondary);white-space:nowrap;font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:2px 8px;font-size:12px;line-height:18px}.Nr89iW_foldStop[data-on]{background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary)}.Nr89iW_flowCell[data-flow-summary]>.Nr89iW_flowCellInner{padding-bottom:0}.Nr89iW_flowCell[data-flow-summary] .Nr89iW_disclosureButton,.Nr89iW_closedProcessSummary .Nr89iW_disclosureButton{width:auto;max-width:100%}.Nr89iW_flowCell[data-flow-summary] .Nr89iW_foldSummary,.Nr89iW_closedProcessSummary .Nr89iW_foldSummary{min-width:0}.Nr89iW_turnProcessSticky>.Nr89iW_disclosure{flex:auto;min-width:0}.Nr89iW_disclosureButton{width:max-content;max-width:calc(100% + 6px)}.Nr89iW_statusText{flex:0 auto}.Nr89iW_think{width:max-content;min-width:0}.Nr89iW_thinkSizer{white-space:normal;overflow-wrap:anywhere}.Nr89iW_thinkText{white-space:normal;overflow-wrap:anywhere;text-overflow:clip;overflow:visible}.Nr89iW_toolbar,.Nr89iW_turnStickyLanes,.Nr89iW_turnProcessSticky,.Nr89iW_liveFoldContainer,.Nr89iW_flowCell[data-flow-summary],.Nr89iW_closedProcessSummary{background-color:canvas;background-image:var(--reader-lane-plate);background-repeat:no-repeat}.Nr89iW_root[data-reader-glass] .Nr89iW_toolbar,.Nr89iW_root[data-reader-glass] .Nr89iW_turnProcessSticky,.Nr89iW_root[data-reader-glass] .Nr89iW_liveFoldContainer{-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:none;background:0 0;border:0;border-radius:0}.Nr89iW_root[data-reader-glass] .Nr89iW_toolbar,.Nr89iW_root[data-reader-glass] .Nr89iW_turnProcessSticky{-webkit-backdrop-filter:none;backdrop-filter:none}.Nr89iW_root[data-reader-glass] .Nr89iW_toolbar{pointer-events:none}.Nr89iW_root[data-reader-glass] .Nr89iW_toolbar>.Nr89iW_textButton,.Nr89iW_root[data-reader-glass] .Nr89iW_turnProcessSticky .Nr89iW_disclosureButton{pointer-events:auto;background:color-mix(in srgb, var(--dsw-alias-bg-layer-1,#ffffffb3) 80%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-radius:999px;padding:2px 10px}.Nr89iW_root[data-reader-glass] .Nr89iW_turnProcessSticky .Nr89iW_disclosureButton{max-width:100%;margin-left:0}.Nr89iW_root[data-reader-glass] .Nr89iW_toolbar>.Nr89iW_textButton:hover,.Nr89iW_root[data-reader-glass] .Nr89iW_turnProcessSticky .Nr89iW_disclosureButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.Nr89iW_root[data-reader-glass] .Nr89iW_flowCell[data-flow-summary],.Nr89iW_root[data-reader-glass] .Nr89iW_closedProcessSummary{box-shadow:none;z-index:auto;border-left:2px solid color-mix(in srgb, var(--dsw-alias-border-l2,#80808059) 80%, transparent);padding-block:2px;background:0 0;border-radius:0;min-height:32px;padding-left:10px;position:static}.Nr89iW_root[data-reader-glass] .Nr89iW_turnStickyLanes{z-index:auto;display:contents;position:static;top:auto}.Nr89iW_root[data-reader-glass] .Nr89iW_turnStickyRegion{--reader-code-summary-height:0px}.Nr89iW_root[data-reader-glass] .Nr89iW_turnStickyLanes .Nr89iW_turnProcessSticky{top:var(--reader-toolbar-height,var(--reader-lane-block,40px));z-index:6;position:sticky}.Nr89iW_root[data-reader-glass] .Nr89iW_user{background:color-mix(in srgb, var(--dsw-specific-bubble,#00000014) 25%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1,#8080804d) 30%, transparent)}.Nr89iW_root[data-reader-glass] .Nr89iW_reasonCard{border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#80808059) 65%, transparent);background:0 0}.Nr89iW_root[data-reader-glass] .Nr89iW_toolDetails,.Nr89iW_root[data-reader-glass] .Nr89iW_notice,.Nr89iW_root[data-reader-glass] .Nr89iW_unknown,.Nr89iW_root[data-reader-glass] .Nr89iW_toolRaw,.Nr89iW_root[data-reader-glass] .Nr89iW_systemPrompt,.Nr89iW_root[data-reader-glass] .Nr89iW_compactionSummaryBox,.Nr89iW_root[data-reader-glass] .Nr89iW_attention,.Nr89iW_root[data-reader-glass] .Nr89iW_imageFrame,.Nr89iW_root[data-reader-glass] .Nr89iW_imageDialog{background:0 0}.Nr89iW_root[data-reader-glass] .Nr89iW_diffOverlay{background:color-mix(in srgb, var(--dsw-alias-bg-module-platform,#7f7f7f1a) 20%, transparent);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}.Nr89iW_root[data-reader-glass] .Nr89iW_diffScrollArea{background:0 0}.Nr89iW_root[data-reader-glass] .Nr89iW_diffTab{background:color-mix(in srgb, var(--dsw-alias-bg-base,#fffc) 25%, transparent)}.Nr89iW_root[data-reader-glass] .Nr89iW_diffTab[data-active]{background:color-mix(in srgb, var(--dsw-alias-bg-base,#fff) 45%, transparent)}:is(.Nr89iW_root[data-reader-glass] .md-code-block,.Nr89iW_root[data-reader-glass] [data-diff]){border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1,#80808033) 30%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:color-mix(in srgb, var(--dsw-alias-markdown-code-block,#0000000f) 25%, transparent)!important}.Nr89iW_root[data-reader-glass] .Nr89iW_foldControl{background:color-mix(in srgb, var(--dsw-alias-bg-module-platform,#7f7f7f1a) 25%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#80808033) 30%, transparent)}.Nr89iW_root[data-reader-glass] .Nr89iW_foldStop[data-on]{background:color-mix(in srgb, var(--dsw-alias-bg-base,#fff) 35%, transparent)}.Nr89iW_root[data-reader-glass] .Nr89iW_compactionPill,.Nr89iW_root[data-reader-glass] .Nr89iW_deliverableChip,.Nr89iW_root[data-reader-glass] .Nr89iW_toolState,.Nr89iW_root[data-reader-glass] .Nr89iW_diffStatButton{background:0 0;border-color:#0000}.Nr89iW_root[data-reader-glass] .Nr89iW_compactionPill:hover,.Nr89iW_root[data-reader-glass] .Nr89iW_compactionPill:focus-visible,.Nr89iW_root[data-reader-glass] .Nr89iW_deliverableChip:hover,.Nr89iW_root[data-reader-glass] .Nr89iW_deliverableChip:focus-within,.Nr89iW_root[data-reader-glass] .Nr89iW_toolState:hover,.Nr89iW_root[data-reader-glass] .Nr89iW_diffStatButton:hover,.Nr89iW_root[data-reader-glass] .Nr89iW_diffStatButton:focus-visible,.Nr89iW_root[data-reader-glass] .Nr89iW_diffStatButton[aria-expanded=true]{background:var(--dsw-alias-bg-module-platform,#7f7f7f1a);border-color:var(--dsw-alias-border-l2,#7f7f7f47)}html body[data-dsh-claude-style][data-dsh-claude-composer-active] [data-dsh-claude-composer-hidden]:has([data-dsh-better-display]) [data-composer-seat]{display:flex!important}"; - const tagId$5 = "dsh-better-chat/Reader.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$5; - tag.textContent = css$5; - document.head.appendChild(tag); - } - var Reader_module_css_default = { - "actionIcon": "Nr89iW_actionIcon", - "answer": "Nr89iW_answer", - "answerActions": "Nr89iW_answerActions", - "attention": "Nr89iW_attention", - "blocks": "Nr89iW_blocks", - "chevron": "Nr89iW_chevron", - "chipActionBtn": "Nr89iW_chipActionBtn", - "chipActions": "Nr89iW_chipActions", - "chipMain": "Nr89iW_chipMain", - "choreographedFlow": "Nr89iW_choreographedFlow", - "closedProcessSummary": "Nr89iW_closedProcessSummary", - "column": "Nr89iW_column", - "commandInput": "Nr89iW_commandInput", - "compactionButton": "Nr89iW_compactionButton", - "compactionDial": "Nr89iW_compactionDial", - "compactionIcon": "Nr89iW_compactionIcon", - "compactionLine": "Nr89iW_compactionLine", - "compactionLineIn": "Nr89iW_compactionLineIn", - "compactionPill": "Nr89iW_compactionPill", - "compactionPillIn": "Nr89iW_compactionPillIn", - "compactionRow": "Nr89iW_compactionRow", - "compactionSummaryBox": "Nr89iW_compactionSummaryBox", - "compactionSummaryHeader": "Nr89iW_compactionSummaryHeader", - "compactionToggle": "Nr89iW_compactionToggle", - "deliverableChip": "Nr89iW_deliverableChip", - "deliverableIcon": "Nr89iW_deliverableIcon", - "deliverableName": "Nr89iW_deliverableName", - "deliverablesLabel": "Nr89iW_deliverablesLabel", - "deliverablesLane": "Nr89iW_deliverablesLane", - "deliverablesMore": "Nr89iW_deliverablesMore", - "deliverablesRoot": "Nr89iW_deliverablesRoot", - "deliverablesRow": "Nr89iW_deliverablesRow", - "deliverablesShowFolder": "Nr89iW_deliverablesShowFolder", - "detail": "Nr89iW_detail", - "dialogClose": "Nr89iW_dialogClose", - "diffAdded": "Nr89iW_diffAdded", - "diffCaret": "Nr89iW_diffCaret", - "diffEmpty": "Nr89iW_diffEmpty", - "diffHunkBody": "Nr89iW_diffHunkBody", - "diffLineAdded": "Nr89iW_diffLineAdded", - "diffLineRemoved": "Nr89iW_diffLineRemoved", - "diffLines": "Nr89iW_diffLines", - "diffOverlay": "Nr89iW_diffOverlay", - "diffOverlayRow": "Nr89iW_diffOverlayRow", - "diffPath": "Nr89iW_diffPath", - "diffRemoved": "Nr89iW_diffRemoved", - "diffScrollArea": "Nr89iW_diffScrollArea", - "diffStat": "Nr89iW_diffStat", - "diffStatButton": "Nr89iW_diffStatButton", - "diffStatRoot": "Nr89iW_diffStatRoot", - "diffTab": "Nr89iW_diffTab", - "diffTabs": "Nr89iW_diffTabs", - "disclosure": "Nr89iW_disclosure", - "disclosureBody": "Nr89iW_disclosureBody", - "disclosureButton": "Nr89iW_disclosureButton", - "dsh-turn-status-shimmer": "Nr89iW_dsh-turn-status-shimmer", - "empty": "Nr89iW_empty", - "error": "Nr89iW_error", - "errorCode": "Nr89iW_errorCode", - "errorCopy": "Nr89iW_errorCopy", - "errorIcon": "Nr89iW_errorIcon", - "errorMessage": "Nr89iW_errorMessage", - "errorTitle": "Nr89iW_errorTitle", - "flowCell": "Nr89iW_flowCell", - "flowCellInner": "Nr89iW_flowCellInner", - "foldControl": "Nr89iW_foldControl", - "foldStop": "Nr89iW_foldStop", - "foldSummary": "Nr89iW_foldSummary", - "foldSummaryPart": "Nr89iW_foldSummaryPart", - "historyButton": "Nr89iW_historyButton", - "iconButton": "Nr89iW_iconButton", - "imageDialog": "Nr89iW_imageDialog", - "imageFigure": "Nr89iW_imageFigure", - "imageFrame": "Nr89iW_imageFrame", - "imageOpen": "Nr89iW_imageOpen", - "imagePlaceholder": "Nr89iW_imagePlaceholder", - "isEnterStart": "Nr89iW_isEnterStart", - "isExit": "Nr89iW_isExit", - "jump": "Nr89iW_jump", - "jumpDock": "Nr89iW_jumpDock", - "liveFoldContainer": "Nr89iW_liveFoldContainer", - "liveFoldElastic": "Nr89iW_liveFoldElastic", - "liveFoldImpact": "Nr89iW_liveFoldImpact", - "liveFoldPulse": "Nr89iW_liveFoldPulse", - "mainFlow": "Nr89iW_mainFlow", - "messageClock": "Nr89iW_messageClock", - "meta": "Nr89iW_meta", - "morphCluster": "Nr89iW_morphCluster", - "morphDrawer": "Nr89iW_morphDrawer", - "nativeToolRow": "Nr89iW_nativeToolRow", - "nativeToolSummary": "Nr89iW_nativeToolSummary", - "notice": "Nr89iW_notice", - "numberRollDigit": "Nr89iW_numberRollDigit", - "numberRollEnter": "Nr89iW_numberRollEnter", - "numberRollExit": "Nr89iW_numberRollExit", - "numberRollIn": "Nr89iW_numberRollIn", - "numberRollOut": "Nr89iW_numberRollOut", - "numberRollRoot": "Nr89iW_numberRollRoot", - "numberRollSizer": "Nr89iW_numberRollSizer", - "pendingImage": "Nr89iW_pendingImage", - "priorFoldDrawer": "Nr89iW_priorFoldDrawer", - "processContents": "Nr89iW_processContents", - "processFootnote": "Nr89iW_processFootnote", - "processFrame": "Nr89iW_processFrame", - "processItem": "Nr89iW_processItem", - "processLabel": "Nr89iW_processLabel", - "processMeta": "Nr89iW_processMeta", - "processMetaInner": "Nr89iW_processMetaInner", - "processMetaLine": "Nr89iW_processMetaLine", - "processSeamRow": "Nr89iW_processSeamRow", - "readerRunningGlow": "Nr89iW_readerRunningGlow", - "readerStepShimmer": "Nr89iW_readerStepShimmer", - "readingText": "Nr89iW_readingText", - "reasonAction": "Nr89iW_reasonAction", - "reasonCaption": "Nr89iW_reasonCaption", - "reasonCard": "Nr89iW_reasonCard", - "reasonFooter": "Nr89iW_reasonFooter", - "reasonHeading": "Nr89iW_reasonHeading", - "reasonLabel": "Nr89iW_reasonLabel", - "reasonPlain": "Nr89iW_reasonPlain", - "reasonText": "Nr89iW_reasonText", - "reasonTrack": "Nr89iW_reasonTrack", - "reasonViewport": "Nr89iW_reasonViewport", - "retiringContent": "Nr89iW_retiringContent", - "root": "Nr89iW_root", - "rowSeparator": "Nr89iW_rowSeparator", - "srOnly": "Nr89iW_srOnly", - "statusIcon": "Nr89iW_statusIcon", - "statusText": "Nr89iW_statusText", - "stopped": "Nr89iW_stopped", - "streamAtom": "Nr89iW_streamAtom", - "streamInlineWord": "Nr89iW_streamInlineWord", - "streamWord": "Nr89iW_streamWord", - "summaryRow": "Nr89iW_summaryRow", - "systemPrompt": "Nr89iW_systemPrompt", - "textButton": "Nr89iW_textButton", - "think": "Nr89iW_think", - "thinkShimmer": "Nr89iW_thinkShimmer", - "thinkSizer": "Nr89iW_thinkSizer", - "thinkText": "Nr89iW_thinkText", - "tool": "Nr89iW_tool", - "toolActivity": "Nr89iW_toolActivity", - "toolbar": "Nr89iW_toolbar", - "toolChildren": "Nr89iW_toolChildren", - "toolDetailNote": "Nr89iW_toolDetailNote", - "toolDetails": "Nr89iW_toolDetails", - "toolDocument": "Nr89iW_toolDocument", - "toolElapsed": "Nr89iW_toolElapsed", - "toolEngine": "Nr89iW_toolEngine", - "toolGlyph": "Nr89iW_toolGlyph", - "toolHeading": "Nr89iW_toolHeading", - "toolHeadingCopy": "Nr89iW_toolHeadingCopy", - "toolHeadingState": "Nr89iW_toolHeadingState", - "toolLedger": "Nr89iW_toolLedger", - "toolPanel": "Nr89iW_toolPanel", - "toolRaw": "Nr89iW_toolRaw", - "toolRawLabel": "Nr89iW_toolRawLabel", - "toolReceipt": "Nr89iW_toolReceipt", - "toolState": "Nr89iW_toolState", - "toolTabs": "Nr89iW_toolTabs", - "toolTarget": "Nr89iW_toolTarget", - "toolTitle": "Nr89iW_toolTitle", - "turn": "Nr89iW_turn", - "turnProcessSticky": "Nr89iW_turnProcessSticky", - "turnStatus": "Nr89iW_turnStatus", - "turnStatusClock": "Nr89iW_turnStatusClock", - "turnStatusLabel": "Nr89iW_turnStatusLabel", - "turnStickyLanes": "Nr89iW_turnStickyLanes", - "turnStickyRegion": "Nr89iW_turnStickyRegion", - "unknown": "Nr89iW_unknown", - "user": "Nr89iW_user", - "userActions": "Nr89iW_userActions", - "userCluster": "Nr89iW_userCluster", - "userImages": "Nr89iW_userImages", - "waitClock": "Nr89iW_waitClock", - "waitOvertime": "Nr89iW_waitOvertime", - "waitSeconds": "Nr89iW_waitSeconds" - }; - // src/client/word-motion.tsx - const WordScope = (0, react.createContext)({ - enabled: false, - generation: 0 - }); - const CODE_LABELS = { - copyLabel: "复制代码", - copiedLabel: "已复制" - }; - function useSourceReveal(element, born, generation) { - const scope = (0, react.useContext)(WordScope); - const cancelled = (0, react.useRef)(false); - (0, react.useLayoutEffect)(() => { - const target = element.current; - if (!target) return; - target.dataset.wordState = "settled"; - if (!scope.enabled || scope.generation !== generation) { - cancelled.current = true; - return; - } - if (cancelled.current || born === null || document.hidden) return; - if (Number(document.timeline.currentTime ?? performance.now()) - born >= WORD_MOTION.duration || typeof target.animate !== "function") return; - const animation = target.animate([{ - opacity: 0, - filter: `blur(${WORD_MOTION.blur}px)` - }, { - opacity: 1, - filter: "blur(0px)" - }], { - duration: WORD_MOTION.duration, - easing: WORD_MOTION.easing, - fill: "backwards" - }); - animation.startTime = born; - target.dataset.wordState = "resolving"; - const finish = () => { - animation.cancel(); - target.dataset.wordState = "settled"; - document.removeEventListener("visibilitychange", hidden); - }; - animation.onfinish = finish; - const hidden = () => { - if (document.hidden) { - cancelled.current = true; - finish(); - } - }; - document.addEventListener("visibilitychange", hidden); - return () => { - animation.cancel(); - document.removeEventListener("visibilitychange", hidden); - target.dataset.wordState = "settled"; - }; - }, [ - element, - born, - generation, - scope.enabled, - scope.generation - ]); - } - function Word({ children, born, generation, offset, inline }) { - const element = (0, react.useRef)(null); - useSourceReveal(element, born, generation); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - ref: element, - className: inline ? Reader_module_css_default.streamInlineWord : Reader_module_css_default.streamWord, - "data-reader-word": true, - "data-source-start": offset, - "data-source-birth": born ?? void 0, - children - }); - } - /** A native code block enters on the same clock, without rebuilding its text. */ - function MotionAtom({ children, born, generation, offset }) { - const element = (0, react.useRef)(null); - useSourceReveal(element, born, generation); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: element, - className: Reader_module_css_default.streamAtom, - "data-reader-atom": true, - "data-source-start": offset, - "data-source-birth": born ?? void 0, - children - }); - } - /** Native Think is literal text, not Markdown. Spans never alter its bytes. */ - function MotionPlainText({ text, enabled, revision }) { - const timeline = (0, react.useRef)(); - timeline.current ??= new WordTimeline(); - timeline.current.begin(text, enabled, revision, Number(document.timeline.currentTime ?? performance.now())); - const current = timeline.current; - const generation = current.generation; - const scope = (0, react.useMemo)(() => ({ - enabled, - generation - }), [enabled, generation]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WordScope.Provider, { - value: scope, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.reasonPlain, - children: current.hasLiveText ? current.words(text, 0).map((word) => word.text.trim() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Word, { - born: word.born, - generation, - offset: word.key, - inline: true, - children: word.text - }, word.key) : word.text) : text - }) - }); - } - /** Native DSH Markdown semantics with a stable text-leaf animation hook. */ - function MotionMarkdown({ text, streaming, enabled, revision, fileMentions }) { - const timeline = (0, react.useRef)(); - timeline.current ??= new WordTimeline(); - timeline.current.begin(text, enabled, revision, Number(document.timeline.currentTime ?? performance.now())); - const generation = timeline.current.generation; - const scope = (0, react.useMemo)(() => ({ - enabled, - generation - }), [enabled, generation]); - const renderText = (0, react.useMemo)(() => (value, offset, inline = false) => { - const current = timeline.current; - if (!current.hasLiveText) return value; - return current.words(value, offset).map((word) => word.text.trim() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Word, { - born: word.born, - generation: current.generation, - offset: word.key, - inline: inline || /^\p{P}+$/u.test(word.text), - children: word.text - }, word.key) : word.text); - }, []); - const renderAtom = (0, react.useMemo)(() => (children, offset) => { - const current = timeline.current; - return current.hasLiveText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionAtom, { - born: current.bornAt(offset), - generation: current.generation, - offset, - children - }) : children; - }, []); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WordScope.Provider, { - value: scope, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownText$2, { - text, - streaming, - codeLabels: CODE_LABELS, - fileMentions, - pathImages: readerPathImages, - renderText, - renderAtom - }) - }); - } - // src/client/text-transform.ts - /** - * Cordis service name. Another client plugin lists this in `inject` and - * registers a transformer. The reading view paints the result. The session - * block, transcript, and fold inputs stay on the original text. - */ - const TEXT_TRANSFORM_SERVICE = "dsh-better-display.text-transform"; - const KINDS = /* @__PURE__ */ new Set(["reasoning", "body"]); - function isKind(value) { - return KINDS.has(value); - } - function reportTransformError(error) { - console.warn("[dsh-better-display] text transform failed; showing original text", error); - } - function passthrough(request) { - return { - text: request.text, - final: !request.streaming, - transformRevision: 0, - motionRevision: 0 - }; - } - function normalize(value, request) { - if (typeof value === "string") return { - text: value, - final: !request.streaming - }; - if (!value || typeof value.text !== "string") return { - text: request.text, - final: !request.streaming - }; - return { - text: value.text, - final: typeof value.final === "boolean" ? value.final : !request.streaming - }; - } - /** - * Appends keep the motion revision. A replacement gets a new one so the - * timeline treats the swapped string as already settled. - */ - function nextDisplayCursor(previous, display) { - if (!previous) return { - ...display, - transformRevision: 0, - motionRevision: 0 - }; - if (previous.text === display.text && previous.final === display.final) return previous; - const appended = display.text.startsWith(previous.text); - return { - text: display.text, - final: display.final, - transformRevision: previous.transformRevision + 1, - motionRevision: appended ? previous.motionRevision : previous.motionRevision + 1 - }; - } - /** - * Streaming flag fed to the reveal. With no transformer this is the model's - * flag. A transformer that reports `final: !streaming` produces the same flag. - */ - function displayStreaming(sourceStreaming, shown, active) { - return active ? !shown.final : sourceStreaming; - } - var TextTransformRegistryImpl = class { - stacks = /* @__PURE__ */ new Map(); - listeners = /* @__PURE__ */ new Map(); - cursors = /* @__PURE__ */ new Map(); - register(kind, transformer) { - const requested = [...new Set(Array.isArray(kind) ? kind : [kind])]; - for (const item of requested) if (!isKind(item)) throw new Error(`Unknown display text kind: ${String(item)}`); - const bound = []; - for (const item of requested) { - const entry = { transformer }; - try { - entry.unsubscribe = transformer.subscribe?.(() => { - this.emit(item); - }); - } catch (error) { - reportTransformError(error); - } - const stack = this.stacks.get(item) ?? []; - stack.push(entry); - this.stacks.set(item, stack); - bound.push({ - kind: item, - entry - }); - this.emit(item); - } - return () => { - for (const { kind: item, entry } of bound) { - try { - entry.unsubscribe?.(); - } catch (error) { - reportTransformError(error); - } - const stack = this.stacks.get(item); - if (!stack) continue; - const next = stack.filter((candidate) => candidate !== entry); - if (next.length > 0) this.stacks.set(item, next); - else this.stacks.delete(item); - this.emit(item); - } - }; - } - has(kind) { - return (this.stacks.get(kind)?.length ?? 0) > 0; - } - read(request) { - const transformer = this.stacks.get(request.kind)?.at(-1)?.transformer; - if (!transformer) return passthrough(request); - let display; - try { - display = normalize(transformer.read(request), request); - } catch (error) { - reportTransformError(error); - display = { - text: request.text, - final: !request.streaming - }; - } - const key = `${request.kind}\u0000${request.blockKey}`; - const next = nextDisplayCursor(this.cursors.get(key), display); - this.cursors.set(key, next); - return next; - } - subscribe(kind, listener) { - const set = this.listeners.get(kind) ?? /* @__PURE__ */ new Set(); - set.add(listener); - this.listeners.set(kind, set); - return () => { - set.delete(listener); - }; - } - release(kind, blockKey) { - this.cursors.delete(`${kind}\u0000${blockKey}`); - } - emit(kind) { - const set = this.listeners.get(kind); - if (!set) return; - for (const listener of [...set]) listener(); - } - }; - function createTextTransformRegistry() { - return new TextTransformRegistryImpl(); - } - let active; - /** Points the reading view at the registry this client plugin provides. */ - function installTextTransformRegistry(registry) { - const previous = active; - active = registry; - return () => { - active = previous; - }; - } - function activeTextTransform() { - return active; - } - /** - * Subscribe while mounted. The reveal components call this only after - * `has(kind)`, so an empty registry adds no hook and no listener. - */ - function useDisplayText(registry, request) { - const [epoch, setEpoch] = (0, react.useState)(0); - const { text, streaming, blockKey, kind, source } = request; - (0, react.useEffect)(() => registry.subscribe(kind, () => { - setEpoch((value) => value + 1); - }), [registry, kind]); - (0, react.useEffect)(() => () => { - registry.release(kind, blockKey); - }, [ - registry, - kind, - blockKey - ]); - return (0, react.useMemo)(() => registry.read({ - text, - streaming, - blockKey, - kind, - source - }), [ - registry, - text, - streaming, - blockKey, - kind, - source, - epoch - ]); - } - /** Chain-slot owner. Extra fields are optional so older callers still type-check. */ - function readerBlockOwner(block, streaming, source, presentation, holdFormatting) { - return { - block, - streaming, - source, - presentation: { - startedAt: presentation.startedAt, - interrupted: presentation.interrupted, - liveText: presentation.liveText - }, - holdFormatting, - liveText: presentation.liveText - }; - } - /** Copy actions read this. Display text never replaces it. */ - function originalAnswerText(blocks) { - return blocks.flatMap((block) => block.kind === "text" && typeof block.text === "string" ? [block.text] : []).join("\n\n"); - } - // \0dshx-css-module:src/client/TurnMetrics.module.css.mjs - const css$4 = ".Dds6gq_container{color:var(--dsw-alias-label-tertiary);align-items:center;gap:2px;font-size:13px;line-height:24px;display:inline-flex;position:relative}.Dds6gq_pillButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-tertiary);cursor:pointer;border-radius:12px;outline:none;align-items:center;gap:5px;padding:2px 8px;font-family:inherit;font-size:11px;transition:all .14s;display:inline-flex}.Dds6gq_pillButton:hover,.Dds6gq_pillButton[data-active=true]{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-interactive-bg-hover)}.Dds6gq_timeButton{height:28px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;cursor:pointer;background:0 0;border:none;border-radius:28px;align-items:center;gap:4px;padding:6px 8px;font-family:inherit;font-size:13px;line-height:24px;display:inline-flex}.Dds6gq_timeButton:hover,.Dds6gq_timeButton[data-active=true]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.Dds6gq_pillIcon{opacity:.8;flex:none;width:12px;height:12px}.Dds6gq_metricsPop{background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l2);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:50;text-align:left;border-radius:10px;flex-direction:column;gap:8px;width:260px;padding:12px 14px;animation:.14s ease-out Dds6gq_popIn;display:flex;position:absolute;bottom:calc(100% + 8px);left:0;box-shadow:0 6px 20px #00000024}@keyframes Dds6gq_popIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.Dds6gq_popHeader{color:var(--dsw-alias-label-primary);border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;padding-bottom:6px;font-size:12px;font-weight:600;display:flex}.Dds6gq_popSection{flex-direction:column;gap:4px;display:flex}.Dds6gq_popSectionTitle{text-transform:uppercase;letter-spacing:.5px;color:var(--dsw-alias-label-tertiary);margin-top:2px;font-size:10px;font-weight:600}.Dds6gq_popGrid{grid-template-columns:1fr auto;gap:3px 12px;font-size:11px;line-height:18px;display:grid}.Dds6gq_popLabel{color:var(--dsw-alias-label-secondary)}.Dds6gq_popValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:right;font-weight:500}.Dds6gq_popBadge{background:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);border-radius:3px;margin-left:4px;padding:0 4px;font-size:10px}"; - const tagId$4 = "dsh-better-chat/TurnMetrics.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$4; - tag.textContent = css$4; - document.head.appendChild(tag); - } - var TurnMetrics_module_css_default = { - "container": "Dds6gq_container", - "metricsPop": "Dds6gq_metricsPop", - "pillButton": "Dds6gq_pillButton", - "pillIcon": "Dds6gq_pillIcon", - "popBadge": "Dds6gq_popBadge", - "popGrid": "Dds6gq_popGrid", - "popHeader": "Dds6gq_popHeader", - "popIn": "Dds6gq_popIn", - "popLabel": "Dds6gq_popLabel", - "popSection": "Dds6gq_popSection", - "popSectionTitle": "Dds6gq_popSectionTitle", - "popValue": "Dds6gq_popValue", - "timeButton": "Dds6gq_timeButton" - }; - // src/client/TurnMetrics.tsx - function formatTokens(count) { - if (count >= 1e6) return `${(count / 1e6).toFixed(2)}M tok`; - if (count >= 1e3) return `${(count / 1e3).toFixed(1)}k tok`; - return `${count} tok`; - } - const TurnMetrics = (0, react.memo)(function TurnMetrics({ usage, runMs, tokensPerSecond, ttftMs }) { - const [open, setOpen] = (0, react.useState)(false); - const containerRef = (0, react.useRef)(null); - (0, react.useEffect)(() => { - if (!open) return; - const onClickOutside = (e) => { - if (containerRef.current && !containerRef.current.contains(e.target)) setOpen(false); - }; - const onKeyDown = (e) => { - if (e.key === "Escape") setOpen(false); - }; - document.addEventListener("pointerdown", onClickOutside); - document.addEventListener("keydown", onKeyDown); - return () => { - document.removeEventListener("pointerdown", onClickOutside); - document.removeEventListener("keydown", onKeyDown); - }; - }, [open]); - const totalTokens = usage?.totalTokens; - const hasTiming = typeof runMs === "number" && runMs > 0; - const hasTokens = typeof totalTokens === "number" && totalTokens > 0; - if (!hasTiming && !hasTokens) return null; - const cacheHitPercent = usage && usage.cacheReadTokens && usage.totalTokens > usage.outputTokens ? Math.round(usage.cacheReadTokens / (usage.totalTokens - usage.outputTokens) * 100) : null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - ref: containerRef, - className: TurnMetrics_module_css_default.container, - children: [ - hasTokens && typeof totalTokens === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: TurnMetrics_module_css_default.pillButton, - "data-active": open, - onClick: () => setOpen((v) => !v), - "aria-expanded": open, - title: "查看本轮 Token 消耗", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: TurnMetrics_module_css_default.pillIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ellipse", { - cx: "8", - cy: "4.2", - rx: "5", - ry: "2.2", - strokeWidth: "1.2" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3 4.2v7.6c0 1.2 2.2 2.2 5 2.2s5-1 5-2.2V4.2", - strokeWidth: "1.2" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3 8c0 1.2 2.2 2.2 5 2.2s5-1 5-2.2", - strokeWidth: "1.2" - }) - ] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["用量 ", formatTokens(totalTokens)] })] - }), - hasTiming && typeof runMs === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: TurnMetrics_module_css_default.timeButton, - "data-active": open, - onClick: () => setOpen((v) => !v), - "aria-expanded": open, - "aria-label": formatRanFor(runMs), - title: "查看本轮用时和速度", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: TurnMetrics_module_css_default.pillIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "8", - cy: "8", - r: "6.5", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 4.5v3.8l2.5 1.5", - strokeWidth: "1.2", - strokeLinecap: "round", - strokeLinejoin: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: formatRanFor(runMs) })] - }), - open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: TurnMetrics_module_css_default.metricsPop, - role: "dialog", - "aria-label": "本轮概况", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TurnMetrics_module_css_default.popHeader, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "本轮性能与用量概况" }) - }), - hasTiming && typeof runMs === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: TurnMetrics_module_css_default.popSection, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TurnMetrics_module_css_default.popSectionTitle, - children: "耗时与生成速度" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: TurnMetrics_module_css_default.popGrid, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: "总用时" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popValue, - children: formatRunDuration(runMs) - }), - typeof tokensPerSecond === "number" && tokensPerSecond > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: "生成吞吐 (TPS)" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [tokensPerSecond.toFixed(1), " tok/s"] - })] }), - typeof ttftMs === "number" && ttftMs > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: "首字延迟 (TTFT)" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [(ttftMs / 1e3).toFixed(2), "s"] - })] }) - ] - })] - }), - hasTokens && usage && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: TurnMetrics_module_css_default.popSection, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TurnMetrics_module_css_default.popSectionTitle, - children: "Token 消耗分解" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: TurnMetrics_module_css_default.popGrid, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: "总消耗" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [usage.totalTokens.toLocaleString(), " tok"] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: ["输入", cacheHitPercent !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popBadge, - children: [ - "命中 ", - cacheHitPercent, - "%" - ] - })] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [(usage.totalTokens - usage.outputTokens).toLocaleString(), " tok"] - }), - typeof usage.cacheReadTokens === "number" && usage.cacheReadTokens > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: "缓存读取" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [usage.cacheReadTokens.toLocaleString(), " tok"] - })] }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popLabel, - children: ["输出", typeof usage.reasoningTokens === "number" && usage.reasoningTokens > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popBadge, - children: ["思考 ", usage.reasoningTokens.toLocaleString()] - })] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: TurnMetrics_module_css_default.popValue, - children: [usage.outputTokens?.toLocaleString() ?? 0, " tok"] - }) - ] - })] - }) - ] - }) - ] - }); - }); - // src/client/Blocks.tsx - const IMAGE_TYPES = /* @__PURE__ */ new Set([ - "image/png", - "image/jpeg", - "image/webp", - "image/gif" - ]); - var BlockBoundary = class extends react.Component { - state = { - failed: false, - detail: "" - }; - static getDerivedStateFromError(error) { - return { - failed: true, - detail: String(error?.message ?? error).slice(0, 160) - }; - } - render() { - return this.state.failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.notice, - children: ["此内容暂时无法在阅读页显示;原对话中的记录未受影响。", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - "data-reader-block-error": true, - style: { opacity: .65 }, - children: [ - "(", - this.state.detail, - ")" - ] - })] - }) : this.props.children; - } - }; - const ImageBlock = (0, react.memo)(function ImageBlock({ attachment, loadImage }) { - const [attempt, setAttempt] = (0, react.useState)(0); - const [url, setUrl] = (0, react.useState)(null); - const [error, setError] = (0, react.useState)(false); - const [decoded, setDecoded] = (0, react.useState)(false); - const dialog = (0, react.useRef)(null); - const opener = (0, react.useRef)(null); - (0, react.useEffect)(() => { - let active = true; - let owned = null; - const timeout = setTimeout(() => { - if (active) { - setError(true); - active = false; - } - }, 2e4); - setError(false); - setDecoded(false); - setUrl(null); - loadImage(attachment).then((result) => { - if (!active) return; - clearTimeout(timeout); - if (!IMAGE_TYPES.has(result.mediaType)) throw new Error("Unsupported image media type"); - const bytes = Uint8Array.from(result.data); - owned = URL.createObjectURL(new Blob([bytes.buffer], { type: result.mediaType })); - setUrl(owned); - }).catch(() => { - clearTimeout(timeout); - if (active) setError(true); - }); - return () => { - active = false; - clearTimeout(timeout); - if (owned) URL.revokeObjectURL(owned); - }; - }, [ - attachment.attachmentId, - attempt, - loadImage - ]); - const width = Number.isFinite(attachment.width) && attachment.width > 0 ? attachment.width : 4; - const height = Number.isFinite(attachment.height) && attachment.height > 0 ? attachment.height : 3; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("figure", { - className: Reader_module_css_default.imageFigure, - "data-reader-image": true, - "data-image-state": error ? "error" : decoded ? "ready" : "loading", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.imageFrame, - style: { aspectRatio: `${width} / ${height}` }, - children: [!error && url && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - ref: opener, - type: "button", - className: Reader_module_css_default.imageOpen, - "aria-label": `放大图片${attachment.name ? `:${attachment.name}` : ""}`, - onClick: () => dialog.current?.showModal(), - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", { - src: url, - alt: attachment.name ?? "会话图片", - width, - height, - onLoad: () => setDecoded(true), - onError: () => setError(true), - "data-ready": decoded - }) - }), (!decoded || error) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.imagePlaceholder, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: error ? "图片未能加载" : "正在加载图片" }), error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.textButton, - onClick: () => setAttempt((value) => value + 1), - children: "重试" - })] - })] - }), - attachment.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("figcaption", { children: attachment.name }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dialog", { - ref: dialog, - className: Reader_module_css_default.imageDialog, - "aria-label": "图片预览", - onClose: () => opener.current?.focus(), - onClick: (event) => { - if (event.target === dialog.current) dialog.current?.close(); - }, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - autoFocus: true, - className: Reader_module_css_default.dialogClose, - "aria-label": "关闭图片预览", - onClick: () => dialog.current?.close(), - children: "×" - }), url && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", { - src: url, - alt: attachment.name ?? "会话图片" - })] - }) - ] - }); - }); - function contentBlocks(content) { - return content.map((block) => { - if (block.type === "text") return { - kind: "text", - text: block.text - }; - if (block.type === "image") return { - kind: "image", - attachment: block.attachment - }; - return { - kind: "other", - block - }; - }); - } - function MarkdownStream({ text, streaming, holdFormatting, startedAt, interrupted = false, liveText = false, kind = "body", fileMentions, transformed = false }) { - const root = (0, react.useRef)(null); - const presentation = useStreamingText(text, streaming, { - startedAt, - interrupted: interrupted || !liveText, - selected: holdFormatting - }); - const committedMode = (0, react.useRef)(streaming); - const effectiveMode = holdFormatting ? committedMode.current : presentation.formatStreaming; - (0, react.useLayoutEffect)(() => { - committedMode.current = effectiveMode; - }, [effectiveMode]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: root, - className: Reader_module_css_default.readingText, - "data-reader-text": true, - "data-reader-text-kind": kind, - "data-received-length": text.length, - "data-shown-length": presentation.text.length, - "data-presentation-pending": presentation.pending || void 0, - "data-motion-style": "opacity-blur", - "data-ud-motion": "reader-text-arrival", - "data-ud-motion-type": "reveal", - "data-ud-motion-no-flash": "true", - "data-text-transform": transformed ? streaming ? "live" : "final" : void 0, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionMarkdown, { - text: presentation.text, - streaming: effectiveMode, - enabled: liveText && presentation.reveal && effectiveMode, - revision: presentation.revision, - fileMentions - }) - }); - } - function TransformedMarkdown({ registry, blockKey, source, text, streaming, ...props }) { - const shown = useDisplayText(registry, { - text, - streaming, - blockKey, - kind: "body", - source - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownStream, { - ...props, - text: shown.text, - streaming: displayStreaming(streaming, shown, true), - transformed: true - }); - } - function ReadingMarkdown({ blockKey, source, ...props }) { - const registry = activeTextTransform(); - if (registry?.has("body")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransformedMarkdown, { - registry, - blockKey, - source, - ...props - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownStream, { ...props }); - } - function ReasoningStream({ blockKey, text, streaming, holdFormatting, startedAt, interrupted = false, liveText = false, transformed = false }) { - const presentation = useStreamingText(text, streaming, { - startedAt, - interrupted: interrupted || !liveText, - selected: holdFormatting - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.readingText, - "data-reader-text": true, - "data-reader-text-kind": "reasoning", - "data-reader-reasoning-block-key": blockKey, - "data-received-length": text.length, - "data-shown-length": presentation.text.length, - "data-presentation-pending": presentation.pending || void 0, - "data-motion-style": "opacity-blur", - "data-ud-motion": "reader-text-arrival", - "data-ud-motion-type": "reveal", - "data-ud-motion-no-flash": "true", - "data-text-transform": transformed ? streaming ? "live" : "final" : void 0, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionPlainText, { - text: presentation.text, - enabled: liveText && presentation.reveal, - revision: presentation.revision - }) - }); - } - function TransformedReasoning({ registry, blockKey, source, text, streaming, ...props }) { - const shown = useDisplayText(registry, { - text, - streaming, - blockKey, - kind: "reasoning", - source - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningStream, { - ...props, - blockKey, - text: shown.text, - streaming: displayStreaming(streaming, shown, true), - transformed: true - }); - } - function ReadingReasoning({ blockKey, source, ...props }) { - const registry = activeTextTransform(); - if (registry?.has("reasoning")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransformedReasoning, { - registry, - blockKey, - source, - ...props - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningStream, { - ...props, - blockKey - }); - } - function fallback(block, streaming, source, loadImage, fillComposer, holdFormatting, presentation, blockKey, fileMentions) { - switch (block.kind) { - case "text": return source === "user" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, { - text: block.text, - labels: markdownLabels - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReadingMarkdown, { - text: block.text, - streaming, - holdFormatting, - ...presentation, - fileMentions, - blockKey, - source - }); - case "image": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBlock, { - attachment: block.attachment, - loadImage - }); - case "reasoning": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReadingReasoning, { - text: block.text, - streaming, - holdFormatting, - ...presentation, - blockKey, - source - }); - case "tool-call": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: `工具参数 · ${block.name}`, - payload: block.argsRaw, - truncatedLabel: truncatedJsonLabel - }); - case "other": { - const raw = block.block; - if (raw && typeof raw === "object") { - const item = raw; - if ((item.type === "mcp-app" || item.type === "mcpapp" || item.type === "ui") && typeof item.html === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(McpAppFrame, { - html: item.html, - title: typeof item.title === "string" ? item.title : void 0, - fillComposer - }); - } - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.unknown, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: "此内容类型尚未接入阅读页,原始内容已保留。" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: "查看原始内容", - payload: block.block, - truncatedLabel: truncatedJsonLabel - })] - }); - } - } - } - const Blocks = (0, react.memo)(function Blocks({ blocks, streaming = false, source = "assistant", holdFormatting = false, startedAt, interrupted, liveText, renderSlotChain, loadImage, fillComposer, fileMentions }) { - const reactId = (0, react.useId)(); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerFillContext.Provider, { - value: fillComposer, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.blocks, - "data-streaming": streaming || void 0, - children: blocks.map((block, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderSlotChain("dsh-better-display.block", readerBlockOwner(block, streaming, source, { - startedAt, - interrupted, - liveText - }, holdFormatting), { fallback: fallback(block, streaming, source, loadImage, fillComposer, holdFormatting, { - startedAt, - interrupted, - liveText - }, `${reactId}:${index}:${block.kind}`, fileMentions) }) }) }, block.kind === "image" ? `image:${block.attachment.attachmentId}:${index}` : `${index}:${block.kind}`)) - }) - }); - }); - function CopyGlyph() { - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - viewBox: "0 0 16 16", - width: "16", - height: "16", - "aria-hidden": "true", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", { - x: "5", - y: "5", - width: "8", - height: "8", - rx: "1.5" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 10H2.8A.8.8 0 0 1 2 9.2V2.8a.8.8 0 0 1 .8-.8h6.4a.8.8 0 0 1 .8.8V3" })] - }); - } - function useCopyReceipt() { - const [receipt, setReceipt] = (0, react.useState)(""); - const timer = (0, react.useRef)(null); - (0, react.useEffect)(() => () => { - if (timer.current) clearTimeout(timer.current); - }, []); - const copy = async (text) => { - const accepted = await (0, _deepseek_ai_dsh_client_ui_primitives.writeClipboard)(text); - setReceipt(accepted ? "已复制" : "未能复制,请手动选择文字"); - if (timer.current) clearTimeout(timer.current); - timer.current = setTimeout(() => setReceipt(""), 2e3); - }; - return { - receipt, - copy - }; - } - function MessageClock({ time }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", { - className: Reader_module_css_default.messageClock, - dateTime: new Date(time).toISOString(), - children: formatMessageClock(time) - }); - } - function CopyAnswer({ blocks, onFork, metrics, extraActions }) { - const { receipt, copy } = useCopyReceipt(); - const text = originalAnswerText(blocks); - const endedAt = metrics?.endedAt; - const hasMetrics = metrics !== void 0 && (metrics.usage !== void 0 || metrics.runMs !== void 0 || endedAt !== void 0); - if (!text.trim() && !onFork && !hasMetrics) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.answerActions, - children: [ - text.trim() !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.iconButton, - "aria-label": "复制回答", - title: "复制回答", - onClick: () => { - copy(text); - }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyGlyph, {}) - }), - extraActions, - onFork && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.iconButton, - "aria-label": "以此处为基础创建分叉会话", - title: "以此处为基础创建分叉会话 (Fork)", - onClick: onFork, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - viewBox: "0 0 16 16", - width: "14", - height: "14", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.2", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "4.5", - cy: "3.5", - r: "1.8" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "4.5", - cy: "12.5", - r: "1.8" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "11.5", - cy: "5.5", - r: "1.8" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M4.5 5.5v5M4.5 8c2.5 0 4.5-1 7-2.5", - strokeLinecap: "round" - }) - ] - }) - }), - metrics && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TurnMetrics, { - usage: metrics.usage, - runMs: metrics.runMs, - tokensPerSecond: metrics.tokensPerSecond, - ttftMs: metrics.ttftMs - }), - endedAt !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageClock, { time: endedAt }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - role: "status", - className: Reader_module_css_default.meta, - children: receipt - }) - ] - }); - } - function UserMessageActions({ text, time }) { - const { receipt, copy } = useCopyReceipt(); - const hasText = text.trim() !== ""; - if (!hasText && time === void 0) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.userActions, - children: [ - time !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageClock, { time }), - hasText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.iconButton, - "aria-label": "复制消息", - title: "复制消息", - onClick: () => { - copy(text); - }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyGlyph, {}) - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - role: "status", - className: Reader_module_css_default.meta, - children: receipt - }) - ] - }); - } - function reasoningTarget(top, contentHeight, viewportHeight, lineHeight, backlogLines = 0) { - const end = Math.max(0, contentHeight - viewportHeight); - return Math.min(end, Math.min(end, Math.max(0, top)) + Math.max(1, lineHeight) * Math.max(2, Math.min(40, Math.ceil(backlogLines)))); - } - // src/client/ReasoningCard.tsx - const EASING$1 = "cubic-bezier(.22,1,.36,1)"; - /** One real transcript: reference transform while following, native scroll while reading. */ - function ReasoningCard({ children, step, active, motion, selected, onRead }) { - const viewport = (0, react.useRef)(null); - const track = (0, react.useRef)(null); - const content = (0, react.useRef)(null); - const controls = (0, react.useId)(); - const [expanded, setExpanded] = (0, react.useState)(false); - const [following, setFollowing] = (0, react.useState)(true); - const [overflow, setOverflow] = (0, react.useState)(false); - const [edges, setEdges] = (0, react.useState)("none"); - const lastHeight = (0, react.useRef)(0); - const resize = (0, react.useRef)(null); - const previousExpanded = (0, react.useRef)(expanded); - const stopFollow = (0, react.useRef)(() => {}); - const { paused = false } = (0, react.useContext)(StreamMotionContext); - const allowed = following && active && motion && !selected && !paused; - const pause = (0, react.useCallback)(() => { - stopFollow.current(); - setFollowing(false); - onRead(); - }, [onRead]); - (0, react.useLayoutEffect)(() => { - if (!selected) return; - stopFollow.current(); - setFollowing(false); - }, [selected]); - (0, react.useLayoutEffect)(() => { - if (!expanded) return; - const port = viewport.current; - const host = port?.closest("[data-conversation-scroll]"); - if (!port || !host) return; - const fit = () => { - const composer = parseFloat(getComputedStyle(host).getPropertyValue("--dsh-composer-height")) || 152; - const heading = port.parentElement?.querySelector("[data-reader-reasoning-heading]")?.offsetHeight || 30; - const footer = port.parentElement?.querySelector("[data-ud-check=reasoning-controls]")?.offsetHeight || 38; - const available = Math.max(120, host.clientHeight - composer - heading - footer - 32); - port.style.setProperty("--reason-reading-height", `${available}px`); - }; - fit(); - const observer = new ResizeObserver(fit); - observer.observe(host); - return () => { - observer.disconnect(); - }; - }, [expanded]); - (0, react.useLayoutEffect)(() => { - const port = viewport.current; - const text = content.current; - const scrollTrack = track.current; - if (!port || !text || !scrollTrack) return; - let frame = 0; - let timer; - let nextAt = performance.now() + 840; - let alive = true; - let automatic = false; - let lastPainted = port.scrollTop; - let targetOffset = lastPainted; - const tail = () => Math.max(0, text.offsetHeight - port.clientHeight); - const clamp = (value) => Math.max(0, Math.min(tail(), value)); - const paintedOffset = () => { - if (!automatic) return port.scrollTop; - const transform = getComputedStyle(scrollTrack).transform; - return clamp(transform === "none" ? lastPainted : port.scrollTop - new DOMMatrixReadOnly(transform).m42); - }; - const hasSelection = () => { - const selection = document.getSelection(); - return !!selection && !selection.isCollapsed && !!selection.anchorNode && text.contains(selection.anchorNode); - }; - const cancel = () => { - cancelAnimationFrame(frame); - frame = 0; - clearTimeout(timer); - timer = void 0; - delete port.dataset.reasoningMoving; - }; - const manual = () => { - if (!automatic) return; - const top = paintedOffset(); - automatic = false; - scrollTrack.style.transition = "none"; - scrollTrack.style.transform = "none"; - port.style.overflow = "auto"; - port.scrollTop = top; - lastPainted = port.scrollTop; - port.dataset.reasoningMode = "manual"; - }; - const follow = () => { - if (automatic) return; - targetOffset = lastPainted = clamp(port.scrollTop); - scrollTrack.style.transition = "none"; - scrollTrack.style.transform = `translateY(-${lastPainted}px)`; - port.scrollTop = 0; - port.style.overflow = "hidden"; - automatic = true; - port.dataset.reasoningMode = "transform"; - }; - const measure = (recordHeight = true) => { - const previewHeight = parseFloat(getComputedStyle(port).getPropertyValue("--reason-preview-height")); - setOverflow(text.offsetHeight > previewHeight + 1); - lastPainted = paintedOffset(); - const top = lastPainted > 1; - const bottom = tail() - lastPainted > 1; - const next = top ? bottom ? "both" : "top" : bottom ? "bottom" : "none"; - setEdges((value) => value === next ? value : next); - if (recordHeight && !resize.current) lastHeight.current = port.clientHeight; - }; - stopFollow.current = () => { - cancel(); - manual(); - measure(false); - }; - const canFollow = () => allowed && alive && !document.hidden && !hasSelection(); - const schedule = () => { - if (!canFollow() || frame || timer !== void 0) return; - follow(); - if (tail() - paintedOffset() < 1) return; - timer = setTimeout(start, Math.max(0, nextAt - performance.now())); - }; - const start = () => { - timer = void 0; - if (!canFollow()) return; - const from = paintedOffset(); - const lineHeight = parseFloat(getComputedStyle(text).lineHeight) || 24; - const backlogLines = Math.max(0, (tail() - from) / lineHeight); - const target = reasoningTarget(from, text.offsetHeight, port.clientHeight, lineHeight, backlogLines); - if (target - from < 1) return; - const began = performance.now(); - nextAt = began + (backlogLines > 2 ? 40 : 840); - targetOffset = target; - scrollTrack.style.transition = "none"; - scrollTrack.style.transform = `translateY(-${from}px)`; - scrollTrack.offsetHeight; - scrollTrack.style.transition = "transform var(--reason-step) var(--reason-ease)"; - scrollTrack.style.transform = `translateY(-${target}px)`; - port.dataset.reasoningMoving = "true"; - port.dataset.reasoningFrom = String(from); - port.dataset.reasoningTarget = String(target); - port.dataset.reasoningBegan = String(began); - const tick = (now) => { - frame = 0; - if (!canFollow()) { - cancel(); - manual(); - return; - } - measure(); - if (now - began < 500 || Math.abs(lastPainted - target) > .05) frame = requestAnimationFrame(tick); - else { - delete port.dataset.reasoningMoving; - schedule(); - } - }; - frame = requestAnimationFrame(tick); - }; - const onScroll = () => { - measure(); - if (automatic && port.scrollTop > 1) pause(); - }; - const onWheel = (event) => { - if (!event.deltaY) return; - const handoff = automatic && event.cancelable; - if (handoff) event.preventDefault(); - const unit = event.deltaMode === WheelEvent.DOM_DELTA_LINE ? parseFloat(getComputedStyle(text).lineHeight) || 24 : event.deltaMode === WheelEvent.DOM_DELTA_PAGE ? port.clientHeight : 1; - pause(); - if (handoff) { - port.scrollTop = clamp(port.scrollTop + event.deltaY * unit); - measure(); - } - }; - const onSelection = () => { - if (hasSelection()) pause(); - }; - const onVisibility = () => { - cancel(); - manual(); - nextAt = performance.now() + 840; - if (!document.hidden) schedule(); - }; - const observer = new ResizeObserver(() => { - if (automatic && targetOffset > tail() + 1) { - cancel(); - manual(); - nextAt = performance.now() + 840; - } - measure(); - schedule(); - }); - observer.observe(text); - observer.observe(port); - port.addEventListener("scroll", onScroll, { passive: true }); - port.addEventListener("wheel", onWheel, { passive: false }); - document.addEventListener("selectionchange", onSelection); - document.addEventListener("visibilitychange", onVisibility); - measure(false); - schedule(); - return () => { - alive = false; - cancel(); - manual(); - observer.disconnect(); - port.removeEventListener("scroll", onScroll); - port.removeEventListener("wheel", onWheel); - document.removeEventListener("selectionchange", onSelection); - document.removeEventListener("visibilitychange", onVisibility); - stopFollow.current = () => {}; - }; - }, [allowed, pause]); - (0, react.useLayoutEffect)(() => { - const port = viewport.current; - if (!port) return; - const changed = expanded !== previousExpanded.current; - previousExpanded.current = expanded; - const from = resize.current ? port.clientHeight : lastHeight.current; - resize.current?.cancel(); - resize.current = null; - port.style.maxHeight = ""; - port.style.height = ""; - const target = port.clientHeight; - if (changed && !selected) { - const card = port.parentElement; - const host = port.closest("[data-conversation-scroll]"); - if (card && host) { - const composer = parseFloat(getComputedStyle(host).getPropertyValue("--dsh-composer-height")) || 152; - const region = host.getBoundingClientRect(); - const box = card.getBoundingClientRect(); - const top = region.top + 16; - const bottom = region.bottom - composer - 16; - const delta = box.top < top ? box.top - top : box.bottom > bottom ? Math.min(box.bottom - bottom, box.top - top) : 0; - if (Math.abs(delta) > 1) host.scrollTo({ - top: Math.max(0, host.scrollTop + delta), - behavior: motion ? "smooth" : "instant" - }); - } - } - if (!changed || !motion || from < 1 || Math.abs(target - from) < 1) { - lastHeight.current = target; - return; - } - port.style.maxHeight = "none"; - const animation = port.animate([{ height: `${from}px` }, { height: `${target}px` }], { - duration: 300, - easing: EASING$1, - fill: "both" - }); - resize.current = animation; - const restore = () => { - port.style.maxHeight = ""; - port.style.height = ""; - lastHeight.current = port.clientHeight; - }; - let settled = false; - const settle = () => { - if (settled) return; - settled = true; - if (resize.current === animation) resize.current = null; - animation.cancel(); - restore(); - }; - animation.onfinish = settle; - const deadline = window.setTimeout(settle, 540); - return () => { - window.clearTimeout(deadline); - }; - }, [ - expanded, - motion, - selected - ]); - (0, react.useEffect)(() => () => resize.current?.cancel(), []); - const toggleReading = () => { - onRead(); - setExpanded((value) => !value); - }; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.reasonCard, - "data-reader-reasoning-card": true, - "data-reader-anchor": true, - "data-expanded": expanded, - "data-following": allowed, - "data-overflow": overflow, - "data-ud-motion": "reader-reasoning-size", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.reasonHeading, - "data-reader-reasoning-heading": true, - "data-ud-check": "reasoning-identity", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.reasonLabel, - "data-reader-reasoning-label": true, - children: "思考" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["步骤 ", step] })] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: viewport, - id: controls, - className: Reader_module_css_default.reasonViewport, - "data-reader-reasoning-scroll": true, - "data-edges": edges, - "data-ud-motion": "reader-reasoning-scroll", - role: "region", - "aria-label": `步骤 ${step} 的思考${overflow ? ",可滚动阅读" : ""}`, - tabIndex: overflow ? 0 : void 0, - onPointerDown: pause, - onFocus: pause, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: track, - className: Reader_module_css_default.reasonTrack, - "data-reader-reasoning-track": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: content, - className: Reader_module_css_default.reasonText, - "data-reader-reasoning-text": true, - children - }) - }) - }), - (overflow || expanded) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.reasonFooter, - "data-ud-check": "reasoning-controls", - children: [active && motion ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: Reader_module_css_default.reasonAction, - disabled: selected, - "aria-controls": controls, - "aria-label": following ? "暂停自动跟随思考" : "继续跟随最新思考", - title: selected ? "取消文字选择后可继续跟随" : void 0, - onClick: () => { - if (following) pause(); - else { - onRead(); - setFollowing(true); - } - }, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - width: "12", - height: "12", - viewBox: "0 0 16 16", - "aria-hidden": "true", - children: following ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5.5 4v8m5-8v8" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 3v10m-4-4 4 4 4-4" }) - }), following ? "暂停跟随" : "跟随最新"] - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.reasonCaption, - children: expanded ? "手动阅读" : "可滚动阅读" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: Reader_module_css_default.reasonAction, - "aria-expanded": expanded, - "aria-controls": controls, - "aria-label": expanded ? "收起完整思考" : "展开阅读完整思考", - onClick: toggleReading, - children: [expanded ? "收起" : "展开阅读", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - width: "12", - height: "12", - viewBox: "0 0 16 16", - "aria-hidden": "true", - children: expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m4 10 4-4 4 4" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m4 6 4 4 4-4" }) - })] - })] - }) - ] - }); - } - // src/client/official-slots.tsx - /** - * RC2 composition adapter. Only public registry operations are used. We lend - * registrations a Reader-owned seat, not a second implementation of their UI. - * The platform still binds injection, hooks, locale, stores and boundaries. - * Original entries, declarations and components are never changed. - * - * Child seats have unique names because RC2 declarations have one owner. The - * sole component wrapper translates those names before delegating to the - * framework-provided renderSlot. It does not implement a slot renderer. - */ - const OFFICIAL_SLOTS = { - actions: "conversation.chat.assistant-actions", - tools: "tool.call.toolview", - tail: "conversation.chat.turnTail", - nodes: "conversation.chat.node", - messageImages: "conversation.chat.message.images", - userImages: "conversation.chat.user.images" - }; - const OFFICIAL_SEATS = { - actions: "dsh-better-display.official.actions/conversation.chat.assistant-actions", - tools: "dsh-better-display.official.tools/tool.call.toolview", - tail: "dsh-better-display.official.tail/conversation.chat.turnTail", - nodes: "dsh-better-display.official.nodes/conversation.chat.node", - messageImages: "dsh-better-display.official.messageImages/conversation.chat.message.images", - userImages: "dsh-better-display.official.userImages/conversation.chat.user.images" - }; - const officialSeat = (family, source = OFFICIAL_SLOTS[family]) => `dsh-better-display.official.${family}/${source}`; - /** - * Searchable hide for official nodes drawn outside the Chat flow viewport. - * The flow's own `useGroupAction` is not in scope here; this keeps the same - * `hidden="until-found"` contract so browser find can still reveal the row. - */ - function useReaderGroupAction(hidden, reveal) { - const ref = (0, react.useRef)(null); - (0, react.useLayoutEffect)(() => { - const element = ref.current; - if (element === null) return; - if (hidden && element.contains(element.ownerDocument.activeElement)) { - reveal(); - return; - } - if (hidden) element.setAttribute("hidden", "until-found"); - else element.removeAttribute("hidden"); - }, [hidden, reveal]); - (0, react.useEffect)(() => { - const element = ref.current; - if (element === null) return; - element.addEventListener("beforematch", reveal); - return () => { - element.removeEventListener("beforematch", reveal); - }; - }, [reveal]); - return ref; - } - const readerGroupAction = useReaderGroupAction; - const READER_OWNED_NODES = /* @__PURE__ */ new Set([ - "tool-call", - "turn-tail", - "turn-process" - ]); - /** - * Mirror a chat-node registration into the Reader seat. - * Assistant replacements are the entries that would actually replace the - * official renderer on the host. The official priority itself stays out, so - * Reader keeps its own answer markdown until a plugin opts in. - */ - function acceptMirroredChatNode(entry) { - const key = entry.options.key ?? ""; - if (key === "assistant-step") return (entry.options.priority ?? 0) < 0; - return !READER_OWNED_NODES.has(key); - } - const EXPECTED = { - actions: { - kind: "list", - scope: "session" - }, - tools: { - kind: "keyed", - scope: "session" - }, - tail: { - kind: "list", - scope: "session" - }, - nodes: { - kind: "keyed", - scope: "session" - }, - messageImages: { - kind: "single", - scope: "session" - }, - userImages: { - kind: "single", - scope: "session" - } - }; - /** - * Reader already presents produced paths with its copy/reveal actions. RC2's - * official tail additionally owns explicit `present` artifacts. Leave those - * cards, actions and state intact, and omit only the duplicate produced chips. - * This changes a presentation prop, never the source match or session data. - * Unrecognized shapes pass through intact for safe forward degradation. - */ - function readerTailMatch(value, displayedPaths) { - if (!value || typeof value !== "object") return value; - const match = value; - const displayed = new Set(displayedPaths ?? []); - return displayed.size > 0 && Array.isArray(match.produced) && Array.isArray(match.presented) ? { - ...match, - produced: match.produced.filter((path) => !displayed.has(path)) - } : value; - } - function tailPresentation(component) { - const Original = component; - return (0, react.memo)(function ReaderTailPresentation(props) { - const matched = (0, react.useMemo)(() => readerTailMatch(props.matched, props.readerProducedPaths), [props.matched, props.readerProducedPaths]); - return (0, react.createElement)(Original, { - ...props, - matched - }); - }); - } - function officialChildren(slots) { - return Object.fromEntries(Object.entries(OFFICIAL_SLOTS).map(([name, source]) => { - const family = name; - const spec = slots.spec(source); - if (spec && (spec.kind !== EXPECTED[family].kind || spec.scope !== EXPECTED[family].scope)) throw new Error(`Official slot contract changed: ${source} (${spec.kind}/${spec.scope})`); - return [officialSeat(family), spec ?? EXPECTED[family]]; - })); - } - function translatedComponent(entry, names) { - if (names.size === 0) return entry.component; - const Original = entry.component; - return (0, react.memo)(function OfficialSlotChildren(props) { - const renders = (0, react.useMemo)(() => { - const translate = (render) => (key, owner, options) => { - const seat = names.get(key); - if (!seat || !render) throw new Error(`Undeclared official child slot: ${key}`); - return render(seat, owner, options); - }; - return { - renderSlot: translate(props.renderSlot), - ...props.renderSlotChain ? { renderSlotChain: translate(props.renderSlotChain) } : {} - }; - }, [props.renderSlot, props.renderSlotChain]); - return (0, react.createElement)(Original, { - ...props, - ...renders - }); - }); - } - /** - * Mirror one elected contribution set incrementally. Unrelated additions do not - * remount existing cards or recreate their subscriptions. A source unload/HMR - * disposes the corresponding subtree and closures before its replacement. - */ - function mirrorOfficialSlot(slots, source, target, namespace, accept = () => true) { - const mounted = /* @__PURE__ */ new Map(); - let stopped = false; - const reconcile = () => { - if (stopped) return; - const entries = slots.entriesOfSlot(source).filter(accept); - const wanted = new Set(entries); - for (const [entry, dispose] of mounted) { - if (wanted.has(entry)) continue; - dispose(); - mounted.delete(entry); - } - for (const entry of entries) { - if (mounted.has(entry)) continue; - const names = new Map(Object.keys(entry.children ?? {}).map((key) => [key, `${namespace}/${key}`])); - const children = Object.fromEntries([...names].map(([key, seat]) => [seat, entry.children[key]])); - const disposers = []; - const dispose = () => { - for (const stop of disposers.splice(0).reverse()) stop(); - }; - try { - const { component: _component, options, children: _children, ...metadata } = entry; - const presentation = source === OFFICIAL_SLOTS.tail && entry.locale === "deliverables" ? { - ...entry, - component: tailPresentation(entry.component) - } : entry; - disposers.push(slots.register({ - ...options, - ...metadata, - name: target, - ...names.size ? { children } : {}, - registrant: `dsh-better-display → ${entry.registrant ?? source}` - }, translatedComponent(presentation, names))); - for (const [key, seat] of names) disposers.push(mirrorOfficialSlot(slots, key, seat, namespace)); - mounted.set(entry, dispose); - } catch (error) { - dispose(); - throw error; - } - } - }; - const unsubscribe = slots.subscribe(source, reconcile); - const dispose = () => { - stopped = true; - unsubscribe(); - for (const stop of [...mounted.values()].reverse()) stop(); - mounted.clear(); - }; - try { - reconcile(); - } catch (error) { - dispose(); - throw error; - } - return dispose; - } - function installOfficialSlots(ctx) { - const slots = ctx.slots; - const disposers = []; - try { - for (const [name, source] of Object.entries(OFFICIAL_SLOTS)) { - const family = name; - disposers.push(slots.inject(source, () => { - const spec = slots.spec(source); - const target = officialSeat(family); - const declared = slots.spec(target); - if (spec.kind !== declared?.kind || spec.scope !== declared.scope) throw new Error(`Official slot contract changed: ${source}`); - return mirrorOfficialSlot(slots, source, target, `dsh-better-display.official.${family}`, family === "nodes" ? acceptMirroredChatNode : void 0); - })); - } - } catch (error) { - for (const stop of disposers.reverse()) stop(); - throw error; - } - return () => { - for (const stop of disposers.splice(0).reverse()) stop(); - }; - } - // src/client/chat-seat.ts - function chatSeatProps(kind, key) { - return { - "data-chat-anchor-key": key, - "data-chat-flow-key": key, - "data-chat-node-key": key, - "data-chat-flow-kind": kind - }; - } - // src/client/OfficialContent.tsx - function OfficialActions({ official, messageId }) { - if (!official || !messageId) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - "data-reader-official-actions": true, - style: { display: "contents" }, - children: official.renderSlot(OFFICIAL_SEATS.actions, { messageId }) - }); - } - /** Each atomic Tool view owns its disclosure state through this stable Hook prop. */ - const useToolDisclosure = () => { - const [expanded, setExpanded] = (0, react.useState)(false); - return { - expanded, - setExpanded, - toggle: (0, react.useCallback)(() => setExpanded((previous) => !previous), []) - }; - }; - function OfficialTool({ official, block, toolName, cwd, openFile, fallback }) { - const home = (0, react.useSyncExternalStore)(official.officialHost.subscribe, official.officialHost.getSnapshot).home; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-official": true, - children: official.renderSlot(OFFICIAL_SEATS.tools, { - callId: block.callId, - toolName, - phase: "kind" in block ? "result" : block.phase, - block, - cwd, - home, - openFile: openFile ?? (() => {}), - loadImage: official.officialImageLoader, - useDisclosure: useToolDisclosure, - inspect: () => official.openView("trajectory", block.callId) - }, { - entryKey: toolName, - hookContext: { - callId: block.callId, - assistant: void 0 - }, - fallback - }) - }); - } - function chatNodeOwner(render, official) { - return { - cwd: render.cwd, - openFile: render.openFile ?? (() => {}), - forkAt: render.forkAt ?? (() => {}), - inspectCall: (callId) => official.openView("trajectory", callId), - loadImage: official.officialImageLoader, - fileMentions: official.officialFileMentions - }; - } - function nodeHookContext(turnData, disclosureReset) { - return { - turnData, - disclosureReset, - useGroupAction: readerGroupAction - }; - } - function OfficialNode({ node, fallback, ...render }) { - const official = render.official; - const [disclosureReset] = (0, react.useState)(() => (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(0)); - if (!official) return fallback; - const turn = node.location.kind === "turn" || node.location.kind === "step" ? node.location.turn : void 0; - const renderNode = official.renderSlot; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-official-node": node.kind, - ...node.kind === "user" || node.kind === "steering" ? chatSeatProps(node.kind, node.key) : {}, - children: renderNode(OFFICIAL_SEATS.nodes, { - ...chatNodeOwner(render, official), - node - }, { - entryKey: node.kind, - hookContext: nodeHookContext(turn?.data, disclosureReset), - fallback - }) - }); - } - /** - * Body of one assistant segment. A mirrored assistant-step replacement draws - * it; Reader markdown is the fallback when no replacement is registered. - * The caller keeps reasoning blocks on the reading card. - */ - function OfficialAssistantBody({ node, blocks, streaming = false, holdFormatting = false, startedAt, interrupted = false, liveText = false, ...render }) { - const official = render.official; - const [disclosureReset] = (0, react.useState)(() => (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(0)); - const fallback = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks, - streaming, - holdFormatting, - startedAt, - interrupted, - liveText - }); - if (!official) return fallback; - const turn = node.location.kind === "turn" || node.location.kind === "step" ? node.location.turn : void 0; - const view = blocks.length === node.data.blocks.length && blocks.every((block, index) => block === node.data.blocks[index]) ? node : { - ...node, - data: { - ...node.data, - blocks - } - }; - const renderNode = official.renderSlot; - return renderNode(OFFICIAL_SEATS.nodes, { - ...chatNodeOwner(render, official), - node: view, - groupPart: "response" - }, { - entryKey: "assistant-step", - hookContext: nodeHookContext(turn?.data, disclosureReset), - fallback - }); - } - function OfficialTail({ official, owner, produced }) { - const tailOwner = owner && official ? { - ...owner, - openFile: official.officialPreviewFile, - readerProducedPaths: produced - } : void 0; - return official && tailOwner ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-official-tail": true, - style: { display: "contents" }, - children: official.renderSlot(OFFICIAL_SEATS.tail, tailOwner) - }) : null; - } - // src/client/turn-slots.ts - /** - * Keep live turns in the incoming `groups` order, and keep a departing turn - * next to the live neighbour that preceded it. - * - * A rewind removes turn keys from the visible order. Unmounting them in that - * same commit snaps the transcript, so the lane retains the last group object - * until the collapse finishes. A re-render, a stream tick, or a reconnect that - * still contains the same keys only replaces the group object and leaves - * `live` true — those updates must not start a collapse. A key that returns - * is live again where `groups` places it. Loading older history therefore - * stays in transcript order instead of appending the older turns after the - * ones already on screen. A departing slot is inserted immediately after the - * nearest preceding slot that is still live, or at the front when it had none, - * so several departing neighbours keep their relative order. - * - * Returns `current` itself when nothing changed, so a React state update can - * bail out on `Object.is`. - */ - function reconcileTurnSlots(current, groups) { - const incoming = new Map(groups.map((group) => [group.key, group])); - const next = groups.map((group) => ({ - group, - live: true - })); - for (const slot of current) { - if (incoming.has(slot.group.key)) continue; - insertDeparting(next, { - group: slot.group, - live: false - }, precedingLiveKey(current, incoming, slot.group.key)); - } - return next.length === current.length && next.every((slot, index) => slot.live === current[index].live && slot.group === current[index].group) ? current : next; - } - /** Nearest preceding slot that is still in the incoming order, if any. */ - function precedingLiveKey(current, incoming, key) { - const index = current.findIndex((slot) => slot.group.key === key); - for (let cursor = index - 1; cursor >= 0; cursor--) { - const candidate = current[cursor].group.key; - if (incoming.has(candidate)) return candidate; - } - } - /** - * Place a departing slot after `anchorKey`, or at the front when the slot had - * no preceding live neighbour. Slots that share an anchor keep `current` order - * because each one is inserted at the end of the departing run after that anchor. - */ - function insertDeparting(next, slot, anchorKey) { - if (anchorKey === void 0) { - const firstLive = next.findIndex((item) => item.live); - next.splice(firstLive < 0 ? next.length : firstLive, 0, slot); - return; - } - const anchorIndex = next.findIndex((item) => item.group.key === anchorKey); - if (anchorIndex < 0) { - next.unshift(slot); - return; - } - let insertAt = anchorIndex + 1; - while (insertAt < next.length && next[insertAt]?.live === false) insertAt++; - next.splice(insertAt, 0, slot); - } - // src/client/motion.tsx - const EASING = "cubic-bezier(.22,1,.36,1)"; - function useMotionAllowed(enabled) { - const [reduced, setReduced] = (0, react.useState)(() => window.matchMedia("(prefers-reduced-motion: reduce)").matches); - (0, react.useEffect)(() => { - const query = window.matchMedia("(prefers-reduced-motion: reduce)"); - const change = () => setReduced(query.matches); - query.addEventListener("change", change); - return () => query.removeEventListener("change", change); - }, []); - return enabled && !reduced; - } - function usePinnedSelection(root, selector = "[data-reader-answer], [data-reader-body], [data-reader-process]") { - const [keys, setKeys] = (0, react.useState)([]); - (0, react.useEffect)(() => { - const update = () => { - const selection = document.getSelection(); - const range = selection && !selection.isCollapsed && selection.rangeCount ? selection.getRangeAt(0) : null; - const next = range && root.current ? [...new Set(Array.from(root.current.querySelectorAll(selector)).filter((element) => range.intersectsNode(element)).map((element) => element.dataset.readerKey ?? element.dataset.readerProcessKey).filter(Boolean))] : []; - setKeys((previous) => previous.length === next.length && previous.every((key, index) => key === next[index]) ? previous : next); - }; - document.addEventListener("selectionchange", update); - return () => document.removeEventListener("selectionchange", update); - }, [root, selector]); - return keys; - } - function StatusText({ text, motion, shimmer = false }) { - const ref = (0, react.useRef)(null); - const [visible, setVisible] = (0, react.useState)(() => !document.hidden); - const [forcedColors, setForcedColors] = (0, react.useState)(() => window.matchMedia("(forced-colors: active)").matches); - const allowed = motion && visible && !forcedColors; - const [frame, setFrame] = (0, react.useState)({ - text, - id: 0, - phase: "idle", - outgoing: null - }); - if (frame.text !== text) setFrame({ - text, - id: frame.id + 1, - phase: allowed ? "start" : "idle", - outgoing: allowed ? { - text: frame.text, - id: frame.id - } : null - }); - (0, react.useEffect)(() => { - const update = () => setVisible(!document.hidden); - const query = window.matchMedia("(forced-colors: active)"); - const colors = () => setForcedColors(query.matches); - document.addEventListener("visibilitychange", update); - query.addEventListener("change", colors); - return () => { - document.removeEventListener("visibilitychange", update); - query.removeEventListener("change", colors); - }; - }, []); - (0, react.useLayoutEffect)(() => { - const id = frame.id; - const settle = () => setFrame((current) => current.id === id && current.outgoing ? { - ...current, - phase: "idle", - outgoing: null - } : current); - if (!allowed) { - settle(); - return; - } - if (!frame.outgoing || !ref.current) return; - ref.current.getBoundingClientRect(); - let timer = 0; - const tick = requestAnimationFrame(() => { - setFrame((current) => current.id === id ? { - ...current, - phase: "running" - } : current); - timer = window.setTimeout(settle, 200); - }); - return () => { - cancelAnimationFrame(tick); - window.clearTimeout(timer); - }; - }, [frame.id, allowed]); - const active = shimmer && allowed; - const swapping = allowed && frame.outgoing !== null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.statusText, - "data-reader-status": true, - "data-reader-busy": shimmer, - "data-ud-check": "reader-status", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.think, - "aria-hidden": "true", - "data-active": active, - "data-reader-status-phase": swapping ? frame.phase : "idle", - "data-ud-motion": "reader-thinking-state", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.thinkSizer, - children: text - }), - swapping && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: `${Reader_module_css_default.thinkText} ${frame.phase === "running" ? Reader_module_css_default.isExit : ""}`, - "data-reader-status-copy": "outgoing", - "data-text": frame.outgoing.text, - children: frame.outgoing.text - }, frame.outgoing.id), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - ref, - className: `${Reader_module_css_default.thinkText} ${swapping && frame.phase === "start" ? Reader_module_css_default.isEnterStart : ""}`, - "data-reader-status-copy": "current", - "data-reader-shimmer": active || void 0, - "data-text": text, - children: text - }, frame.id) - ] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.srOnly, - role: "status", - "aria-live": "polite", - "aria-atomic": "true", - children: text - })] - }); - } - function Disclosure({ open, onChange, label, controls, buttonRef, ariaLabel }) { - const name = ariaLabel ?? "思考与过程"; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.disclosure, - "data-reader-disclosure": true, - "data-expanded": open, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - ref: buttonRef, - type: "button", - className: Reader_module_css_default.disclosureButton, - "aria-label": `${open ? "收起" : "展开"}${name}`, - "aria-expanded": open, - ...controls ? { "aria-controls": controls } : {}, - onClick: () => onChange(!open), - children: [label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.chevron, - "data-open": open, - viewBox: "0 0 16 16", - width: "12", - height: "12", - "aria-hidden": "true", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 4 4 4-4 4" }) - })] - }) - }); - } - /** Supplemental details stay in source order beside their own narration. */ - function ProcessFragment({ open, motion, onRead, returnFocusTo, nodeKey, children, framed = false }) { - const body = (0, react.useRef)(null); - const running = (0, react.useRef)(null); - const previous = (0, react.useRef)(open); - const [present, setPresent] = (0, react.useState)(open); - (0, react.useLayoutEffect)(() => { - const element = body.current; - if (!element) return; - const from = running.current ? element.getBoundingClientRect().height : previous.current ? element.scrollHeight : 0; - running.current?.cancel(); - running.current = null; - const changed = previous.current !== open; - previous.current = open; - if (open) setPresent(true); - if (!open && element.contains(document.activeElement)) returnFocusTo.current?.focus(); - element.style.height = open ? "auto" : "0px"; - const target = open ? element.scrollHeight : 0; - if (!motion || !changed || Math.abs(from - target) < 1) { - setPresent(open); - return; - } - const animation = element.animate(from > target ? [ - { - offset: 0, - height: `${from}px`, - opacity: 1, - transform: "scaleY(1) translateY(0)" - }, - { - offset: .32, - height: `${Math.round(from * .92)}px`, - opacity: .35, - transform: "scaleY(0.96) translateY(-2px)" - }, - { - offset: 1, - height: `${target}px`, - opacity: 0, - transform: "scaleY(0.68) translateY(-8px)" - } - ] : [ - { - offset: 0, - height: `${from}px`, - opacity: 0, - transform: "scaleY(0.8) translateY(6px)" - }, - { - offset: .3, - height: `${Math.round(target * .4)}px`, - opacity: .4, - transform: "scaleY(0.92) translateY(3px)" - }, - { - offset: 1, - height: `${target}px`, - opacity: 1, - transform: "scaleY(1) translateY(0)" - } - ], { - duration: 380, - easing: "cubic-bezier(0.16, 1, 0.3, 1)", - fill: "both" - }); - running.current = animation; - let settled = false; - const settle = () => { - if (settled) return; - settled = true; - if (running.current === animation) running.current = null; - animation.cancel(); - setPresent(open); - }; - animation.onfinish = settle; - const deadline = window.setTimeout(settle, 620); - return () => { - window.clearTimeout(deadline); - running.current?.cancel(); - }; - }, [ - open, - motion, - returnFocusTo - ]); - if (!open && !present) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: body, - className: Reader_module_css_default.disclosureBody, - "data-reader-process": true, - "data-reader-process-key": nodeKey, - "data-ud-motion": "reader-process-size", - "aria-hidden": !open, - onPointerDown: () => { - if (open) onRead(); - }, - onFocusCapture: () => { - if (open) onRead(); - }, - ...!open ? { inert: "" } : {}, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: framed ? Reader_module_css_default.processFrame : Reader_module_css_default.processContents, - children - }) - }); - } - /** Retire only narration that was actually visible; historical rows stay folded. */ - function RetiringContent({ visible, children, onRetired }) { - const { enabled } = (0, react.useContext)(StreamMotionContext); - const root = (0, react.useRef)(null); - const animation = (0, react.useRef)(null); - const [present, setPresent] = (0, react.useState)(visible); - const [focusHeld, setFocusHeld] = (0, react.useState)(false); - const retired = (0, react.useRef)(onRetired); - retired.current = onRetired; - (0, react.useLayoutEffect)(() => { - const element = root.current; - if (visible) { - animation.current?.cancel(); - animation.current = null; - setPresent(true); - return; - } - if (!element) return; - let retiredNow = false; - const retireNow = () => { - if (retiredNow) return; - retiredNow = true; - animation.current?.cancel(); - animation.current = null; - focusSurvivesRetire(element); - setPresent(false); - retired.current?.(); - }; - if (!enabled || document.hidden) { - retireNow(); - return; - } - const canListen = typeof document.addEventListener === "function"; - const holdsFocus = element.contains(document.activeElement); - if (holdsFocus || focusHeld) { - if (holdsFocus) setFocusHeld(true); - const onHiddenWhileHeld = () => { - if (document.hidden) retireNow(); - }; - if (canListen) document.addEventListener("visibilitychange", onHiddenWhileHeld); - return () => { - if (canListen) document.removeEventListener("visibilitychange", onHiddenWhileHeld); - }; - } - const from = element.getBoundingClientRect().height; - animation.current?.cancel(); - animation.current = null; - if (from < 1) { - setPresent(false); - retired.current?.(); - return; - } - const next = element.animate([{ - height: `${from}px`, - opacity: 1 - }, { - height: "0px", - opacity: 0 - }], { - duration: 220, - easing: EASING, - fill: "both" - }); - animation.current = next; - let settled = false; - const settle = () => { - if (settled || animation.current !== next) return; - settled = true; - animation.current = null; - next.cancel(); - setPresent(false); - retired.current?.(); - }; - next.onfinish = settle; - const deadline = window.setTimeout(settle, 460); - const onHide = () => { - if (document.hidden) settle(); - }; - if (canListen) document.addEventListener("visibilitychange", onHide); - return () => { - window.clearTimeout(deadline); - if (canListen) document.removeEventListener("visibilitychange", onHide); - if (animation.current === next) animation.current = null; - next.cancel(); - }; - }, [ - visible, - enabled, - focusHeld - ]); - (0, react.useEffect)(() => () => animation.current?.cancel(), []); - if (!visible && !present) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: root, - className: Reader_module_css_default.retiringContent, - "data-reader-retiring": visible ? "visible" : "retiring", - "data-ud-motion": "reader-progress-retire", - onBlur: (event) => { - if (!event.currentTarget.contains(event.relatedTarget)) setFocusHeld(false); - }, - children - }); - } - /** - * Keeps a departing turn mounted for the length of its own collapse. - * - * A rewind removes turns from the visible order, and unmounting them outright - * snapped the transcript: every withdrawn row disappeared in one frame with - * nothing to scroll. Instead each departing turn is retained, rendered with - * `visible={false}` so it animates to zero height, and released only once the - * collapse has settled — so the reader watches the rows fold away and the rows - * below glide up into their place. - * - * Live slots follow the incoming group order, so older history stays above the - * tail. A collapsing turn stays next to the live neighbour that preceded it; - * appending it would jump it to the bottom for the length of the animation. - * Retention is bounded by the animation itself: `onRetired` - * drops the slot, so a departing turn lives for one collapse and no longer — - * and a key that comes back later is re-added as a live slot. - */ - function RetiringTurns({ groups, render }) { - const [slots, setSlots] = (0, react.useState)(() => groups.map((group) => ({ - group, - live: true - }))); - (0, react.useLayoutEffect)(() => { - setSlots((current) => reconcileTurnSlots(current, groups)); - }, [groups]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: slots.map((slot) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RetiringContent, { - visible: slot.live, - onRetired: () => setSlots((current) => current.filter((candidate) => candidate.live || candidate.group.key !== slot.group.key)), - children: render(slot.group) - }, slot.group.key)) }); - } - /** A turn that is still on screen, not one this commit is about to unmount. */ - function survivingTurn(node) { - if (!(node instanceof HTMLElement) || node.dataset.readerRetiring === "retiring") return null; - const turn = node.hasAttribute("data-reader-turn") ? node : node.querySelector("[data-reader-turn]"); - if (turn === null) return null; - const retiring = turn.closest("[data-reader-retiring]"); - if (retiring instanceof HTMLElement && retiring.dataset.readerRetiring === "retiring") return null; - return turn; - } - /** - * Where focus goes when cut content is removed without an animation. - * Prefer the nearest turn that is still live. Otherwise the reading column - * (or the host scrollport) so focus does not fall through to the document. - */ - function retireFocusTarget(element) { - const parent = element.parentElement; - if (parent) { - const siblings = [...parent.children]; - const index = siblings.indexOf(element); - for (let cursor = index - 1; cursor >= 0; cursor--) { - const turn = survivingTurn(siblings[cursor]); - if (turn) return turn; - } - for (let cursor = index + 1; cursor < siblings.length; cursor++) { - const turn = survivingTurn(siblings[cursor]); - if (turn) return turn; - } - } - const column = element.closest("[data-chat-flow]"); - if (column && !element.contains(column)) return column; - const scroll = element.closest("[data-conversation-scroll]"); - if (scroll && !element.contains(scroll)) return scroll; - return null; - } - /** Move focus out of `element` before it unmounts. A no-op when focus is elsewhere. */ - function focusSurvivesRetire(element) { - const active = document.activeElement; - if (active === null || !element.contains(active)) return; - const target = retireFocusTarget(element); - if (target === null || element.contains(target)) return; - if (target.tabIndex < 0) target.tabIndex = -1; - target.focus({ preventScroll: true }); - } - function useReadingScroll(root, motion) { - const port = (0, react.useRef)(null); - const following = (0, react.useRef)(true); - const pinned = (0, react.useRef)(true); - const anchor = (0, react.useRef)(null); - const cancelFollow = (0, react.useRef)(() => {}); - const [detached, setDetached] = (0, react.useState)(false); - (0, react.useLayoutEffect)(() => { - const content = root.current; - if (!content) return; - const scroll = content.closest("[data-conversation-scroll]") ?? content; - port.current = scroll; - const previousOverflowAnchor = scroll.style.overflowAnchor; - scroll.style.overflowAnchor = "none"; - let followFrame = 0; - let lastFrameAt = 0; - let layoutDepth = 0; - let lastWrittenTop = null; - const layoutStart = () => { - layoutDepth++; - cancelAnimationFrame(followFrame); - followFrame = 0; - capture(); - }; - const layoutEnd = () => { - layoutDepth = Math.max(0, layoutDepth - 1); - if (!layoutDepth && following.current && !followFrame) { - lastFrameAt = performance.now(); - followFrame = requestAnimationFrame(follow); - } - }; - cancelFollow.current = () => { - cancelAnimationFrame(followFrame); - followFrame = 0; - lastWrittenTop = null; - }; - const selected = () => { - const selection = document.getSelection(); - return selection && !selection.isCollapsed && selection.anchorNode && content.contains(selection.anchorNode); - }; - const editingText = () => { - const active = document.activeElement; - if (!(active instanceof HTMLElement)) return false; - if (!content.contains(active)) return false; - return active.isContentEditable || active.tagName === "TEXTAREA" || active.tagName === "INPUT"; - }; - const capture = () => { - const top = scroll.getBoundingClientRect().top; - const candidates = content.querySelectorAll("[data-reader-anchor]"); - let candidate = null; - for (let index = 0; index < candidates.length; index++) { - const element = candidates[index]; - if (element.getBoundingClientRect().bottom > top + 8) { - candidate = element; - break; - } - } - anchor.current = candidate ? { - element: candidate, - docTop: candidate.getBoundingClientRect().top + scroll.scrollTop - } : null; - }; - let captureFrame = 0; - const scheduleCapture = () => { - if (captureFrame) return; - captureFrame = requestAnimationFrame(() => { - captureFrame = 0; - capture(); - }); - }; - const atBottom = () => scroll.scrollHeight - scroll.scrollTop - scroll.clientHeight < 25; - pinned.current = true; - const onScroll = () => { - if (followFrame !== 0 || layoutDepth > 0) return; - if (lastWrittenTop !== null && Math.abs(scroll.scrollTop - lastWrittenTop) < 1) return; - const bottom = atBottom(); - pinned.current = bottom; - if (!bottom) { - cancelAnimationFrame(followFrame); - followFrame = 0; - scheduleCapture(); - } - if (!following.current) { - if (bottom) { - following.current = true; - setDetached(false); - } - return; - } - if (!bottom) { - following.current = false; - setDetached(true); - } - }; - const onWheel = (event) => { - cancelAnimationFrame(followFrame); - followFrame = 0; - lastWrittenTop = null; - if (event.deltaY < 0) { - following.current = false; - setDetached(true); - pinned.current = false; - scheduleCapture(); - } - }; - const onTouch = () => { - cancelAnimationFrame(followFrame); - followFrame = 0; - lastWrittenTop = null; - }; - const onKey = (event) => { - if (event.target instanceof HTMLElement && event.target.closest("textarea,input,[contenteditable=true]")) return; - if ([ - "PageUp", - "Home", - "ArrowUp" - ].includes(event.key)) { - cancelAnimationFrame(followFrame); - followFrame = 0; - lastWrittenTop = null; - following.current = false; - setDetached(true); - pinned.current = false; - scheduleCapture(); - } - }; - const writeTop = (top) => { - scroll.scrollTop = top; - lastWrittenTop = scroll.scrollTop; - }; - const follow = (now) => { - followFrame = 0; - if (!following.current || selected() || editingText()) return; - if (layoutDepth > 0) return; - const gap = scroll.scrollHeight - scroll.clientHeight - scroll.scrollTop; - const delta = Math.min(48, Math.max(1, now - lastFrameAt)); - lastFrameAt = now; - if (!motion || Math.abs(gap) < 1.5) { - writeTop(scroll.scrollHeight); - capture(); - return; - } - writeTop(scroll.scrollTop + gap * (1 - Math.exp(-delta / 52))); - followFrame = requestAnimationFrame(follow); - }; - const firstFrame = requestAnimationFrame(() => { - if (following.current && !selected()) writeTop(scroll.scrollHeight); - capture(); - }); - let lastHeight = content.scrollHeight; - const observer = new ResizeObserver(() => { - if (selected()) return; - const height = scroll.scrollHeight; - const grew = height > lastHeight + 1; - lastHeight = height; - if (grew && pinned.current && !editingText()) { - following.current = true; - setDetached(false); - } - if (following.current && !editingText()) { - if (!motion || layoutDepth > 0) writeTop(scroll.scrollHeight); - else if (!followFrame) { - lastFrameAt = performance.now(); - followFrame = requestAnimationFrame(follow); - } - } else if (!following.current && anchor.current?.element.isConnected) { - const delta = anchor.current.element.getBoundingClientRect().top + scroll.scrollTop - anchor.current.docTop; - if (Math.abs(delta) > .5) writeTop(scroll.scrollTop + delta); - } - capture(); - }); - observer.observe(content); - if (scroll !== content) observer.observe(scroll); - content.addEventListener("reader-layout-start", layoutStart); - content.addEventListener("reader-layout-end", layoutEnd); - scroll.addEventListener("scroll", onScroll, { passive: true }); - scroll.addEventListener("wheel", onWheel, { passive: true }); - scroll.addEventListener("touchstart", onTouch, { passive: true }); - scroll.addEventListener("touchmove", onTouch, { passive: true }); - scroll.addEventListener("keydown", onKey); - return () => { - cancelAnimationFrame(firstFrame); - cancelAnimationFrame(followFrame); - cancelAnimationFrame(captureFrame); - observer.disconnect(); - content.removeEventListener("reader-layout-start", layoutStart); - content.removeEventListener("reader-layout-end", layoutEnd); - scroll.style.overflowAnchor = previousOverflowAnchor; - scroll.removeEventListener("scroll", onScroll); - scroll.removeEventListener("wheel", onWheel); - scroll.removeEventListener("touchstart", onTouch); - scroll.removeEventListener("touchmove", onTouch); - scroll.removeEventListener("keydown", onKey); - }; - }, [root, motion]); - return { - detached, - jump: (0, react.useCallback)(() => { - cancelFollow.current(); - anchor.current = null; - following.current = true; - pinned.current = true; - setDetached(false); - if (port.current) port.current.scrollTop = port.current.scrollHeight; - }, []), - release: (0, react.useCallback)(() => { - cancelFollow.current(); - following.current = false; - pinned.current = false; - anchor.current = null; - setDetached(true); - }, []) - }; - } - // src/client/fold-choreography.ts - /** Presentation clock, not model/network time. */ - const FOLD_TIMING = { - collapse: 320, - count: 160, - settle: 80, - reveal: 180, - /** - * Slack added to every phase deadline before the watchdog forces the next phase. - * - * The choreography advances on animation promises and rendered frames. Both are - * best-effort: a cancelled animation *rejects* and a compositor that never - * finishes one leaves its promise pending, while a backgrounded tab stops - * delivering frames. Without a deadline the machine would sit in a non-idle - * phase forever, and a non-idle phase freezes both the frame source and the text - * reveal, so the turn would look stuck until a remount. This is the liveness - * guarantee that does not depend on any of them. - */ - watchdogSlack: 240 - }; - /** A step always has the same parent and React key, even when its membership changes. */ - function flowRows(items) { - return items.flatMap((item) => item.kind === "fold" ? [{ - kind: "summary", - key: item.key, - item - }, ...item.steps.map((step) => ({ - kind: "step", - key: step.key, - step, - foldKey: item.key - }))] : [{ - kind: "step", - key: item.key, - step: item.step - }]); - } - function retiringKeys(before, after, open) { - const folded = new Set(flowRows(after).filter((row) => row.kind === "step" && row.foldKey && !open[row.foldKey]).map((row) => row.key)); - return flowRows(before).filter((row) => row.kind === "step" && !row.foldKey && folded.has(row.key)).map((row) => row.key); - } - /** Insert only new summary slots. Never admit incoming content during shrink. */ - function collapseRows(before, target) { - const rows = flowRows(before); - const headers = new Set(rows.filter((row) => row.kind === "summary").map((row) => row.key)); - for (const item of target) { - if (item.kind !== "fold" || headers.has(item.key)) continue; - const members = new Set(item.steps.map((step) => step.key)); - const at = rows.findIndex((row) => members.has(row.key)); - if (at >= 0) rows.splice(at, 0, { - kind: "summary", - key: item.key, - item: { - ...item, - summary: item.summary.replace(/\d+/g, "0") - } - }); - } - return rows; - } - function containsNewUser(before, after) { - const users = new Set(before.filter((item) => item.kind === "user").map((item) => item.key)); - return after.some((item) => item.kind === "user" && !users.has(item.key)); - } - // src/client/LiveFold.tsx - /** Values are presentation commits, never live network counters. */ - function SubtleNumberRoll({ value, motion }) { - const [outgoing, setOutgoing] = (0, react.useState)(null); - const previous = (0, react.useRef)(value); - (0, react.useLayoutEffect)(() => { - if (value === previous.current) return; - const old = previous.current; - previous.current = value; - if (!motion) { - setOutgoing(null); - return; - } - setOutgoing(old); - const timer = window.setTimeout(() => setOutgoing(null), FOLD_TIMING.count); - return () => window.clearTimeout(timer); - }, [value, motion]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.numberRollRoot, - "aria-hidden": "true", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.numberRollSizer, - children: value - }), - outgoing !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: `${Reader_module_css_default.numberRollDigit} ${Reader_module_css_default.numberRollExit}`, - children: outgoing - }, `out-${outgoing}`), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: `${Reader_module_css_default.numberRollDigit} ${outgoing !== null ? Reader_module_css_default.numberRollEnter : ""}`, - children: value - }, `cur-${value}`) - ] - }); - } - function FoldSummaryText({ summary, motion }) { - const parts = (0, react.useMemo)(() => { - const regex = /([^\d]+)(\d+)/g; - const result = []; - let end = 0; - for (const match of summary.matchAll(regex)) { - result.push({ - text: match[1], - number: Number(match[2]) - }); - end = match.index + match[0].length; - } - if (end < summary.length) result.push({ text: summary.slice(end) }); - return result; - }, [summary]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.foldSummary, - "data-reader-fold-summary": summary, - "aria-label": summary, - children: parts.map((part) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.foldSummaryPart, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: part.text }), part.number !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SubtleNumberRoll, { - value: part.number, - motion - })] - }, part.text)) - }); - } - // src/client/projection.ts - function groupNodes(order, get) { - const groups = []; - const seenTurns = /* @__PURE__ */ new Set(); - for (const key of order) { - const node = get(key); - if (!node || node.visibility === "hidden") continue; - const turn = node.location.kind === "step" || node.location.kind === "turn" ? node.location.turn.turn : null; - const previous = groups.at(-1); - if (turn !== null && previous?.turn === turn) previous.keys.push(key); - else { - groups.push({ - key: turn === null ? `node:${key}` : seenTurns.has(turn) ? `turn:${turn}:${key}` : `turn:${turn}`, - turn, - keys: [key] - }); - if (turn !== null) seenTurns.add(turn); - } - } - return groups; - } - function boundaryOf(turn) { - return { - status: turn?.status ?? "unknown", - reason: turn?.end?.data.reason.kind ?? null, - latestStep: turn?.steps.at(-1)?.step ?? -1, - closingStep: turn?.data.get("turn-tail")?.closing?.step ?? null - }; - } - /** - * A settled body step before the closing step of a successful turn. - * - * This is presentation classification only. Narration is never process content - * and never folds. The flag only marks body text that is no longer the turn's - * final answer, so copy and fork stay on that final answer. - */ - function isEarlierNarration(data, boundary) { - if (data.status !== "settled" || boundary.status !== "closed" || boundary.reason !== "completed") return false; - if (data.blocks.some((block) => block.kind === "image" || block.kind === "other")) return false; - return boundary.closingStep !== null && data.step < boundary.closingStep; - } - function processExpanded(choice, boundary) { - return choice ?? !(boundary.status === "closed" && boundary.reason === "completed"); - } - /** Reading while running must not pin the process open after completion. */ - function processChoiceKey(groupKey, boundary) { - return `${groupKey}:${boundary.status}:${boundary.reason ?? "pending"}`; - } - /** - * A body-only assistant step is not a thinking/process disclosure. - * - * Narration (text/image/other blocks) is always visible, so it never counts as - * foldable process content; only literal reasoning does. Tool calls arrive as - * their own flow entries and are checked separately by the reader. - */ - function hasProcessContent(node, _boundary) { - if (!node || node.visibility === "hidden") return false; - if (node.kind === "assistant-step") return node.data.blocks.some((block) => block.kind === "reasoning" && block.text.trim() !== ""); - return node.kind === "context" || node.kind === "model-retry" || node.kind === "system-prompt" || node.kind === "turn-process" || node.kind === "command" || node.kind === "manual-compaction" || node.kind === "compaction"; - } - function hasVisibleBody(blocks) { - return blocks.some((block) => block.kind === "image" || block.kind === "other" || block.kind === "text" && block.text.trim() !== ""); - } - /** Keep native block order. In particular, never lift a later Think above text. */ - function assistantSegments(blocks) { - const segments = []; - let previous; - blocks.forEach((block, index) => { - if (block.kind === "tool-call") { - previous = void 0; - return; - } - const kind = block.kind === "reasoning" ? "reasoning" : "body"; - if (previous?.kind === kind) previous.blocks.push(block); - else { - previous = { - kind, - start: index, - blocks: [block] - }; - segments.push(previous); - } - }); - return segments; - } - function terminalLabel(reason) { - switch (reason) { - case "completed": return null; - case "aborted": - case "interrupted": return "本轮已停止,已生成的内容仍保留。"; - case "blocked": return "本轮需要处理阻塞事项;请查看原对话与下方操作区。"; - case "max-tokens": return "输出达到本轮长度限制,内容可能尚未完整。"; - case "error": return "本轮未完成;错误信息保留在下方。"; - case null: return null; - default: return `本轮结束状态:${reason}。请在原对话中核对完整记录。`; - } - } - /** - * Extract the first usable fork anchor seq from candidate message nodes. - * Only the durable closing message seq cuts the intended turn prefix: an - * absent anchor must surface as undefined (never as 0 or NaN), because the - * host treats a missing atSeq as a whole-session fork. - */ - function forkAnchorSeq(candidates) { - for (const candidate of candidates) { - const seq = candidate?.seq; - if (typeof seq === "number" && Number.isFinite(seq)) return seq; - } - } - // src/client/AssistantNode.tsx - function isNode$1(node, kind) { - return node.kind === kind; - } - const AssistantNode = (0, react.memo)(function AssistantNode({ useChat, nodeKey, boundary, processOpen = false, pinned = false, folded = false, partStart, seamSummary, seamAfter = false, motion, onRead, returnFocusTo, ...render }) { - const node = useChat((snapshot) => snapshot.nodes.get(nodeKey)); - if (!node || node.visibility === "hidden" || !isNode$1(node, "assistant-step")) return null; - const data = node.data; - const parts = assistantSegments(data.blocks); - const earlier = isEarlierNarration(data, boundary); - const hasToolCalls = data.blocks.some((block) => block.kind === "tool-call"); - const isProcessStep = earlier || folded || hasToolCalls || boundary.latestStep > 0 && data.step < boundary.latestStep; - const body = data.blocks.filter((block) => block.kind !== "reasoning" && block.kind !== "tool-call"); - const visible = partStart === void 0 ? parts : parts.filter((part) => part.start === partStart); - const bodyProps = { - streaming: data.status === "running", - holdFormatting: pinned, - startedAt: data.time, - interrupted: data.status === "interrupted", - liveText: true - }; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: visible.map((part) => { - const last = parts.findIndex((item) => item.start === part.start) === parts.length - 1; - if (part.kind === "reasoning") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProcessFragment, { - open: processOpen, - motion, - onRead, - returnFocusTo, - nodeKey, - framed: true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningCard, { - step: data.step, - active: processOpen && boundary.status === "open" && data.step === boundary.latestStep, - motion, - selected: pinned, - onRead, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks: part.blocks, - streaming: data.status === "running" && last && data.blocks.at(-1)?.kind === "reasoning", - holdFormatting: pinned, - startedAt: data.time, - interrupted: data.status === "interrupted", - liveText: true - }) - }) - }, part.start); - if (!hasVisibleBody(part.blocks)) return null; - const isFinalAnswer = !isProcessStep; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [seamSummary && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.processSeamRow, - "data-reader-process-seam": true, - "data-reader-process-seam-summary": seamSummary, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Disclosure, { - open: false, - onChange: () => onRead(), - ariaLabel: "被折叠的过程", - label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FoldSummaryText, { - summary: seamSummary, - motion: false - }) - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", { - className: Reader_module_css_default.answer, - "data-reader-body": true, - "data-reader-anchor": true, - "data-reader-key": nodeKey, - "data-reader-source-start": part.start, - "data-reader-seam-after": seamAfter || void 0, - "data-answer-status": data.status, - "data-answer-phase": isFinalAnswer ? "body" : "process", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialAssistantBody, { - ...render, - node, - blocks: part.blocks, - ...bodyProps - }), - isFinalAnswer && last && data.status === "interrupted" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.stopped, - children: "已停止" - }), - isFinalAnswer && last && data.status !== "running" && boundary.status === "closed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyAnswer, { - blocks: body, - onFork: (() => { - const anchor = forkAnchorSeq([data.finalNode, { seq: render.forkSeq }]); - return render.forkAt && anchor !== void 0 ? () => render.forkAt(anchor) : void 0; - })(), - metrics: render.metrics, - extraActions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialActions, { - official: render.official, - messageId: data.finalNode?.messageId - }) - }) - ] - })] }, part.start); - }) }); - }); - // src/client/native/tool-call-model.ts - /** - * Pure row-model derivation for tool summary rows: variant classification, - * one-line summary, expanded-body text, and flattened result output from the - * frozen call slice. Input material comes from the call ARGUMENTS; output and - * error material from the settled result node. A call whose render intent is - * a terminal card gets its expanded body from the views instead, through - * `terminalCardModel` in terminal-card-model.ts. - */ - /** Figma row titles per variant (design literals, not translatable copy). */ - const VARIANT_TITLES = { - search: "Search", - read: "Read", - bash: "Bash", - write: "Write", - edit: "Edit", - code: "Code", - others: "Tool call" - }; - /** - * Known tool name -> variant. - * - * `cordis_define` is deliberately absent: ui-cordis registers a keyed - * `tool.call.toolview` entry for it, and a keyed hit REPLACES the generic row - * (this table is only reached through GenericToolCard, the dispatch fallback in - * ToolCallTree). An entry here would be unreachable, and a second title for the - * same call would be a second answer to a question the card already owns. - */ - const TOOL_VARIANTS = { - bash: "bash", - pwsh: "bash", - read: "read", - web_fetch: "read", - web_search: "search", - grep: "search", - glob: "search", - write: "write", - edit: "edit", - run_code: "code", - cordis_package_inspect: "read", - cordis_runtime_inspect: "read", - cordis_run: "others", - cordis_stop: "others", - cordis_undefine: "others" - }; - /** Tool-owned titles that refine a generic row variant without replacing it. */ - const TOOL_TITLES = { - cordis_package_inspect: "Inspect", - cordis_runtime_inspect: "Inspect", - cordis_run: "Run Cordis Plugin", - cordis_stop: "Stop Cordis Plugin", - cordis_undefine: "Remove Cordis Plugin", - pwsh: "Pwsh" - }; - /** - * Classify a tool name into its row variant. - * @param toolName - wire tool name. - * @returns matching variant, others when unknown. - */ - function classifyTool(toolName) { - return TOOL_VARIANTS[toolName] ?? "others"; - } - /** - * Flatten a settled result's content blocks to display text: text blocks - * verbatim, other block shapes as pretty JSON. Empty content on a failed call - * falls back to the structured error's `name: code` line. - * @param node - the settled result node. - * @returns the flattened result text (may be empty). - */ - function resultText(node) { - const parts = []; - for (const block of node.content) if (block.type === "text") parts.push(block.text); - else parts.push(JSON.stringify(block, null, 2)); - if (parts.length === 0 && node.error !== void 0) parts.push(`${node.error.name}: ${node.error.code}`); - return parts.join("\n"); - } - function parseArgs(argsRaw) { - try { - return JSON.parse(argsRaw); - } catch { - return; - } - } - function firstLine(text) { - const nl = text.indexOf("\n"); - return nl === -1 ? text : text.slice(0, nl); - } - function pickString(args, keys) { - for (const key of keys) { - const v = args[key]; - if (typeof v === "string" && v !== "") return v; - } - } - /** Summary key preference per variant (args-derived; result-derived summaries are a ledger item). */ - const SUMMARY_KEYS = { - bash: ["description", "command"], - read: [ - "path", - "file_path", - "url" - ], - search: [ - "query", - "pattern", - "url" - ], - write: ["path", "file_path"], - edit: ["path", "file_path"], - code: ["description"], - others: [] - }; - /** - * Strip the workspace root from a workspace-rooted absolute path (display only). - * @param text - the path to shorten. - * @param cwd - session workspace root; absent or empty leaves the path unchanged. - * @returns the path relative to the workspace root, or unchanged when it is not rooted there. - */ - function relativizeToCwd(text, cwd) { - if (cwd === void 0 || cwd === "") return text; - const root = cwd.replace(/[/\\]+$/, ""); - if (text.startsWith(`${root}/`) || text.startsWith(`${root}\\`)) return text.slice(root.length + 1); - return text; - } - function deriveSummary(variant, argsRaw) { - const parsed = parseArgs(argsRaw); - if (typeof parsed !== "object" || parsed === null) return firstLine(argsRaw); - const args = parsed; - if (variant === "search" && Array.isArray(args.queries)) { - const queries = args.queries.filter((query) => typeof query === "string" && query !== ""); - if (queries.length > 0) return queries.map(firstLine).join(", "); - } - const picked = pickString(args, SUMMARY_KEYS[variant]); - if (picked !== void 0) return firstLine(picked); - for (const v of Object.values(args)) if (typeof v === "string" && v !== "") return firstLine(v); - return firstLine(argsRaw); - } - /** Path keys only — never `url` (web_fetch lands on the read variant). */ - const FILE_PATH_KEYS = ["path", "file_path"]; - /** File-tool variants whose summary may be an openable workspace path. */ - const FILE_PATH_VARIANTS = /* @__PURE__ */ new Set([ - "read", - "write", - "edit" - ]); - function deriveFilePath(variant, argsRaw) { - if (!FILE_PATH_VARIANTS.has(variant)) return void 0; - const parsed = parseArgs(argsRaw); - if (typeof parsed !== "object" || parsed === null) return void 0; - const picked = pickString(parsed, FILE_PATH_KEYS); - return picked === void 0 ? void 0 : firstLine(picked); - } - function deriveBody(variant, argsRaw) { - if (argsRaw === "") return null; - const parsed = parseArgs(argsRaw); - if (parsed === void 0) return argsRaw; - if (variant === "code" && typeof parsed === "object" && parsed !== null) { - const code = parsed.code; - if (typeof code === "string" && code !== "") return code; - } - return JSON.stringify(parsed, null, 2); - } - /** - * Derive the full row model from a frozen call slice. - * @param toolName - wire tool name (dispatch-supplied; survives windowless results). - * @param block - RunningToolCall or ToolResultNode off the snapshot caches. - * @param cwd - session workspace root; workspace-rooted path summaries display relative to it. - * @param home - host account home; a leftover POSIX home path displays as `~`. - * @returns the row model. - */ - function toolRowModel(toolName, block, cwd, home) { - const variant = classifyTool(toolName); - const done = "kind" in block; - const argsRaw = (done ? block.call?.argsRaw : "argsRaw" in block ? block.argsRaw : "") ?? ""; - const state = !done ? "running" : block.error?.code === "interrupted" ? "stopped" : block.isError ? "error" : "ok"; - const base = argsRaw === "" ? block.callId : abbreviateHomePath(relativizeToCwd(deriveSummary(variant, argsRaw), cwd), home); - const toolTitle = TOOL_TITLES[toolName]; - const summary = variant === "others" && toolName !== "" && toolTitle === void 0 ? `${toolName} · ${base}` : base; - const output = done ? resultText(block) || null : null; - const errorSummary = state === "error" && output !== null ? firstLine(output) : null; - return { - variant, - title: toolTitle ?? VARIANT_TITLES[variant], - summary, - filePath: deriveFilePath(variant, argsRaw), - body: deriveBody(variant, argsRaw), - output, - errorSummary, - state - }; - } - // src/client/ToolActivity.tsx - const LABEL = { - preparing: "输入生成中", - running: "执行中", - returned: "已返回", - succeeded: "已完成", - failed: "失败", - interrupted: "已中断" - }; - const ICONS = { - write: _deepseek_ai_dsh_client_ui_primitives.IconEditOutlineRegular, - read: _deepseek_ai_dsh_client_ui_primitives.IconBrowseOutlineRegular, - terminal: _deepseek_ai_dsh_client_ui_primitives.IconApiOutlineRegular, - search: _deepseek_ai_dsh_client_ui_primitives.IconSearchOutlineRegular, - web: _deepseek_ai_dsh_client_ui_primitives.IconSearchOutlineRegular, - code: _deepseek_ai_dsh_client_ui_primitives.IconApiOutlineRegular, - other: _deepseek_ai_dsh_client_ui_primitives.IconSparkleRegular - }; - const number = new Intl.NumberFormat("zh-CN"); - const preparingTerminalLabels = { - ...terminalBlockLabels, - running: "正在生成命令" - }; - const language = (path) => path?.split(".").at(-1); - const duration = (ms) => ms < 1e3 ? `${Math.round(ms)} 毫秒` : `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} 秒`; - function generatedInput(content, target, preparing) { - const lines = content.split("\n").map((text, index) => ({ - number: index + 1, - text - })); - const visible = preparing ? lines.slice(-12) : lines.slice(0, 1600); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - "data-reader-tool-file": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { - className: Reader_module_css_default.toolDetailNote, - children: [preparing ? "正在生成的输入 · 尚未执行 · 末尾 12 行" : "工具输入中的文件内容", !preparing && lines.length > visible.length ? " · 预览前 1,600 行,完整内容在原始数据中" : ""] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ReadBlock, { - label: target ?? "文件内容", - lang: language(target), - lines: visible, - totalLines: lines.length, - maxLines: 16, - labels: readBlockLabels - })] - }); - } - function InputView({ model, phase, fillComposer }) { - const preparing = phase === "preparing"; - const inProgress = preparing || phase === "running"; - if ((model.name === "render_ui" || model.name === "show_widget") && typeof model.args?.html === "string") return preparing ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamingMcpAppPlaceholder, { title: typeof model.args.title === "string" ? model.args.title : void 0 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(McpAppFrame, { - html: model.args.html, - title: typeof model.args.title === "string" ? model.args.title : void 0, - fillComposer - }); - if (model.content) return generatedInput(model.content, model.target, preparing); - if (model.command) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - "data-reader-tool-terminal": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: preparing ? "正在生成命令 · 尚未执行" : "提交的命令" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.TerminalBlock, { - command: model.command, - cwd: model.cwd, - running: inProgress, - labels: preparing ? preparingTerminalLabels : terminalBlockLabels - })] - }); - if (model.category === "terminal" && preparing && model.argsState === "partial") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - "data-reader-tool-command-pending": true, - children: "命令仍在生成,收到可识别的命令文本后会显示预览。" - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonTree, { - data: model.args, - label: preparing ? "已收到的输入字段" : "工具输入", - labels: jsonTreeLabels - }); - } - function readLines(value) { - if (!Array.isArray(value)) return null; - const lines = []; - for (const item of value) { - const row = objectValue(item); - if (typeof row?.number !== "number" || !Number.isInteger(row.number) || typeof row.text !== "string") return null; - lines.push({ - number: row.number, - text: row.text - }); - } - return lines; - } - /** A step past this reads as slow rather than merely in progress. */ - const SLOW_TOOL_MS = 1e4; - function diffHunks(value) { - if (!Array.isArray(value) || value.length === 0) return null; - const diffs = []; - for (const item of value) { - const row = objectValue(item); - if (typeof row?.path !== "string" || row.oldText !== null && typeof row.oldText !== "string" || typeof row.newText !== "string") return null; - diffs.push({ - path: row.path, - oldText: row.oldText, - newText: row.newText - }); - } - return diffs; - } - function searchFiles(value) { - if (!Array.isArray(value)) return null; - const files = []; - for (const item of value) { - const row = objectValue(item); - if (typeof row?.path !== "string" || !Array.isArray(row.matches)) return null; - const matches = []; - for (const itemMatch of row.matches) { - const match = objectValue(itemMatch); - if (typeof match?.lineNumber !== "number" || !Number.isInteger(match.lineNumber) || typeof match.line !== "string") return null; - matches.push({ - lineNumber: match.lineNumber, - line: match.line - }); - } - files.push({ - path: row.path, - matches - }); - } - return files; - } - function ResultView(props) { - const { official, entry, model } = props; - const fallback = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResultFallback, { ...props }); - if (!official || !entry.block || model.name === "render_ui" || model.name === "show_widget") return fallback; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialTool, { - ...props, - official, - block: entry.block, - toolName: model.name, - cwd: props.cwd ?? model.cwd, - fallback - }); - } - function ResultFallback({ entry, model, phase, ...render }) { - if ((model.name === "render_ui" || model.name === "show_widget") && typeof model.args?.html === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(McpAppFrame, { - html: model.args.html, - title: typeof model.args.title === "string" ? model.args.title : void 0, - fillComposer: render.fillComposer - }); - const block = entry.block; - if (!block || !("kind" in block)) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: phase === "interrupted" ? "已中断,没有工具结果。已生成的输入仍可查看。" : phase === "preparing" ? "模型正在生成工具输入,工具还未开始执行。" : "工具已开始执行,正在等待结果。" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputView, { - model, - phase, - fillComposer: render.fillComposer - })] }); - const meta = objectValue(block.meta); - const text = block.content.filter((item) => item.type === "text").map((item) => item.text).join("\n"); - if (phase === "interrupted") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "工具已取消,未正常完成。输入和原始返回记录仍可查看。" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputView, { - model, - phase, - fillComposer: render.fillComposer - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { - className: Reader_module_css_default.toolRaw, - children: text - }) - ] }); - if (model.category === "terminal") { - const facts = executionFacts(block); - const output = text.replace(/\n\[(?:exit code: \d+|killed by signal: [^\]\n]+)\]$/, ""); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-terminal": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.TerminalBlock, { - command: model.command ?? model.name, - cwd: model.cwd, - output, - exitCode: facts.exitCode, - signal: facts.signal, - maxLines: 18, - labels: terminalBlockLabels - }) - }); - } - const lines = readLines(meta?.lines); - if (model.category === "read" && typeof meta?.path === "string" && typeof meta.totalLines === "number" && lines) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-file": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ReadBlock, { - label: meta.path, - lang: typeof meta.lang === "string" ? meta.lang : void 0, - lines, - totalLines: meta.totalLines, - maxLines: 18, - labels: readBlockLabels - }) - }); - const diffs = diffHunks(meta?.diffs) ?? callDiffHunks(block, model.args, model.name); - if (diffs.length) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-diff": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DiffBlock, { - diffs, - maxLines: 18, - labels: diffBlockLabels - }) - }); - if (model.category === "search" && typeof meta?.total === "number" && typeof meta.truncated === "boolean") { - if (meta.shape === "paths" && Array.isArray(meta.paths) && meta.paths.every((path) => typeof path === "string")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-search": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SearchBlock, { - kind: "paths", - paths: meta.paths, - total: meta.total, - truncated: meta.truncated, - maxLines: 18, - labels: searchBlockLabels - }) - }); - const files = searchFiles(meta.files); - if (meta.shape === "matches" && files) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-search": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SearchBlock, { - kind: "matches", - files, - total: meta.total, - truncated: meta.truncated, - maxLines: 18, - labels: searchBlockLabels - }) - }); - } - if (model.category === "web" && typeof meta?.truncated === "boolean") { - if (model.name === "web_fetch" && typeof meta.url === "string" && typeof meta.statusCode === "number") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-web": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.WebBlock, { - kind: "fetch", - url: meta.url, - statusCode: meta.statusCode, - truncated: meta.truncated, - labels: webBlockLabels - }) - }); - if (model.name === "web_search" && Array.isArray(meta.sources)) { - const sources = meta.sources.flatMap((source) => { - const item = objectValue(source); - return typeof item?.url === "string" ? [{ - url: item.url, - ...typeof item.title === "string" ? { title: item.title } : {}, - ...typeof item.snippet === "string" ? { snippet: item.snippet } : {}, - ...typeof item.publishedAt === "string" ? { publishedAt: item.publishedAt } : {} - }] : []; - }); - if (sources.length === meta.sources.length) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-web": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.WebBlock, { - kind: "search", - sources, - answer: typeof meta.answer === "string" ? meta.answer : void 0, - truncated: meta.truncated, - labels: webBlockLabels - }) - }); - } - } - if (model.category === "write" && model.content && !block.isError) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "文件工具已返回。以下为提交的内容;完整返回记录可在「原始数据」查看。" - }), generatedInput(model.content, model.target, false)] }); - const content = block.content; - if (model.category === "code") { - const output = content.filter((item) => item.type === "text").map((item) => item.text).join("\n"); - const facts = executionFacts(block); - if (output.trim()) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-tool-code": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.TerminalBlock, { - command: model.command ?? model.name, - cwd: model.cwd, - output, - exitCode: facts.exitCode, - signal: facts.signal, - maxLines: 18, - labels: terminalBlockLabels - }) - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "代码已执行,没有可展示的输出。" - }); - } - if (content.some((item) => item.type === "text")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.toolDocument, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks: contentBlocks(content).filter((item) => item.kind === "text"), - source: "tool" - }) - }); - if (content.length) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "图片或扩展内容已在对话中单独展示。" - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "工具没有返回可展示的内容。" - }); - } - /** One occurrence, keyed by call id all the way from generation to result. */ - const ToolActivity = (0, react.memo)(function ToolActivityView({ entry, motion, turnClosed, onRead, depth = 0, ...render }) { - const [open, setOpen] = (0, react.useState)(false); - const [tab, setTab] = (0, react.useState)("result"); - const control = (0, react.useRef)(null); - const panel = (0, react.useRef)(null); - const [selected, setSelected] = (0, react.useState)(false); - const detailId = (0, react.useId)(); - const tabRefs = (0, react.useRef)([]); - const model = (0, react.useMemo)(() => activitySummary(entry), [entry.block, entry.draft]); - const phase = activityPhase(entry, turnClosed); - const heldPreview = (0, react.useRef)({ - entry, - model, - phase - }); - if (!selected) heldPreview.current = { - entry, - model, - phase - }; - const preview = heldPreview.current; - (0, react.useEffect)(() => { - const track = () => { - const selection = document.getSelection(); - setSelected(!!selection && !selection.isCollapsed && !!selection.anchorNode && !!panel.current?.contains(selection.anchorNode)); - }; - document.addEventListener("selectionchange", track); - return () => document.removeEventListener("selectionchange", track); - }, []); - const facts = executionFacts(entry.block); - const Icon = model.name === "skill" ? _deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular : ICONS[model.category]; - const block = entry.block; - const native = block ? toolRowModel(model.name, block) : null; - const skillName = typeof model.args?.name === "string" ? model.args.name.split("\n")[0] : model.raw.split("\n")[0]; - const rowTitle = model.name === "skill" ? "Skill" : native?.title ?? VARIANT_TITLES[classifyTool(model.name)]; - const rowSummary = phase === "interrupted" ? "已停止 · 调用记录保留" : model.name === "skill" ? skillName : native?.errorSummary ?? native?.summary ?? (classifyTool(model.name) === "others" ? `${model.name} · ${model.target ?? model.title}` : model.target ?? model.title); - const diff = (0, react.useMemo)(() => diffTotals$1(block, model.args, model.name), [ - block, - model.args, - model.name - ]); - const showState = phase === "preparing" || phase === "running" || phase === "failed" || phase === "interrupted"; - const running = phase === "preparing" || phase === "running"; - const [liveMs, setLiveMs] = (0, react.useState)(null); - (0, react.useEffect)(() => { - if (!running) { - forgetCallClock(entry.callId); - setLiveMs(null); - return; - } - const base = runningClockBase(entry.callId, block); - const tick = () => setLiveMs(Math.max(0, Date.now() - base)); - tick(); - const timer = setInterval(tick, 200); - return () => clearInterval(timer); - }, [ - running, - block, - entry.callId - ]); - const elapsed = block && "kind" in block && block.callTime != null ? Math.max(0, block.time - block.callTime) : null; - const shownMs = liveMs ?? (elapsed !== null && elapsed >= SLOW_TOOL_MS ? elapsed : null); - const rawResult = (0, react.useMemo)(() => { - const value = preview.entry.block; - return value && "kind" in value ? JSON.stringify({ - content: value.content, - isError: value.isError, - meta: value.meta - }, null, 2) : ""; - }, [preview.entry.block]); - const tabs = [ - ["result", phase === "preparing" ? "生成预览" : "结果"], - ["input", "输入"], - ["raw", "原始数据"] - ]; - const activate = (index) => { - const item = tabs[(index + tabs.length) % tabs.length]; - setTab(item[0]); - tabRefs.current[(index + tabs.length) % tabs.length]?.focus(); - }; - if (depth > 6) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.meta, - children: "更深的嵌套调用可在原对话查看。" - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - ref: (element) => { - control.current = element?.querySelector("[data-disclosure-row]") ?? null; - }, - className: Reader_module_css_default.toolActivity, - "data-reader-tool-call": entry.callId, - "data-tool-phase": phase, - "data-tool-args-length": model.raw.length, - "data-tool-category": model.category, - "data-expanded": open, - "data-ud-check": "reader-tool-activity", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, { - icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { size: 14 }), - title: rowTitle, - open, - expandable: true, - expandOnRowClick: true, - keepContentWhenOpen: true, - onToggle: () => { - onRead(); - setOpen((value) => !value); - }, - rowClassName: Reader_module_css_default.nativeToolRow, - collapsedContent: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.rowSeparator, - "aria-hidden": true - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.nativeToolSummary, - title: rowSummary, - "data-reader-tool-summary": true, - ...running ? { "data-running": "" } : {}, - children: rowSummary - }), - shownMs !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.toolElapsed, - "data-reader-tool-elapsed": true, - ...shownMs >= SLOW_TOOL_MS ? { "data-slow": "" } : {}, - children: [(shownMs / 1e3).toFixed(shownMs < 1e4 ? 1 : 0), "s"] - }), - diff && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.diffStat, - "data-reader-diff-stat": true, - children: [diff.added > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.diffAdded, - children: ["+", number.format(diff.added)] - }), diff.removed > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.diffRemoved, - children: ["-", number.format(diff.removed)] - })] - }), - showState && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.toolState, - "data-phase": phase, - children: LABEL[phase] - }) - ] }) - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProcessFragment, { - open, - motion, - onRead, - returnFocusTo: control, - nodeKey: `${entry.key}:detail`, - framed: true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - id: detailId, - className: Reader_module_css_default.toolDetails, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.toolLedger, - "aria-live": "off", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["工具 · ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.toolEngine, - children: model.name - })] }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - "data-reader-tool-progress": true, - children: phase === "preparing" ? `已接收 ${number.format(model.raw.length)} 字符输入` : phase === "running" ? "已提交 · 等待工具返回" : phase === "interrupted" ? "已停止 · 输入记录保留" : elapsed !== null ? `执行 ${duration(elapsed)}` : "结果已记录" - }), - facts.exitCode !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["退出码 ", facts.exitCode] }), - facts.signal && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["信号 ", facts.signal] }) - ] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.toolTabs, - role: "tablist", - "aria-label": `${model.title}的执行数据`, - onKeyDown: (event) => { - const index = tabs.findIndex((item) => item[0] === tab); - if (event.key === "ArrowRight" || event.key === "ArrowLeft") { - event.preventDefault(); - activate(index + (event.key === "ArrowRight" ? 1 : -1)); - } else if (event.key === "Home" || event.key === "End") { - event.preventDefault(); - activate(event.key === "Home" ? 0 : tabs.length - 1); - } - }, - children: tabs.map(([id, title], index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - ref: (element) => { - tabRefs.current[index] = element; - }, - type: "button", - role: "tab", - id: `${detailId}-${id}`, - "aria-selected": tab === id, - "aria-controls": `${detailId}-panel`, - tabIndex: tab === id ? 0 : -1, - onClick: () => setTab(id), - children: title - }, id)) - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - ref: panel, - id: `${detailId}-panel`, - className: Reader_module_css_default.toolPanel, - role: "tabpanel", - "aria-labelledby": `${detailId}-${tab}`, - tabIndex: 0, - children: [ - selected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "为保留选区,预览暂停更新;当前状态见卡片标题。" - }), - tab === "result" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResultView, { - ...render, - ...preview - }), - tab === "input" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputView, { - model: preview.model, - phase: preview.phase, - fillComposer: render.fillComposer - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { - className: Reader_module_css_default.detail, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: "全部输入字段" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonTree, { - data: preview.model.args, - label: "输入字段", - labels: jsonTreeLabels - })] - })] }), - tab === "raw" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.toolDetailNote, - children: "完整记录 · 只读 · 不执行其中的代码" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { - className: Reader_module_css_default.toolRawLabel, - children: "工具输入" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { - className: Reader_module_css_default.toolRaw, - children: preview.model.raw || "输入尚未到达" - }), - rawResult && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { - className: Reader_module_css_default.toolRawLabel, - children: "工具结果" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { - className: Reader_module_css_default.toolRaw, - children: rawResult - })] }) - ] }) - ] - }) - ] - }) - }), - !!block?.subCalls.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.toolChildren, - "aria-label": "子调用", - children: block.subCalls.map((child, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolActivity, { - ...render, - entry: { - kind: "tool", - key: `reader-tool:${child.callId}`, - callId: child.callId, - step: entry.step, - order: index, - block: child - }, - motion, - turnClosed, - onRead, - depth: depth + 1 - }, child.callId)) - }) - ] - }); - }, (previous, next) => previous.entry.callId === next.entry.callId && previous.entry.block === next.entry.block && previous.entry.draft === next.entry.draft && previous.entry.step === next.entry.step && previous.motion === next.motion && previous.turnClosed === next.turnClosed && previous.depth === next.depth && previous.onRead === next.onRead && previous.renderSlotChain === next.renderSlotChain && previous.loadImage === next.loadImage && previous.fillComposer === next.fillComposer && previous.official === next.official && previous.cwd === next.cwd && previous.openFile === next.openFile); - /** Rich media (images, MCP widgets) rendered outside the folded tool ledger. */ - function ToolMedia({ block, depth = 0, ...render }) { - if (depth > 6) return null; - const visible = "kind" in block ? contentBlocks(block.content).filter((item) => item.kind === "image" || item.kind === "other") : []; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [visible.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks: visible, - source: "tool" - }), block.subCalls.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolMedia, { - ...render, - block: child, - depth: depth + 1 - }, child.callId))] }); - } - // src/client/open-file.ts - function deliverableOpenModeOf(value) { - return value === "sidebar" ? "sidebar" : "external"; - } - function modeFromSnapshot(store) { - try { - return deliverableOpenModeOf(store?.getSnapshot()?.deliverableOpenMode); - } catch { - return "external"; - } - } - /** Workspace-folder affordances stay on the OS opener, not the Sidebar switch. */ - function isFolderOpenPath(path) { - return path === "." || path === ""; - } - function encodeSegment(segment) { - return encodeURIComponent(segment).replace(/%3A/gi, ":"); - } - function encodePath(path) { - return path.split("/").map(encodeSegment).join("/"); - } - /** - * Session-scoped `dsh-resource://file/session/<id>/…` address. - * Matches official `fileAddressFor` / `sessionFileAddress` (0.1.5). - */ - function fileAddressFor(sessionId, cwd, path) { - const normalized = path.replace(/\\/g, "/"); - const address = (relative) => { - const cleaned = relative.replace(/\\/g, "/").replace(/^(?:\.\/)+/, ""); - return `dsh-resource://file/session/${encodeSegment(sessionId)}/${encodePath(cleaned)}`; - }; - if (!isAbsoluteWorkspacePath(normalized)) return address(normalized); - const root = cwd === void 0 ? "" : cwd.replace(/\\/g, "/").replace(/\/+$/, ""); - if (root !== "" && normalized === root) return address(""); - if (root !== "" && normalized.startsWith(`${root}/`)) return address(normalized.slice(root.length + 1)); - return address(normalized); - } - function resolveOpenWorkspacePath(cwd, path, resolveWorkspacePath) { - return isFolderOpenPath(path) ? cwd ?? "." : resolveWorkspacePath(cwd, path); - } - async function openDeliverableFile(args) { - const targetPath = resolveOpenWorkspacePath(args.cwd, args.path, args.resolveWorkspacePath); - if (args.mode === "sidebar" && !isFolderOpenPath(args.path)) { - if (typeof args.openSidebar !== "function") args.warn?.("[dsh-better-display] sidebarRight.openResource is not available; falling back to system app"); - else try { - const address = (args.fileAddressFor ?? fileAddressFor)(args.sessionId, args.cwd, args.path); - args.openSidebar(address); - return "sidebar"; - } catch (error) { - args.warn?.("[dsh-better-display] sidebar open failed; falling back to system app", error); - } - } - await args.openExternal(targetPath); - return "external"; - } - // src/client/pending-submission.ts - function asReadonlyArray(value) { - return Array.isArray(value) ? value : []; - } - function isImage(value) { - return value !== null && typeof value === "object" && typeof value.previewUrl === "string"; - } - /** - * Safe image list for conversation.view pending echoes. - * Official 0.1.5 uses `images`; older hosts used `attachments`. - * Either field may be missing — never read `.length` on undefined. - */ - function pendingSubmissionImages(submission) { - if (submission == null) return []; - if (Array.isArray(submission.images)) return submission.images.filter(isImage); - if (Array.isArray(submission.attachments)) { - const images = []; - for (const item of submission.attachments) if (item?.type === "image" && isImage(item.value)) images.push(item.value); - return images; - } - return []; - } - // src/client/WaitClock.tsx - /** Past this, a wait stops being a pause and reads as the model not answering. */ - const WAIT_OVERTIME_MS = 1e4; - /** - * How long the model has been given the turn, counted in plain seconds. - * - * Just the number and, past ten seconds, a「暂未响应」badge — no bar, because the - * question the reader has is「how long has this been hanging」, not「how far - * along」: there is no known total to be a fraction of. - * - * The clock restarts whenever the anchor changes, so each wait is timed from the - * event that started it rather than from the beginning of the turn. - */ - function WaitClock({ startTime }) { - const [mountedAt] = (0, react.useState)(() => Date.now()); - const [now, setNow] = (0, react.useState)(() => Date.now()); - const anchor = startTime ?? mountedAt; - (0, react.useEffect)(() => { - const id = setInterval(() => setNow(Date.now()), 250); - return () => clearInterval(id); - }, []); - const waited = Math.max(0, now - anchor); - const overtime = waited >= WAIT_OVERTIME_MS; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.waitClock, - "data-reader-wait-clock": true, - ...overtime ? { "data-overtime": "" } : {}, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.waitSeconds, - children: formatRunDuration(waited) - }), overtime && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.waitOvertime, - "data-reader-wait-badge": true, - children: "暂未响应" - })] - }); - } - // src/client/WaitingStatus.tsx - function WaitingStatus({ anchor, label }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.turnStatus, - role: "status", - "aria-live": "polite", - "data-reader-turn-status": true, - "data-reader-wait-start": anchor.time ?? "", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.turnStatusLabel, - children: label - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WaitClock, { startTime: anchor.time }, anchor.key)] - }); - } - // src/client/waiting-clock.ts - const timestamp = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null; - /** - * Chat-layer kinds that hand the turn back to the model unconditionally. - * - * These are `ChatNodeDataMap` keys, NOT conversation-layer `ConversationNode` kinds. - * The two layers name the same idea differently: a returned tool is `tool-result` - * in the conversation contract, but the row the reader sees is the `tool-call` node. - * A name copied from the wrong layer silently disables the branch it guards, so - * the `satisfies` below makes the compiler reject any name that is not a real kind. - */ - const WAIT_AFTER = /* @__PURE__ */ new Set(["context", "model-retry"]); - /** - * Mirrors the host's `isSettledTool`: a running call has no `kind`, a settled one - * carries `kind: 'tool-result'`. Kept local so this module stays dependency-free, - * and pinned by a test against the host's own helper contract. - */ - function toolSettled(data) { - const root = data?.root; - return typeof root === "object" && root !== null && root.kind === "tool-result"; - } - /** A command that is still executing has no outcome yet; only a settled one hands over. */ - function commandSettled(data) { - return data?.outcome != null; - } - /** - * Does this node leave the model on the hook for the next move? - * - * A tool or command that is *still running* is not a wait — the tool is the one - * working. Only its returned form hands control back, which is exactly the moment - * the model can stall. - */ - function handsBackToModel(node) { - if (node.kind === "user" || node.kind === "steering") return true; - if (node.kind === "tool-call") return toolSettled(node.data); - if (node.kind === "command") return commandSettled(node.data); - return WAIT_AFTER.has(node.kind); - } - /** - * The moment the current wait began. - * - * This is the time of the **last** node that handed control to the model — a - * returned tool, an injected context, or the user's own message. Anchoring on the - * user's message alone made the readout count the entire turn, so a wait that had - * only just begun showed the minutes the tools had already spent. - */ - function waitingAnchor(order, get, pending = []) { - let anchor = { - key: "unresolved", - time: null - }; - for (let i = order.length - 1; i >= 0; i--) { - const node = get(order[i]); - if (!node) continue; - if (!handsBackToModel(node)) continue; - const time = node.data && typeof node.data === "object" && "time" in node.data && typeof node.data.time === "number" ? node.data.time : void 0; - anchor = { - key: order[i], - time: timestamp(time) - }; - break; - } - for (let i = pending.length - 1; i >= 0; i--) { - const input = pending[i]; - if (input.placement === "queued") continue; - const time = timestamp(input.time); - if (time === null || anchor.time === null || time >= anchor.time) return { - key: `pending:${input.requestId}`, - time - }; - break; - } - return anchor; - } - // src/client/native/ReferenceIcon.tsx - /** - * Render the icon that identifies one inline reference domain. - * @param props - Reference kind, optional size, and optional CSS class. - * @returns The corresponding current-color SVG glyph. - */ - function ReferenceIcon({ kind, size = 16, className }) { - switch (kind) { - case "session": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - width: size, - height: size, - className, - viewBox: "0 0 16 16", - fill: "none", - "aria-hidden": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 0.597656C3.91296 0.597656 0.599716 3.91103 0.599609 7.99805C0.599609 9.13171 0.854567 10.2079 1.31152 11.1699L1.59277 11.7607L2.77441 11.1992L2.49414 10.6084L2.36035 10.3076C2.06865 9.59612 1.90723 8.81645 1.90723 7.99805C1.90733 4.63362 4.63554 1.90625 8 1.90625C11.3644 1.90635 14.0917 4.63368 14.0918 7.99805C14.0918 11.3625 11.3644 14.0907 8 14.0908C7.311 14.0908 6.80642 14.0414 6.35938 13.918C5.919 13.7963 5.50105 13.5929 5.00098 13.2441C4.26805 12.7329 3.21756 12.5526 2.35156 13.0996L2.33789 13.1084L2.32422 13.1182L1.74805 13.5234L2.18164 14.8184L3.05957 14.2002C3.37505 14.0068 3.84248 14.0319 4.25195 14.3174C4.84447 14.7307 5.39718 15.009 6.01172 15.1787C6.61963 15.3465 7.25579 15.3984 8 15.3984C12.087 15.3983 15.4004 12.0851 15.4004 7.99805C15.4003 3.9111 12.087 0.59776 8 0.597656ZM4.56836 8.50977V9.80371H8.12402V8.50977H4.56836ZM4.56836 7.30078H11.4619V6.00684H4.56836V7.30078Z", - fill: "currentColor" - }) - }); - case "file": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBrowseOutlineRegular, { - size, - className - }); - case "folder": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderCloseRegular, { - size, - className - }); - } - } - // \0dshx-css-module:src/client/native/ContextBody.module.css.mjs - const css$3 = "._1q5eoq_text{color:var(--dsw-alias-label-secondary);font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}._1q5eoq_fields{border-top:1px solid var(--dsw-alias-line-secondary);flex-direction:column;gap:2px;margin:8px 0 0;padding-top:8px;display:flex}._1q5eoq_field{gap:8px;min-width:0;display:flex}._1q5eoq_fieldKey{min-width:96px;color:var(--dsw-alias-label-caption);flex:none}._1q5eoq_fieldValue{min-width:0;color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;flex:auto;margin:0}._1q5eoq_files{flex-wrap:wrap;gap:4px 12px;margin:0 0 8px;padding:0;list-style:none;display:flex}._1q5eoq_file{align-items:baseline;gap:6px;min-width:0;display:flex}._1q5eoq_filePath{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}._1q5eoq_fileAction{color:var(--dsw-alias-label-caption)}._1q5eoq_catalogNotice{color:var(--dsw-alias-label-caption);margin:0 0 6px}._1q5eoq_entries{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}._1q5eoq_entry{gap:8px;min-width:0;display:flex}._1q5eoq_entryName{color:var(--dsw-alias-label-secondary);flex:none}._1q5eoq_entryDescription{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;overflow:hidden}._1q5eoq_sections{flex-direction:column;gap:8px;margin:0;display:flex}._1q5eoq_section{flex-direction:column;gap:2px;min-width:0;display:flex}._1q5eoq_sectionName{color:var(--dsw-alias-label-caption)}._1q5eoq_sectionText{color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0}._1q5eoq_relaySender{color:var(--dsw-alias-label-caption);overflow-wrap:anywhere;margin:0 0 6px}._1q5eoq_recalls{flex-direction:column;gap:2px;margin:0 0 8px;padding:0;list-style:none;display:flex}._1q5eoq_recall{gap:8px;min-width:0;display:flex}._1q5eoq_recallLabel{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}._1q5eoq_recallCounts{color:var(--dsw-alias-label-caption);flex:none}"; - const tagId$3 = "dsh-better-chat/ContextBody.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$3; - tag.textContent = css$3; - document.head.appendChild(tag); - } - var ContextBody_module_css_default = { - "catalogNotice": "_1q5eoq_catalogNotice", - "entries": "_1q5eoq_entries", - "entry": "_1q5eoq_entry", - "entryDescription": "_1q5eoq_entryDescription", - "entryName": "_1q5eoq_entryName", - "field": "_1q5eoq_field", - "fieldKey": "_1q5eoq_fieldKey", - "fields": "_1q5eoq_fields", - "fieldValue": "_1q5eoq_fieldValue", - "file": "_1q5eoq_file", - "fileAction": "_1q5eoq_fileAction", - "filePath": "_1q5eoq_filePath", - "files": "_1q5eoq_files", - "recall": "_1q5eoq_recall", - "recallCounts": "_1q5eoq_recallCounts", - "recallLabel": "_1q5eoq_recallLabel", - "recalls": "_1q5eoq_recalls", - "relaySender": "_1q5eoq_relaySender", - "section": "_1q5eoq_section", - "sectionName": "_1q5eoq_sectionName", - "sections": "_1q5eoq_sections", - "sectionText": "_1q5eoq_sectionText", - "text": "_1q5eoq_text" - }; - // src/client/native/ContextBody.tsx - /** Model-facing text stays bounded at the disclosure, not at the producer. */ - const MAX_CHARS = 2e4; - /** Rows a list body materializes before summarizing the remainder. */ - const MAX_ENTRIES = 200; - /** One durable source narrowed to the readable-record shape; null for anything else. */ - function asRecord(value) { - return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null; - } - /** - * The content blocks as runs, IN THE ORDER the model received them. - * - * Adjacent text blocks join with no separator, matching how provider adapters - * flatten them — inserting a line break would show the reader a line the model - * never saw. An unknown block breaks the run and keeps its own fallback rather - * than being hoisted past the text around it or vanishing; the block union is - * merge-extensible, so a foreign log may interleave shapes this build does not - * know. - */ - function contentRuns(content) { - const runs = []; - for (const block of content) { - if (block.type !== "text") { - runs.push({ block }); - continue; - } - const last = runs[runs.length - 1]; - if (last !== void 0 && "text" in last) last.text += block.text; - else runs.push({ text: block.text }); - } - return runs; - } - /** Only the blocks this UI version does not know, for bodies that replace the text. */ - function unknownBlocks(content) { - return contentRuns(content).flatMap((run) => "block" in run ? [run.block] : []); - } - /** The model-facing text, truncated to the display bound. */ - function boundedText(text, t) { - return text.length > MAX_CHARS ? `${text.slice(0, MAX_CHARS)}\n${t("json.truncated", { total: text.length })}` : text; - } - /** - * One source field rendered as a value row; nested shapes stay compact JSON. - * Bounded on its own, because source fields are as unbounded as the text: an unknown - * producer may record an arbitrarily large string or array. - */ - function fieldValue(value, t) { - return boundedText(typeof value === "string" ? value : typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value), t); - } - /** - * Source fields as a key/value list. `kind` is always omitted because the - * row header already names the producer. `form` is omitted only when a - * dedicated body rendered for it — then the presentation the reader is looking - * at IS that value. On the opaque fallback the declaration is kept, because - * that is the one place a form this version cannot present would otherwise - * disappear from the UI entirely. - */ - function SourceFields({ source, formRendered, t }) { - const record = asRecord(source); - if (record === null) return null; - const hidden = formRendered ? ["kind", "form"] : ["kind"]; - const rows = Object.entries(record).filter(([key]) => !hidden.includes(key)); - if (rows.length === 0) return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", { - className: ContextBody_module_css_default.fields, - "data-context-fields": true, - children: rows.map(([key, value]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: ContextBody_module_css_default.field, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { - className: ContextBody_module_css_default.fieldKey, - children: key - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { - className: ContextBody_module_css_default.fieldValue, - children: fieldValue(value, t) - })] - }, key)) - }); - } - /** - * Content blocks this UI version does not know, kept visible rather than - * dropped: the block union is merge-extensible, so a newer or foreign log may - * carry a shape this build has no presentation for. - * @param props - The unrecognized blocks and the locale seat. - * @returns One generic JSON block per unknown entry. - */ - function UnknownBlocks({ blocks, t }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: blocks.map((block, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: t("message.unknownBlock"), - payload: block, - truncatedLabel: (total) => t("json.truncated", { total }) - }, index)) }); - } - /** - * The model-facing content of one context, shared by every form that shows it: - * the text with its real line breaks, then any block this UI version does not - * know, which keeps its own fallback rather than vanishing. - * @param props - Durable content and the locale seat. - * @returns The content blocks as the model received them. - */ - function ModelFacingContent({ content, t }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: contentRuns(content).map((run, index) => "text" in run ? run.text !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { - className: ContextBody_module_css_default.text, - "data-context-text": true, - children: boundedText(run.text, t) - }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: t("message.unknownBlock"), - payload: run.block, - truncatedLabel: (total) => t("json.truncated", { total }) - }, index)) }); - } - /** - * Default presentation: the model-facing text as text, with its real line - * breaks, and the remaining source fields beneath it. This is what every form - * this UI version does not recognize renders as. - * @param props - Durable content, its source, and the locale seat. - * @returns The opaque context body. - */ - function OpaqueBody({ content, source, t }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelFacingContent, { - content, - t - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SourceFields, { - source, - formRendered: false, - t - })] }); - } - /** - * Instruction changes read off the source, or null when the record is not a - * usable instruction list. - * - * The read is all-or-nothing: silently dropping one unreadable entry would show - * a confident, incomplete file list for a log this version cannot fully read. - * Paths are deduplicated in first-seen order, matching how the header label is - * derived from the same array. - */ - function instructionChanges(source) { - const record = asRecord(source); - const list = record === null ? void 0 : record["changes"]; - if (!Array.isArray(list)) return null; - const changes = []; - const seen = /* @__PURE__ */ new Set(); - for (const entry of list) { - const change = asRecord(entry); - if (change === null) return null; - const path = change["path"]; - if (typeof path !== "string" || path === "") return null; - const action = change["action"]; - if (action !== "set" && action !== "replace" && action !== "remove") return null; - const digest = change["digest"]; - if (seen.has(path)) continue; - seen.add(path); - changes.push({ - action, - path, - ...typeof digest === "string" ? { digest } : {} - }); - } - return changes.length === 0 ? null : changes; - } - /** - * Locale key for one reconciled file. The baseline loads a file; a later delta - * distinguishes a newly reconciled path from a rewritten one, which `set` and - * `replace` already separate at the producer. - * @param action - the durable change action. - * @param baseline - whether this context is the startup/resume baseline. - * @returns the key naming what happened to that file. - */ - function instructionAction(action, baseline) { - if (action === "remove") return "message.context.instructions.removed"; - if (baseline) return "message.context.instructions.loaded"; - return action === "set" ? "message.context.instructions.added" : "message.context.instructions.updated"; - } - /** - * `instructions` form: the files this context reconciled, then their text. - * - * The text keeps its `<system-reminder>` framing verbatim — the framing is part - * of what the model read, so hiding it would misreport the request. - * @param props - Durable content, its source, and the locale seat. - * @returns The instructions context body, or the opaque body when the change - * list is unreadable. - */ - function InstructionsBody({ content, source, t }) { - const changes = instructionChanges(source); - if (changes === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { - content, - source, - t - }); - const baseline = asRecord(source)?.["baseline"] === true; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { - className: ContextBody_module_css_default.files, - "data-context-files": true, - children: changes.map((change) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { - className: ContextBody_module_css_default.file, - title: change.digest, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.filePath, - children: change.path - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.fileAction, - children: t(instructionAction(change.action, baseline)) - })] - }, change.path)) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelFacingContent, { - content, - t - })] }); - } - /** - * Catalog entries read off the source, or null when the record is not a usable - * catalog. All-or-nothing for the same reason as the instruction list: this body - * replaces the model-facing text, so a partial list would hide the only complete - * account of what the model read. - */ - function catalogEntries(source) { - const record = asRecord(source); - const list = record === null ? void 0 : record["entries"]; - if (!Array.isArray(list)) return null; - const entries = []; - for (const item of list) { - const entry = asRecord(item); - if (entry === null) return null; - const name = entry["name"]; - const description = entry["description"]; - if (typeof name !== "string" || name === "" || typeof description !== "string") return null; - entries.push({ - name, - description - }); - } - return entries; - } - /** - * `catalog` form: the published entries as a list, read from the source rather - * than re-parsed out of the model-facing prose. - * - * A catalog whose source carries no usable entries falls through to the opaque - * body, so an older or hand-edited log still shows its text. - * @param props - Durable content, its source, and the locale seat. - * @returns The catalog context body, or the opaque body when the entry list is - * unreadable. - */ - function CatalogBody({ content, source, t }) { - const entries = catalogEntries(source); - if (entries === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { - content, - source, - t - }); - const update = asRecord(source)?.["update"] === true; - const shown = entries.slice(0, MAX_ENTRIES); - const rest = unknownBlocks(content); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - update && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: ContextBody_module_css_default.catalogNotice, - "data-context-catalog-update": true, - children: t("message.context.catalog.replaced") - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { - className: ContextBody_module_css_default.entries, - "data-context-entries": true, - children: shown.map((entry, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { - className: ContextBody_module_css_default.entry, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { - className: ContextBody_module_css_default.entryName, - children: entry.name - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.entryDescription, - children: entry.description - })] - }, index)) - }), - shown.length < entries.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: ContextBody_module_css_default.catalogNotice, - "data-context-entries-truncated": true, - children: t("message.context.catalog.more", { count: entries.length - shown.length }) - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnknownBlocks, { - blocks: rest, - t - }) - ] }); - } - /** Snapshot sections read off the source, or null when the record is unusable. */ - function snapshotSections(source) { - const record = asRecord(source); - const list = record === null ? void 0 : record["sections"]; - if (!Array.isArray(list)) return null; - const sections = []; - for (const item of list) { - const section = asRecord(item); - if (section === null) return null; - const name = section["name"]; - const text = section["text"]; - if (typeof name !== "string" || name === "" || typeof text !== "string") return null; - sections.push({ - name, - text - }); - } - return sections.length === 0 ? null : sections; - } - /** - * `snapshot` form: the named contributions this snapshot assembled, in order. - * - * The sections are the same bytes the model read, split at the boundaries the - * producer assembled them on, so a reader sees which subsystem contributed - * which state instead of one undifferentiated wall. - * - * One sentence of the model-facing text is NOT in any section: the producer's - * framing line declaring that this snapshot supersedes earlier ones. Unlike the - * `<system-reminder>` wrapper an instruction context carries — which wraps - * content and cannot be separated from it — that line states the form's own - * semantics, so the body states them as a caption instead of reprinting the - * joined prose beside the sections it was split from. - * @param props - Durable content, its source, and the locale seat. - * @returns The snapshot context body, or the opaque body when unreadable. - */ - function SnapshotBody({ content, source, t }) { - const sections = snapshotSections(source); - /* v8 ignore next -- contextBody reads the sections before choosing this body. */ - if (sections === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { - content, - source, - t - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: ContextBody_module_css_default.catalogNotice, - "data-context-snapshot-supersedes": true, - children: t("message.context.snapshot.supersedes") - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", { - className: ContextBody_module_css_default.sections, - "data-context-sections": true, - children: sections.map((section, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: ContextBody_module_css_default.section, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { - className: ContextBody_module_css_default.sectionName, - children: section.name - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { - className: ContextBody_module_css_default.sectionText, - children: boundedText(section.text, t) - })] - }, index)) - })] }); - } - /** - * `notice` form: what just happened, with the model-facing text beneath it. - * - * The one-line account also rides the collapsed row ({@link contextBody}), so a - * notice is usually readable without expanding at all. - * @param props - Durable content, its source, and the locale seat. - * @returns The notice context body. - */ - function NoticeBody({ content, t }) { - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelFacingContent, { - content, - t - }); - } - /** - * `relay` form: which agent sent this, then what it said. - * - * The sender is an opaque session id; it is shown as a field rather than a - * label, because this client cannot resolve it to a title. - * @param props - Durable content, its source, and the locale seat. - * @returns The relay context body. - */ - function RelayBody({ content, source, t }) { - const sender = relaySender(source); - /* v8 ignore next -- contextBody resolves the sender before choosing this body. */ - if (sender === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { - content, - source, - t - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: ContextBody_module_css_default.relaySender, - "data-context-relay-sender": true, - children: t("message.context.relay.from", { session: sender }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelFacingContent, { - content, - t - })] }); - } - /** The sending agent's session id, or null when the record does not name one. */ - function relaySender(source) { - const sender = asRecord(source)?.["senderSessionId"]; - return typeof sender === "string" && sender !== "" ? sender : null; - } - /** Recalled sessions read off the source, or null when the record is unusable. */ - function recalledSessions(source) { - const record = asRecord(source); - const list = record === null ? void 0 : record["references"]; - if (!Array.isArray(list)) return null; - const sessions = []; - for (const item of list) { - const reference = asRecord(item); - if (reference === null) return null; - const label = reference["label"]; - const retained = reference["retainedMessages"]; - const omitted = reference["omittedMessages"]; - const truncated = reference["truncated"]; - if (typeof label !== "string" || label === "" || typeof retained !== "number" || typeof omitted !== "number" || typeof truncated !== "boolean") return null; - sessions.push({ - label, - retained, - omitted, - truncated - }); - } - return sessions.length === 0 ? null : sessions; - } - /** - * `recall` form: which sessions this material came from and how much of each - * survived the read, then the material itself. - * - * Completeness is the fact a reader needs first: recalled context is bounded on - * the way in, so a card that hid the omitted count would overstate what the - * model received. - * @param props - Durable content, its source, and the locale seat. - * @returns The recall context body, or the opaque body when unreadable. - */ - function RecallBody({ content, source, t }) { - const sessions = recalledSessions(source); - if (sessions === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { - content, - source, - t - }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { - className: ContextBody_module_css_default.recalls, - "data-context-recalls": true, - children: sessions.map((session, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { - className: ContextBody_module_css_default.recall, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.recallLabel, - children: session.label - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.recallCounts, - children: t("message.context.recall.counts", { - retained: session.retained, - omitted: session.omitted - }) - }), - session.truncated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextBody_module_css_default.recallCounts, - children: t("message.context.recall.truncated") - }) - ] - }, index)) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelFacingContent, { - content, - t - })] }); - } - /** The one-line account a `notice` puts on its collapsed row, when it records one. */ - function noticeSummary(source) { - const summary = asRecord(source)?.["summary"]; - return typeof summary === "string" && summary !== "" ? summary : null; - } - /** - * Choose the body for one context node. - * - * Returns the form the body actually rendered as, which is not always the - * declared one: a declared form whose fields are unreadable falls back to - * opaque, and the caller labels the row with what it really shows. - * `summary` is the collapsed row's one-line account, which only a `notice` - * records: its whole point is being readable without expanding. - * @param form - the producer-declared form projected onto the node. - * @param props - durable content, its source, and the locale seat. - * @returns the rendered form (null for opaque), its collapsed summary, and its body. - */ - function contextBody(form, props) { - const opaque = { - rendered: null, - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpaqueBody, { ...props }) - }; - switch (form) { - case "instructions": return instructionChanges(props.source) === null ? opaque : { - rendered: "instructions", - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstructionsBody, { ...props }) - }; - case "catalog": return catalogEntries(props.source) === null ? opaque : { - rendered: "catalog", - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CatalogBody, { ...props }) - }; - case "snapshot": return snapshotSections(props.source) === null ? opaque : { - rendered: "snapshot", - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SnapshotBody, { ...props }) - }; - case "notice": { - const summary = noticeSummary(props.source); - return summary === null ? opaque : { - rendered: "notice", - summary, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoticeBody, { ...props }) - }; - } - case "relay": return relaySender(props.source) === null ? opaque : { - rendered: "relay", - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RelayBody, { ...props }) - }; - case "recall": return recalledSessions(props.source) === null ? opaque : { - rendered: "recall", - summary: null, - body: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecallBody, { ...props }) - }; - case null: return opaque; - /* v8 ignore next 4 -- closed-union backstop; the compiler rejects a new - KnownContextForm here rather than letting it degrade to opaque silently. */ - default: throw new Error(`unreachable context form: ${String(form)}`); - } - } - // src/client/native/tool-update.ts - /** - * Classify a context as the rc.2 tool-update row. - * Mixed or empty content stays on the generic injection presentation. - * @param content - durable context blocks. - * @returns collected names, or null when any block is not a tool change. - */ - function toolUpdateRows(content) { - if (content.length === 0) return null; - const rows = []; - for (const block of content) { - if (block.type !== "tool-addition" && block.type !== "tool-removal") return null; - if (typeof block.toolName !== "string") return null; - rows.push({ - type: block.type, - toolName: block.toolName - }); - } - return { - added: rows.flatMap((row) => row.type === "tool-addition" ? [row.toolName] : []), - removed: rows.flatMap((row) => row.type === "tool-removal" ? [row.toolName] : []), - single: rows.length === 1 ? rows[0] : null - }; - } - // \0dshx-css-module:src/client/native/ContextInjectionRow.module.css.mjs - const css$2 = ".Zj4cZW_root{min-width:0}.Zj4cZW_root[data-open]{padding-bottom:4px}.Zj4cZW_chevron{color:var(--dsw-alias-label-secondary)}.Zj4cZW_sep{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.Zj4cZW_source{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:14px;line-height:24px;overflow:hidden}.Zj4cZW_summary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:14px;line-height:24px;overflow:hidden}.Zj4cZW_body{box-sizing:border-box;background:var(--dsw-alias-markdown-code-block);width:calc(100% - 22px);max-height:141px;color:var(--dsw-alias-label-tertiary);font:400 11px/16px var(--ds-font-family-code);border:none;border-radius:8px;margin:4px 0 0 22px;padding:10px 16px 12px 12px;overflow:auto}.Zj4cZW_toolChanges{white-space:nowrap}"; - const tagId$2 = "dsh-better-chat/ContextInjectionRow.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$2; - tag.textContent = css$2; - document.head.appendChild(tag); - } - var ContextInjectionRow_module_css_default = { - "body": "Zj4cZW_body", - "chevron": "Zj4cZW_chevron", - "root": "Zj4cZW_root", - "sep": "Zj4cZW_sep", - "source": "Zj4cZW_source", - "summary": "Zj4cZW_summary", - "toolChanges": "Zj4cZW_toolChanges" - }; - // src/client/native/ContextInjectionRow.tsx - /** - * Render logged context with the Tool calls disclosure chrome from Figma. - * - * The header names the role the context plays and, beside it, the producer the - * durable source identifies, so a reader can tell an injected skill catalog - * from a workspace instruction file or a recalled session without expanding. - * The expanded body follows the producer-declared form; an absent or unknown - * form renders the opaque body. - * @param props - Durable content, its projected producer role/name and form, and the locale seat. - * @returns A collapsed context row with a bounded, form-specific body. - */ - function ContextInjectionRow({ content, source, provenance, producer, form, t }) { - const [open, setOpen] = (0, react.useState)(false); - const view = provenance ?? producer ?? { - role: "inject", - label: null - }; - const { rendered, summary, body } = contextBody(form, { - content, - source, - t - }); - const tools = toolUpdateRows(content); - const toolSummary = tools === null || tools.single !== null ? null : tools.added.length > 0 && tools.removed.length > 0 ? t("message.toolsChanged", { - added: tools.added.length, - removed: tools.removed.length - }) : tools.added.length > 0 ? t("message.toolsAddedCount", { count: tools.added.length }) : t("message.toolsRemovedCount", { count: tools.removed.length }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, { - className: ContextInjectionRow_module_css_default.root, - icon: view.role === "recall" && tools === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - "data-context-recall-icon": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReferenceIcon, { kind: "session" }) - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBrowseOutlineRegular, { size: 14 }), - chevronClassName: ContextInjectionRow_module_css_default.chevron, - title: tools?.single !== void 0 && tools.single !== null ? t(tools.single.type === "tool-addition" ? "message.toolAdded" : "message.toolRemoved", { name: tools.single.toolName }) : tools !== null ? t("message.toolsUpdated") : t(view.role === "recall" ? "message.contextRecall" : "message.contextInjection"), - collapsedContent: toolSummary !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.sep, - "aria-hidden": true - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.summary, - children: toolSummary - })] }) : tools !== null || view.label === null ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.sep, - "aria-hidden": true - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.source, - "data-context-source": true, - children: view.label - }), - summary !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.sep, - "aria-hidden": true - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: ContextInjectionRow_module_css_default.summary, - "data-context-summary": true, - children: summary - })] }) - ] }), - keepContentWhenOpen: true, - open: open && tools?.single == null, - expandable: tools?.single == null, - expandOnRowClick: true, - onToggle: () => { - setOpen((value) => !value); - }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: ContextInjectionRow_module_css_default.body, - "data-context-injection-body": true, - "data-context-form": rendered ?? void 0, - children: tools === null ? body : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: ContextInjectionRow_module_css_default.toolChanges, - children: [tools.added.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: t("message.toolsAdded", { names: tools.added.join(", ") }) }), tools.removed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: t("message.toolsRemoved", { names: tools.removed.join(", ") }) })] - }) - }) - }); - } - // \0dshx-css-module:src/client/TimelineRail.module.css.mjs - const css$1 = ".yMsdPa_slot{z-index:10;pointer-events:none;height:0;position:sticky;top:0}.yMsdPa_frame{--turn-rail-band:calc(var(--dsh-conversation-viewport-height,100dvh) - var(--dsh-composer-height,152px));--turn-preview-height:100px;top:calc(var(--turn-rail-band) / 2);width:26px;height:min(var(--turn-natural-height), max(0px, calc(var(--turn-rail-band) - 64px)), 420px);cursor:pointer;pointer-events:auto;transition:height .22s cubic-bezier(.2,.8,.2,1);position:absolute;right:6px;transform:translateY(-50%)}.yMsdPa_scroller{overscroll-behavior:contain;scrollbar-width:none;position:absolute;inset:0;overflow-y:auto}.yMsdPa_scroller::-webkit-scrollbar{display:none}.yMsdPa_fadeTop{mask-image:linear-gradient(#0000 0,#000 24px 100%)}.yMsdPa_fadeBottom{mask-image:linear-gradient(#000 0 calc(100% - 24px),#0000 100%)}.yMsdPa_fadeTop.yMsdPa_fadeBottom{mask-image:linear-gradient(#0000 0,#000 24px calc(100% - 24px),#0000 100%)}.yMsdPa_marks{height:var(--turn-natural-height);position:relative}.yMsdPa_markPosition{top:calc(var(--turn-natural-position) + var(--turn-rail-inset));height:12px;transition:top .22s cubic-bezier(.2,.8,.2,1);position:absolute;left:0;right:0;transform:translateY(-50%)}.yMsdPa_mark{cursor:pointer;pointer-events:none;background:0 0;border:0;justify-content:flex-end;align-items:center;width:24px;padding:0;display:flex;position:absolute;inset:0 0 0 auto}.yMsdPa_tick{border-radius:2px;flex:none;transition:width .1s cubic-bezier(.16,1,.3,1),height .1s cubic-bezier(.16,1,.3,1),opacity .1s,background-color .14s}.yMsdPa_markBusy .yMsdPa_tick{animation:1s ease-in-out infinite alternate yMsdPa_markBusyPulse}@keyframes yMsdPa_markBusyPulse{0%{opacity:.4;width:8px}to{opacity:1;width:18px}}.yMsdPa_preview{top:clamp(0px, calc(var(--turn-natural-position) + var(--turn-rail-inset) - var(--turn-scroll-top,0px) - var(--turn-preview-height) / 2), calc(100% - var(--turn-preview-height)));box-sizing:border-box;width:min(280px,100cqw - 120px);max-height:var(--turn-preview-height);border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);pointer-events:none;z-index:40;border-radius:10px;padding:10px 12px;transition:top .14s cubic-bezier(.2,.8,.2,1);animation:.12s ease-out yMsdPa_previewFadeIn;position:absolute;right:calc(100% + 10px);overflow:hidden;box-shadow:0 4px 18px #0000001f}@keyframes yMsdPa_previewFadeIn{0%{opacity:0;transform:translate(4px)}to{opacity:1;transform:translate(0)}}.yMsdPa_previewPrompt{-webkit-line-clamp:2;text-overflow:ellipsis;word-break:break-word;-webkit-box-orient:vertical;font-size:12px;font-weight:500;line-height:18px;display:-webkit-box;overflow:hidden}.yMsdPa_previewResponse{color:var(--dsw-alias-label-tertiary);-webkit-line-clamp:2;text-overflow:ellipsis;word-break:break-word;-webkit-box-orient:vertical;margin-top:4px;font-size:11px;line-height:16px;display:-webkit-box;overflow:hidden}@media (max-width:960px){.yMsdPa_slot{display:none!important}}"; - const tagId$1 = "dsh-better-chat/TimelineRail.module.css"; - if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) { - const tag = document.createElement("style"); - tag.dataset.plugin = "dsh-better-chat"; - tag.dataset.pluginCss = tagId$1; - tag.textContent = css$1; - document.head.appendChild(tag); - } - var TimelineRail_module_css_default = { - "fadeBottom": "yMsdPa_fadeBottom", - "fadeTop": "yMsdPa_fadeTop", - "frame": "yMsdPa_frame", - "mark": "yMsdPa_mark", - "markBusy": "yMsdPa_markBusy", - "markBusyPulse": "yMsdPa_markBusyPulse", - "markPosition": "yMsdPa_markPosition", - "marks": "yMsdPa_marks", - "preview": "yMsdPa_preview", - "previewFadeIn": "yMsdPa_previewFadeIn", - "previewPrompt": "yMsdPa_previewPrompt", - "previewResponse": "yMsdPa_previewResponse", - "scroller": "yMsdPa_scroller", - "slot": "yMsdPa_slot", - "tick": "yMsdPa_tick" - }; - // src/client/TimelineRail.tsx - const TURN_SPACING_PX = 12; - const RAIL_INSET_PX = 6; - const FADE_PX = 24; - function itemPosition(index) { - return { "--turn-natural-position": `${index * TURN_SPACING_PX}px` }; - } - function frameStyle(count, scrollTop) { - return { - "--turn-natural-height": `${(count - 1) * TURN_SPACING_PX + 12}px`, - "--turn-rail-inset": `${RAIL_INSET_PX}px`, - "--turn-scroll-top": `${scrollTop}px` - }; - } - function itemIndexAtPointer(items, frame, scrollTop, clientY) { - const offset = clientY - frame.getBoundingClientRect().top + scrollTop - RAIL_INSET_PX; - return Math.max(0, Math.min(items.length - 1, Math.round(offset / TURN_SPACING_PX))); - } - const RAIL_AT_REST = { - top: 0, - canScrollUp: false, - canScrollDown: false - }; - function railScrollState(scroller) { - const top = scroller.scrollTop; - return { - top, - canScrollUp: top > 1, - canScrollDown: top < scroller.scrollHeight - scroller.clientHeight - 1 - }; - } - const TimelineRail = (0, react.memo)(function TimelineRail({ items, activeTurn, busyTurn, onNavigate }) { - const [hoveredIndex, setHoveredIndex] = (0, react.useState)(null); - const [scrollState, setScrollState] = (0, react.useState)(RAIL_AT_REST); - const scrollerRef = (0, react.useRef)(null); - const pointerInsideRef = (0, react.useRef)(false); - const previewId = (0, react.useId)(); - const syncScrollState = () => { - const scroller = scrollerRef.current; - if (!scroller) return; - const next = railScrollState(scroller); - setScrollState((cur) => cur.top === next.top && cur.canScrollUp === next.canScrollUp && cur.canScrollDown === next.canScrollDown ? cur : next); - }; - (0, react.useEffect)(() => { - const scroller = scrollerRef.current; - if (!scroller || typeof ResizeObserver === "undefined") return; - const observer = new ResizeObserver(syncScrollState); - observer.observe(scroller); - return () => observer.disconnect(); - }, []); - (0, react.useEffect)(syncScrollState, [items.length]); - (0, react.useEffect)(() => { - const scroller = scrollerRef.current; - const index = items.findIndex((item) => item.turn === activeTurn); - if (!scroller || index < 0 || pointerInsideRef.current) return; - const markTop = index * TURN_SPACING_PX + RAIL_INSET_PX; - const viewTop = scroller.scrollTop; - const viewHeight = scroller.clientHeight; - if (viewHeight <= 0 || markTop >= viewTop + FADE_PX && markTop <= viewTop + viewHeight - FADE_PX) return; - const target = Math.max(0, markTop - viewHeight / 2); - if (typeof scroller.scrollTo === "function") scroller.scrollTo({ - top: target, - behavior: "smooth" - }); - else scroller.scrollTop = target; - syncScrollState(); - }, [activeTurn, items]); - if (items.length < 2) return null; - const preview = hoveredIndex !== null && hoveredIndex >= 0 ? items[hoveredIndex] : void 0; - const previewPosition = hoveredIndex !== null && hoveredIndex >= 0 ? itemPosition(hoveredIndex) : void 0; - const onPointerMove = (event) => { - const scrollTop = scrollerRef.current?.scrollTop ?? 0; - const idx = itemIndexAtPointer(items, event.currentTarget, scrollTop, event.clientY); - setHoveredIndex(idx); - }; - const onPointerLeave = () => { - pointerInsideRef.current = false; - setHoveredIndex(null); - }; - const navigateAtPointer = (event) => { - const scrollTop = scrollerRef.current?.scrollTop ?? 0; - const item = items[itemIndexAtPointer(items, event.currentTarget, scrollTop, event.clientY)]; - if (item !== void 0) onNavigate(item); - }; - const fadeClasses = [TimelineRail_module_css_default.scroller]; - if (scrollState.canScrollUp) fadeClasses.push(TimelineRail_module_css_default.fadeTop); - if (scrollState.canScrollDown) fadeClasses.push(TimelineRail_module_css_default.fadeBottom); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TimelineRail_module_css_default.slot, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", { - className: TimelineRail_module_css_default.frame, - style: frameStyle(items.length, scrollState.top), - "aria-label": "轮次导航时间轴", - onClick: navigateAtPointer, - onPointerMove, - onPointerEnter: () => { - pointerInsideRef.current = true; - }, - onPointerLeave, - onMouseDown: (event) => { - event.preventDefault(); - }, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: scrollerRef, - className: fadeClasses.join(" "), - onScroll: syncScrollState, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TimelineRail_module_css_default.marks, - children: items.map((item, index) => { - const isBusy = busyTurn === item.turn; - const isActive = activeTurn === item.turn; - const isUnloaded = item.anchor.kind === "unloaded"; - let width = isUnloaded ? 6 : 8; - let height = 2; - let opacity = isUnloaded ? .3 : .45; - let background = "var(--dsw-alias-label-tertiary)"; - if (hoveredIndex !== null) { - const diff = Math.abs(index - hoveredIndex); - if (diff === 0) { - width = 26; - height = 2.8; - opacity = 1; - background = "var(--dsw-alias-label-primary)"; - } else if (diff === 1) { - width = 18; - height = 2.2; - opacity = .8; - background = "var(--dsw-alias-label-primary)"; - } else if (diff === 2) { - width = 13; - height = 1.8; - opacity = .6; - background = "var(--dsw-alias-label-secondary)"; - } else if (diff === 3) { - width = 9; - height = 1.6; - opacity = .45; - background = "var(--dsw-alias-label-tertiary)"; - } else { - width = 8; - height = 2; - opacity = .35; - background = "var(--dsw-alias-label-tertiary)"; - } - } else if (isActive) { - width = 20; - height = 2.4; - opacity = .95; - background = "var(--dsw-alias-label-primary)"; - } - const tickStyle = { - width: `${width}px`, - height: `${height}px`, - opacity, - backgroundColor: background - }; - const markClasses = [TimelineRail_module_css_default.mark]; - if (isBusy) markClasses.push(TimelineRail_module_css_default.markBusy); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TimelineRail_module_css_default.markPosition, - style: itemPosition(index), - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: markClasses.join(" "), - "aria-label": `第 ${item.turn + 1} 轮`, - "aria-current": isActive ? "true" : void 0, - "aria-busy": isBusy ? "true" : void 0, - "aria-describedby": hoveredIndex === index ? previewId : void 0, - onMouseDown: (event) => { - event.preventDefault(); - }, - onClick: (e) => { - e.stopPropagation(); - onNavigate(item); - }, - onFocus: () => setHoveredIndex(index), - onBlur: () => setHoveredIndex(null), - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: TimelineRail_module_css_default.tick, - style: tickStyle - }) - }) - }, item.turn); - }) - }) - }), preview !== void 0 && previewPosition !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - id: previewId, - role: "tooltip", - className: TimelineRail_module_css_default.preview, - style: previewPosition, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TimelineRail_module_css_default.previewPrompt, - children: preview.prompt || `第 ${preview.turn + 1} 轮` - }), preview.response !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: TimelineRail_module_css_default.previewResponse, - children: preview.response - })] - })] - }) - }); - }); - /** Active column host when present; otherwise the view-local scroller. */ - function scrollerOf(from) { - return from.closest("[data-conversation-scroll]") ?? from; - } - /** Row position in scrollport coordinates (viewport-independent). */ - function flowTop(row, scrollport) { - return row.getBoundingClientRect().top - scrollport.getBoundingClientRect().top; - } - /** - * Place `row` on the conversation scroller only. Never calls scrollIntoView. - * @param row - a rendered `[data-reader-turn]` row. - * @param scrollport - `scrollerOf` of the reader root. - */ - function landTurn(row, scrollport, offsetPx = 24) { - scrollport.scrollTop += flowTop(row, scrollport) - offsetPx; - } - // src/client/timeline.ts - /** - * Merge host turn outline with loaded navigation items and turn deliverables. - * Guarantees strictly ascending turn order and dedupes entries. - */ - function mergeTimelineItems(loaded, outline, turnsWithDeliverables) { - const byTurn = /* @__PURE__ */ new Map(); - if (Array.isArray(outline)) for (const raw of outline) { - if (typeof raw !== "object" || raw === null) continue; - const entry = raw; - if (typeof entry.turn !== "number" || !Number.isSafeInteger(entry.turn) || entry.turn < 0) continue; - if (typeof entry.seq !== "number" || !Number.isSafeInteger(entry.seq) || entry.seq < 0) continue; - byTurn.set(entry.turn, { - turn: entry.turn, - prompt: typeof entry.prompt === "string" ? entry.prompt.trim() : "", - response: typeof entry.response === "string" ? entry.response.trim() : "", - hasDeliverables: turnsWithDeliverables?.has(entry.turn) ?? false, - anchor: { - kind: "unloaded", - seq: entry.seq - } - }); - } - if (Array.isArray(loaded)) for (const item of loaded) { - if (typeof item.turn !== "number") continue; - const preview = byTurn.get(item.turn); - const prompt = item.prompt?.trim() || preview?.prompt || ""; - const response = item.response?.trim() || preview?.response || ""; - const hasDeliverables = turnsWithDeliverables?.has(item.turn) ?? preview?.hasDeliverables ?? false; - byTurn.set(item.turn, { - turn: item.turn, - prompt, - response, - hasDeliverables, - anchor: { - kind: "loaded", - key: item.anchorKey - } - }); - } - if (byTurn.size === 0) return []; - return [...byTurn.values()].sort((a, b) => a.turn - b.turn); - } - // src/client/live-turn.ts - function liveFoldEnabled(boundary) { - return boundary.status === "open"; - } - function foldSummary(steps) { - let reasoning = 0; - let body = 0; - let tool = 0; - let extra = 0; - for (const step of steps) if (step.kind === "reasoning") reasoning += 1; - else if (step.kind === "body") body += 1; - else if (step.kind === "tool") tool += 1; - else if (step.kind !== "user") extra += 1; - const parts = []; - if (reasoning) parts.push(`思考×${reasoning}`); - if (body) parts.push(`输出×${body}`); - if (tool) parts.push(`工具×${tool}`); - if (extra) parts.push(`记录×${extra}`); - return parts.join(" · ") || "此前步骤"; - } - function skipReasoning(part) { - return part.kind === "reasoning" && !part.blocks.some((block) => block.kind === "reasoning" && block.text.trim() !== ""); - } - function skipBody(part) { - return part.kind === "body" && !hasVisibleBody(part.blocks); - } - function stepsFromAssistant(nodeKey, data, toolsByCallId, consumed) { - const marks = []; - for (const part of assistantSegments(data.blocks)) { - if (skipReasoning(part) || skipBody(part)) continue; - marks.push({ - at: part.start, - step: { - kind: part.kind, - key: `${nodeKey}:${part.kind}:${part.start}`, - nodeKey, - start: part.start, - blocks: part.blocks, - step: data.step - } - }); - } - data.blocks.forEach((block, index) => { - if (block.kind !== "tool-call" || !block.callId) return; - const tool = toolsByCallId.get(block.callId); - if (!tool || consumed.has(tool.callId)) return; - consumed.add(tool.callId); - marks.push({ - at: index, - step: { - kind: "tool", - key: tool.key, - entry: tool - } - }); - }); - marks.sort((left, right) => left.at - right.at || left.step.key.localeCompare(right.step.key)); - return marks.map((mark) => mark.step); - } - /** Expand readerFlow into source-ordered live steps using existing block boundaries. */ - function segmentLiveTurn(flow, get) { - const steps = []; - const consumed = /* @__PURE__ */ new Set(); - const toolsByCallId = /* @__PURE__ */ new Map(); - for (const entry of flow) if (entry.kind === "tool") toolsByCallId.set(entry.callId, entry); - for (const entry of flow) { - if (entry.kind === "tool") { - if (!consumed.has(entry.callId)) { - steps.push({ - kind: "tool", - key: entry.key, - entry - }); - consumed.add(entry.callId); - } - continue; - } - const node = get(entry.nodeKey); - if (!node || node.visibility === "hidden" || node.kind === "turn-tail") continue; - if (node.kind === "user" || node.kind === "steering") { - steps.push({ - kind: "user", - key: entry.key, - nodeKey: entry.nodeKey - }); - continue; - } - if (node.kind === "assistant-step") { - steps.push(...stepsFromAssistant(entry.nodeKey, node.data, toolsByCallId, consumed)); - continue; - } - steps.push({ - kind: "other", - key: entry.key, - nodeKey: entry.nodeKey - }); - } - return steps; - } - /** Only a run that contains real thinking/tool work is worth folding. */ - function foldableRun(run) { - return run.some((step) => step.kind === "reasoning" || step.kind === "tool"); - } - /** - * One live chain: narration stays visible, while every earlier reasoning/tool - * run collapses into its own box at its original position. - */ - function presentLiveTurn(steps, boundary, autoFold = true) { - const live = autoFold && liveFoldEnabled(boundary); - const items = []; - const open = (step) => items.push({ - kind: "open", - key: step.key, - step - }); - const fold = (run) => { - if (!run.length) return; - if (live && foldableRun(run)) items.push({ - kind: "fold", - key: `live-fold:${run[0].key}`, - steps: run, - summary: foldSummary(run) - }); - else for (const step of run) open(step); - }; - let run = []; - const flush = () => { - fold(run); - run = []; - }; - const segments = []; - let segment = []; - for (const step of steps) if (step.kind === "user") { - segments.push(segment); - segments.push([step]); - segment = []; - } else segment.push(step); - segments.push(segment); - for (const part of segments) { - if (!part.length) continue; - const first = part[0]; - if (part.length === 1 && first.kind === "user") { - items.push({ - kind: "user", - key: first.key, - step: first - }); - continue; - } - if (!live) { - for (const step of part) open(step); - continue; - } - const lastReasoning = part.findLastIndex((step) => step.kind === "reasoning"); - if (lastReasoning <= 0) { - for (const step of part) open(step); - continue; - } - for (let index = 0; index < part.length; index++) { - const step = part[index]; - if (index < lastReasoning) { - if (step.kind === "body") { - flush(); - open(step); - } else run.push(step); - } else { - if (index === lastReasoning) flush(); - open(step); - } - } - flush(); - } - return items; - } - /** - * Summaries for collapsed process that sits between two narration blocks. - * - * A live-fold cell already shows that summary while the turn is open. Drawing - * the seam as well repeats the same counts, so a run whose every step is - * already inside a fold cell contributes neither a seam nor `after`. `after` - * is what marks the previous body with `data-reader-seam-after` and drops its - * bottom padding; skipping the seam must leave that spacing alone. - */ - function planProcessSeams(steps, liveItems, expanded) { - const before = /* @__PURE__ */ new Map(); - const after = /* @__PURE__ */ new Set(); - if (expanded) return { - before, - after - }; - const liveFolded = new Set(liveItems.flatMap((item) => item.kind === "fold" ? item.steps.map((step) => step.key) : [])); - let previousBody; - let process = []; - for (const step of steps) if (step.kind === "body") { - const folded = process.filter((item) => item.kind !== "user"); - if (!(folded.length > 0 && folded.every((item) => liveFolded.has(item.key))) && previousBody && folded.some((item) => item.kind === "reasoning" || item.kind === "tool" || item.kind === "other")) { - before.set(step.key, foldSummary(folded)); - after.add(previousBody.key); - } - previousBody = step; - process = []; - } else if (step.kind === "user") { - previousBody = void 0; - process = []; - } else process.push(step); - return { - before, - after - }; - } - // src/client/fold-intensity.ts - function frostedGlassOf(state) { - if (state && typeof state === "object" && "frostedGlass" in state) return state.frostedGlass === true; - return state === true; - } - function autoFoldFromIntensity(intensity) { - return intensity !== 0; - } - function processOnlyFromIntensity(intensity) { - return intensity === 2; - } - // src/client/DiffPanel.tsx - /** - * Reveals and withdraws its child by animating real height, in the plugin's own - * motion language. Height is the animated property rather than transform because - * the panel pushes the transcript down and the reading scroll measures that - * growth; the curve and duration are the fold choreography's, so this reads as - * the same gesture as opening a digest. - * - * Closing animates too: the child stays mounted until the shrink finishes, which - * is why the owner keeps it alive on an `open` flag instead of unmounting it. - */ - function MorphPanel({ open, children, onSettled, onClosed }) { - const ref = (0, react.useRef)(null); - (0, react.useLayoutEffect)(() => { - const element = ref.current; - if (!element) return; - element.dispatchEvent(new CustomEvent("reader-layout-start", { bubbles: true })); - let released = false; - const release = () => { - if (!released) { - released = true; - element.dispatchEvent(new CustomEvent("reader-layout-end", { bubbles: true })); - } - }; - if (typeof element.animate !== "function") { - release(); - if (!open) onClosed(); - return; - } - const height = element.scrollHeight; - const frames = open ? [{ - height: "0px", - opacity: 0, - transform: "translateY(-6px)" - }, { - height: `${height}px`, - opacity: 1, - transform: "translateY(0)" - }] : [{ - height: `${height}px`, - opacity: 1 - }, { - height: "0px", - opacity: 0 - }]; - const animation = element.animate(frames, { - duration: FOLD_TIMING.reveal + FOLD_TIMING.settle, - easing: "cubic-bezier(.4,0,.2,1)" - }); - let settled = false; - const settle = () => { - if (settled) return; - settled = true; - release(); - if (open) { - element.style.height = "auto"; - element.style.overflow = "visible"; - onSettled?.(element); - } else onClosed(); - }; - animation.onfinish = settle; - const deadline = window.setTimeout(settle, FOLD_TIMING.reveal + FOLD_TIMING.settle + 240); - return () => { - window.clearTimeout(deadline); - animation.cancel(); - release(); - }; - }, [open]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref, - className: Reader_module_css_default.diffOverlay, - children - }); - } - /** - * Keeps a newly opened panel on screen. - * - * Opening grows the row downward, so a badge near the fold reveals its card below - * the viewport and the reader has to chase it. The scroll container is not known - * here, so the nearest scrollable ancestor is found and the card's head is brought - * to the top of it — the same thing a jump-to-anchor does. - */ - function revealPanel(element) { - let port = element.parentElement; - while (port && port.scrollHeight <= port.clientHeight + 1) port = port.parentElement; - if (!port) { - element.scrollIntoView({ block: "nearest" }); - return; - } - const gap = element.getBoundingClientRect().top - port.getBoundingClientRect().top; - if (gap >= 0 && element.getBoundingClientRect().bottom <= port.getBoundingClientRect().bottom) return; - port.scrollTop += gap - 8; - } - /** - * Line counts for everything a folded run of steps changed. - * - * A run that touched no files renders nothing, so an ordinary process digest is - * unchanged. Clicking the counts opens the same diff surface the official tool - * row uses — one file at a time, red removed / green added, expandable. - */ - function DiffStat({ steps, label }) { - const hunks = (0, react.useMemo)(() => foldDiffHunks(steps), [steps]); - const [open, setOpen] = (0, react.useState)(false); - const [visible, setVisible] = (0, react.useState)(false); - const totals = (0, react.useMemo)(() => (0, _deepseek_ai_dsh_client_ui_primitives.diffTotals)(hunks), [hunks]); - const [active, setActive] = (0, react.useState)(0); - if (!hunks.length) return null; - const current = hunks[Math.min(active, hunks.length - 1)]; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.diffStatRoot, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: Reader_module_css_default.diffStatButton, - "aria-expanded": open, - "aria-label": `${label} · 改动 ${totals.added} 行,删除 ${totals.removed} 行`, - onClick: (event) => { - event.stopPropagation(); - if (open) { - setOpen(false); - return; - } - setVisible(true); - setOpen(true); - }, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.diffCaret, - "aria-hidden": true, - children: open ? "▾" : "▸" - }), - totals.added > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.diffAdded, - children: ["+", totals.added] - }), - totals.removed > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.diffRemoved, - children: ["-", totals.removed] - }) - ] - }) - }), visible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.diffOverlayRow, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MorphPanel, { - open, - onSettled: revealPanel, - onClosed: () => setVisible(false), - children: [hunks.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.diffTabs, - children: hunks.map((hunk, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.diffTab, - "data-active": index === active || void 0, - onClick: () => setActive(index), - title: hunk.path, - children: hunk.path.split(/[/\\]+/).filter(Boolean).slice(-1)[0] ?? hunk.path - }, `${hunk.path}:${index}`)) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.diffScrollArea, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DiffBlock, { - diffs: [current], - maxLines: 36, - labels: diffBlockLabels - }) - })] - }) - })] }); - } - // src/client/StickyLane.tsx - const MIN_LANE_PX = 40; - const LaneOwnerContext = (0, react.createContext)(null); - const ownersByRoot = /* @__PURE__ */ new WeakMap(); - /** One map per Reader, so two roots that both contain turn 1 do not share a writer. */ - function ReaderLaneScope({ children }) { - const owners = (0, react.useRef)(/* @__PURE__ */ new Map()); - (0, react.useLayoutEffect)(() => { - const map = owners.current; - return () => { - map.clear(); - }; - }, []); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LaneOwnerContext.Provider, { - value: owners.current, - children - }); - } - function laneScope(el) { - return el.closest("[data-reader-turn]") ?? el.closest("[data-dsh-better-display]"); - } - function ownersFor(el, scoped) { - if (scoped) return scoped; - const root = el.closest("[data-dsh-better-display]") ?? el; - let owners = ownersByRoot.get(root); - if (!owners) { - owners = /* @__PURE__ */ new Map(); - ownersByRoot.set(root, owners); - } - return owners; - } - function publishedLanePx(el) { - return Math.max(MIN_LANE_PX, Math.ceil(el.getBoundingClientRect().height)); - } - /** One writer per turn inside a single Reader. A retiring summary cannot clear the lane that replaced it. */ - function publishLaneHeight(el, property, scoped = null) { - const scope = laneScope(el); - if (!scope) return () => {}; - const owners = ownersFor(el, scoped); - const root = el.closest("[data-dsh-better-display]"); - const key = `${property}\0${scope.getAttribute("data-reader-turn") ?? "root"}`; - const update = () => { - if (owners.get(key) !== el) return; - scope.style.setProperty(property, `${publishedLanePx(el)}px`); - }; - owners.set(key, el); - update(); - const observer = new ResizeObserver(update); - observer.observe(el); - return () => { - observer.disconnect(); - if (owners.get(key) !== el) return; - owners.delete(key); - scope.style.removeProperty(property); - if (!scoped && root && owners.size === 0) ownersByRoot.delete(root); - }; - } - function usePublishedHeight(property) { - const owners = (0, react.useContext)(LaneOwnerContext); - const ref = (0, react.useRef)(null); - (0, react.useLayoutEffect)(() => { - const el = ref.current; - if (!el) return; - return publishLaneHeight(el, property, owners); - }, [owners, property]); - return ref; - } - function useSummaryLane(ref, active) { - const owners = (0, react.useContext)(LaneOwnerContext); - (0, react.useLayoutEffect)(() => { - const el = ref.current; - if (!active || !el) return; - return publishLaneHeight(el, "--reader-summary-height", owners); - }, [ - active, - owners, - ref - ]); - } - /** Publish real lane geometry; wrapped labels must not collide with statistics. */ - function StickyLane({ kind, className, children }) { - const ref = (0, react.useRef)(null); - (0, react.useLayoutEffect)(() => { - const el = ref.current; - const scope = el?.closest(kind === "toolbar" ? "[data-dsh-better-display]" : "[data-reader-turn]"); - if (!el || !scope) return; - const property = kind === "toolbar" ? "--reader-toolbar-height" : "--reader-status-height"; - const update = () => { - scope.style.setProperty(property, `${Math.max(MIN_LANE_PX, el.getBoundingClientRect().height)}px`); - if (kind !== "toolbar") return; - const controls = el.querySelectorAll("button"); - let width = 80; - if (controls.length > 0) { - const first = controls[0].getBoundingClientRect(); - width = controls[controls.length - 1].getBoundingClientRect().right - first.left; - } - scope.style.setProperty("--reader-control-width", `${width + 28}px`); - }; - update(); - const observer = new ResizeObserver(update); - observer.observe(el); - if (kind === "toolbar") for (const control of el.querySelectorAll("button")) observer.observe(control); - return () => { - observer.disconnect(); - scope.style.removeProperty(property); - if (kind === "toolbar") scope.style.removeProperty("--reader-control-width"); - }; - }, [kind]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref, - className, - "data-reader-lane": kind, - "data-ud-check": kind === "toolbar" ? "reader-toolbar" : void 0, - children - }); - } - // src/client/ChoreographedFlow.tsx - const FlowSnapshot = (0, react.createContext)(null); - /** Public projection only. Descendants cannot leak live data through a frozen frame. */ - const useFlowChat = (selector) => { - const snapshot = (0, react.useContext)(FlowSnapshot); - if (!snapshot) throw new Error("Flow snapshot provider missing"); - return selector(snapshot); - }; - const idle = (frame) => ({ - phase: "idle", - shown: frame, - target: frame, - retiring: [], - beforeKeys: /* @__PURE__ */ new Set() - }); - function Summary({ item, open, onChange, motion }) { - const button = (0, react.useRef)(null); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - "data-reader-live-fold": true, - "data-expanded": open, - "data-reader-live-fold-summary": item.summary, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.summaryRow, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Disclosure, { - open, - onChange, - buttonRef: button, - ariaLabel: "此前步骤", - label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FoldSummaryText, { - summary: item.summary, - motion - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DiffStat, { - steps: item.steps, - label: item.summary - })] - }) - }); - } - /** Manual disclosure shares the measured-size path; children survive until finish. */ - function FlowCell({ hidden, instant, motion, rowKey, children, summary = false }) { - const ref = (0, react.useRef)(null); - useSummaryLane(ref, summary); - const [present, setPresent] = (0, react.useState)(!hidden); - const previous = (0, react.useRef)(hidden); - if (!hidden && !present) setPresent(true); - (0, react.useLayoutEffect)(() => { - const el = ref.current; - const changed = previous.current !== hidden; - previous.current = hidden; - if (!el) return; - if (!changed || instant || !motion) { - setPresent(!hidden); - return; - } - const height = el.scrollHeight; - const animation = el.animate([{ - height: `${hidden ? height : 0}px`, - opacity: hidden ? 1 : 0 - }, { - height: `${hidden ? 0 : height}px`, - opacity: hidden ? 0 : 1 - }], { - duration: 220, - easing: "cubic-bezier(.4,0,.2,1)", - fill: "both" - }); - el.dispatchEvent(new CustomEvent("reader-layout-start", { bubbles: true })); - let released = false; - const release = () => { - if (!released) { - released = true; - el.dispatchEvent(new CustomEvent("reader-layout-end", { bubbles: true })); - } - }; - let settled = false; - const settle = () => { - if (settled) return; - settled = true; - if (!hidden) animation.cancel(); - setPresent(!hidden); - release(); - }; - animation.onfinish = settle; - const deadline = window.setTimeout(settle, 460); - return () => { - window.clearTimeout(deadline); - animation.cancel(); - release(); - }; - }, [ - hidden, - instant, - motion, - present - ]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref, - className: Reader_module_css_default.flowCell, - "data-flow-key": rowKey, - "data-flow-summary": summary || void 0, - hidden: hidden && !present, - "aria-hidden": hidden || void 0, - ...hidden ? { inert: "" } : {}, - children: present && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.flowCellInner, - children - }) - }); - } - function ChoreographedFlow({ frame, motion, enabled, urgent, open, onOpenChange, processOpen, renderStep, id }) { - const root = (0, react.useRef)(null); - const stream = (0, react.useContext)(StreamMotionContext); - const latest = (0, react.useRef)(frame); - latest.current = frame; - const [visible, setVisible] = (0, react.useState)(() => !document.hidden); - const [state, setState] = (0, react.useState)(() => idle(frame)); - if ((!motion || !enabled || urgent || !visible || !processOpen || state.phase !== "idle" && Object.values(open).some(Boolean) || containsNewUser(state.shown.items, frame.items)) && (state.phase !== "idle" || state.shown !== frame)) setState(idle(frame)); - else if (state.phase === "idle" && state.shown !== frame) { - const retiring = retiringKeys(state.shown.items, frame.items, open); - setState(retiring.length ? { - ...state, - phase: "collapse", - target: frame, - retiring, - beforeKeys: new Set(flowRows(state.shown.items).map((row) => row.key)) - } : idle(frame)); - } - (0, react.useEffect)(() => { - const update = () => setVisible(!document.hidden); - document.addEventListener("visibilitychange", update); - return () => document.removeEventListener("visibilitychange", update); - }, []); - (0, react.useLayoutEffect)(() => { - if (state.phase !== "collapse") return; - const el = root.current; - if (!el) return; - const retiring = new Set(state.retiring); - const animations = []; - el.dispatchEvent(new CustomEvent("reader-layout-start", { bubbles: true })); - for (const cell of el.querySelectorAll(":scope > [data-flow-key]")) { - const key = cell.dataset.flowKey; - const isHeader = cell.dataset.flowSummary && !state.beforeKeys.has(key); - if (!retiring.has(key) && !isHeader) continue; - const height = cell.getBoundingClientRect().height; - animations.push(cell.animate(isHeader ? [{ - height: "0px", - opacity: 0 - }, { - height: `${height}px`, - opacity: 1 - }] : [ - { - height: `${height}px`, - opacity: 1 - }, - { - height: `${height * .5}px`, - opacity: .85, - offset: .5 - }, - { - height: "0px", - opacity: 0 - } - ], { - duration: FOLD_TIMING.collapse, - easing: "cubic-bezier(.4,0,.2,1)", - fill: "both" - })); - } - let cancelled = false; - let advanced = false; - const advance = () => { - if (cancelled || advanced) return; - advanced = true; - setState((current) => current.phase === "collapse" ? { - ...current, - phase: "count", - target: latest.current - } : current); - }; - const deadline = window.setTimeout(advance, FOLD_TIMING.collapse + FOLD_TIMING.watchdogSlack); - Promise.all(animations.map((animation) => animation.finished)).then(advance, advance); - return () => { - cancelled = true; - window.clearTimeout(deadline); - animations.forEach((animation) => animation.cancel()); - el.dispatchEvent(new CustomEvent("reader-layout-end", { bubbles: true })); - }; - }, [state.phase]); - (0, react.useEffect)(() => { - if (state.phase !== "count" && state.phase !== "settle" && state.phase !== "reveal") return; - const phase = state.phase; - let done = false; - const finish = () => { - if (done) return; - done = true; - setState((current) => { - if (current.phase !== phase) return current; - if (phase === "count") return { - ...current, - phase: "settle" - }; - if (phase === "settle") return { - ...current, - phase: "reveal" - }; - return idle(current.target); - }); - }; - let elapsed = 0; - let previous; - let raf = 0; - const tick = (now) => { - if (previous !== void 0) elapsed += Math.min(40, now - previous); - previous = now; - if (elapsed < FOLD_TIMING[phase]) { - raf = requestAnimationFrame(tick); - return; - } - finish(); - }; - raf = requestAnimationFrame(tick); - const deadline = window.setTimeout(finish, FOLD_TIMING[phase] + FOLD_TIMING.watchdogSlack); - return () => { - window.clearTimeout(deadline); - cancelAnimationFrame(raf); - }; - }, [state.phase]); - (0, react.useLayoutEffect)(() => { - if (state.phase !== "reveal" || !root.current) return; - const el = root.current; - el.dispatchEvent(new CustomEvent("reader-layout-start", { bubbles: true })); - const animations = Array.from(el.children).filter((child) => !child.hidden && !state.beforeKeys.has(child.dataset.flowKey)).map((child) => child.animate([{ - height: "0px", - opacity: 0 - }, { - height: `${child.getBoundingClientRect().height}px`, - opacity: 1 - }], { - duration: FOLD_TIMING.reveal, - easing: "cubic-bezier(.4,0,.2,1)", - fill: "both" - })); - return () => { - animations.forEach((animation) => animation.cancel()); - el.dispatchEvent(new CustomEvent("reader-layout-end", { bubbles: true })); - }; - }, [state.phase]); - const blocked = state.phase === "collapse" || state.phase === "count" || state.phase === "settle"; - const source = state.phase === "idle" || state.phase === "collapse" ? state.shown : state.target; - const rows = state.phase === "collapse" ? collapseRows(state.shown.items, state.target.items) : flowRows(source.items); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FlowSnapshot.Provider, { - value: source.snapshot, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamMotionContext.Provider, { - value: { - ...stream, - paused: state.phase !== "idle", - resumed: state.phase === "reveal" - }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - id, - ref: root, - className: Reader_module_css_default.choreographedFlow, - "data-reader-flow": true, - "data-reader-transition": state.phase, - "data-ud-motion": "fold-choreography", - children: rows.map((row) => { - if (row.kind === "summary") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FlowCell, { - rowKey: row.key, - hidden: false, - instant: true, - motion, - summary: true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Summary, { - item: row.item, - open: processOpen && !!open[row.key], - onChange: (value) => onOpenChange(row.key, value), - motion: motion && state.phase !== "collapse" - }) - }, row.key); - const hidden = !!row.foldKey && (!processOpen || !open[row.foldKey]) || blocked && state.phase !== "collapse" && !state.beforeKeys.has(row.key); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FlowCell, { - rowKey: row.key, - hidden, - instant: state.phase !== "idle", - motion, - children: renderStep(row.step, !!row.foldKey) - }, row.key); - }) - }) - }) - }); - } - // src/client/ClosedProcessSummary.tsx - /** Keep process counts discoverable after the live-fold presentation retires. */ - function ClosedProcessSummary({ steps, open, onChange, controls }) { - const button = (0, react.useRef)(null); - const lane = usePublishedHeight("--reader-summary-height"); - if (!steps.length) return null; - const summary = foldSummary(steps); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - ref: lane, - className: Reader_module_css_default.closedProcessSummary, - "data-reader-closed-summary": summary, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.summaryRow, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Disclosure, { - open, - onChange, - controls, - buttonRef: button, - ariaLabel: "本轮过程详情", - label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FoldSummaryText, { - summary, - motion: false - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DiffStat, { - steps, - label: summary - })] - }) - }); - } - // src/client/Reader.tsx - function isNode(node, kind) { - return node.kind === kind; - } - function observedInputIds(order, getNode) { - const ids = /* @__PURE__ */ new Set(); - for (const key of order) { - const node = getNode(key); - if (!node || node.kind !== "user" && node.kind !== "steering" && node.kind !== "turn-trigger") continue; - const source = node.data.source; - if (source?.kind === "user" && typeof source.rpcId === "string") ids.add(source.rpcId); - } - return ids; - } - function inboxText(item) { - return (item.content ?? []).filter((block) => { - return typeof block === "object" && block !== null && block.type === "text" && typeof block.text === "string"; - }).map((block) => block.text).join(""); - } - function inboxAttachmentCount(item) { - return (item.content ?? []).filter((block) => typeof block === "object" && block !== null && block.type !== "text").length; - } - function cleanErrorMessage(raw) { - if (!raw) return "模型服务暂时无响应或连接中断,请稍后重试。"; - let str = raw.trim(); - if (str.includes("\"error\"") || str.startsWith("{")) try { - const idx = str.indexOf("{"); - const parsed = JSON.parse(str.slice(idx)); - const msg = parsed?.error?.message || parsed?.message || parsed?.error; - if (typeof msg === "string") str = msg; - } catch {} - return str; - } - const CompactionDivider = (0, react.memo)(function CompactionDivider({ data }) { - const [open, setOpen] = (0, react.useState)(false); - if (!data) return null; - const hasSummary = typeof data.summary === "string" && data.summary.trim().length > 0; - const items = data.shadowedItemCount; - const tokens = data.shadowedTokenCount; - let label = "已压缩历史上下文"; - if (items && tokens) label = `已压缩 ${items} 条上下文 · 释放约 ${tokens >= 1e3 ? `${(tokens / 1e3).toFixed(1)}k` : String(tokens)} tokens`; - else if (items) label = `已压缩 ${items} 条上下文`; - else if (tokens) label = `已压缩上下文 · 释放约 ${tokens >= 1e3 ? `${(tokens / 1e3).toFixed(1)}k` : String(tokens)} tokens`; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.compactionRow, - "data-reader-compaction": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.compactionLine, - children: hasSummary ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: `${Reader_module_css_default.compactionPill} ${Reader_module_css_default.compactionButton}`, - onClick: () => setOpen((v) => !v), - "aria-expanded": open, - title: open ? "收起历史记忆摘要" : "展开查看此节点提炼的记忆摘要", - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.compactionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 5v3.2l2 1.8", - strokeWidth: "1.2", - strokeLinecap: "round", - strokeLinejoin: "round" - })] - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.compactionToggle, - children: open ? "收起备忘" : "查看备忘" - }) - ] - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.compactionPill, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.compactionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 5v3.2l2 1.8", - strokeWidth: "1.2", - strokeLinecap: "round", - strokeLinejoin: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label })] - }) - }), open && hasSummary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.compactionSummaryBox, - "data-reader-anchor": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.compactionSummaryHeader, - children: "前期对话要点备忘" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, { - text: data.summary, - labels: markdownLabels - })] - })] - }); - }); - const ProcessNode = (0, react.memo)(function ProcessNode({ useChat, t, nodeKey, open, motion, onRead, returnFocusTo }) { - const node = useChat((snapshot) => snapshot.nodes.get(nodeKey)); - if (!node || node.visibility === "hidden") return null; - let content = null; - if (isNode(node, "context")) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextInjectionRow, { - ...node.data, - t - }); - else if (isNode(node, "system-prompt")) content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { - className: Reader_module_css_default.detail, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: "系统提示词" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { - className: Reader_module_css_default.systemPrompt, - children: node.data.text - })] - }); - else if (isNode(node, "model-retry")) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: "模型重试记录", - payload: node.data.attempts, - truncatedLabel: truncatedJsonLabel - }); - else if (isNode(node, "manual-compaction")) { - if (node.data.command.outcome?.kind === "error") content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.error, - role: "alert", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.errorIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "8", - cy: "8", - r: "6.5", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 5v3.5M8 11.2h.01", - strokeWidth: "1.5", - strokeLinecap: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.errorCopy, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.errorTitle, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "上下文压缩未成功" }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.errorMessage, - children: node.data.command.outcome.text - })] - })] - }); - else content = node.data.compaction ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactionDivider, { data: node.data.compaction }) : null; - } else if (isNode(node, "compaction")) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactionDivider, { data: node.data }); - else if (isNode(node, "command")) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: "命令记录", - payload: node.data, - truncatedLabel: truncatedJsonLabel - }); - return content && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProcessFragment, { - open, - motion, - onRead, - returnFocusTo, - nodeKey, - framed: true, - children: content - }); - }); - const MainNode = (0, react.memo)(function MainNode({ useChat, nodeKey, boundary, pinned, processOpen: _processOpen = false, ...render }) { - const node = useChat((snapshot) => snapshot.nodes.get(nodeKey)); - const [disclosureReset] = (0, react.useState)(() => (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(0)); - if (!node || node.visibility === "hidden") return null; - if (isNode(node, "user") || isNode(node, "steering")) { - const blocks = contentBlocks(node.data.content); - const imageBlocks = blocks.filter((b) => b.kind === "image"); - const otherBlocks = blocks.filter((b) => b.kind !== "image"); - const text = otherBlocks.filter((block) => block.kind === "text").map((block) => block.text).join("\n\n"); - const time = node.data.time; - const fallback = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ - node.kind === "steering" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.meta, - children: "补充消息" - }), - imageBlocks.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.userImages, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks: imageBlocks, - source: "user" - }) - }), - otherBlocks.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.user, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Blocks, { - ...render, - blocks: otherBlocks, - source: "user" - }) - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UserMessageActions, { - text, - time - }) - ] }); - const official = render.official; - let rendered = fallback; - if (official) { - const turn = node.location.kind === "turn" || node.location.kind === "step" ? node.location.turn : void 0; - const owner = { - cwd: render.cwd, - openFile: render.openFile ?? (() => {}), - forkAt: render.forkAt ?? (() => {}), - inspectCall: (callId) => official.openView("trajectory", callId), - loadImage: official.officialImageLoader, - fileMentions: official.officialFileMentions, - sessionId: render.sessionId - }; - const options = { - hookContext: { - turnData: turn?.data, - disclosureReset, - useGroupAction: readerGroupAction - }, - fallback - }; - rendered = node.kind === "user" ? official.renderSlot(OFFICIAL_SEATS.nodes, { - ...owner, - node - }, { - ...options, - entryKey: "user" - }) : official.renderSlot(OFFICIAL_SEATS.nodes, { - ...owner, - node - }, { - ...options, - entryKey: "steering" - }); - } - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.userCluster, - "data-reader-anchor": true, - "data-reader-key": nodeKey, - ...chatSeatProps(node.kind, nodeKey), - children: rendered - }); - } - if (isNode(node, "assistant-step")) return null; - if (isNode(node, "tool-call")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolMedia, { - ...render, - block: node.data.root - }); - if (isNode(node, "turn-error")) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.error, - role: "alert", - "data-reader-anchor": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.errorIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "8", - cy: "8", - r: "6.5", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 5v3.5M8 11.2h.01", - strokeWidth: "1.5", - strokeLinecap: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.errorCopy, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.errorTitle, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "本轮运行失败" }), node.data.code && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { - className: Reader_module_css_default.errorCode, - children: node.data.code - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.errorMessage, - children: cleanErrorMessage(node.data.message) - })] - })] - }); - if (isNode(node, "turn-max-tokens")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.notice, - children: "已到达输出长度限制,回答尚未完整。" - }); - if (isNode(node, "model-retry")) return node.data.current.retryState === "scheduled" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.notice, - role: "status", - children: "模型请求未成功,正在等待重试。详情保留在执行过程中。" - }) : null; - if (isNode(node, "command") && render.official) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialNode, { - ...render, - node, - fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: "命令记录", - payload: node.data, - truncatedLabel: truncatedJsonLabel - }) - }); - if (isNode(node, "command")) { - if (node.data.outcome?.kind === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.error, - role: "alert", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.errorIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", { - cx: "8", - cy: "8", - r: "6.5", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M8 5v3.5M8 11.2h.01", - strokeWidth: "1.5", - strokeLinecap: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.errorCopy, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.errorTitle, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "命令执行未成功" }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.errorMessage, - children: node.data.outcome.text ?? node.data.name ?? "查看原对话中的命令记录" - })] - })] - }); - return node.data.outcome?.text ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, { - text: node.data.outcome.text, - labels: markdownLabels - }) : null; - } - if (isNode(node, "manual-compaction") || isNode(node, "compaction")) return null; - if (node.kind === "context" || node.kind === "turn-tail" || node.kind === "system-prompt" || node.kind === "turn-process") return null; - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialNode, { - ...render, - node, - fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.unknown, - "data-reader-anchor": true, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: ["此记录类型暂未接入阅读页:", node.kind] }), - render.official && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.textButton, - onClick: () => render.official.openView("chat", node.key), - children: "在对话中查看" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.JsonBlock, { - label: "查看原始记录", - payload: node.data, - truncatedLabel: truncatedJsonLabel - }) - ] - }) - }); - }); - /** - * Sub-agents this turn dispatched, read from the host's own Turn-process row. - * - * The host already derives this from the dispatch tree (`subagentCount` on - * `TurnProcessChatData`), so counting calls here would only risk disagreeing with - * it. The row is otherwise hidden by the reader, which is why this is the one place - * its counters are read. - */ - function subagentCount(snapshot, keys) { - for (const key of keys) { - const node = snapshot.nodes.get(key); - if (!node || node.kind !== "turn-process") continue; - const value = node.data.subagentCount; - if (typeof value === "number" && Number.isFinite(value) && value > 0) return value; - } - return 0; - } - function GroupStatus({ group, useChat, pending, motion }) { - const text = useChat((snapshot) => { - const turn = group.turn === null ? void 0 : snapshot.timeline.turns.get(group.turn); - if (turn?.status === "closed") { - if (turn.end?.data.reason.kind !== "completed") return "执行过程"; - const elapsed = turn.start && turn.end ? Math.max(0, Math.round((turn.end.time - turn.start.time) / 1e3)) : null; - return elapsed === null ? "执行过程" : elapsed < 60 ? `用时 ${elapsed} 秒` : `用时 ${Math.floor(elapsed / 60)} 分 ${elapsed % 60} 秒`; - } - if (turn?.status !== "open") return "执行过程"; - if (pending !== void 0) return "等待你的操作"; - const current = turn.steps.at(-1)?.data.get("assistant-step"); - const last = current?.blocks.at(-1); - if (current?.status === "running" && last?.kind === "tool-call") { - const spawned = subagentCount(snapshot, group.keys); - return spawned ? `${preparingLabel(last.name)}·${spawned} 个子代理` : preparingLabel(last.name); - } - for (let index = group.keys.length - 1; index >= 0; index--) { - const node = snapshot.nodes.get(group.keys[index]); - if (!node) continue; - if (isNode(node, "tool-call") && !("kind" in node.data.root)) return "正在使用工具"; - if (isNode(node, "assistant-step") && node.data.status === "running") { - const last = node.data.blocks.at(-1); - return last?.kind === "reasoning" ? "正在思考" : last?.kind === "text" ? "正在输出" : "正在准备回复"; - } - } - return "正在处理"; - }); - const busy = useChat((snapshot) => group.turn !== null && snapshot.timeline.turns.get(group.turn)?.status === "open" && pending === void 0); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusText, { - text, - motion, - shimmer: busy - }); - } - const DeliverableChip = (0, react.memo)(function DeliverableChip({ path, openFile, revealFile, openMode }) { - const [status, setStatus] = (0, react.useState)("idle"); - const timer = (0, react.useRef)(); - const flash = (next) => { - setStatus(next); - clearTimeout(timer.current); - timer.current = setTimeout(() => setStatus("idle"), 1600); - }; - const onOpen = (event) => { - event.stopPropagation(); - try { - openFile?.(path); - flash("opened"); - } catch {} - }; - const onReveal = (event) => { - event.stopPropagation(); - try { - if (revealFile) revealFile(path); - else openFile?.(dirname(path)); - flash("revealed"); - } catch {} - }; - const onCopy = (event) => { - event.stopPropagation(); - try { - navigator.clipboard?.writeText(path); - flash("copied"); - } catch {} - }; - const name = basename(path); - const folder = dirname(path); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.deliverableChip, - "data-status": status, - title: path, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: Reader_module_css_default.chipMain, - onClick: onOpen, - onDoubleClick: onOpen, - "aria-label": openMode === "sidebar" ? `在内置面板中打开 ${path}` : `用系统应用打开 ${path}`, - children: [status === "opened" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.statusIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3.5 8.5l3 3 6-7", - strokeWidth: "1.8", - strokeLinecap: "round", - strokeLinejoin: "round" - }) - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.deliverableIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M4 2.5h5l3 3V13.5H4V2.5z", - strokeWidth: "1.2", - strokeLinejoin: "round" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M9 2.5v3h3", - strokeWidth: "1.2", - strokeLinejoin: "round" - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.deliverableName, - children: status === "opened" ? openMode === "sidebar" ? "已在面板打开" : "已在外部打开" : name - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.chipActions, - "aria-label": "文件操作", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.chipActionBtn, - title: `在访达中定位所在目录 (${folder})`, - "aria-label": "在访达中显示所在目录", - onClick: onReveal, - children: status === "revealed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.actionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3.5 8.5l3 3 6-7", - strokeWidth: "1.8", - strokeLinecap: "round", - strokeLinejoin: "round" - }) - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.actionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M2 4.5h4l1.5 2H14v6.5H2V4.5z", - strokeWidth: "1.2", - strokeLinejoin: "round" - }) - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.chipActionBtn, - title: "复制相对路径", - "aria-label": "复制相对路径", - onClick: onCopy, - children: status === "copied" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.actionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3.5 8.5l3 3 6-7", - strokeWidth: "1.8", - strokeLinecap: "round", - strokeLinejoin: "round" - }) - }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", { - className: Reader_module_css_default.actionIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", { - x: "5.5", - y: "5.5", - width: "8", - height: "8", - rx: "1.5", - strokeWidth: "1.2" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M4 10.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v1", - strokeWidth: "1.2", - strokeLinecap: "round" - })] - }) - })] - })] - }); - }); - function DeliverablesRow({ deliverables, openFile, revealFile, openMode }) { - const [folderStatus, setFolderStatus] = (0, react.useState)("idle"); - const onOpenWorkspace = () => { - try { - openFile?.("."); - setFolderStatus("opened"); - setTimeout(() => setFolderStatus("idle"), 1600); - } catch {} - }; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.deliverablesRoot, - "data-reader-deliverables": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { - className: Reader_module_css_default.deliverablesLabel, - children: "产物" - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.deliverablesLane, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.deliverablesRow, - children: [ - deliverables.slice(0, 8).map((path) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeliverableChip, { - path, - openFile, - revealFile, - openMode - }, path)), - deliverables.length > 8 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { - className: Reader_module_css_default.deliverablesMore, - children: [ - "+ ", - deliverables.length - 8, - " 个文件" - ] - }), - deliverables.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", { - type: "button", - className: Reader_module_css_default.deliverablesShowFolder, - "data-status": folderStatus, - onClick: onOpenWorkspace, - title: "在访达中打开整个工作区目录", - children: [folderStatus === "opened" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - className: Reader_module_css_default.statusIcon, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3.5 8.5l3 3 6-7", - strokeWidth: "1.8", - strokeLinecap: "round", - strokeLinejoin: "round" - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: folderStatus === "opened" ? "已打开访达" : "在文件夹中显示" })] - }) - ] - }) - })] - }); - } - const TurnGroup = (0, react.memo)(function TurnGroup({ group, motion, autoFold, pinnedKeys, selectedProcessKeys, isAwaitingModel = false, ...props }) { - const snapshot = props.useChat((snapshot) => snapshot); - const nodes = snapshot.nodes; - const turn = group.turn === null ? void 0 : snapshot.timeline.turns.get(group.turn); - const interaction = props.useSessionStatus((snapshot) => snapshot.get(props.sessionId)?.pendingInteraction); - const sessionRunning = props.useSession((snapshot) => snapshot.running); - const boundary = (0, react.useMemo)(() => boundaryOf(turn), [turn]); - const choiceKey = processChoiceKey(group.key, boundary); - const expansionChoice = props.useStore((state) => state.expanded[choiceKey]); - const flowId = (0, react.useId)(); - const processButton = (0, react.useRef)(null); - const setExpanded = (0, react.useCallback)((value) => props.actions.setExpanded(choiceKey, value), [props.actions, choiceKey]); - const pinProcess = (0, react.useCallback)(() => setExpanded(true), [setExpanded]); - const startsWithUser = props.useChat((snapshot) => snapshot.nodes.get(group.keys[0])?.kind) === "user"; - const mainKeys = startsWithUser ? group.keys.slice(1) : group.keys; - const flow = (0, react.useMemo)(() => readerFlow({ - ...group, - keys: mainKeys - }, turn, (key) => nodes.get(key), snapshot.order), [ - nodes, - group, - mainKeys, - turn, - snapshot.order - ]); - const steps = (0, react.useMemo)(() => segmentLiveTurn(flow, (key) => nodes.get(key)), [flow, nodes]); - const liveItems = (0, react.useMemo)(() => presentLiveTurn(steps, boundary, autoFold), [ - steps, - boundary, - autoFold - ]); - const openMode = deliverableOpenModeOf((0, react.useSyncExternalStore)(props.openPrefs?.subscribe ?? ((fn) => { - return () => {}; - }), () => props.openPrefs?.getSnapshot()?.deliverableOpenMode, () => "external")); - const hasProcess = flow.some((item) => item.kind === "tool" || hasProcessContent(nodes.get(item.nodeKey), boundary)); - const showStatusLane = hasProcess && !isAwaitingModel; - const showClosedSummary = boundary.status === "closed" && hasProcess && autoFold; - const holdingSelection = selectedProcessKeys.some((key) => flow.some((item) => item.key === key) || liveItems.some((item) => item.kind === "fold" ? item.key === key || item.steps.some((step) => step.key === key || "nodeKey" in step && step.nodeKey === key) : item.key === key || "nodeKey" in item.step && item.step.nodeKey === key)); - const expanded = !autoFold || holdingSelection || processExpanded(expansionChoice, boundary); - const seamPlan = (0, react.useMemo)(() => planProcessSeams(steps, liveItems, expanded), [ - steps, - liveItems, - expanded - ]); - const [foldOpenByKey, setFoldOpenByKey] = (0, react.useState)({}); - (0, react.useLayoutEffect)(() => { - if (autoFold) setFoldOpenByKey((current) => Object.keys(current).length ? {} : current); - }, [autoFold]); - const deliverables = (0, react.useMemo)(() => getTurnDeliverables(turn, flow), [turn, flow]); - const tailData = (0, react.useMemo)(() => { - for (const key of group.keys) { - const n = nodes.get(key); - if (n && isNode(n, "turn-tail")) return n.data; - } - }, [group.keys, nodes]); - const tailOwner = (0, react.useMemo)(() => turn && tailData ? { - turn, - seq: tailData.closing?.finalNode.seq ?? tailData.seq, - openFile: props.openFile - } : void 0, [ - turn, - tailData, - props.openFile - ]); - const fileMentions = (0, react.useMemo)(() => { - const official = tailOwner ? props.officialFileMentions(tailOwner) : void 0; - const reader = deliverables.length > 0 ? createProducedFileMentions(deliverables, props.openFile) : void 0; - return official || reader ? { resolve: (value) => official?.resolve(value) ?? reader?.resolve(value) } : void 0; - }, [ - tailOwner, - props.officialFileMentions, - deliverables, - props.openFile - ]); - const official = (0, react.useMemo)(() => ({ - renderSlot: props.renderSlot, - renderSlotChain: props.renderSlotChain, - officialImageLoader: props.officialImageLoader, - officialFileMentions: props.officialFileMentions, - officialPreviewFile: props.officialPreviewFile, - officialHost: props.officialHost, - openView: props.openView - }), [ - props.renderSlot, - props.renderSlotChain, - props.officialImageLoader, - props.officialFileMentions, - props.officialPreviewFile, - props.officialHost, - props.openView - ]); - const cwd = props.useSessions((state) => state.byId[props.sessionId]?.cwd); - const runMs = turn?.start && turn?.end ? Math.max(0, turn.end.time - turn.start.time) : void 0; - const metrics = (0, react.useMemo)(() => ({ - usage: tailData?.tokenUsage, - runMs, - tokensPerSecond: tailData?.tokensPerSecond, - ttftMs: tailData?.ttftMs, - endedAt: tailData?.closing?.time ?? turn?.end?.time - }), [ - tailData, - runMs, - turn?.end?.time - ]); - const forkSeq = forkAnchorSeq([tailData?.closing?.finalNode]); - const presentation = (0, react.useMemo)(() => { - const captured = new Map(group.keys.flatMap((key) => { - const node = nodes.get(key); - return node ? [[key, node]] : []; - })); - return { - items: holdingSelection ? presentLiveTurn(steps, boundary, false) : liveItems, - snapshot: { - ...snapshot, - nodes: { - ...nodes, - get: (key) => captured.get(key), - values: () => [...captured.values()] - } - } - }; - }, [ - snapshot, - nodes, - group, - steps, - boundary, - liveItems, - holdingSelection - ]); - const shared = { - useChat: useFlowChat, - renderSlotChain: props.renderSlotChain, - loadImage: props.loadImage, - fillComposer: props.fillComposer, - openFile: props.openFile, - revealFile: props.revealFile, - forkAt: props.forkAt, - forkSeq, - fileMentions, - metrics, - official, - sessionId: props.sessionId, - cwd - }; - const terminal = terminalLabel(boundary.reason); - const hasTurnError = flow.some((item) => item.kind === "node" && nodes.get(item.nodeKey)?.kind === "turn-error"); - const hasAnswerProse = steps.some((step) => step.kind === "body" && step.blocks.some((block) => block.kind === "text" && block.text.trim() !== "")); - const stoppedWithoutAnswer = (boundary.reason === "interrupted" || boundary.reason === "aborted") && !hasAnswerProse; - const showTerminalNotice = terminal && !hasTurnError && (stoppedWithoutAnswer || boundary.reason !== "interrupted" && boundary.reason !== "aborted"); - const renderStep = (step, folded) => { - const processOpen = folded || expanded; - if (step.kind === "reasoning" || step.kind === "body") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssistantNode, { - ...shared, - boundary, - nodeKey: step.nodeKey, - partStart: step.start, - pinned: pinnedKeys.includes(step.nodeKey), - processOpen, - folded, - motion, - onRead: pinProcess, - returnFocusTo: processButton, - seamSummary: step.kind === "body" ? seamPlan.before.get(step.key) : void 0, - seamAfter: step.kind === "body" && seamPlan.after.has(step.key) - }) }); - if (step.kind === "tool") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ProcessFragment, { - open: processOpen, - motion, - onRead: pinProcess, - returnFocusTo: processButton, - nodeKey: step.key, - framed: true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolActivity, { - ...shared, - entry: step.entry, - motion, - turnClosed: boundary.status === "closed", - onRead: pinProcess - }), step.entry.block && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolMedia, { - ...shared, - block: step.entry.block - })] - }) }); - if (step.kind === "user") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainNode, { - ...shared, - boundary, - nodeKey: step.nodeKey - }) }); - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProcessNode, { - useChat: useFlowChat, - t: props.t, - nodeKey: step.nodeKey, - open: processOpen, - motion, - onRead: pinProcess, - returnFocusTo: processButton - }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainNode, { - ...shared, - boundary, - nodeKey: step.nodeKey, - pinned: pinnedKeys.includes(step.nodeKey), - processOpen - }) })] }); - }; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { - className: Reader_module_css_default.turn, - "data-reader-turn": group.turn ?? "unresolved", - "data-reader-turn-state": boundary.status, - "data-reader-turn-result": boundary.reason ?? void 0, - children: [ - startsWithUser && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainNode, { - ...shared, - useChat: props.useChat, - boundary, - nodeKey: group.keys[0] - }) }), - /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.turnStickyRegion, - "data-reader-sticky-region": true, - children: [(showStatusLane || showClosedSummary) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.turnStickyLanes, - children: [showStatusLane && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StickyLane, { - kind: "status", - className: Reader_module_css_default.turnProcessSticky, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Disclosure, { - open: expanded, - onChange: setExpanded, - controls: flowId, - buttonRef: processButton, - label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupStatus, { - group, - useChat: props.useChat, - pending: interaction, - motion - }) - }) - }), showClosedSummary && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClosedProcessSummary, { - open: expanded, - onChange: setExpanded, - controls: flowId, - steps: steps.filter((step) => step.kind !== "user" && step.kind !== "body") - })] - }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoreographedFlow, { - id: flowId, - frame: presentation, - motion, - enabled: autoFold && boundary.status === "open" && !holdingSelection, - urgent: hasTurnError || interaction !== void 0 || !sessionRunning, - open: foldOpenByKey, - processOpen: expanded, - onOpenChange: (key, value) => { - pinProcess(); - setFoldOpenByKey((current) => ({ - ...current, - [key]: value - })); - }, - renderStep - })] - }), - !hasProcess && boundary.status === "open" && !isAwaitingModel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.disclosure, - "data-reader-status-only": true, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupStatus, { - group, - useChat: props.useChat, - pending: interaction, - motion - }) - }), - showDeliverablesRow(boundary.status, deliverables) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeliverablesRow, { - deliverables, - openFile: props.openFile, - revealFile: props.revealFile, - openMode - }), - boundary.status === "closed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OfficialTail, { - official, - owner: tailOwner, - produced: deliverables - }) }), - showTerminalNotice && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.notice, - "data-reader-terminal": true, - children: terminal - }) - ] - }); - }); - function Reader(props) { - (0, react.useInsertionEffect)(() => { - ensureStyles(); - }, []); - const root = (0, react.useRef)(null); - const activatedAt = (0, react.useRef)(Date.now()); - const order = props.useChat((snapshot) => snapshot.order); - const nodes = props.useChat((snapshot) => snapshot.nodes); - const rewindSignature = props.useChat((snapshot) => visibleChatSignature(snapshot)); - const renderKeys = (0, react.useMemo)(() => visibleChatKeys({ - order, - nodes - }), [ - order, - nodes, - rewindSignature - ]); - const timeline = props.useChat((snapshot) => snapshot.timeline); - const running = props.useSession((snapshot) => snapshot.running); - const pending = props.useSessionStatus((snapshot) => snapshot.get(props.sessionId)?.pendingInteraction); - const openError = props.useSession((snapshot) => snapshot.openError); - const loading = props.useSession((snapshot) => snapshot.openState === "loading"); - const hasMore = props.useSession((snapshot) => snapshot.hasMore); - const loadingOlder = props.useSession((snapshot) => snapshot.loadingOlder); - const pendingList = asReadonlyArray(props.useSession((snapshot) => snapshot.pendingSubmissions)); - const inbox = props.useProjection?.("inbox"); - const inboxSteering = asReadonlyArray(inbox?.["next-step"]).filter((item) => item.source?.kind === "user"); - const observed = (0, react.useMemo)(() => observedInputIds(order, (key) => nodes.get(key)), [order, nodes]); - const visibleSubmissions = (0, react.useMemo)(() => pendingList.filter((sub) => sub.placement !== "queued" && !observed.has(sub.requestId)), [pendingList, observed]); - const pendingInputs = (0, react.useMemo)(() => { - const local = new Map(visibleSubmissions.map((sub) => [sub.requestId, sub])); - const localIds = new Set(pendingList.filter((sub) => sub.placement !== "queued").map((sub) => sub.requestId)); - const rows = []; - for (const item of inboxSteering) { - const rpcId = typeof item.source?.rpcId === "string" ? item.source.rpcId : void 0; - if (!rpcId) { - rows.push(item); - continue; - } - const submission = local.get(rpcId); - if (submission) { - local.delete(rpcId); - rows.push(submission); - } else if (!localIds.has(rpcId)) rows.push(item); - } - rows.push(...local.values()); - return rows; - }, [ - inboxSteering, - pendingList, - visibleSubmissions - ]); - const waitAnchor = waitingAnchor(renderKeys, (key) => nodes.get(key), pendingList); - const motion = useMotionAllowed(props.useStore((state) => state.motion)); - const prefsSnap = (0, react.useSyncExternalStore)(props.openPrefs?.subscribe ?? ((fn) => { - return () => {}; - }), () => props.openPrefs?.getSnapshot?.(), () => void 0); - const storeAutoFold = props.useStore((state) => state.autoFold); - const autoFold = prefsSnap?.autoFold ?? (prefsSnap?.foldIntensity !== void 0 ? prefsSnap.foldIntensity !== 0 : void 0) ?? storeAutoFold ?? true; - const previousAutoFold = (0, react.useRef)(autoFold); - (0, react.useLayoutEffect)(() => { - const restored = autoFold && !previousAutoFold.current; - previousAutoFold.current = autoFold; - if (restored) props.actions.resetExpanded(); - }, [autoFold, props.actions]); - const frostedGlass = frostedGlassOf(prefsSnap); - const streamMotion = (0, react.useMemo)(() => ({ - enabled: motion, - activatedAt: activatedAt.current - }), [motion]); - const groups = (0, react.useMemo)(() => groupNodes(renderKeys, (key) => nodes.get(key)), [ - renderKeys, - nodes, - timeline - ]); - const isAwaitingModel = (0, react.useMemo)(() => { - if (!running && pendingList.length > 0) return true; - const lastKey = renderKeys.at(-1); - const lastNode = lastKey ? nodes.get(lastKey) : void 0; - if (!lastKey || !lastNode) return false; - if (lastNode.kind === "assistant-step") { - const data = lastNode.data; - return (data.blocks ?? []).length === 0 && data.status === "running"; - } - if (!handsBackToModel(lastNode)) return false; - const lastGroup = groups.at(-1); - return (lastGroup?.turn === null || lastGroup?.turn === void 0 ? void 0 : timeline.turns.get(lastGroup.turn))?.status !== "closed"; - }, [ - running, - pendingList, - renderKeys, - nodes, - groups, - timeline - ]); - const scroll = useReadingScroll(root, motion); - const pinnedKeys = usePinnedSelection(root); - const selectedProcessKeys = usePinnedSelection(root, "[data-reader-process]"); - const [historyError, setHistoryError] = (0, react.useState)(false); - const turnNavigationItems = props.useChat((snapshot) => snapshot.navigation?.items ? snapshot.navigation.items() : void 0); - const turnOutline = props.useProjection?.("turnOutline"); - const turnsWithDeliverables = (0, react.useMemo)(() => { - const set = /* @__PURE__ */ new Set(); - for (const [turnNum, loc] of timeline.turns) { - const deliv = loc.data?.get("deliverables"); - if (Array.isArray(deliv?.produced) && deliv.produced.length > 0) set.add(turnNum); - } - return set; - }, [timeline]); - const timelineItems = (0, react.useMemo)(() => mergeTimelineItems(turnNavigationItems, turnOutline, turnsWithDeliverables), [ - turnNavigationItems, - turnOutline, - turnsWithDeliverables - ]); - const [activeTurn, setActiveTurn] = (0, react.useState)(null); - const [busyTurn, setBusyTurn] = (0, react.useState)(null); - (0, react.useEffect)(() => { - const el = root.current; - if (!el) return; - const scroller = el.closest("[data-conversation-scroll]") ?? el; - let ticking = false; - const updateActive = () => { - if (ticking) return; - ticking = true; - requestAnimationFrame(() => { - ticking = false; - const line = (scroller instanceof HTMLElement ? scroller.clientHeight : window.innerHeight) * .35; - const turnRows = el.querySelectorAll("[data-reader-turn]:not([data-reader-turn=\"unresolved\"])"); - let current = null; - for (const row of turnRows) if (row.getBoundingClientRect().top <= line) { - const num = Number(row.dataset.readerTurn); - if (Number.isSafeInteger(num)) current = num; - } else break; - if (current !== null) setActiveTurn(current); - else if (turnRows.length > 0) { - const first = Number(turnRows[0].dataset.readerTurn); - if (Number.isSafeInteger(first)) setActiveTurn(first); - } - }); - }; - scroller.addEventListener("scroll", updateActive, { passive: true }); - updateActive(); - return () => scroller.removeEventListener("scroll", updateActive); - }, [groups]); - const onNavigateTurn = (0, react.useCallback)(async (item) => { - const el = root.current; - if (!el) return; - const port = scrollerOf(el); - const reveal = (turn) => { - const targetRow = el.querySelector(`[data-reader-turn="${turn}"]`); - if (!targetRow) return; - const last = timelineItems.at(-1); - if (last !== void 0 && last.turn === turn) scroll.jump(); - else { - scroll.release(); - landTurn(targetRow, port); - } - setActiveTurn(turn); - }; - if (item.anchor.kind === "loaded") { - reveal(item.turn); - return; - } - setBusyTurn(item.turn); - try { - if (props.loadThrough) await props.loadThrough(item.anchor.seq); - else await props.loadOlder(); - setTimeout(() => { - reveal(item.turn); - }, 50); - } finally { - setBusyTurn(null); - } - }, [ - props.loadThrough, - props.loadOlder, - scroll.jump, - scroll.release, - timelineItems - ]); - const lastKey = renderKeys.at(-1); - const lastNode = lastKey ? nodes.get(lastKey) : void 0; - const lastSubmissionId = pendingList.length ? pendingList[pendingList.length - 1].requestId : null; - const lastOrderKeyRef = (0, react.useRef)(lastKey); - const lastSubmissionRef = (0, react.useRef)(lastSubmissionId); - (0, react.useLayoutEffect)(() => { - const appendedUser = lastKey !== lastOrderKeyRef.current && (lastNode?.kind === "user" || lastNode?.kind === "steering"); - const appendedSubmission = lastSubmissionId !== null && lastSubmissionId !== lastSubmissionRef.current; - lastOrderKeyRef.current = lastKey; - lastSubmissionRef.current = lastSubmissionId; - if (appendedUser || appendedSubmission) scroll.jump(); - }, [ - lastKey, - lastNode?.kind, - lastSubmissionId, - scroll - ]); - return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamMotionContext.Provider, { - value: streamMotion, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReaderLaneScope, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - ref: root, - className: Reader_module_css_default.root, - "data-reader-build": "0.3.4", - "data-dsh-better-display": "0.3.4", - "data-reader-wait-clock-version": "input-v1", - "data-reader-wait-start": waitAnchor.time ?? void 0, - "data-motion": motion ? "on" : "off", - "data-reader-glass": frostedGlass || void 0, - "data-reader-auto-fold": autoFold ? "on" : "off", - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimelineRail, { - items: timelineItems, - activeTurn, - busyTurn, - onNavigate: onNavigateTurn - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.column, - "data-chat-flow": "", - tabIndex: -1, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StickyLane, { - kind: "toolbar", - className: Reader_module_css_default.toolbar, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.textButton, - "aria-pressed": autoFold, - onClick: () => { - props.actions.setAutoFold(!autoFold); - props.openPrefs?.actions?.setAutoFold?.(!autoFold); - }, - title: "新思考产生时,是否自动将此前步骤收拢为一行汇总。关闭后完整保留原始过程与流式输出。", - children: `自动折叠${autoFold ? "开" : "关"}` - }) - }), - hasMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.historyButton, - disabled: loadingOlder, - onClick: async () => { - setHistoryError(false); - try { - await props.loadOlder(); - } catch { - setHistoryError(true); - } - }, - children: loadingOlder ? "正在加载更早记录" : "加载更早记录" - }), - historyError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.notice, - children: "历史记录加载失败,可再次尝试;现有内容未改变。" - }), - openError && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.error, - role: "alert", - children: ["会话暂时无法读取:", openError.message] - }), - loading && groups.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: Reader_module_css_default.empty, - role: "status", - children: "正在读取会话…" - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RetiringTurns, { - groups, - render: (group) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TurnGroup, { - ...props, - group, - motion, - autoFold, - pinnedKeys, - selectedProcessKeys, - isAwaitingModel: isAwaitingModel && group.key === groups.at(-1)?.key - }) - }), - pendingInputs.map((item, index) => { - const submission = "requestId" in item ? item : void 0; - const text = submission?.text ?? inboxText(item); - const images = submission ? pendingSubmissionImages(submission) : []; - const attachmentCount = submission ? images.length : inboxAttachmentCount(item); - const requestId = submission?.requestId ?? `inbox-${index}`; - return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.userCluster, - "data-reader-pending-submission": true, - "data-pending-steering": submission ? void 0 : "", - "data-pending-attachment-count": attachmentCount, - children: [ - images.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.userImages, - children: images.map((item, idx) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("figure", { - className: Reader_module_css_default.imageFigure, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.imageFrame, - style: { aspectRatio: `${item.width || 4} / ${item.height || 3}` }, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", { - src: item.previewUrl, - alt: item.name ?? "发送的图片", - className: Reader_module_css_default.pendingImage - }) - }) - }, idx)) - }), - text ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.user, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.blocks, - children: text - }) - }) : null, - /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UserMessageActions, { - text, - time: submission?.time - }) - ] - }, requestId); - }), - isAwaitingModel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WaitingStatus, { - anchor: waitAnchor, - label: props.t ? props.t("chat.deepDiving") : "深度求索中..." - }), - pending !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: Reader_module_css_default.attention, - role: "alert", - "data-reader-attention": true, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: pending.kind === "question" ? "需要你回答一个问题" : "需要你的确认" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "请在下方原生操作区处理。此提示不会收进执行过程。" })] - }), - scroll.detached && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: Reader_module_css_default.jumpDock, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: Reader_module_css_default.jump, - "aria-label": "回到底部", - title: "回到底部", - onClick: scroll.jump, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", { - viewBox: "0 0 14 14", - width: "14", - height: "14", - "aria-hidden": "true", - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { - d: "M3 5.5 7 9.5 11 5.5", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.4", - strokeLinecap: "round", - strokeLinejoin: "round" - }) - }) - }) - }) - ] - })] - }) }) - }); - } - // src/client/store.ts - function applyFoldIntensity(draft, value) { - draft.foldIntensity = value; - draft.autoFold = autoFoldFromIntensity(value); - draft.processOnly = processOnlyFromIntensity(value); - } - function createReaderStore() { - return (0, _deepseek_ai_dsh_client_store.defineStore)({ - init: () => ({ - expanded: {}, - motion: true, - autoFold: true, - deliverableOpenMode: "external", - foldIntensity: 1, - frostedGlass: false, - processOnly: false - }), - persist: "dsh.reader.v1", - actions: { - setExpanded: (draft, key, value) => { - draft.expanded[key] = value; - }, - resetExpanded: (draft) => { - draft.expanded = {}; - }, - setMotion: (draft, value) => { - draft.motion = value; - }, - setAutoFold: (draft, value) => { - applyFoldIntensity(draft, value ? draft.foldIntensity === 2 ? 2 : 1 : 0); - }, - setDeliverableOpenMode: (draft, value) => { - draft.deliverableOpenMode = value; - }, - setFoldIntensity: (draft, value) => { - applyFoldIntensity(draft, value); - }, - setFrostedGlass: (draft, value) => { - draft.frostedGlass = value; - } - } - }); - } - // src/client/entry-policy.ts - /** Select the reading view on entry, without fighting a later explicit tab choice. */ - var ReaderEntryPolicy = class { - requested; - consumeRequest; - entered = false; - constructor(requested, consumeRequest = () => {}) { - this.requested = requested; - this.consumeRequest = consumeRequest; - } - select(view) { - const requested = !this.entered && this.requested; - if (!this.entered) { - this.entered = true; - if (this.requested) this.consumeRequest(); - } - return (requested || view == null) && view !== "reader" ? "reader" : null; - } - }; - function readerEntryRequested(search) { - const value = new URLSearchParams(search).get("reader"); - return value === "1" || /^0\.1\.0-trial\.\d+$/.test(value ?? ""); - } - // src/client/entry.tsx - function isConversationStore(store) { - return typeof store === "object" && store !== null && store.spec.persist === "dsh.conversation" && typeof store.spec.actions.setView === "function"; - } - function ReaderEntry({ useStore, actions, policy }) { - const view = useStore((state) => state.view); - (0, react.useLayoutEffect)(() => { - const next = policy.select(view); - if (next) actions.setView(next); - }, [ - view, - actions, - policy - ]); - return null; - } - /** Reuse the native store handle; its framework-owned instance preserves drafts. */ - function installReaderEntry(ctx) { - const native = ctx.slots.entriesOfSlot("conversation.session")[0]?.store; - if (!isConversationStore(native)) throw new Error("DSH Reader cannot bind the native conversation view store."); - const policy = new ReaderEntryPolicy(readerEntryRequested(location.search), () => { - const url = new URL(location.href); - url.searchParams.delete("reader"); - history.replaceState(history.state, "", `${url.pathname}${url.search}${url.hash}`); - }); - return ctx.slots.register({ - name: "conversation.input.dock", - id: "dsh-better-display-entry", - store: native, - inject: () => ({ policy }) - }, ReaderEntry); - } // src/client/settings-copy.ts const en = { nav: "Better Chat", @@ -53119,6 +900,15 @@ ${trimmed} function settingsCopyFor(tag) { return settingsLanguage(tag) === "zh" ? zh : en; } + // src/client/fold-intensity.ts + function frostedGlassOf(state) { + if (state && typeof state === "object" && "frostedGlass" in state) return state.frostedGlass === true; + return state === true; + } + // src/client/open-file.ts + function deliverableOpenModeOf(value) { + return value === "sidebar" ? "sidebar" : "external"; + } // \0dshx-css-module:src/client/SettingsSection.module.css.mjs const css = ".TSdzRq_section{flex-direction:column;gap:28px;width:100%;max-width:720px;display:flex}.TSdzRq_row{border-bottom:.5px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;padding:16px 0;display:flex}.TSdzRq_rowText{flex-direction:column;flex:1;gap:4px;min-width:0;padding-right:24px;display:flex}.TSdzRq_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:400;line-height:22px}.TSdzRq_desc{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400;line-height:18px}.TSdzRq_switch{background:var(--dsw-alias-bg-module-platform);cursor:pointer;border:none;border-radius:12px;flex:none;width:40px;height:24px;padding:0;position:relative}.TSdzRq_switch:after{content:\"\";background:var(--dsw-alias-label-primary);border-radius:50%;width:18px;height:18px;transition:transform .16s;position:absolute;top:3px;left:3px}.TSdzRq_switch[data-on]:after{transform:translate(16px)}.TSdzRq_switch[data-on]{background:var(--dsw-alias-state-business-primary)}.TSdzRq_block{flex-direction:column;gap:10px;display:flex}.TSdzRq_actions{gap:8px;display:flex}.TSdzRq_button{border:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);height:32px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:8px;padding:0 12px;font-size:13px}.TSdzRq_button:hover{background:var(--dsw-alias-interactive-bg-hover)}.TSdzRq_button:disabled{opacity:.6;cursor:default}.TSdzRq_segment{background:var(--dsw-alias-bg-module-platform);border-radius:10px;gap:2px;width:100%;margin-top:8px;padding:2px;display:flex}.TSdzRq_segmentStop{min-width:0;height:32px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:8px;flex:1 1 0;padding:0 8px;font-size:12px;line-height:18px}.TSdzRq_segmentStop[data-on]{background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);box-shadow:0 0 0 .5px var(--dsw-alias-border-l2)}.TSdzRq_slider{width:100%;accent-color:var(--dsw-alias-state-business-primary);margin:10px 0 0}.TSdzRq_keyActions{flex:none;align-items:center;gap:8px;display:flex}.TSdzRq_keyButton{border:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-width:96px;height:32px;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Consolas, monospace);cursor:pointer;border-radius:8px;padding:0 12px;font-size:12px;line-height:20px}.TSdzRq_keyButton:hover{border-color:var(--dsw-alias-border-l3)}.TSdzRq_keyButton[data-recording]{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-module-platform)}.TSdzRq_error{color:var(--dsw-alias-state-error-primary,#d1483c);margin:0;font-size:12px;line-height:18px}"; const tagId = "dsh-better-chat/SettingsSection.module.css"; @@ -53156,12 +946,13 @@ ${trimmed} } function SettingsSection(props) { const copy = props.copy ?? settingsCopyFor(props.languageTag); - const snap = (0, react.useSyncExternalStore)(props.prefs.subscribe, () => props.prefs.getSnapshot() ?? {}, () => ({})); + const prefs = props.prefs; + const snap = (0, react.useSyncExternalStore)(prefs?.subscribe ?? (() => () => {}), () => prefs?.getSnapshot() ?? {}, () => ({})); const mode = deliverableOpenModeOf(snap.deliverableOpenMode); const glass = frostedGlassOf(snap); const autoFold = snap.autoFold !== false && snap.foldIntensity !== 0; const setMode = (value) => { - props.prefs.actions.setDeliverableOpenMode(value); + prefs?.actions.setDeliverableOpenMode(value); }; const on = mode === "sidebar"; const chat = props.chat; @@ -53226,7 +1017,7 @@ ${trimmed} return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: SettingsSection_module_css_default.section, "data-better-display-settings": true, - children: [ + children: [prefs ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: SettingsSection_module_css_default.row, children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { @@ -53269,7 +1060,7 @@ ${trimmed} "data-on": glass || void 0, "data-better-display-glass": glass ? "on" : "off", onClick: () => { - props.prefs.actions.setFrostedGlass(!glass); + prefs?.actions.setFrostedGlass(!glass); } })] }), @@ -53292,92 +1083,91 @@ ${trimmed} "data-on": autoFold || void 0, "data-better-display-auto-fold": autoFold ? "on" : "off", onClick: () => { - props.prefs.actions.setAutoFold?.(!autoFold); - props.prefs.actions.setFoldIntensity?.(!autoFold ? 1 : 0); + prefs?.actions.setAutoFold?.(!autoFold); + prefs?.actions.setFoldIntensity?.(!autoFold ? 1 : 0); } })] - }), - chat ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { - className: SettingsSection_module_css_default.block, - "data-better-chat-shortcuts": true, - children: [ - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: SettingsSection_module_css_default.title, - children: text(props, copy, "shortcutTitle") - }), - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: SettingsSection_module_css_default.desc, - children: text(props, copy, "shortcutDescription") - }), + }) + ] }) : null, chat ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { + className: SettingsSection_module_css_default.block, + "data-better-chat-shortcuts": true, + children: [ + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { + className: SettingsSection_module_css_default.title, + children: text(props, copy, "shortcutTitle") + }), + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { + className: SettingsSection_module_css_default.desc, + children: text(props, copy, "shortcutDescription") + }), + [ [ - [ - "allow", - "shortcutAllow", - bindings.allow - ], - [ - "always", - "shortcutAlways", - bindings.always - ], - [ - "reject", - "shortcutReject", - bindings.reject - ] - ].map(([action, title, binding]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: SettingsSection_module_css_default.row, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: SettingsSection_module_css_default.rowText, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: SettingsSection_module_css_default.title, - children: text(props, copy, title) - }) - }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { - className: SettingsSection_module_css_default.keyActions, - children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: SettingsSection_module_css_default.keyButton, - "data-recording": recording === action || void 0, - onClick: () => { - setKeyError(void 0); - setRecording(action); - }, - children: recording === action ? text(props, copy, "shortcutRecording") : binding ? bindingKeycap(binding, mac) : text(props, copy, "shortcutDisabled") - }), action === "always" && binding ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { - type: "button", - className: SettingsSection_module_css_default.button, - onClick: () => { - chat.actions.setApprovalBinding("always", null); - announceBindings(); - setKeyError(void 0); - }, - children: text(props, copy, "shortcutDisable") - }) : null] - })] - }, action)), - keyError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { - className: SettingsSection_module_css_default.error, - "data-better-chat-key-error": true, - children: keyError - }) : null, - /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { - className: SettingsSection_module_css_default.actions, - children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + "allow", + "shortcutAllow", + bindings.allow + ], + [ + "always", + "shortcutAlways", + bindings.always + ], + [ + "reject", + "shortcutReject", + bindings.reject + ] + ].map(([action, title, binding]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + className: SettingsSection_module_css_default.row, + children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { + className: SettingsSection_module_css_default.rowText, + children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { + className: SettingsSection_module_css_default.title, + children: text(props, copy, title) + }) + }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + className: SettingsSection_module_css_default.keyActions, + children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: SettingsSection_module_css_default.keyButton, + "data-recording": recording === action || void 0, + onClick: () => { + setKeyError(void 0); + setRecording(action); + }, + children: recording === action ? text(props, copy, "shortcutRecording") : binding ? bindingKeycap(binding, mac) : text(props, copy, "shortcutDisabled") + }), action === "always" && binding ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { type: "button", className: SettingsSection_module_css_default.button, onClick: () => { - chat.actions.resetApprovalBindings(); + chat.actions.setApprovalBinding("always", null); announceBindings(); - setRecording(null); setKeyError(void 0); }, - children: text(props, copy, "shortcutReset") - }) + children: text(props, copy, "shortcutDisable") + }) : null] + })] + }, action)), + keyError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { + className: SettingsSection_module_css_default.error, + "data-better-chat-key-error": true, + children: keyError + }) : null, + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { + className: SettingsSection_module_css_default.actions, + children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: SettingsSection_module_css_default.button, + onClick: () => { + chat.actions.resetApprovalBindings(); + announceBindings(); + setRecording(null); + setKeyError(void 0); + }, + children: text(props, copy, "shortcutReset") }) - ] - }) : null - ] + }) + ] + }) : null] }); } // src/client/settings.tsx @@ -53414,176 +1204,9 @@ ${trimmed} inject: injected }, SettingsSection)); } - // src/client/reader-plugin.tsx - const officialFileAddressFor = fileAddressFor$1; - async function openWorkspacePath(ctx, path) { - const remoteSession = ctx.remote?.session ?? ctx.get?.("remote.session") ?? (ctx.get?.("remote"))?.session; - if (remoteSession?.openWorkspacePath) { - const result = await remoteSession.openWorkspacePath({ path }); - if (!result?.ok) console.warn("[dsh-better-display] openWorkspacePath failed:", result?.error?.message); - } else console.warn("[dsh-better-display] remote.session is not available"); - } - ensureStyles(); - function apply$1(ctx, options = {}) { - const textTransform = createTextTransformRegistry(); - const restoreTextTransform = installTextTransformRegistry(textTransform); - ctx.provide(TEXT_TRANSFORM_SERVICE, textTransform); - ctx.effect(() => restoreTextTransform); - const store = createReaderStore(); - const prefs = store.create(); - installBetterDisplaySettings(ctx, prefs, options.chatPrefs); - ctx.slots.inject("conversation.chat.node", function* () { - yield ctx.slots.register({ - name: "conversation.view", - id: "reader", - order: -5, - label: () => "阅读", - locale: "chat", - children: { - "dsh-better-display.block": { - kind: "chain", - scope: "session" - }, - ...officialChildren(ctx.slots) - }, - store, - inject: (sessionId) => { - const session = () => { - const current = ctx.sessions.binding(sessionId)?.session; - if (!current) throw new Error("阅读页对应的会话已关闭。"); - return current; - }; - return { - openPrefs: prefs, - officialImageLoader: Object.assign((attachment) => ctx.uiConversation.imageUrl(sessionId, attachment), { peek: (attachment) => ctx.uiConversation.peekImageUrl(sessionId, attachment) }), - officialFileMentions: (owner) => ctx.get("chatFileMentions")?.forClosing(owner, sessionId), - officialPreviewFile: (path) => { - const cwd = ctx.sessions.list.getSnapshot().byId[sessionId]?.cwd; - const sidebar = ctx.get("sidebarRight"); - if (!sidebar?.openResource) throw new Error("文件预览面板不可用。"); - sidebar.openResource((officialFileAddressFor ?? fileAddressFor)(sessionId, cwd, path)); - }, - officialHost: { - getSnapshot: () => ctx.remote.$host, - subscribe: (listener) => ctx.on("connection/reset", listener) - }, - loadOlder: async () => { - await session().loadOlder(); - }, - loadImage: async (attachment) => { - const receipt = await session().readAttachment(attachment.attachmentId); - if (!receipt.ok) throw new Error(receipt.error.message); - return { - data: Uint8Array.from(receipt.value.data), - mediaType: receipt.value.attachment.mediaType - }; - }, - openFile: async (path, options) => { - try { - const cwd = ctx.sessions?.list?.getSnapshot?.()?.byId[sessionId]?.cwd; - const sidebar = ctx.get?.("sidebarRight") ?? ctx.sidebarRight; - await openDeliverableFile({ - path, - mode: modeFromSnapshot(prefs), - sessionId, - cwd, - resolveWorkspacePath, - openExternal: async (absolutePath) => { - await openWorkspacePath(ctx, absolutePath); - }, - openSidebar: typeof sidebar?.openResource === "function" ? (address) => { - sidebar.openResource(address, options?.line === void 0 ? void 0 : { params: { line: options.line } }); - } : void 0, - fileAddressFor: officialFileAddressFor ?? fileAddressFor, - warn: (message, extra) => { - console.warn(message, extra); - } - }); - } catch (error) { - console.warn("[dsh-better-display] openFile error:", error); - } - }, - revealFile: async (path) => { - try { - const cwd = ctx.sessions?.list?.getSnapshot?.()?.byId[sessionId]?.cwd; - const targetPath = resolveWorkspacePath(cwd, path); - try { - const res = await fetch("/better-display/reveal", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - path: targetPath, - sessionId - }) - }); - if (res.ok) { - if ((await res.json()).ok) return; - } - } catch {} - const parentDir = dirname(targetPath); - if (!isAbsoluteWorkspacePath(parentDir)) { - console.warn("[dsh-better-display] reveal failed; refusing to open a relative parent:", targetPath); - return; - } - const remoteSession = ctx.remote?.session ?? ctx.get?.("remote.session"); - if (remoteSession?.openWorkspacePath) await remoteSession.openWorkspacePath({ path: parentDir }); - } catch (error) { - console.warn("[dsh-better-display] revealFile error:", error); - } - }, - forkAt: (seq) => { - if (typeof seq !== "number" || !Number.isFinite(seq)) { - console.warn("[dsh-better-display] fork refused: missing anchor seq"); - return; - } - try { - const sessionsApi = ctx.sessions; - if (sessionsApi?.fork) sessionsApi.fork({ - sessionId, - atSeq: seq, - increaseTitle: true - }).then((childId) => { - sessionsApi.open?.(childId); - }).catch((err) => { - console.warn("[dsh-better-display] fork failed:", err); - }); - } catch (error) { - console.warn("[dsh-better-display] forkAt error:", error); - } - }, - loadThrough: async (seq) => { - try { - const current = session(); - if (typeof current?.loadThrough === "function") await current.loadThrough(seq); - else await session().loadOlder(); - } catch (error) { - console.warn("[dsh-better-display] loadThrough error:", error); - } - }, - fillComposer: (text) => { - try { - const shell = ctx.conversation?.input?.shell?.(sessionId); - if (shell && typeof shell.setDraft === "function") { - shell.setDraft(text); - return true; - } - } catch {} - try { - return fillComposerDom(text); - } catch { - return false; - } - } - }; - } - }, Reader); - yield installOfficialSlots(ctx); - yield installReaderEntry(ctx); - }); - } // src/client/index.tsx const name = "dsh-better-chat"; - /** 阅读视图所需的宿主客户端服务;聊天增强不额外依赖服务。 */ + /** 阅读视图已移除;这里保留宿主客户端服务注入,聊天增强本身不额外依赖。 */ const inject = [ "slots", "sessions", @@ -53601,7 +1224,7 @@ ${trimmed} try { ctx.plugin(storeUpdatePlugin); } catch {} - apply$1(ctx, { chatPrefs }); + installBetterDisplaySettings(ctx, void 0, chatPrefs); } exports.apply = apply; exports.inject = inject; diff --git a/lib/client.js.map b/lib/client.js.map index 3ca9054..f82fc78 100644 --- a/lib/client.js.map +++ b/lib/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","names":["CARD_SELECTOR","defineStore","encodeSegment","encodePath","isAbsoluteWorkspacePath","fileAddressFor","asRecord","diffTotals","styles","createContext","useContext","memo","useMemo","useRef","useState","useId","useCallback","useEffect","css","createContext","useContext","useRef","useState","useLayoutEffect","useEffect","own","content","EditMap","addImplementation","document","EditMap","exit","nonLazyContinuation","tokenizeNonLazyContinuation","nonLazyContinuation","previous","nonLazyContinuation","tokenizeIndent","EditMap","flow","string","text","EditMap","document","text","resolveText","defaultConstructs","content","document","flow","string","text","point","ok","escape","assert","previous","assert","assert","assert","assert","path","text","nonLazyContinuation","tokenizeNonLazyContinuation","math","math","text","createElement","createElement","Fragment","css","CodeBlock","useState","MarkdownText","memo","useRef","useMemo","css","createContext","useContext","useRef","useLayoutEffect","css","useMemo","MarkdownText","useState","useEffect","useMemo","memo","useState","useRef","useEffect","css","Component","err","css","memo","useState","useRef","useEffect","useLayoutEffect","MarkdownText","JsonBlock","useId","Fragment","writeClipboard","EASING","useRef","useId","useState","useContext","useCallback","useLayoutEffect","useEffect","css","useRef","useLayoutEffect","useEffect","memo","useMemo","createElement","useState","useCallback","useSyncExternalStore","createSnapshotStore","useState","useEffect","useRef","useLayoutEffect","css","useContext","useCallback","useState","useRef","useLayoutEffect","css","useMemo","isNode","memo","Fragment","css","IconEditOutlineRegular","IconBrowseOutlineRegular","IconApiOutlineRegular","IconSearchOutlineRegular","IconSparkleRegular","css","ReadBlock","TerminalBlock","JsonTree","DiffBlock","SearchBlock","WebBlock","memo","useState","useRef","useId","useMemo","useEffect","IconSkillOutlineRegular","diffTotals","DisclosureRow","useState","useEffect","css","css","IconBrowseOutlineRegular","IconFolderCloseRegular","css","JsonBlock","unreachable","useState","DisclosureRow","css","IconBrowseOutlineRegular","memo","useState","useRef","useId","useEffect","css","useRef","useLayoutEffect","css","useMemo","useState","diffTotals","DiffBlock","createContext","useRef","useLayoutEffect","useContext","createContext","useContext","useRef","css","useState","useLayoutEffect","useEffect","useRef","css","memo","useState","css","MarkdownText","JsonBlock","createSnapshotStore","useRef","useMemo","useId","useCallback","useSyncExternalStore","useLayoutEffect","Fragment","useInsertionEffect","useEffect","defineStore","useLayoutEffect","useSyncExternalStore","useState","useCallback","useEffect","css","(workspacePathPkg as {\n fileAddressFor?: typeof fileAddressFor;\n}).fileAddressFor","apply","installApprovalKeys","applyReader"],"sources":["../src/client/chat/bindings.ts","../src/client/chat/approval-keys.ts","../src/client/chat/bindings-store.ts","../src/client/chat/key-hint.ts","../src/client/chat/permission-policy.ts","../src/client/chat/store-update.ts","../node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js","../src/client/rewind-cut.ts","../src/client/tool-activity.ts","../src/client/deliverables.ts","../src/workspace-path.ts","../src/client/styles.ts","../src/client/mcp-app.ts","../src/client/McpAppFrame.tsx","../src/client/message-chrome.ts","../src/client/primitive-labels.ts","../src/client/stream-buffer.ts","../src/client/word-timeline.ts","../src/client/streaming.tsx","../src/client/markdown/incremental.ts","../node_modules/mdast-util-to-string/lib/index.js","../node_modules/character-entities/index.js","../node_modules/decode-named-character-reference/index.js","../node_modules/micromark-util-chunked/index.js","../node_modules/micromark-util-combine-extensions/index.js","../node_modules/micromark-util-decode-numeric-character-reference/index.js","../node_modules/micromark-util-normalize-identifier/index.js","../node_modules/micromark-util-character/index.js","../node_modules/micromark-util-sanitize-uri/index.js","../node_modules/micromark-factory-space/index.js","../node_modules/micromark/lib/initialize/content.js","../node_modules/micromark-util-edit-map/index.js","../node_modules/micromark/lib/initialize/document.js","../node_modules/micromark-util-classify-character/index.js","../node_modules/micromark-util-resolve-all/index.js","../node_modules/micromark-core-commonmark/lib/attention.js","../node_modules/micromark-core-commonmark/lib/autolink.js","../node_modules/micromark-core-commonmark/lib/blank-line.js","../node_modules/micromark-core-commonmark/lib/block-quote.js","../node_modules/micromark-core-commonmark/lib/character-escape.js","../node_modules/micromark-core-commonmark/lib/character-reference.js","../node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js","../node_modules/micromark-core-commonmark/lib/code-fenced.js","../node_modules/micromark-core-commonmark/lib/code-indented.js","../node_modules/micromark-core-commonmark/lib/code-text.js","../node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../node_modules/micromark-util-subtokenize/index.js","../node_modules/micromark-core-commonmark/lib/content.js","../node_modules/micromark-factory-destination/index.js","../node_modules/micromark-factory-label/index.js","../node_modules/micromark-factory-title/index.js","../node_modules/micromark-factory-whitespace/index.js","../node_modules/micromark-core-commonmark/lib/definition.js","../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../node_modules/micromark-core-commonmark/lib/heading-atx.js","../node_modules/micromark-util-html-tag-name/index.js","../node_modules/micromark-core-commonmark/lib/html-flow.js","../node_modules/micromark-core-commonmark/lib/html-text.js","../node_modules/micromark-core-commonmark/lib/label-end.js","../node_modules/micromark-core-commonmark/lib/label-start-image.js","../node_modules/micromark-core-commonmark/lib/label-start-link.js","../node_modules/micromark-core-commonmark/lib/line-ending.js","../node_modules/micromark-core-commonmark/lib/thematic-break.js","../node_modules/micromark-core-commonmark/lib/list.js","../node_modules/micromark-core-commonmark/lib/setext-underline.js","../node_modules/micromark/lib/initialize/flow.js","../node_modules/micromark/lib/initialize/text.js","../node_modules/micromark/lib/constructs.js","../node_modules/micromark/lib/create-tokenizer.js","../node_modules/micromark/lib/parse.js","../node_modules/micromark/lib/postprocess.js","../node_modules/micromark/lib/preprocess.js","../node_modules/micromark-util-decode-string/index.js","../node_modules/unist-util-stringify-position/lib/index.js","../node_modules/mdast-util-from-markdown/lib/index.js","../node_modules/ccount/index.js","../node_modules/devlop/lib/default.js","../node_modules/escape-string-regexp/index.js","../node_modules/unist-util-is/lib/index.js","../node_modules/unist-util-visit-parents/lib/color.node.js","../node_modules/unist-util-visit-parents/lib/index.js","../node_modules/mdast-util-find-and-replace/lib/index.js","../node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../node_modules/mdast-util-gfm-footnote/lib/index.js","../node_modules/mdast-util-gfm-strikethrough/lib/index.js","../node_modules/mdast-util-gfm-table/lib/index.js","../node_modules/mdast-util-gfm-task-list-item/lib/index.js","../node_modules/mdast-util-gfm/lib/index.js","../node_modules/mdast-util-math/lib/index.js","../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../node_modules/micromark-extension-gfm-table/lib/edit-map.js","../node_modules/micromark-extension-gfm-table/lib/infer.js","../node_modules/micromark-extension-gfm-table/lib/syntax.js","../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../node_modules/micromark-extension-gfm/index.js","../node_modules/micromark-extension-math/lib/math-flow.js","../node_modules/micromark-extension-math/lib/math-text.js","../node_modules/micromark-extension-math/lib/syntax.js","../node_modules/micromark-util-symbol/lib/codes.js","../node_modules/micromark-util-symbol/lib/constants.js","../node_modules/micromark-util-symbol/lib/types.js","../src/client/markdown/cjkFriendlyStrong.ts","../src/client/markdown/mathCompatibility.ts","../src/client/markdown/parse.ts","../node_modules/clsx/dist/clsx.mjs","../node_modules/katex/dist/katex.mjs","../src/client/markdown/katex.tsx","../src/client/markdown/render.tsx","../src/client/markdown/MarkdownText.tsx","../src/client/platform-media.ts","../src/client/word-motion.tsx","../src/client/text-transform.ts","../src/client/TurnMetrics.tsx","../src/client/Blocks.tsx","../src/client/reasoning-follow.ts","../src/client/ReasoningCard.tsx","../src/client/official-slots.tsx","../src/client/chat-seat.ts","../src/client/OfficialContent.tsx","../src/client/turn-slots.ts","../src/client/motion.tsx","../src/client/fold-choreography.ts","../src/client/LiveFold.tsx","../src/client/projection.ts","../src/client/AssistantNode.tsx","../src/client/native/tool-call-model.ts","../src/client/ToolActivity.tsx","../src/client/open-file.ts","../src/client/pending-submission.ts","../src/client/WaitClock.tsx","../src/client/WaitingStatus.tsx","../src/client/waiting-clock.ts","../src/client/native/ReferenceIcon.tsx","../src/client/native/ContextBody.tsx","../src/client/native/tool-update.ts","../src/client/native/ContextInjectionRow.tsx","../src/client/TimelineRail.tsx","../src/client/conversation-scroll.ts","../src/client/timeline.ts","../src/client/live-turn.ts","../src/client/fold-intensity.ts","../src/client/DiffPanel.tsx","../src/client/StickyLane.tsx","../src/client/ChoreographedFlow.tsx","../src/client/ClosedProcessSummary.tsx","../src/client/Reader.tsx","../src/client/store.ts","../src/client/entry-policy.ts","../src/client/entry.tsx","../src/client/settings-copy.ts","../src/client/SettingsSection.tsx","../src/client/settings.tsx","../src/client/reader-plugin.tsx","../src/client/index.tsx"],"sourcesContent":["/**\n * 审批卡快捷键模型:默认 Enter 允许(单次)、Ctrl+Enter 始终允许、Esc 拒绝。\n *\n * 允许自定义:允许/始终允许固定在 Enter 上、拒绝固定在 Esc 上,只让修饰键可调,\n * 避免把普通字母键变成全局快捷键。`primary` 表示 Windows/Linux 的 Ctrl、macOS 的\n * Cmd —— 判定时 Ctrl 或 Meta 任一按下即算命中,展示时按平台显示 Ctrl/Cmd。\n */\n\nexport type ApprovalAction = 'allow' | 'always' | 'reject'\nexport type ApprovalBaseKey = 'Enter' | 'Escape'\n\nexport interface ApprovalBinding {\n key: ApprovalBaseKey\n /** Ctrl(Windows/Linux)或 Cmd(macOS)。 */\n primary: boolean\n shift: boolean\n alt: boolean\n}\n\nexport interface ApprovalBindings {\n allow: ApprovalBinding\n /** null = 不绑定「始终允许」。 */\n always: ApprovalBinding | null\n reject: ApprovalBinding\n}\n\nexport interface KeyEventLike {\n key: string\n ctrlKey?: boolean\n metaKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n}\n\n/** 「始终允许」的默认键帽;单列出来,展开时不会沾上 `null` 带来的可选键。 */\nexport const DEFAULT_ALWAYS: ApprovalBinding = { key: 'Enter', primary: true, shift: false, alt: false }\n\nexport const DEFAULT_BINDINGS: ApprovalBindings = {\n allow: { key: 'Enter', primary: false, shift: false, alt: false },\n always: DEFAULT_ALWAYS,\n reject: { key: 'Escape', primary: false, shift: false, alt: false },\n}\n\n/** 设置页保存快捷键后派发的窗口事件;提示与判定都靠实时 getter,无需重启。 */\nexport const BINDINGS_CHANGED_EVENT = 'better-chat:bindings-changed'\n\n/** 每个动作允许的基础键:允许类只能用 Enter,拒绝只能用 Esc。 */\nexport function baseKeyFor(action: ApprovalAction): ApprovalBaseKey {\n return action === 'reject' ? 'Escape' : 'Enter'\n}\n\n/** 展示用键帽文案,例如 Enter / Ctrl+Enter / Shift+Alt+Enter / Esc。 */\nexport function bindingKeycap(binding: ApprovalBinding, mac: boolean): string {\n const parts: string[] = []\n if (binding.primary) parts.push(mac ? 'Cmd' : 'Ctrl')\n if (binding.shift) parts.push('Shift')\n if (binding.alt) parts.push('Alt')\n parts.push(binding.key === 'Escape' ? 'Esc' : binding.key)\n return parts.join('+')\n}\n\n/** 纯判定:按键事件是否命中这条绑定(修饰键必须完全一致)。 */\nexport function bindingMatches(binding: ApprovalBinding, event: KeyEventLike): boolean {\n const primary = Boolean(event.ctrlKey) || Boolean(event.metaKey)\n return event.key === binding.key\n && primary === binding.primary\n && Boolean(event.shiftKey) === binding.shift\n && Boolean(event.altKey) === binding.alt\n}\n\n/** 是否是不带任何修饰键的裸键(Enter / Esc)。 */\nexport function isPlainBinding(binding: ApprovalBinding | null | undefined): boolean {\n return Boolean(binding) && !binding!.primary && !binding!.shift && !binding!.alt\n}\n\n/** 两条绑定是否相同。 */\nexport function bindingsEqual(\n left: ApprovalBinding | null | undefined,\n right: ApprovalBinding | null | undefined,\n): boolean {\n if (!left || !right) return left === right\n return left.key === right.key\n && left.primary === right.primary\n && left.shift === right.shift\n && left.alt === right.alt\n}\n\nfunction booleanOrFalse(value: unknown): boolean {\n return value === true\n}\n\n/** 校验并收敛一条绑定;形状不对时返回 undefined。 */\nexport function normalizeBinding(value: unknown): ApprovalBinding | undefined {\n if (!value || typeof value !== 'object') return undefined\n const record = value as Record<string, unknown>\n if (record.key !== 'Enter' && record.key !== 'Escape') return undefined\n return {\n key: record.key,\n primary: booleanOrFalse(record.primary),\n shift: booleanOrFalse(record.shift),\n alt: booleanOrFalse(record.alt),\n }\n}\n\n/**\n * 把持久化快照收敛成合法绑定;`{ bindings: ... }` 或内层对象都接受。\n * 缺失/非法/冲突的项回落到默认值,保证任何旧快照都能用。\n */\nexport function normalizeBindings(value: unknown): ApprovalBindings {\n const inner = value && typeof value === 'object' && 'bindings' in (value as Record<string, unknown>)\n ? (value as Record<string, unknown>).bindings\n : value\n const record = inner && typeof inner === 'object' ? inner as Record<string, unknown> : {}\n const allowRaw = normalizeBinding(record.allow)\n const rejectRaw = normalizeBinding(record.reject)\n const allow = allowRaw && allowRaw.key === 'Enter' ? allowRaw : { ...DEFAULT_BINDINGS.allow }\n const reject = rejectRaw && rejectRaw.key === 'Escape' ? rejectRaw : { ...DEFAULT_BINDINGS.reject }\n const alwaysRaw = 'always' in record ? record.always : DEFAULT_ALWAYS\n const alwaysParsed = alwaysRaw === null ? null : normalizeBinding(alwaysRaw)\n const always: ApprovalBinding | null = alwaysRaw === null\n ? null\n : alwaysParsed && alwaysParsed.key === 'Enter'\n ? alwaysParsed\n : { ...DEFAULT_ALWAYS }\n\n const out: ApprovalBindings = { allow, always, reject }\n // 冲突(或「始终允许」没修饰键)时把 allow/always 一起回落到默认,\n // 避免一个按键命中两个动作;默认值本身互不冲突。\n if (out.always && (!hasModifier(out.always) || bindingsEqual(out.allow, out.always))) {\n out.allow = { ...DEFAULT_BINDINGS.allow }\n out.always = { ...DEFAULT_ALWAYS }\n }\n if (out.always && bindingsEqual(out.reject, out.always)) {\n out.reject = { ...DEFAULT_BINDINGS.reject }\n }\n if (bindingsEqual(out.allow, out.reject)) {\n out.allow = { ...DEFAULT_BINDINGS.allow }\n out.reject = { ...DEFAULT_BINDINGS.reject }\n }\n return out\n}\n\nfunction hasModifier(binding: ApprovalBinding): boolean {\n return binding.primary || binding.shift || binding.alt\n}\n\nexport type BindingVerdict = 'ok' | 'key' | 'modifier' | 'conflict'\n\n/**\n * 保存前的校验:基础键是否匹配动作、始终允许是否有修饰键、是否与其他动作冲突。\n */\nexport function validateBinding(\n action: ApprovalAction,\n binding: ApprovalBinding,\n current: ApprovalBindings,\n): BindingVerdict {\n if (binding.key !== baseKeyFor(action)) return 'key'\n if (action === 'always' && !hasModifier(binding)) return 'modifier'\n const others: ApprovalBinding[] = []\n if (action !== 'allow') others.push(current.allow)\n if (action !== 'always' && current.always) others.push(current.always)\n if (action !== 'reject') others.push(current.reject)\n if (others.some((other) => bindingsEqual(other, binding))) return 'conflict'\n return 'ok'\n}\n","/**\n * 功能一:审批卡片的回车批准 / Esc 拒绝(自动送入焦点 + 全局兜底路由)。\n *\n * 背景(@deepseek-ai/dsh-client-ui-approval):官方审批卡自带键盘处理\n * —— Enter 批准(单次)、Esc 拒绝 —— 但 keydown 挂在卡片根节点上,且\n * 要求焦点先落在卡片内。审批弹出时焦点往往还在对话区,按回车毫无反应。\n *\n * 本模块补两件事,不改官方任何逻辑:\n * 1. 审批卡出现时,若用户没有正在别处输入,把焦点送进卡片详情区。\n * 2. 焦点不在卡片内时兜底路由:document 捕获阶段拦 keydown,点击卡片\n * 操作行里的按钮 —— 回车点「允许(单次)」,Esc 点「拒绝」。\n */\n\nconst CARD_SELECTOR = '[data-approval-key]'\nconst SCROLL_SELECTOR = '[data-approval-scroll]'\nconst EDITABLE_SELECTOR = 'input, textarea, select, [contenteditable=\"true\"], [contenteditable=\"\"]'\n\nimport {\n DEFAULT_BINDINGS,\n bindingMatches,\n isPlainBinding,\n type ApprovalAction,\n type ApprovalBinding,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport interface KeyActionInput {\n key: string\n ctrlKey?: boolean\n metaKey?: boolean\n altKey?: boolean\n shiftKey?: boolean\n repeat?: boolean\n isComposing?: boolean\n keyCode?: number\n defaultPrevented?: boolean\n target?: Element | null\n activeElement?: Element | null\n card?: Element | null\n /** 卡片是否有可用的「始终允许」按钮(第三个操作按钮)。 */\n hasAlways?: boolean\n /** 当前快捷键绑定;缺省使用 DEFAULT_BINDINGS。 */\n bindings?: ApprovalBindings\n}\n\n/** 卡片操作行的按钮:详情滚动区之外的全部按钮,顺序 [拒绝, 允许, 始终允许?]。 */\nexport function actionButtons(card: Element): HTMLButtonElement[] {\n return [...card.querySelectorAll('button')].filter(\n (button) => !button.closest(SCROLL_SELECTOR),\n ) as HTMLButtonElement[]\n}\n\n/** 找当前可作答的审批卡(DOM 顺序第一张未作答、按钮齐全的卡)。 */\nexport function findPendingCard(doc: Document): Element | null {\n for (const card of doc.querySelectorAll(CARD_SELECTOR)) {\n if (card.getAttribute('aria-busy') === 'true') continue\n const buttons = actionButtons(card)\n if (buttons.length >= 2 && !buttons[0].disabled && !buttons[1].disabled) return card\n }\n return null\n}\n\n/**\n * 纯判定:这次 keydown 是否应该路由到审批卡。\n *\n * 默认绑定:Enter → 允许(单次)、Ctrl/Cmd+Enter → 始终允许、Esc → 拒绝;\n * 绑定可由设置页改写(见 bindings.ts),基础键固定 Enter/Escape,只调修饰键。\n * 官方卡片本身对带修饰键的按键不作答,所以带修饰键的绑定即使在卡内也由\n * 本插件处理;裸 Enter/Esc 在卡内交给官方。\n *\n * @returns 'allow' | 'reject' | 'always' | null\n */\nexport function decideKeyAction(input: KeyActionInput): 'allow' | 'reject' | 'always' | null {\n const {\n repeat, isComposing, keyCode, defaultPrevented, target, activeElement, card, hasAlways,\n } = input\n if (!card) return null\n if (defaultPrevented) return null\n if (repeat || isComposing || keyCode === 229) return null\n // 正在输入控件里打字时一律不拦截(含卡片内的输入框)。\n if (target && typeof target.closest === 'function' && target.closest(EDITABLE_SELECTOR) !== null) {\n return null\n }\n\n const bindings = input.bindings ?? DEFAULT_BINDINGS\n const candidates: Array<[ApprovalAction, ApprovalBinding | null]> = [\n ['allow', bindings.allow],\n ['always', hasAlways ? bindings.always : null],\n ['reject', bindings.reject],\n ]\n\n for (const [action, binding] of candidates) {\n if (!binding || !bindingMatches(binding, input)) continue\n if (isPlainBinding(binding)) {\n // 裸键在卡内交给官方;Enter 落在别的按钮/链接上时保留它自己的行为。\n if (activeElement && card.contains(activeElement)) return null\n if (binding.key === 'Enter' && target && typeof target.closest === 'function'\n && target.closest('button, a[href], [role=\"button\"]') !== null) {\n return null\n }\n }\n return action\n }\n return null\n}\n\n/** 纯判定:审批卡出现时是否应该把焦点送进详情区。 */\nexport function shouldAutoFocus(activeElement: Element | null | undefined, card: Element): boolean {\n if (!activeElement) return true\n if (activeElement === card.ownerDocument?.body) return true\n if (card.contains(activeElement)) return false // 已经在卡里\n if (typeof activeElement.closest === 'function' && activeElement.closest(EDITABLE_SELECTOR) !== null) {\n return false // 正在别处输入\n }\n return true\n}\n\n/** 安装审批键盘增强,返回卸载函数。 */\nexport function install(doc: Document, getBindings?: () => ApprovalBindings): () => void {\n const focusedCards = new WeakSet<Element>()\n\n const tryAutoFocus = (): void => {\n const card = findPendingCard(doc)\n if (!card || focusedCards.has(card)) return\n focusedCards.add(card)\n if (!shouldAutoFocus(doc.activeElement, card)) return\n const region = card.querySelector(SCROLL_SELECTOR)\n if (region && typeof (region as HTMLElement).focus === 'function') (region as HTMLElement).focus()\n }\n\n const observer = new MutationObserver(tryAutoFocus)\n observer.observe(doc.documentElement, { childList: true, subtree: true })\n tryAutoFocus()\n\n const onKeyDown = (event: KeyboardEvent): void => {\n const card = findPendingCard(doc)\n if (!card) return\n const buttons = actionButtons(card)\n const hasAlways = buttons.length >= 3 && !buttons[2].disabled\n const action = decideKeyAction({\n key: event.key,\n ctrlKey: event.ctrlKey, metaKey: event.metaKey, altKey: event.altKey, shiftKey: event.shiftKey,\n repeat: event.repeat, isComposing: event.isComposing, keyCode: event.keyCode,\n defaultPrevented: event.defaultPrevented,\n target: event.target as Element | null, activeElement: doc.activeElement, card, hasAlways,\n bindings: getBindings?.() ?? DEFAULT_BINDINGS,\n })\n if (!action) return\n const button = action === 'allow'\n ? buttons[1]\n : action === 'always'\n ? buttons[2]\n : buttons[0]\n if (!button || button.disabled) return\n event.preventDefault()\n event.stopPropagation()\n button.click()\n }\n doc.addEventListener('keydown', onKeyDown, true)\n\n return () => {\n observer.disconnect()\n doc.removeEventListener('keydown', onKeyDown, true)\n }\n}\n","/**\n * 聊天增强的持久化设置:审批卡快捷键。存储键 `dsh.better-chat.v1`,由宿主\n * 客户端 store 的 persist 机制写入配置,重启后仍在。\n */\nimport { defineStore } from '@deepseek-ai/dsh-client-store'\nimport type { EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\nimport {\n normalizeBindings,\n type ApprovalAction,\n type ApprovalBinding,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport interface ChatState {\n bindings: ApprovalBindings\n}\n\nexport type ChatActionsDecl = {\n setApprovalBinding: (draft: ChatState, action: ApprovalAction, binding: ApprovalBinding | null) => void\n resetApprovalBindings: (draft: ChatState) => void\n}\n\nexport interface ChatPrefs {\n getSnapshot: () => ChatState\n subscribe: (fn: () => void) => () => void\n actions: {\n setApprovalBinding: (action: ApprovalAction, binding: ApprovalBinding | null) => void\n resetApprovalBindings: () => void\n }\n}\n\nexport const CHAT_PREFS_KEY = 'dsh.better-chat.v1'\n\nexport function createChatStore(): EngineStoreHandle<ChatState, ChatActionsDecl> {\n return defineStore({\n init: (): ChatState => ({ bindings: normalizeBindings(undefined) }),\n persist: CHAT_PREFS_KEY,\n actions: {\n setApprovalBinding: (draft, action: ApprovalAction, binding: ApprovalBinding | null) => {\n draft.bindings = normalizeBindings({ ...draft.bindings, [action]: binding })\n },\n resetApprovalBindings: (draft) => {\n draft.bindings = normalizeBindings(undefined)\n },\n },\n })\n}\n\n/** 从设置实例读取当前绑定;旧快照/非法值自动回落默认。 */\nexport function currentBindings(prefs: ChatPrefs | undefined): ApprovalBindings {\n try {\n return normalizeBindings(prefs?.getSnapshot())\n } catch {\n return normalizeBindings(undefined)\n }\n}\n","/**\n * 审批卡键盘提示:在操作行左侧显示「Enter 允许(单次) · Ctrl+Enter\n * 始终允许 · Esc 拒绝」的键帽提示,文案直接取卡片按钮的实际文字。\n *\n * 提示只是说明,不参与点击:pointer-events: none、aria-hidden,且只挂在\n * 卡片操作行里(详情滚动区之外)。React 重渲染把提示冲掉时,MutationObserver\n * 会按按钮文案的签名重新挂回去;卡片作答后(aria-busy)立即移除。\n */\nimport { actionButtons } from './approval-keys.js'\nimport {\n BINDINGS_CHANGED_EVENT,\n DEFAULT_BINDINGS,\n bindingKeycap,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport const HINT_ATTR = 'data-better-chat-keyhint'\nconst CARD_SELECTOR = '[data-approval-key]'\nconst SEPARATOR = '·'\n\nexport interface HintPart {\n key: string\n label: string\n}\n\nexport interface HintLabels {\n allow?: string\n always?: string\n reject?: string\n}\n\n/** 纯判定:当前平台是否用 Cmd 代替 Ctrl(只影响提示文案)。 */\nexport function isMacPlatform(platform: string | undefined | null): boolean {\n return typeof platform === 'string' && /Mac|iPhone|iPad|iPod/.test(platform)\n}\n\n/**\n * 纯函数:根据卡片上实际存在的按钮文案与当前绑定,生成提示的分段。\n * 「始终允许」被关掉(binding 为 null)时就不显示这一段。\n */\nexport function hintParts(\n labels: HintLabels,\n mac: boolean,\n bindings: ApprovalBindings = DEFAULT_BINDINGS,\n): HintPart[] {\n const parts: HintPart[] = []\n if (labels.allow) parts.push({ key: bindingKeycap(bindings.allow, mac), label: labels.allow })\n // Use the word \"Cmd\" instead of the ⌘ glyph: the glyph falls back to a CJK\n // character under some font stacks, while \"Cmd\" is always legible.\n if (labels.always && bindings.always) {\n parts.push({ key: bindingKeycap(bindings.always, mac), label: labels.always })\n }\n if (labels.reject) parts.push({ key: bindingKeycap(bindings.reject, mac), label: labels.reject })\n return parts\n}\n\n/** 纯函数:提示内容的签名,用于判断是否需要重建。 */\nexport function hintSignature(parts: readonly HintPart[]): string {\n return parts.map((part) => `${part.key}=${part.label}`).join('|')\n}\n\nconst HINT_CSS = [\n 'margin-right:auto',\n 'display:inline-flex',\n 'flex-wrap:wrap',\n 'align-items:center',\n 'gap:6px',\n 'font-size:12px',\n 'line-height:18px',\n 'color:var(--dsw-alias-label-tertiary,#8b919b)',\n 'user-select:none',\n 'pointer-events:none',\n].join(';')\n\nconst KEYCAP_CSS = [\n 'display:inline-flex',\n 'align-items:center',\n 'justify-content:center',\n 'height:18px',\n 'padding:0 5px',\n 'border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.35))',\n 'border-bottom-width:2px',\n 'border-radius:5px',\n 'background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.08))',\n 'font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace)',\n 'font-size:11px',\n 'line-height:1',\n 'letter-spacing:.2px',\n].join(';')\n\nconst PAIR_CSS = 'display:inline-flex;align-items:center;gap:5px'\nconst SEPARATOR_CSS = 'opacity:.45;margin:0 2px'\n\nfunction labelOf(button: HTMLButtonElement | undefined): string | undefined {\n if (!button) return undefined\n const text = button.textContent?.trim()\n return text ? text : undefined\n}\n\nfunction buildHint(doc: Document, parts: readonly HintPart[]): HTMLElement {\n const hint = doc.createElement('div')\n hint.setAttribute(HINT_ATTR, '')\n hint.setAttribute('role', 'note')\n hint.setAttribute('aria-hidden', 'true')\n hint.style.cssText = HINT_CSS\n parts.forEach((part, index) => {\n if (index > 0) {\n const separator = doc.createElement('span')\n separator.textContent = SEPARATOR\n separator.style.cssText = SEPARATOR_CSS\n hint.append(separator)\n }\n const pair = doc.createElement('span')\n pair.style.cssText = PAIR_CSS\n const keycap = doc.createElement('span')\n keycap.textContent = part.key\n keycap.style.cssText = KEYCAP_CSS\n const label = doc.createElement('span')\n label.textContent = part.label\n pair.append(keycap, label)\n hint.append(pair)\n })\n return hint\n}\n\nfunction removeHints(doc: Document): void {\n for (const hint of doc.querySelectorAll(`[${HINT_ATTR}]`)) hint.remove()\n}\n\nexport interface KeyHintOptions {\n /** 用于区分 Cmd/Ctrl;默认读 navigator.platform。 */\n platform?: string | null\n /** 当前绑定;设置页保存后会派发 BINDINGS_CHANGED_EVENT 触发重建。 */\n getBindings?: () => ApprovalBindings\n}\n\n/** 安装审批卡键盘提示,返回卸载函数。 */\nexport function installKeyHints(doc: Document, options: KeyHintOptions = {}): () => void {\n const platform = options.platform ?? doc.defaultView?.navigator?.platform\n const mac = isMacPlatform(platform)\n const getBindings = options.getBindings ?? (() => DEFAULT_BINDINGS)\n let disposed = false\n\n const syncCard = (card: Element): void => {\n const buttons = actionButtons(card)\n const existing = card.querySelector(`[${HINT_ATTR}]`)\n const answered = card.getAttribute('aria-busy') === 'true'\n if (answered || buttons.length < 2 || buttons[0].disabled || buttons[1].disabled) {\n existing?.remove()\n return\n }\n const always = buttons.length >= 3 && !buttons[2].disabled ? buttons[2] : undefined\n const parts = hintParts({\n allow: labelOf(buttons[1]),\n always: labelOf(always),\n reject: labelOf(buttons[0]),\n }, mac, getBindings())\n if (parts.length === 0) {\n existing?.remove()\n return\n }\n const signature = hintSignature(parts)\n if (existing && existing.getAttribute('data-signature') === signature) return\n existing?.remove()\n const row = buttons[0].parentElement\n if (!row) return\n const hint = buildHint(doc, parts)\n hint.setAttribute('data-signature', signature)\n row.insertBefore(hint, row.firstChild)\n }\n\n const sync = (): void => {\n if (disposed) return\n const cards = doc.querySelectorAll(CARD_SELECTOR)\n if (cards.length === 0) {\n removeHints(doc)\n return\n }\n for (const card of cards) syncCard(card)\n }\n\n const observer = new MutationObserver(sync)\n observer.observe(doc.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-busy', 'disabled'],\n })\n const view = doc.defaultView\n view?.addEventListener?.(BINDINGS_CHANGED_EVENT, sync)\n sync()\n\n return () => {\n disposed = true\n observer.disconnect()\n view?.removeEventListener?.(BINDINGS_CHANGED_EVENT, sync)\n removeHints(doc)\n }\n}\n","/**\n * 功能二:权限策略 —— 去掉「完全权限」选项,新会话默认「自动审查」。\n *\n * 会话权限有四个预设值:read-only(仅可查看)、workspace-write(工作区内\n * 修改)、danger-full-access(完全权限)、auto(自动审查,EXP)。「自动\n * 审查」由实验层 @deepseek-ai/dsh-experimental-auto-review 提供,开启后才\n * 出现在当前会话的选择器里;通用设置不提供 auto,新会话默认值里也选不到它。\n *\n * 本模块做两件事:\n * 1. 界面移除「完全权限」:观察 DOM,把选择器/菜单/设置下拉里标签为「完全\n * 权限 / Full access」的选项摘掉。只动界面,手动输入命令仍可达。\n * 2. 新建/空白会话默认「自动审查」:首次见到空白顶层会话且其权限不是 auto\n * 时,通过宿主命令通道 `/permission auto` 切过去。已处理过的会话 id 会\n * 持久化在 localStorage(`dsh.better-chat.permission-handled.v1`),且已\n * 有对话内容的会话(`blank === false`)和子代理会话不会被改写;用户手\n * 动切回只读/工作区修改后,刷新或重载也不会被覆盖。\n */\n\n/** 完全权限的预设机器值。 */\nexport const FULL_ACCESS_PRESET = 'danger-full-access'\n/** 自动审查的预设机器值。 */\nexport const AUTO_REVIEW_PRESET = 'auto'\n/** 完全权限在各语言界面里的选项标签(选项文字以标签开头)。 */\nexport const FULL_ACCESS_LABELS = ['完全权限', 'Full access']\n/** 已处理会话 id 的浏览器持久化键,避免刷新后覆盖用户手动改过的权限。 */\nexport const HANDLED_STORAGE_KEY = 'dsh.better-chat.permission-handled.v1'\nconst MAX_HANDLED_IDS = 500\n\n/** 纯判定:一段选项文字是否就是「完全权限」选项(标签打头,或恰好相等)。 */\nexport function isFullAccessLabel(text: unknown): boolean {\n if (typeof text !== 'string') return false\n const trimmed = text.trim()\n return FULL_ACCESS_LABELS.some((label) => trimmed === label || trimmed.startsWith(label))\n}\n\n/** 纯判定:这个会话现在是否应该被切到自动审查。 */\nexport function shouldAutoSwitch(preset: string | undefined | null, alreadyHandled: boolean): boolean {\n return preset !== undefined && preset !== null && preset !== AUTO_REVIEW_PRESET && !alreadyHandled\n}\n\nexport interface LiveSession {\n id: string\n live: any\n}\n\n/**\n * 防御式枚举宿主的 live 会话:\n * 1. `keys() + binding()`(测试桩或旧形状)\n * 2. DSH 0.2.2 `ClientSessions`:`scopes` Map 与 `list.getSnapshot()`(`ids` / `byId`)配合 `binding(id)`\n * 3. `list()` 函数回退\n * 服务形状对不上时安静返回空数组,绝不抛错。\n */\nexport function liveSessions(sessions: any): LiveSession[] {\n const out: LiveSession[] = []\n if (!sessions || typeof sessions !== 'object') return out\n try {\n if (typeof sessions.keys === 'function' && typeof sessions.binding === 'function') {\n for (const id of sessions.keys()) {\n const live = sessions.binding(id)?.session\n if (live) out.push({ id, live })\n }\n return out\n }\n if (typeof sessions.binding === 'function' || sessions.scopes instanceof Map) {\n const seen = new Set<string>()\n const addCandidate = (id: unknown) => {\n if (typeof id !== 'string' || !id || seen.has(id)) return\n const live =\n (typeof sessions.binding === 'function' ? sessions.binding(id)?.session : undefined) ??\n (sessions.scopes instanceof Map ? sessions.scopes.get(id)?.binding?.session : undefined)\n if (live) {\n seen.add(id)\n out.push({ id, live })\n }\n }\n if (sessions.scopes instanceof Map) {\n for (const id of sessions.scopes.keys()) addCandidate(id)\n }\n const listSnap = typeof sessions.list?.getSnapshot === 'function' ? sessions.list.getSnapshot() : undefined\n if (Array.isArray(listSnap?.ids)) {\n for (const id of listSnap.ids) addCandidate(id)\n }\n if (listSnap?.byId && typeof listSnap.byId === 'object') {\n for (const id of Object.keys(listSnap.byId)) addCandidate(id)\n }\n if (out.length > 0 || typeof sessions.list !== 'function') return out\n }\n if (typeof sessions.list === 'function') {\n for (const session of (sessions.list() ?? []) as any[]) {\n if (session && session.sessionId) out.push({ id: session.sessionId, live: session })\n }\n }\n } catch {\n // 服务形状不同:放弃枚举\n }\n return out\n}\n\n/**\n * 读会话当前的权限预设值(投影不可用时返回 undefined)。\n * 兼容 DSH 0.2.2 的 `{ currentValue: string }` 投影视图与直接返回字符串的测试桩。\n */\nexport function currentPreset(live: any): string | undefined {\n try {\n const snap = live?.projections?.faceOf?.('permissions')?.getSnapshot?.()\n if (typeof snap === 'string') return snap\n if (snap && typeof snap === 'object' && typeof (snap as { currentValue?: unknown }).currentValue === 'string') {\n return (snap as { currentValue: string }).currentValue\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * 判定会话是否允许执行首次默认自动审查切换:\n * - 已有对话内容的会话(`blank === false`)不改;\n * - 子代理会话(`origin === 'subagent'`)不改;\n * - 其余空白新建会话(以及未提供 blank 元数据的轻量测试桩)允许首次切换。\n */\nexport function isAutoSwitchEligible(id: string, live: any, sessions?: any): boolean {\n try {\n if (live?.getSnapshot?.()?.blank === false) return false\n const summary = sessions?.list?.getSnapshot?.()?.byId?.[id]\n if (summary?.blank === false) return false\n if (summary?.origin === 'subagent') return false\n } catch {\n // 忽略元数据读取异常\n }\n return true\n}\n\nfunction loadHandledIds(doc: Document): Set<string> {\n const set = new Set<string>()\n try {\n const storage = (doc as any)?.defaultView?.localStorage\n const raw = storage?.getItem?.(HANDLED_STORAGE_KEY)\n if (typeof raw === 'string' && raw) {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n for (const item of parsed) {\n if (typeof item === 'string' && item) set.add(item)\n }\n }\n }\n } catch {\n // localStorage 不可用时仅在内存保存\n }\n return set\n}\n\nfunction saveHandledIds(doc: Document, set: Set<string>): void {\n try {\n const storage = (doc as any)?.defaultView?.localStorage\n if (!storage?.setItem) return\n const items = [...set].slice(-MAX_HANDLED_IDS)\n storage.setItem(HANDLED_STORAGE_KEY, JSON.stringify(items))\n } catch {\n // 忽略写入异常\n }\n}\n\n/**\n * 把「完全权限」选项从当前文档里摘掉:原生 select 的 option、弹出\n * 选择器(role=listbox)与菜单(role=menu)里的 option/menuitem。\n * @returns 摘掉的个数\n */\nexport function pruneFullAccess(doc: Document): number {\n let removed = 0\n for (const option of doc.querySelectorAll('option')) {\n if (isFullAccessLabel(option.textContent)) {\n option.remove()\n removed++\n }\n }\n for (const item of doc.querySelectorAll('[role=\"listbox\"] [role=\"option\"], [role=\"menu\"] [role=\"menuitem\"]')) {\n if (isFullAccessLabel(item.textContent)) {\n item.remove()\n removed++\n }\n }\n return removed\n}\n\nexport interface PolicyTimers {\n setInterval?: (fn: () => void, ms: number) => number\n clearInterval?: (id: number) => void\n setTimeout: (fn: () => void, ms: number) => number\n clearTimeout: (id: number) => void\n}\n\nconst defaultTimers: Required<PolicyTimers> = {\n setInterval: (fn, ms) => setInterval(fn, ms) as unknown as number,\n clearInterval: (id) => clearInterval(id),\n setTimeout: (fn, ms) => setTimeout(fn, ms) as unknown as number,\n clearTimeout: (id) => clearTimeout(id),\n}\n\n/**\n * 安装权限策略:\n * 1. 观察 DOM、摘掉「完全权限」选项;\n * 2. 观察/轮询空白新建会话,首次见到时自动切到 `auto`(自动审查)。\n * @returns 卸载函数\n */\nexport function installPermissionPolicy(\n doc: Document,\n getSessions?: () => any,\n timers: PolicyTimers = defaultTimers,\n): () => void {\n let disposed = false\n let scanTimer = 0\n const setTimerInterval = timers.setInterval ?? defaultTimers.setInterval\n const clearTimerInterval = timers.clearInterval ?? defaultTimers.clearInterval\n const scheduleScan = (): void => {\n if (disposed || scanTimer) return\n scanTimer = timers.setTimeout(() => {\n scanTimer = 0\n if (!disposed) pruneFullAccess(doc)\n }, 120)\n }\n const observer = new MutationObserver(scheduleScan)\n if (doc.body) observer.observe(doc.body, { childList: true, subtree: true })\n pruneFullAccess(doc)\n\n const handled = loadHandledIds(doc)\n const inFlight = new Set<string>()\n const projectionUnsubs = new Map<string, () => void>()\n let listUnsub: (() => void) | undefined\n\n const markHandled = (id: string): void => {\n if (!handled.has(id)) {\n handled.add(id)\n saveHandledIds(doc, handled)\n }\n const unsub = projectionUnsubs.get(id)\n if (unsub) {\n projectionUnsubs.delete(id)\n try { unsub() } catch { /* ignore */ }\n }\n }\n\n const watchProjection = (id: string, live: any): void => {\n if (projectionUnsubs.has(id) || handled.has(id)) return\n const face = live?.projections?.faceOf?.('permissions')\n if (typeof face?.subscribe !== 'function') return\n try {\n const unsub = face.subscribe(() => {\n if (!disposed) void tick()\n })\n if (typeof unsub === 'function') projectionUnsubs.set(id, unsub)\n } catch {\n // ignore\n }\n }\n\n const tick = async (): Promise<void> => {\n if (disposed || typeof getSessions !== 'function') return\n let sessions: any\n try {\n sessions = getSessions()\n } catch {\n return\n }\n if (!listUnsub && typeof sessions?.list?.subscribe === 'function') {\n try {\n listUnsub = sessions.list.subscribe(() => {\n if (!disposed) void tick()\n })\n } catch {\n // ignore\n }\n }\n for (const { id, live } of liveSessions(sessions)) {\n if (handled.has(id) || inFlight.has(id)) continue\n if (!isAutoSwitchEligible(id, live, sessions)) {\n markHandled(id)\n continue\n }\n const preset = currentPreset(live)\n if (!shouldAutoSwitch(preset, handled.has(id))) {\n if (preset !== undefined && preset !== null) {\n markHandled(id)\n } else {\n watchProjection(id, live)\n }\n continue\n }\n markHandled(id)\n if (typeof live?.command !== 'function') continue\n inFlight.add(id)\n try {\n const result = await live.command(`/permission ${AUTO_REVIEW_PRESET}`)\n if (!result?.ok) {\n console.info('[dsh-better-chat] auto review not applied for session', id, result?.error?.code ?? '')\n }\n } catch {\n console.info('[dsh-better-chat] auto review switch failed for session', id)\n } finally {\n inFlight.delete(id)\n }\n }\n }\n\n const intervalId = typeof getSessions === 'function' ? setTimerInterval(() => { void tick() }, 2500) : 0\n if (typeof getSessions === 'function') void tick()\n\n return () => {\n disposed = true\n observer.disconnect()\n if (scanTimer) timers.clearTimeout(scanTimer)\n if (intervalId) clearTimerInterval(intervalId)\n if (listUnsub) {\n try { listUnsub() } catch { /* ignore */ }\n listUnsub = undefined\n }\n for (const unsub of projectionUnsubs.values()) {\n try { unsub() } catch { /* ignore */ }\n }\n projectionUnsubs.clear()\n }\n}\n","/**\n * 功能三:插件商店「更新」按钮。\n *\n * DSH 只给官方插件原地更新;从自定义索引装的插件在发现页只有「有新版本」\n * 标签、没有按钮。这里补一个真按钮:数据与动作都走宿主自己的远程服务\n * ——pluginMarket 查索引和安装状态,pluginManager.installBundle 按索引\n * 给出的精确 spec 覆盖安装——与官方安装流程同一套接口,不模拟点击、\n * 不动官方状态。\n *\n * 服务经子插件声明 inject 取用:主插件保持自己的 inject,商店功能不\n * 依赖这些服务;未启用实验性插件索引时子插件不生效,本功能静默关闭。\n */\n\nconst UPDATE_LABELS = ['有新版本', 'Update available']\n\nexport interface StoreUpdate {\n name: string\n title: string\n installedVersion: string\n version: string\n spec: string\n registry?: string\n}\n\n/** 索引条目的本地化标题在当前语言下的文本(与发现页行内展示一致)。 */\nexport function localizedTitle(title: unknown, lang: string): string {\n if (typeof title === 'string') return title\n if (!title || typeof title !== 'object') return ''\n const record = title as Record<string, unknown>\n const chain = [lang, lang && lang.split('-')[0], 'zh-CN', 'en']\n for (const key of chain) {\n if (key && typeof record[key] === 'string' && record[key]) return record[key] as string\n }\n const values = Object.values(record)\n return typeof values[0] === 'string' ? (values[0] as string) : ''\n}\n\n/** 从各索引的搜索结果里挑出「有新版本」的条目,整理成可执行的更新计划。 */\nexport function pickUpdates(searchResults: any[], lang: string): StoreUpdate[] {\n const updates: StoreUpdate[] = []\n for (const result of searchResults ?? []) {\n const entries = result?.value?.entries ?? result?.entries ?? []\n for (const entry of entries as any[]) {\n if (entry?.installation?.status !== 'update-available') continue\n const versions = entry.versions ?? []\n const version = versions.find((candidate: any) => candidate.version === entry.defaultVersion) ?? versions[0]\n const spec = version?.install?.spec\n if (!entry.name || !version?.version || !spec) continue\n updates.push({\n name: entry.name,\n title: localizedTitle(entry.title, lang) || entry.name,\n installedVersion: entry.installation.installedVersion ?? '',\n version: version.version,\n spec,\n registry: version.install.registry,\n })\n }\n }\n return updates\n}\n\n/** 执行一次更新:按索引 spec 覆盖安装,宿主结果信封原样返回。 */\nexport async function runUpdate(remote: any, update: StoreUpdate, makeRequestId?: () => string | undefined): Promise<any> {\n const requestId = makeRequestId ? makeRequestId() : 'better-chat-update-' + Date.now()\n return remote.pluginManager.installBundle(update.spec, {\n enabled: true,\n requestId,\n ...(update.registry ? { registry: update.registry } : {}),\n })\n}\n\n/**\n * 发现页里某个插件的行:状态标签本身是个按钮,从它向上找第一个\n * 同时包含插件标题、且文本总量还像一行的祖先。\n */\nexport function findUpdateRow(doc: Document, title: string): Element | null {\n for (const element of doc.querySelectorAll('button')) {\n if (!UPDATE_LABELS.includes(element.textContent?.trim() ?? '')) continue\n let node: Element | null = element\n for (let depth = 0; depth < 6 && node; depth++) {\n node = node.parentElement\n if (node && node.textContent?.includes(title) && node.textContent.length < 600) return node\n }\n }\n return null\n}\n\n/** 更新按钮的点击处理:确认 → 调宿主覆盖安装 → 按结果改按钮文案。 */\nexport function makeUpdateClickHandler(\n doc: Document,\n getRemote: () => any,\n update: StoreUpdate,\n button: HTMLButtonElement,\n): (event?: Event) => Promise<void> {\n return async (event?: Event): Promise<void> => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n const view = doc.defaultView as (Window & typeof globalThis) | null\n const ask = view?.confirm ?? (globalThis as any).confirm\n const message = '更新「' + update.title + '」'\n + (update.installedVersion ? ' ' + update.installedVersion : '')\n + ' → ' + update.version + '?\\n会直接覆盖安装新版,插件数据保留。'\n if (ask && !ask.call(view ?? globalThis, message)) return\n button.disabled = true\n button.textContent = '更新中…'\n try {\n const result = await runUpdate(getRemote(), update, () => (globalThis as any).crypto?.randomUUID?.() ?? undefined)\n if (result?.value?.application === 'applied') {\n button.textContent = '已更新,重启 DSH 后生效'\n } else {\n console.error('[dsh-better-chat] update failed for', update.name, result?.value?.error ?? result)\n button.disabled = false\n button.textContent = '更新失败,点此重试'\n }\n } catch (error) {\n console.error('[dsh-better-chat] update failed for', update.name, error)\n button.disabled = false\n button.textContent = '更新失败,点此重试'\n }\n }\n}\n\nexport interface StoreTimers {\n setInterval: (fn: () => void, ms: number) => number\n clearInterval: (id: number) => void\n}\n\n/** 发现页增强:轮询索引状态,把「更新」按钮挂到有新版本的行上。 */\nexport function installStoreUpdateButtons(\n doc: Document,\n getRemote: () => any,\n timers: StoreTimers = {\n setInterval: (fn, ms) => setInterval(fn, ms) as unknown as number,\n clearInterval: (id) => clearInterval(id),\n },\n): () => void {\n let disposed = false\n let updates: StoreUpdate[] = []\n const decorate = (): void => {\n for (const update of updates) {\n const row = findUpdateRow(doc, update.title)\n if (!row || row.querySelector('[data-better-chat-update]')) continue\n const button = doc.createElement('button')\n button.type = 'button'\n button.setAttribute('data-better-chat-update', update.name)\n button.textContent = '更新到 ' + update.version\n button.style.cssText = 'flex:none;margin-left:8px;padding:2px 10px;border:1px solid #7f7f7f55;border-radius:999px;background:transparent;color:inherit;font-size:12px;cursor:pointer'\n button.addEventListener('click', makeUpdateClickHandler(doc, getRemote, update, button))\n row.appendChild(button)\n }\n }\n const refresh = async (): Promise<void> => {\n try {\n const remote = getRemote()\n if (!remote?.pluginMarket || !remote?.pluginManager) return\n const indexes = await remote.pluginMarket.listIndexes()\n const urls = (indexes?.value ?? indexes ?? []).map((entry: any) => entry?.url).filter(Boolean)\n const results: any[] = []\n for (const url of urls) {\n results.push(await remote.pluginMarket.search(url, { sort: { kind: 'index' }, offset: 0, limit: 100 }))\n }\n if (disposed) return\n updates = pickUpdates(results, doc.documentElement?.lang || 'zh-CN')\n decorate()\n } catch {\n // 索引服务不可用(未启用实验性插件索引等):静默关闭本功能。\n }\n }\n const observer = new MutationObserver(() => decorate())\n observer.observe(doc.documentElement, { childList: true, subtree: true })\n const timer = timers.setInterval(() => { void refresh() }, 30000)\n void refresh()\n return () => {\n disposed = true\n observer.disconnect()\n timers.clearInterval(timer)\n }\n}\n\n/** 商店更新子插件:单独声明远程服务 inject,与主功能互相隔离。 */\nexport const storeUpdatePlugin = {\n name: 'dsh-better-chat-store-update',\n inject: ['remote', 'remote.pluginMarket', 'remote.pluginManager'],\n apply(childCtx: any): void {\n childCtx.effect(\n () => installStoreUpdateButtons(document, () => childCtx.remote),\n 'dsh-better-chat: store update buttons',\n )\n },\n}\n","//#region lib/types/file-address.js\n/**\n* The `dsh-resource://file/…` address grammar: how a file is named across the\n* Sidebar and the resource model, built and parsed without touching a\n* filesystem.\n* @module\n*/\n/** The scheme and type every file address opens with. */\nconst FILE_ADDRESS_PREFIX = \"dsh-resource://file/\";\n/** Component-encode one id or path segment, keeping `:` literal for drive letters. */\nfunction encodeSegment(segment) {\n\treturn encodeURIComponent(segment).replace(/%3A/gi, \":\");\n}\n/** Encode a `/`-separated path segment by segment. */\nfunction encodePath(path) {\n\treturn path.split(\"/\").map(encodeSegment).join(\"/\");\n}\n/** Whether a decoded first path segment is a Windows drive (`C:`). */\nfunction isDriveSegment(segment) {\n\treturn segment !== void 0 && /^[A-Za-z]:$/.test(segment);\n}\n/**\n* Build the address of a file read through one Session.\n* @param sessionId - the Session whose Host workspace resolves the path.\n* @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped.\n* @returns the `dsh-resource://file/session/<sessionId>/<path>` address.\n*/\nfunction sessionFileAddress(sessionId, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\").replace(/^(?:\\.\\/)+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}session/${encodeSegment(sessionId)}/${encodePath(normalized)}`;\n}\n/**\n* Build the address of a file by its absolute path.\n* @param path - absolute path; backslashes are normalized to `/` and the leading `/` is dropped,\n* except that a UNC path (`\\\\server\\share`) keeps one empty first segment.\n* @returns the `dsh-resource://file/absolute/<path>` address.\n*/\nfunction absoluteFileAddress(path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tconst unc = normalized.startsWith(\"//\");\n\tconst absolute = normalized.replace(/^\\/+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}absolute/${unc ? \"/\" : \"\"}${encodePath(absolute)}`;\n}\n/**\n* Read a file address back into its parts without resolving `.` or `..`.\n* Query and fragment suffixes are ignored; encoded path segments are decoded.\n* @param address - a candidate address.\n* @returns the parts, or `undefined` when the string is not a `dsh-resource://file/` URI in a known scope with a path, or a segment is not validly encoded.\n*/\nfunction parseFileAddress(address) {\n\ttry {\n\t\tif (!address.startsWith(FILE_ADDRESS_PREFIX)) return void 0;\n\t\tconst end = address.search(/[?#]/);\n\t\tconst [scope, ...rest] = address.slice(20, end === -1 ? void 0 : end).split(\"/\");\n\t\tif (scope === \"session\") {\n\t\t\tconst [id, ...segments] = rest;\n\t\t\tif (id === void 0 || id === \"\" || segments.length === 0) return void 0;\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tsessionId: decodeURIComponent(id),\n\t\t\t\tpath: segments.map(decodeURIComponent).join(\"/\")\n\t\t\t};\n\t\t}\n\t\tif (scope === \"absolute\") {\n\t\t\tconst unc = rest[0] === \"\" && rest.length > 1;\n\t\t\tconst segments = (unc ? rest.slice(1) : rest).map(decodeURIComponent);\n\t\t\tif (segments.length === 0 || segments[0] === \"\") return void 0;\n\t\t\tif (unc) return {\n\t\t\t\tscope,\n\t\t\t\tpath: `//${segments.join(\"/\")}`\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tpath: isDriveSegment(segments[0]) ? segments.join(\"/\") : `/${segments.join(\"/\")}`\n\t\t\t};\n\t\t}\n\t\treturn;\n\t} catch {\n\t\treturn;\n\t}\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Browser-safe Workspace path and display helpers.\n* @module @deepseek-ai/dsh-util-workspace-path\n*/\n/** Whether a path uses a Windows drive or UNC prefix. */\nfunction isWindowsStylePath(value) {\n\treturn /^[A-Za-z]:[/\\\\]/.test(value) || value.startsWith(\"\\\\\\\\\");\n}\n/**\n* Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC.\n* @param path - the path to classify.\n* @returns `true` for an absolute path; `false` for a Workspace-relative one.\n*/\nfunction isAbsoluteWorkspacePath(path) {\n\treturn path.startsWith(\"/\") || isWindowsStylePath(path);\n}\n/**\n* Resolve a Workspace-relative path into the Host-facing spelling used by path operations.\n* @param cwd - Session Workspace root, when known.\n* @param path - Absolute or Workspace-relative path.\n* @returns an absolute path when a Workspace root is available, otherwise the original path.\n*/\nfunction resolveWorkspacePath(cwd, path) {\n\tif (isAbsoluteWorkspacePath(path)) return path;\n\tif (cwd === void 0 || cwd === \"\") return path;\n\tconst separator = isWindowsStylePath(cwd) && cwd.includes(\"\\\\\") ? \"\\\\\" : \"/\";\n\treturn `${cwd.replace(/[/\\\\]+$/, \"\")}${separator}${path.replace(/^[/\\\\]+/, \"\")}`;\n}\n/**\n* Abbreviate a POSIX home directory for display.\n* @param path - Absolute or already-short display path.\n* @param home - Host account home; absent skips abbreviation.\n* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.\n*/\nfunction abbreviateHomePath(path, home) {\n\tif (home === void 0 || home === \"\") return path;\n\tif (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;\n\tconst root = home.replace(/\\/+$/, \"\");\n\tif (root === \"\" || root === \"/\") return path;\n\tif (path.replace(/\\/+$/, \"\") === root) return \"~\";\n\tif (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;\n\treturn path;\n}\n/**\n* Read the final non-empty segment of a Workspace path for display.\n* Workspace-label surfaces use this helper instead of deriving another basename.\n* @param path - Workspace directory path using POSIX or Windows separators.\n* @returns the final segment, or an empty string for a separator-only path.\n*/\nfunction workspaceTitleOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tconst separator = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\"));\n\treturn trimmed.slice(separator + 1);\n}\n/**\n* Split a path for display: the directories through their last separator, and\n* the final segment after it. Both `/` and `\\` separate, so a Windows path\n* splits where its own segments end; trailing separators are dropped first, so\n* a directory path names its own last segment. A path with no separator, or a\n* separator-only path, is all name.\n* @param path - file or directory path using POSIX or Windows separators.\n* @returns the directory prefix (possibly empty) and the final segment.\n*/\nfunction pathPartsOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tif (trimmed === \"\") return {\n\t\tdirectory: \"\",\n\t\tname: path\n\t};\n\tconst cut = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\")) + 1;\n\treturn {\n\t\tdirectory: trimmed.slice(0, cut),\n\t\tname: trimmed.slice(cut)\n\t};\n}\n/**\n* The address for a path as a caller holds it: a relative path, or an absolute\n* path inside the Session's workspace, becomes a `session`-scoped address; an\n* absolute path outside it, or one whose workspace root is unknown, keeps its\n* absolute path in that Session's address.\n* @param sessionId - the Session the path is read in.\n* @param cwd - that Session's workspace root, when known.\n* @param path - absolute or workspace-relative path, in either separator spelling.\n* @returns the `dsh-resource://file/…` address.\n*/\nfunction fileAddressFor(sessionId, cwd, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tif (!isAbsoluteWorkspacePath(normalized)) return sessionFileAddress(sessionId, normalized);\n\tconst root = cwd === void 0 ? \"\" : cwd.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\");\n\tif (root !== \"\" && normalized === root) return sessionFileAddress(sessionId, \"\");\n\tif (root !== \"\" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1));\n\treturn sessionFileAddress(sessionId, normalized);\n}\n/**\n* Strip the workspace root from a workspace-rooted absolute path (display only).\n* @param text - the path to shorten.\n* @param cwd - session workspace root; absent or empty leaves the path unchanged.\n* @returns the path relative to the workspace root, or unchanged when it is not rooted there.\n*/\nfunction relativizeToCwd(text, cwd) {\n\tif (cwd === void 0 || cwd === \"\") return text;\n\tconst root = cwd.replace(/[/\\\\]+$/, \"\");\n\tif (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1);\n\treturn text;\n}\n/**\n* Address a decoded absolute file path through the authenticated file route.\n* @param base - HTTP(S) application base, including its deployment prefix, or `dsh-app://app/`.\n* @param path - Native file path; URL escapes in authored Markdown must already be decoded.\n* @returns File URL, or undefined for unsupported transports and non-absolute paths.\n*/\nfunction fileMediaUrl(base, path) {\n\tif (!/^https?:/u.test(base) && !base.startsWith(\"dsh-app://app/\") || !isAbsoluteWorkspacePath(path) || /^[/\\\\]{2}/u.test(path) || /[\\u0000-\\u001f\\u007f]/u.test(path)) return void 0;\n\treturn new URL(`api/file?path=${encodeURIComponent(path)}`, base).href;\n}\n//#endregion\nexport { abbreviateHomePath, absoluteFileAddress, fileAddressFor, fileMediaUrl, isAbsoluteWorkspacePath, parseFileAddress, pathPartsOf, relativizeToCwd, resolveWorkspacePath, sessionFileAddress, workspaceTitleOf };\n","/**\n * Which chat rows a `/rewind` withdrew, expressed as a pure function of the\n * chat snapshot.\n *\n * WHY THIS EXISTS. A rewind never deletes history: the host appends one\n * replacement `user/message` marker whose `surfaceOp` shadows everything after\n * the target, and the transcript must then read as it did *before* the target\n * was sent. The official ChatView is a per-node renderer, so the rewind plugin\n * (`dsh-rewind-plugin`) hides withdrawn rows by DOM: it computes the shadowed\n * anchor seqs from the command node and sets `display:none` on every element\n * carrying the official `data-chat-anchor-key` seat attribute.\n *\n * The Reader replaces ChatView's message list and renders its own row shapes\n * (turn sections, answer articles, tool rows), so it does not republish that\n * seat attribute on every row. DOM hiding therefore reaches only the user and\n * steering bubbles, and every other withdrawn row — the answer, the tool rows,\n * and the `/rewind` command row itself — stayed on screen. That is the reported\n * defect: the command is recorded as a rewind row instead of the Reader rolling\n * back to the state before the message was sent.\n *\n * The Reader decides visibility from React state, so it must apply the same\n * contract itself instead of waiting for a third-party MutationObserver. The\n * marker node is not admitted as a chat node (only append-origin surface events\n * become nodes), so the command node's `outcome.sourceEventSeq` — the marker's\n * log seq — plus the `@<seq>` target in its `args` are the only client-side\n * signal for the shadowed range. This mirrors the plugin's own reader of that\n * contract, and is pinned by `tests/rewind-cut.test.ts` so a plugin or host\n * change cannot silently regress it.\n *\n * @module dsh-better-display/rewind-cut\n */\n\n/** A chat-snapshot view node, read structurally (only the fields this module needs). */\nexport interface CutChatNode {\n readonly key: string;\n readonly kind?: string;\n readonly anchorSeq?: number;\n readonly visibility?: string;\n readonly data?: unknown;\n /**\n * Where the host placed the node in the session's location index. Only the\n * owning turn is read from it, and an absent or foreign location is fine.\n */\n readonly location?: unknown;\n}\n\n/** The minimal chat-snapshot reader the cut logic needs. */\nexport interface CutChat {\n readonly order: readonly string[];\n readonly nodes: {\n get(key: string): CutChatNode | undefined;\n };\n}\n\n/** One closed shadow range `[start, end]` in surface/anchor seq space. */\nexport interface CutSpan {\n readonly start: number;\n readonly end: number;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction safeSeq(value: unknown): number | undefined {\n return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 ? value : undefined;\n}\n\n/** The command payload of a `command` chat node, when it is structurally readable. */\nfunction commandOf(node: CutChatNode): Record<string, unknown> | undefined {\n if (node.kind !== 'command') return undefined;\n return asRecord(node.data);\n}\n\n/**\n * The engine names an executed rewind command node can carry. The plugin\n * registers its command as `rewind-plugin` (`ENGINE_COMMANDS = new\n * Set(['rewind-plugin', 'rewind'])` in dsh-rewind-plugin's\n * `src/client/hidden.ts`), and that is the name the client projection actually\n * publishes — the session log's `command/run.name` is not what the Reader sees.\n * `rewind` stays accepted because older logs and the bili-side proxy record the\n * shorter spelling.\n */\nconst REWIND_COMMANDS: ReadonlySet<string> = new Set(['rewind-plugin', 'rewind']);\n\n/** True when a command payload is the rewind engine command, in either spelling. */\nfunction isRewindCommand(command: Record<string, unknown>): boolean {\n return typeof command.name === 'string' && REWIND_COMMANDS.has(command.name);\n}\n\n/**\n * The render POSITION a row is anchored at: the view node's `anchorSeq`, else\n * its payload seq.\n *\n * This is deliberately NOT integer-only. The host anchors synthetic rows at\n * fractional offsets off a real seq (`CHAT_SYNTHETIC_SEQ_OFFSETS` in the\n * official ChatView: `turn-process` at `controlAnchorSeq - 0.1`, `turn-tail` at\n * `seq + 0.1`, an interrupted assistant step at `seq - 0.9`). An integer-only\n * read made those rows invisible to the cut, so the last `turn-process` of a\n * withdrawn turn survived on its own. Log seqs (marker, target) stay integer:\n * see `safeSeq`.\n */\nexport function anchorSeqOf(node: CutChatNode): number | undefined {\n const raw = node.anchorSeq ?? asRecord(node.data)?.seq;\n return typeof raw === 'number' && Number.isFinite(raw) && raw >= 0 ? raw : undefined;\n}\n\n/**\n * Extract the rewind target seq from a `/rewind` command's structured `args`\n * (e.g. `@5 chat`, `preview @5 both`). Locale-independent: it never parses the\n * host's human outcome copy.\n */\nexport function rewindTargetOfArgs(args: unknown): number | undefined {\n if (typeof args !== 'string') return undefined;\n const match = args.match(/@(\\d+)/);\n return match === null ? undefined : Number(match[1]);\n}\n\n/** True for the internal candidate-list probe (`/rewind __candidates`). */\nfunction isCandidateCommand(command: Record<string, unknown>): boolean {\n return typeof command.args === 'string' && command.args.includes('__candidates');\n}\n\n/** True for an impact preview (`/rewind preview @5 both`). */\nfunction isPreviewCommand(command: Record<string, unknown>): boolean {\n return typeof command.args === 'string' && command.args.includes('preview');\n}\n\n/**\n * Merge overlapping or touching shadow ranges.\n *\n * Spans are kept SEPARATE unless they genuinely overlap: collapsing every cut\n * to `[min target, max marker]` would hide a still-on-surface gap of new traffic\n * between an earlier marker and a later target.\n */\nexport function coalesceCutSpans(spans: readonly CutSpan[]): CutSpan[] {\n if (spans.length < 2) return [...spans];\n const sorted = [...spans].sort((left, right) => left.start - right.start || left.end - right.end);\n const merged: { start: number; end: number }[] = [];\n for (const span of sorted) {\n const last = merged.at(-1);\n if (last !== undefined && span.start <= last.end) {\n if (span.end > last.end) last.end = span.end;\n continue;\n }\n merged.push({ start: span.start, end: span.end });\n }\n return merged;\n}\n\n/**\n * True when a row anchored at `seq` falls inside one of the cut spans.\n *\n * A cut runs from the target seq through the marker's own log seq, inclusive\n * (`target <= anchorSeq && anchorSeq <= marker`), the same comparison\n * `dsh-rewind-plugin`'s `RewindVisibilityBuilder` uses. The upper bound stops\n * at the marker. Extending it to the next integer hides the following turn's\n * process row, which the host anchors at `startSeq - 0.1` and therefore in\n * `[marker, marker + 1)`. Fractional anchors inside the closed range still\n * match: `anchorSeqOf` keeps them. A process or tail row parked outside the\n * range is handled by `summaryTurns`, not by widening the cut. Spans stay\n * disjoint, so new traffic between two rewinds survives.\n */\nexport function cutContains(cuts: readonly CutSpan[], seq: number): boolean {\n let low = 0;\n let high = cuts.length - 1;\n let found = -1;\n while (low <= high) {\n const middle = (low + high) >> 1;\n const cut = cuts[middle];\n if (cut === undefined) return false;\n if (seq < cut.start) high = middle - 1;\n else {\n found = middle;\n low = middle + 1;\n }\n }\n const span = found < 0 ? undefined : cuts[found];\n return span !== undefined && seq <= span.end;\n}\n\n/** The turn id a node belongs to (absent outside a turn). */\nfunction turnIdOf(node: CutChatNode): unknown | undefined {\n // The location's own `kind` varies (`turn` for a turn's synthetic rows,\n // `step` for one of its messages); only the turn it carries matters here.\n const turn = asRecord(asRecord(node.location)?.turn);\n if (turn === undefined || !Object.hasOwn(turn, 'turn')) return undefined;\n return turn.turn;\n}\n\n/**\n * Node kinds that SUMMARIZE a turn instead of carrying its content, so the host\n * anchors them at the turn's edges rather than at an event inside it.\n */\nconst TURN_SUMMARY_KINDS: ReadonlySet<string> = new Set(['turn-process', 'turn-tail']);\n\n/**\n * True for a rewind command row the transcript should not keep.\n *\n * Probes (`preview`, `__candidates`) exist only to feed the popover. An\n * executed rewind — success plus a marker seq — is the command that performed\n * the cut, and the plugin hides that row even when its anchor sits outside\n * the numeric range. A failed or still-running command stays visible.\n */\nfunction commandHidden(node: CutChatNode): boolean {\n const command = commandOf(node);\n if (command === undefined || !isRewindCommand(command)) return false;\n if (isPreviewCommand(command) || isCandidateCommand(command)) return true;\n const outcome = asRecord(command.outcome);\n return outcome?.kind === 'success' && safeSeq(outcome.sourceEventSeq) !== undefined;\n}\n\n/** True when the row's own anchor falls in a cut, or the row is a rewind command to hide. */\nfunction anchorWithdrawn(node: CutChatNode, cuts: readonly CutSpan[]): boolean {\n if (commandHidden(node)) return true;\n const seq = anchorSeqOf(node);\n return seq !== undefined && cutContains(cuts, seq);\n}\n\n/**\n * Turns whose process and tail rows must leave.\n *\n * The host opens a turn before its user message is logged and anchors\n * `turn-process` at `controlAnchorSeq - 0.1`, below the first withdrawn\n * event, and `turn-tail` at `turn.end.seq + 0.1`, which can sit past the\n * marker. Containment therefore misses those two rows, and the transcript\n * kept announcing `执行过程 / 本轮已停止,已生成的内容仍保留。`\n *\n * A summary leaves only when every content row of its turn is already\n * withdrawn — the same rule as the plugin's `deriveTurnProcess`. One content\n * row before the target (a mid-turn steering rewind) keeps the summary and\n * that earlier message. A turn with no content rows is left alone.\n */\nfunction summaryTurns(chat: CutChat, cuts: readonly CutSpan[]): Set<unknown> {\n const stays = new Map<unknown, boolean>();\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node === undefined || TURN_SUMMARY_KINDS.has(node.kind ?? '')) continue;\n const id = turnIdOf(node);\n if (id === undefined) continue;\n const visible = node.visibility !== 'hidden' && !anchorWithdrawn(node, cuts);\n stays.set(id, (stays.get(id) ?? false) || visible);\n }\n const withdrawn = new Set<unknown>();\n for (const [id, visible] of stays) if (!visible) withdrawn.add(id);\n return withdrawn;\n}\n\n/** True when this row is a summary of a turn whose content is fully withdrawn. */\nfunction summaryWithdrawn(node: CutChatNode, summaries: ReadonlySet<unknown>): boolean {\n if (!TURN_SUMMARY_KINDS.has(node.kind ?? '')) return false;\n const id = turnIdOf(node);\n return id !== undefined && summaries.has(id);\n}\n\n/**\n * The shadow ranges a session's executed rewinds produced, newest state last.\n * An executed rewind cuts `[target, marker]` — the target itself is included,\n * because a rewind restores the state *before* that message was sent (its text\n * goes back to the composer).\n */\nexport function rewindCutSpans(chat: CutChat | undefined): CutSpan[] {\n if (chat === undefined) return [];\n const spans: CutSpan[] = [];\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node === undefined) continue;\n const command = commandOf(node);\n if (command === undefined || !isRewindCommand(command)) continue;\n // Probes never open a span, even when a later host stamps them with a\n // success marker. Matching them would roll the transcript back on preview.\n if (isPreviewCommand(command) || isCandidateCommand(command)) continue;\n const outcome = asRecord(command.outcome);\n if (outcome?.kind !== 'success') continue;\n const marker = safeSeq(outcome.sourceEventSeq);\n if (marker === undefined) continue;\n const target = rewindTargetOfArgs(command.args);\n if (target === undefined || target > marker) continue;\n spans.push({ start: target, end: marker });\n }\n return coalesceCutSpans(spans);\n}\n\n/**\n * The anchor seqs the Reader must not render: every withdrawn message (the\n * target, everything after it, and the unrendered marker), plus every `/rewind`\n * row that exists only to feed the popover — the candidate-list probe and each\n * impact preview. A SUCCESSFUL executed command row is covered by its own cut;\n * a failed or unsettled one stays visible as an ordinary command record.\n */\nexport function hiddenRewindSeqs(chat: CutChat | undefined): Set<number> {\n const hidden = new Set<number>();\n if (chat === undefined) return hidden;\n const cuts = rewindCutSpans(chat);\n const summaries = summaryTurns(chat, cuts);\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node === undefined) continue;\n if (!anchorWithdrawn(node, cuts) && !summaryWithdrawn(node, summaries)) continue;\n const seq = anchorSeqOf(node);\n if (seq !== undefined) hidden.add(seq);\n }\n return hidden;\n}\n\n/**\n * The chat keys the Reader should render, in snapshot order: withdrawn rows and\n * rows the host itself marked hidden are dropped, everything else keeps its\n * position. Returns the snapshot's own `order` array when nothing is filtered,\n * so React selectors see a stable reference.\n */\nexport function visibleChatKeys(chat: CutChat): readonly string[] {\n const cuts = rewindCutSpans(chat);\n const summaries = summaryTurns(chat, cuts);\n const visible: string[] = [];\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node === undefined) continue;\n if (node.visibility === 'hidden') continue;\n if (anchorWithdrawn(node, cuts) || summaryWithdrawn(node, summaries)) continue;\n visible.push(key);\n }\n return visible.length === chat.order.length ? chat.order : visible;\n}\n\n/**\n * A comparable signal for the visible row set, built for\n * `useSyncExternalStore`-style subscription: the host re-runs a chat selector\n * on every publish and compares the RESULT by `Object.is`, and a rewind\n * publishes an in-place upsert of an existing command row. The snapshot's\n * `order` array and node store are therefore both reference-stable across a\n * rewind, so a selector on them never re-renders; a string does change exactly\n * when the visible set does. Never return the array itself from a selector —\n * a fresh array fails the `Object.is` check on every publish.\n */\nexport function visibleChatSignature(chat: CutChat): string {\n return visibleChatKeys(chat).join('\\u0000');\n}\n","import type { AssistantBlock, ToolCallBlock, TurnLocation } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { ChatConversationViewNode } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { ReaderGroup } from './projection.js';\nimport { anchorSeqOf, cutContains, rewindCutSpans, type CutChatNode } from './rewind-cut.js';\n\nexport type ToolDraft = Extract<AssistantBlock, { kind: 'tool-call' }>;\nexport type ToolPhase = 'preparing' | 'running' | 'returned' | 'succeeded' | 'failed' | 'interrupted';\nexport type ToolCategory = 'write' | 'read' | 'terminal' | 'search' | 'web' | 'code' | 'other';\nexport interface ToolActivityEntry {\n kind: 'tool'; key: string; callId: string; step: number; order: number;\n draft?: ToolDraft; block?: ToolCallBlock;\n}\nexport type ReaderFlowEntry = ToolActivityEntry | { kind: 'node'; key: string; nodeKey: string; order: number };\n\n/**\n * callId of a tool-call chat node. Drafts for a call whose node was cut must\n * not be reintroduced after `group.keys` has already dropped that node.\n */\nfunction toolCallId(node: ChatConversationViewNode): string | undefined {\n const callId = (node.data as { root?: { callId?: unknown } } | null)?.root?.callId;\n return typeof callId === 'string' && callId.length > 0 ? callId : undefined;\n}\n\n/** callIds whose tool-call node sits inside a rewind cut. */\nfunction cutToolCallIds(\n order: readonly string[],\n get: (key: string) => ChatConversationViewNode | undefined,\n spans: readonly { readonly start: number; readonly end: number }[],\n): Set<string> {\n const ids = new Set<string>();\n for (const key of order) {\n const node = get(key);\n if (node?.kind !== 'tool-call') continue;\n const seq = anchorSeqOf(node as CutChatNode);\n if (seq === undefined || !cutContains(spans, seq)) continue;\n const callId = toolCallId(node);\n if (callId !== undefined) ids.add(callId);\n }\n return ids;\n}\n\n/**\n * Public Step data includes tool-only model output before a chat node exists.\n *\n * `sourceOrder` is the unfiltered chat order. Drafts that belong to a cut step,\n * or to a call whose tool-call node was cut, are not put back. A draft that\n * still has no tool-call node, on a step outside the cut, stays — that is the\n * in-flight call the host has not published a node for yet.\n */\nexport function readerFlow(\n group: ReaderGroup,\n turn: TurnLocation | undefined,\n get: (key: string) => ChatConversationViewNode | undefined,\n sourceOrder?: readonly string[],\n): ReaderFlowEntry[] {\n const flow: ReaderFlowEntry[] = [];\n const calls = new Map<string, ToolActivityEntry>();\n const assistantOrder = new Map<number, number>();\n const spans = sourceOrder === undefined ? [] : rewindCutSpans({ order: sourceOrder, nodes: { get } });\n const cutCalls = spans.length === 0 || sourceOrder === undefined ? undefined : cutToolCallIds(sourceOrder, get, spans);\n for (const key of group.keys) {\n const node = get(key);\n if (!node || node.visibility === 'hidden') continue;\n const step = node.location.kind === 'step' ? node.location.step.step : 0;\n if (node.kind === 'tool-call') {\n const block = (node.data as { root: ToolCallBlock }).root;\n calls.set(block.callId, { kind: 'tool', key: `reader-tool:${block.callId}`, callId: block.callId, step, block, order: node.anchorSeq });\n } else {\n flow.push({ kind: 'node', key, nodeKey: key, order: node.anchorSeq });\n if (node.kind === 'assistant-step') assistantOrder.set(step, node.anchorSeq);\n }\n }\n for (const step of turn?.steps ?? []) {\n const data = step.data.get('assistant-step');\n const stepSeq = step.start?.seq;\n const stepCut = typeof stepSeq === 'number' && spans.length > 0 && cutContains(spans, stepSeq);\n let index = 0;\n for (const draft of data?.blocks ?? []) {\n if (draft.kind !== 'tool-call' || !draft.callId) continue;\n const previous = calls.get(draft.callId);\n // A visible tool row still receives its draft. A new row is the streaming\n // case — unless this step, or this call's tool-call node, was cut.\n if (!previous && (stepCut || cutCalls?.has(draft.callId) === true)) continue;\n calls.set(draft.callId, previous ? { ...previous, draft } : {\n kind: 'tool', key: `reader-tool:${draft.callId}`, callId: draft.callId, step: step.step, draft,\n order: (assistantOrder.get(step.step) ?? step.start?.seq ?? 0) + .01 + index++ / 10000,\n });\n }\n }\n flow.push(...calls.values());\n return flow.sort((left, right) => left.order - right.order);\n}\n\nexport function objectValue(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : null;\n}\nexport function stringValue(record: Record<string, unknown> | null, ...keys: string[]): string | undefined {\n for (const key of keys) if (typeof record?.[key] === 'string' && record[key]) return record[key] as string;\n return undefined;\n}\n\n/** Top-level fields from complete or in-flight JSON tool arguments. */\ntype ParsedInputFields =\n | { kind: 'complete'; fields: Record<string, unknown> }\n | { kind: 'partial'; fields: Record<string, unknown> };\n\n/** Read only top-level JSON string values, including an unfinished final string.\n * This never executes input or mistakes escaped/nested content for a path field. */\nfunction parseInputFields(raw: string): ParsedInputFields {\n try { return { kind: 'complete', fields: objectValue(JSON.parse(raw)) ?? {} }; } catch { /* an in-flight argument is normally incomplete */ }\n const fields: Record<string, unknown> = Object.create(null);\n const prefix = raw.slice(0, 262144);\n let depth = 0;\n let key: string | undefined;\n for (let index = 0; index < prefix.length; index++) {\n const char = prefix[index];\n if (char === '{' || char === '[') { depth++; continue; }\n if (char === '}' || char === ']') { depth--; continue; }\n if (char !== '\"') continue;\n const start = index;\n let closed = false;\n for (index++; index < prefix.length; index++) {\n if (prefix[index] === '\\\\') { index++; continue; }\n if (prefix[index] === '\"') { closed = true; break; }\n }\n if (depth !== 1) continue;\n const token = prefix.slice(start, closed ? index + 1 : prefix.length);\n let value: string;\n try { value = JSON.parse(token); } catch {\n if (closed) continue;\n // Strip only an unfinished trailing escape/unicode escape, not content.\n let body = token.slice(1);\n const unicode = /(?<!\\\\)(?:\\\\\\\\)*\\\\u[\\da-f]{0,3}$/i.exec(body);\n if (unicode) body = body.slice(0, unicode.index) + unicode[0].replace(/\\\\u[\\da-f]{0,3}$/i, '');\n let slashes = 0; for (let end = body.length - 1; end >= 0 && body[end] === '\\\\'; end--) slashes++;\n if (slashes % 2) body = body.slice(0, -1);\n try { value = JSON.parse(`\"${body}\"`); } catch { continue; }\n }\n if (closed && /^\\s*:/.test(prefix.slice(index + 1))) key = value;\n else if (key !== undefined) { fields[key] = value; key = undefined; }\n }\n return { kind: 'partial', fields };\n}\n\nexport function inputFields(raw: string): Record<string, unknown> {\n return parseInputFields(raw).fields;\n}\n\n/** Name and raw arguments of any call block, whether it has landed or is pending. */\nexport function toolIdentity(entry: Pick<ToolActivityEntry, 'block' | 'draft'>) {\n const block = entry.block;\n return {\n name: block ? 'kind' in block ? block.call?.name ?? entry.draft?.name ?? '工具调用' : block.name : entry.draft?.name ?? '工具调用',\n raw: block ? 'kind' in block ? block.call?.argsRaw ?? entry.draft?.argsRaw ?? '' : ('argsRaw' in block ? block.argsRaw : entry.draft?.argsRaw ?? '') : entry.draft?.argsRaw ?? '',\n };\n}\n\n/** Name and raw arguments of any call block, whether it has landed or is pending. */\nfunction childIdentity(block: ToolCallBlock): { name?: string; raw: string } {\n if (!block || !('kind' in block)) return { name: block?.name, raw: block && 'argsRaw' in block ? block.argsRaw : '' };\n return { name: block.call?.name, raw: block.call?.argsRaw ?? '' };\n}\n\nexport function executionFacts(block: ToolCallBlock | undefined): { exitCode?: number; signal?: string } {\n if (!block || !('kind' in block)) return {};\n const meta = objectValue(block.meta);\n const code = meta?.exitCode ?? meta?.exit_code;\n const text = block.content.length === 1 && block.content[0]?.type === 'text' ? block.content[0].text : '';\n const exit = /\\n\\[exit code: (\\d+)\\]$/.exec(text);\n const signal = /\\n\\[killed by signal: ([^\\]\\n]+)\\]$/.exec(text);\n const parsedCode = exit?.[1] === undefined ? undefined : Number(exit[1]);\n return {\n exitCode: typeof code === 'number' && Number.isFinite(code) ? code : parsedCode,\n signal: stringValue(meta, 'signal') ?? signal?.[1],\n };\n}\n\n/** Line counts of one text side; a trailing newline does not start a line. */\nfunction lineCount(text: string | null): number {\n if (text === null) return 0;\n const body = text.endsWith('\\n') ? text.slice(0, -1) : text;\n return body === '' ? 0 : body.split('\\n').length;\n}\n\n/** Argument fields that carry the text a call is about to write. */\nconst NEW_TEXT_FIELDS = ['content', 'new_string', 'new_str', 'newText', 'file_text'] as const;\n/** Argument fields that carry the text a call is about to replace. */\nconst OLD_TEXT_FIELDS = ['old_string', 'old_str', 'oldText'] as const;\n\n/**\n * Added/removed line counts for a mutation call, or null when there is no diff\n * to show.\n *\n * The result metadata is preferred when the host attaches one. Not every host\n * build does — a session log may carry no hunk payload at all — so the call's own\n * arguments are read as the fallback, which is also what the official row uses\n * while a write is still pending. A call whose arguments hold none of these\n * fields (a read, a listing) yields null and shows no badge.\n */\n/**\n * One changed file, in the exact shape the official `DiffBlock` primitive takes:\n * `oldText` is null for a pure insertion, and `newText` is always a string. Line\n * counts are derived from these two sides, never stored alongside them.\n */\nexport interface DiffHunk {\n path: string;\n oldText: string | null;\n newText: string;\n}\n\n/** Argument fields that name the file a mutation call targets. */\nconst PATH_FIELDS = ['file_path', 'path', 'filePath'] as const;\n\nfunction firstString(source: Record<string, unknown> | undefined, fields: readonly string[]): string | null {\n if (!source) return null;\n for (const field of fields) {\n const value = source[field];\n if (typeof value === 'string' && value !== '') return value;\n }\n return null;\n}\n\n/**\n * The changed files of a mutation call.\n *\n * Result metadata is preferred when the host attaches it. Not every host build\n * does, so the call's own arguments are the fallback — the same source the\n * official row reads while a write is still pending. A call whose arguments hold\n * none of these fields (a read, a listing) yields nothing and shows no counts.\n */\n/** Only these tools change a file, so only these may fall back to their arguments. */\nexport const DIFF_FALLBACK_TOOLS = ['write', 'edit', 'str_replace_editor'] as const;\nconst MUTATION_TOOLS = new Set<string>(DIFF_FALLBACK_TOOLS);\n\nexport function callDiffHunks(\n block: ToolCallBlock | undefined,\n args?: Record<string, unknown>,\n name?: string,\n): DiffHunk[] {\n // A parent call owns whatever its children changed: a script that writes files\n // reports those writes itself rather than through its own arguments, and the\n // digest must see them too. Without this the counts only ever appeared on the\n // nested row, which is what a reader noticed as a missing badge.\n // Each child contributes through its own arguments, not the parent's: a nested\n // write/edit records its hunks in `argsRaw`, and passing nothing here silently\n // dropped them from the parent total. Errors are contained so one unreadable\n // child cannot blank the whole row.\n const nested = block && 'kind' in block && Array.isArray(block.subCalls)\n ? block.subCalls.flatMap(child => {\n try { return callDiffHunks(child, inputFields(childIdentity(child).raw), childIdentity(child).name); }\n catch { return []; }\n })\n : [];\n if (block && 'kind' in block) {\n const diffs = objectValue(block.meta)?.diffs;\n if (Array.isArray(diffs) && diffs.length > 0) {\n const hunks: DiffHunk[] = [];\n for (const raw of diffs) {\n const entry = objectValue(raw);\n if (!entry) continue;\n const oldText = typeof entry.oldText === 'string' ? entry.oldText : null;\n const newText = typeof entry.newText === 'string' ? entry.newText : '';\n if (!lineCount(newText) && !lineCount(oldText)) continue;\n hunks.push({ path: firstString(entry, PATH_FIELDS) ?? '', oldText, newText });\n }\n if (hunks.length) return [...hunks, ...nested];\n }\n }\n // Several unrelated tools take a field named `content` (a memory note, a typed\n // message). Reading it as a file body invented counts for calls that changed no\n // file at all, so the name decides whether arguments may be read this way.\n if (!name || !MUTATION_TOOLS.has(name)) return nested;\n const path = firstString(args, PATH_FIELDS);\n if (!path) return nested;\n const oldText = firstString(args, OLD_TEXT_FIELDS);\n const newText = firstString(args, NEW_TEXT_FIELDS) ?? '';\n if (!lineCount(newText) && !lineCount(oldText)) return nested;\n return [{ path, oldText, newText }, ...nested];\n}\n\n/** Added/removed line counts for one call, or null when there is nothing to show. */\nexport function diffTotals(\n block: ToolCallBlock | undefined,\n args?: Record<string, unknown>,\n name?: string,\n): { added: number; removed: number } | null {\n const hunks = callDiffHunks(block, args, name);\n if (!hunks.length) return null;\n return diffLineTotals(hunks);\n}\n\n/** Counts the lines on each side, under the same rule the official block uses. */\nexport function diffLineTotals(hunks: readonly DiffHunk[]): { added: number; removed: number } {\n return hunks.reduce((total, hunk) => ({\n added: total.added + lineCount(hunk.newText),\n removed: total.removed + lineCount(hunk.oldText),\n }), { added: 0, removed: 0 });\n}\n\n/** Every changed file across a folded run of steps, in the order they ran. */\nexport function foldDiffHunks(steps: readonly { kind: string; entry?: ToolActivityEntry }[]): DiffHunk[] {\n const hunks: DiffHunk[] = [];\n for (const step of steps) {\n if (step.kind !== 'tool' || !step.entry) continue;\n const model = activitySummary(step.entry);\n hunks.push(...callDiffHunks(step.entry.block, model.args, model.name));\n }\n return hunks;\n}\n\nexport function activityPhase(entry: Pick<ToolActivityEntry, 'block' | 'draft'>, turnClosed = false): ToolPhase {\n if (!entry.block) return turnClosed ? 'interrupted' : 'preparing';\n if (!('kind' in entry.block)) return turnClosed ? 'interrupted' : entry.block.phase === 'preparing' ? 'preparing' : 'running';\n // RC1 publishes canonical cancellation as an error result with a typed code.\n if (entry.block.error?.code === 'ABORTED' || entry.block.error?.code === 'interrupted') return 'interrupted';\n const facts = executionFacts(entry.block);\n if (entry.block.isError || facts.signal || (facts.exitCode !== undefined && facts.exitCode !== 0)\n || entry.block.subCalls.some(block => activityPhase({ block }, turnClosed) === 'failed')) return 'failed';\n if (facts.exitCode === 0) return 'succeeded';\n return 'returned';\n}\n\n/**\n * First-seen time for calls the host has not stamped yet. A draft that\n * precedes a landed call carries no timestamp, so without this memory the\n * running clock would restart at zero on every remount — e.g. switching to\n * another conversation and back while the call is still preparing. Keyed by\n * call id, dropped when the call leaves the running phases.\n */\nconst clockFirstSeen = new Map<string, number>();\nconst CLOCK_FIRST_SEEN_LIMIT = 512;\n\n/**\n * Session-stamped start of a call, or null while only a draft exists.\n * A settled result carries `callTime`, the paired tool/call event's time; a\n * still-running call head stamps the same instant in its own `time` field.\n */\nexport function callStartTime(entry: Pick<ToolActivityEntry, 'block'>): number | null {\n const block = entry.block;\n if (!block) return null;\n return 'kind' in block ? block.callTime : block.time;\n}\n\n/**\n * The instant a still-running call's elapsed clock counts from. The stamped\n * time wins so a remounted view keeps counting from the real start; an\n * un-stamped draft falls back to when this view first saw that call id, which\n * survives remounts for the same reason.\n */\nexport function runningClockBase(callId: string, block: ToolCallBlock | undefined, now = Date.now()): number {\n const stamped = callStartTime({ block });\n if (stamped != null) return stamped;\n const seen = clockFirstSeen.get(callId);\n if (seen !== undefined) return seen;\n if (clockFirstSeen.size >= CLOCK_FIRST_SEEN_LIMIT) clockFirstSeen.delete(clockFirstSeen.keys().next().value!);\n clockFirstSeen.set(callId, now);\n return now;\n}\n\n/** Forget a call's first-seen time once its clock is no longer live. */\nexport function forgetCallClock(callId: string): void {\n clockFirstSeen.delete(callId);\n}\n\nexport function activitySummary(entry: Pick<ToolActivityEntry, 'block' | 'draft'>) {\n const { name, raw } = toolIdentity(entry);\n const parsed = parseInputFields(raw);\n const args = parsed.fields;\n const target = stringValue(args, 'file_path', 'path', 'filename', 'filePath');\n const command = stringValue(args, 'command', 'cmd', 'script');\n const description = stringValue(args, 'description');\n const file = target?.split(/[/\\\\]/).at(-1);\n const category: ToolCategory = /^(write|edit|apply_patch|patch|str_replace_editor)$/.test(name) ? 'write'\n : /^(read|read_file)$/.test(name) ? 'read'\n : /^(bash|shell|terminal|terminal_send|exec_command|pwsh)$/.test(name) ? 'terminal'\n : /^(grep|glob|find|search)$/.test(name) ? 'search'\n : /^(web_search|web_fetch|web_open)$/.test(name) ? 'web'\n // Code interpreters: no file, no shell, no query — the call is a program.\n // Without this branch `run_code` fell through to `other`, which has no\n // renderer of its own, so its result text was emitted as ordinary prose\n // and stayed outside every fold.\n : /^(run_code|execute_code|code_interpreter|python|node|eval|repl)$/.test(name) ? 'code'\n : 'other';\n const title = category === 'write' ? `${name === 'write' ? '写入' : '修改'}${file ? ` ${file}` : name === 'apply_patch' ? '代码补丁' : '文件'}`\n : category === 'read' ? `读取${file ? ` ${file}` : '文件'}`\n : category === 'terminal' ? description || '运行命令'\n : category === 'search' ? name === 'glob' ? '查找文件' : '搜索内容'\n : category === 'web' ? name === 'web_search' ? '搜索网页' : '读取网页'\n : category === 'code' ? (description || '运行代码')\n : name;\n return { name, raw, args, argsState: parsed.kind, category, title, target: target ?? command ?? stringValue(args, 'query', 'pattern', 'url'), command,\n cwd: stringValue(args, 'workdir', 'cwd'), content: stringValue(args, 'content', 'new_string', 'newText', 'file_text') };\n}\n\nexport function preparingLabel(name: string): string {\n return /^(write|edit|apply_patch)$/.test(name) ? '正在生成文件内容' : /^(bash|shell|exec_command|pwsh)$/.test(name) ? '正在准备命令' : '正在准备工具输入';\n}\n","import type { TurnLocation } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { MarkdownFileMentions } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { ReaderFlowEntry } from './tool-activity.js';\nimport { inputFields, stringValue, toolIdentity } from './tool-activity.js';\n\ninterface ProducedEntry {\n readonly seq?: number;\n readonly path: string;\n}\n\ninterface DeliverablesData {\n readonly produced: readonly ProducedEntry[];\n}\n\n/** Extract standard filename without directory components. */\nexport function basename(path: string): string {\n const normalized = path.replace(/[/\\\\]+$/, '');\n const at = Math.max(normalized.lastIndexOf('/'), normalized.lastIndexOf('\\\\'));\n return at === -1 ? normalized : normalized.slice(at + 1);\n}\n\n/** Extract parent directory of a path (or '.' if top-level). */\nexport function dirname(path: string): string {\n const normalized = path.replace(/[/\\\\]+$/, '');\n const at = Math.max(normalized.lastIndexOf('/'), normalized.lastIndexOf('\\\\'));\n if (at === 0 || (at === 2 && /^[A-Za-z]:/.test(normalized))) return normalized.slice(0, at + 1);\n return at === -1 ? '.' : normalized.slice(0, at) || '.';\n}\n\n/**\n * The produced-files chip row waits for turn close. Live writes still\n * accumulate, but the row must not interrupt an in-progress process.\n */\nexport function showDeliverablesRow(status: 'open' | 'closed' | 'unknown', paths: readonly string[]): boolean {\n return status === 'closed' && paths.length > 0\n}\n\n/**\n * Extract all unique file paths produced/modified in one turn.\n * Respects official deliverables data when available, and falls back to\n * inspecting successful write/edit tool invocations in the turn flow.\n */\nexport function getTurnDeliverables(turn: TurnLocation | undefined, flow?: readonly ReaderFlowEntry[]): readonly string[] {\n const paths: string[] = [];\n const seen = new Set<string>();\n\n // 1. Check official deliverables turn data from @deepseek-ai/dsh-client-ui-deliverables\n const deliverables = (turn?.data as { get(key: string): unknown } | undefined)?.get('deliverables') as DeliverablesData | undefined;\n if (deliverables?.produced && Array.isArray(deliverables.produced)) {\n for (const item of deliverables.produced) {\n if (typeof item?.path === 'string' && item.path.trim().length > 0) {\n const clean = item.path.trim();\n if (!seen.has(clean)) {\n seen.add(clean);\n paths.push(clean);\n }\n }\n }\n }\n\n if (paths.length > 0) return paths;\n\n // 2. Fallback: inspect successful file modification tool calls in the flow\n if (flow) {\n for (const item of flow) {\n if (item.kind !== 'tool' || !item.block) continue;\n // Skip failed tool results\n if ('isError' in item.block && item.block.isError) continue;\n const { name, raw } = toolIdentity(item);\n const toolName = name !== '工具调用' ? name : ((item.block as unknown as { name?: string }).name || (item.block as unknown as { call?: { name?: string } }).call?.name);\n const toolRaw = raw || ((item.block as unknown as { argsRaw?: string }).argsRaw || (item.block as unknown as { call?: { argsRaw?: string } }).call?.argsRaw || '');\n if (toolName === 'write' || toolName === 'edit' || toolName === 'apply_patch') {\n const args = inputFields(toolRaw);\n const target = stringValue(args, 'file_path', 'path', 'filename', 'filePath');\n if (target && !seen.has(target)) {\n seen.add(target);\n paths.push(target);\n }\n } else if (toolName === 'str_replace_editor') {\n const args = inputFields(toolRaw);\n const cmd = stringValue(args, 'command');\n if (cmd === 'create' || cmd === 'str_replace' || cmd === 'insert') {\n const target = stringValue(args, 'path');\n if (target && !seen.has(target)) {\n seen.add(target);\n paths.push(target);\n }\n }\n }\n }\n }\n\n return paths;\n}\n\n/** The single produced path whose basename is exactly value, or undefined. */\nfunction onlyPathWithBasename(paths: readonly string[], value: string): string | undefined {\n const matches = paths.filter(path => basename(path) === value);\n return matches.length === 1 ? matches[0] : undefined;\n}\n\n/**\n * File-mention resolver: converts inline-code tokens matching produced paths\n * into clickable file references that open the corresponding file on the host.\n */\nexport function createProducedFileMentions(\n paths: readonly string[],\n openFile: (path: string) => void,\n): MarkdownFileMentions {\n return {\n resolve(value: string) {\n if (!value || value.includes('\\n')) return undefined;\n const clean = value.trim();\n const path = paths.includes(clean) ? clean : onlyPathWithBasename(paths, clean);\n if (path === undefined) return undefined;\n return {\n open: () => { openFile(path); },\n label: `打开 ${path}`,\n title: path,\n };\n },\n };\n}\n","/** Absolute paths accepted by both POSIX and Windows hosts. */\nexport function isAbsoluteWorkspacePath(path: string): boolean {\n return /^(?:\\/|[A-Za-z]:[/\\\\]|\\\\\\\\)/.test(path);\n}\n","const plugin = 'dsh-better-display';\nconst styles = new Map<string, string>();\n\n/** Retain injected CSS across host cleanup and restore it before Reader paints. */\nexport function ensureStyles(): void {\n if (typeof document === 'undefined') return;\n const live = new Set<string>();\n for (const tag of document.querySelectorAll<HTMLStyleElement>(`style[data-plugin=\"${plugin}\"][data-plugin-css]`)) {\n const id = tag.dataset.pluginCss;\n if (id === undefined) continue;\n styles.set(id, tag.textContent ?? '');\n live.add(id);\n }\n for (const [id, text] of styles) {\n if (live.has(id)) continue;\n const tag = document.createElement('style');\n tag.dataset.plugin = plugin;\n tag.dataset.pluginCss = id;\n tag.textContent = text;\n document.head.appendChild(tag);\n }\n}\n","/**\n * Core pure functions for SEP-1865 / MCP Apps integration.\n * Free of CSS module imports so it can be cleanly tested in Node test environments.\n */\n\nexport function getHostTheme(): 'dark' | 'light' {\n if (typeof document === 'undefined') return 'light';\n if (document.body?.hasAttribute('data-ds-dark-theme')) return 'dark';\n const colorScheme = document.documentElement?.style.colorScheme;\n if (colorScheme === 'dark' || colorScheme === 'light') return colorScheme;\n const dataTheme = document.documentElement?.getAttribute('data-theme') || document.body?.getAttribute('data-theme');\n if (dataTheme === 'dark' || dataTheme === 'light') return dataTheme;\n if (document.body?.classList.contains('dark') || document.documentElement?.classList.contains('dark')) return 'dark';\n return typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\n\nexport function getCssTokens(theme: 'dark' | 'light'): Record<string, string> {\n const isDark = theme === 'dark';\n return {\n '--background': isDark ? '#0f172a' : '#ffffff',\n '--card': isDark ? '#1e293b' : '#f8fafc',\n '--foreground': isDark ? '#f8fafc' : '#0f172a',\n '--muted-foreground': isDark ? '#94a3b8' : '#64748b',\n '--primary': '#2563eb',\n '--primary-foreground': '#ffffff',\n '--border': isDark ? '#334155' : '#e2e8f0',\n '--hover': isDark ? 'rgba(148, 163, 184, 0.15)' : 'rgba(148, 163, 184, 0.12)',\n };\n}\n\n/**\n * Extracts a title from the HTML document's <title> tag.\n */\nexport function extractHtmlTitle(html: string): string | undefined {\n const match = /<title[^>]*>([^<]+)<\\/title>/i.exec(html);\n return match?.[1]?.trim();\n}\n\n/**\n * Normalizes user/model generated HTML to ensure a valid HTML5 structure\n * and embeds a dynamic theme listener so dark/light mode switches take effect immediately.\n */\nexport function ensureHtmlDocument(rawHtml: string, initialTheme: 'dark' | 'light' = 'light'): string {\n const isDark = initialTheme === 'dark';\n const trimmed = rawHtml.trim();\n\n const themeScript = `<script>\n(function() {\n function applyTheme(theme) {\n if (!theme) return;\n document.documentElement.setAttribute('data-theme', theme);\n document.documentElement.style.colorScheme = theme;\n if (theme === 'dark') {\n document.documentElement.classList.add('dark');\n if (document.body) document.body.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n if (document.body) document.body.classList.remove('dark');\n }\n }\n applyTheme(${JSON.stringify(initialTheme)});\n\n // Precise content-bottom measurement to avoid scrollHeight latching to iframe outer height\n function reportHeight() {\n var body = document.body;\n if (!body) return;\n var children = body.children;\n var maxBottom = 0;\n for (var i = 0; i < children.length; i++) {\n var el = children[i];\n if (el.tagName === 'SCRIPT' || el.tagName === 'STYLE' || el.tagName === 'LINK') continue;\n var style = window.getComputedStyle(el);\n if (style.display === 'none' || style.position === 'fixed') continue;\n var marginBottom = parseFloat(style.marginBottom) || 0;\n var bottom = el.offsetTop + el.offsetHeight + marginBottom;\n if (bottom > maxBottom) maxBottom = bottom;\n }\n var bodyStyle = window.getComputedStyle(body);\n var bodyPaddingBottom = parseFloat(bodyStyle.paddingBottom) || 0;\n var h = maxBottom > 0 ? Math.ceil(maxBottom + bodyPaddingBottom) : body.scrollHeight;\n if (h > 40) {\n window.parent.postMessage({\n jsonrpc: '2.0',\n method: 'ui/resize',\n params: { height: h }\n }, '*');\n }\n }\n\n if (typeof ResizeObserver !== 'undefined') {\n var ro = new ResizeObserver(function() {\n reportHeight();\n });\n if (document.body) {\n ro.observe(document.body);\n } else {\n document.addEventListener('DOMContentLoaded', function() {\n if (document.body) ro.observe(document.body);\n });\n }\n }\n\n window.addEventListener('load', reportHeight);\n setTimeout(reportHeight, 50);\n setTimeout(reportHeight, 250);\n setTimeout(reportHeight, 600);\n\n window.addEventListener('message', function(e) {\n var msg = e.data;\n if (!msg || typeof msg !== 'object') return;\n var theme = (msg.params && msg.params.theme) || (msg.result && msg.result.hostContext && msg.result.hostContext.theme);\n if (theme) applyTheme(theme);\n });\n})();\n</script>`;\n\n if (/^<!DOCTYPE/i.test(trimmed) || /<html[\\s>]/i.test(trimmed)) {\n if (/<head[\\s>]/i.test(trimmed)) {\n return trimmed.replace(/<head([^>]*)>/i, `<head$1>\\n ${themeScript}`);\n }\n return trimmed;\n }\n return `<!DOCTYPE html>\n<html lang=\"zh-CN\" data-theme=\"${initialTheme}\" class=\"${isDark ? 'dark' : ''}\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n ${themeScript}\n <style>\n :root {\n --background: #ffffff;\n --card: #f8fafc;\n --border: #e2e8f0;\n --foreground: #0f172a;\n --muted-foreground: #64748b;\n --primary: #2563eb;\n --primary-foreground: #ffffff;\n }\n :root[data-theme='dark'], html.dark {\n --background: #0f172a;\n --card: #1e293b;\n --border: #334155;\n --foreground: #f8fafc;\n --muted-foreground: #94a3b8;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme='light']) {\n --background: #0f172a;\n --card: #1e293b;\n --border: #334155;\n --foreground: #f8fafc;\n --muted-foreground: #94a3b8;\n }\n }\n * { box-sizing: border-box; margin: 0; padding: 0; }\n body {\n background: transparent;\n color: var(--foreground);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n padding: 12px;\n }\n </style>\n</head>\n<body class=\"${isDark ? 'dark' : ''}\">\n${trimmed}\n</body>\n</html>`;\n}\n\n/**\n * Determines whether a markdown code block represents an MCP App.\n */\nexport function isMcpAppCodeBlock(lang: string | null | undefined, meta: string | null | undefined, value: string): boolean {\n const l = (lang ?? '').toLowerCase().trim();\n const m = (meta ?? '').toLowerCase().trim();\n if (l === 'mcp-app' || l === 'mcpapp' || l === 'mcp-ui' || l === 'mcp' || l.startsWith('mcp-app:') || l === 'html:mcp-app' || l === 'html:mcp') {\n return true;\n }\n if (m.includes('mcp-app') || m.includes('mcpapp') || m.includes('sep-1865') || m.includes('mcp-ui')) {\n return true;\n }\n if (l === 'html' && (value.includes('ui/submit') || value.includes('ui/initialize') || value.includes('SEP-1865') || value.includes('mcp-app'))) {\n return true;\n }\n return false;\n}\n\n/**\n * Extracts a title from code block meta or HTML content.\n */\nexport function extractMcpAppTitle(meta: string | null | undefined, value: string): string | undefined {\n if (meta) {\n const titleMatch = /title=[\"']([^\"']+)[\"']/i.exec(meta) || /title=([^\\s]+)/i.exec(meta);\n if (titleMatch?.[1]) return titleMatch[1];\n }\n const htmlTitle = extractHtmlTitle(value);\n if (htmlTitle) return htmlTitle;\n return undefined;\n}\n\n/**\n * Extracts an explicit height budget from code block meta (e.g. height=600 or height=\"500px\").\n */\nexport function extractMcpAppHeight(meta: string | null | undefined): number | undefined {\n if (!meta) return undefined;\n const match = /height=[\"']?(\\d+)(?:px)?[\"']?/i.exec(meta);\n if (match?.[1]) {\n const n = parseInt(match[1], 10);\n if (Number.isFinite(n) && n >= 100 && n <= 3000) return n;\n }\n return undefined;\n}\n\n/**\n * Formats a user-submitted MCP App event into a concise, natural language conversational prompt.\n * Avoids raw multiline JSON and excessive whitespace.\n */\nexport function formatReceiptPrompt(params: Record<string, unknown>, title?: string): string {\n // If user selected a choice/variant (e.g. quiz or blind test)\n if (typeof params.choice === 'string') {\n const desc = typeof params.desc === 'string' ? `(${params.desc})` : '';\n const componentName = title ? `「${title}」` : '组件';\n return `我在${componentName}中选择了:${params.choice}${desc}。请根据我的选择继续。`;\n }\n if (typeof params.selectedVariant === 'string') {\n const score = typeof params.score === 'number' ? `,得分:${params.score}` : '';\n return `我在方案评测中选择了:${params.selectedVariant}${score}。请根据该方案继续分析。`;\n }\n if (typeof params.action === 'string') {\n const payloadStr = params.payload ? (typeof params.payload === 'string' ? params.payload : JSON.stringify(params.payload)) : '';\n return `[${title ?? '组件操作'}] 已完成 ${params.action}${payloadStr ? `: ${payloadStr}` : ''}`;\n }\n // Generic single field\n const keys = Object.keys(params);\n if (keys.length === 1 && typeof params[keys[0]] === 'string') {\n return `[${title ?? '组件回执'}] ${keys[0]}: ${params[keys[0]]}`;\n }\n return `[${title ?? '组件回执'}] ${JSON.stringify(params)}`;\n}\n\n/**\n * Finds the DSH composer textarea. The page can contain multiple (hidden)\n * textareas, so prefer a visible, enabled one carrying the input-bar\n * `data-phase` marker; fall back to the tallest visible, then any enabled.\n */\nexport function findComposerTextarea(doc?: Document): HTMLTextAreaElement | null {\n const d = doc ?? (typeof document !== 'undefined' ? document : undefined);\n if (!d) return null;\n const areas = Array.from(d.querySelectorAll('textarea'));\n if (areas.length === 0) return null;\n const visible = areas.filter((el) => !el.disabled && (el as HTMLElement).offsetParent !== null);\n const pool = visible.length > 0 ? visible : areas.filter((el) => !el.disabled);\n const candidates = pool.length > 0 ? pool : areas;\n const phased = candidates.find((el) => el.hasAttribute('data-phase'));\n if (phased) return phased;\n let best = candidates[0];\n for (const el of candidates) {\n if (((el as HTMLElement).offsetHeight || 0) > ((best as HTMLElement).offsetHeight || 0)) best = el;\n }\n return best;\n}\n\n/**\n * DOM fallback for composer fill: types into the Lexical contenteditable\n * surface (`[data-composer-input]`) via execCommand insertText so the editor\n * adopts the change as a genuine user edit. Returns true when accepted.\n */\nexport function fillComposerDom(text: string, doc?: Document): boolean {\n const d = doc ?? (typeof document !== 'undefined' ? document : undefined);\n if (!d) return false;\n try {\n const surfaces = Array.from(d.querySelectorAll('[data-composer-input]'));\n const editable = surfaces.find(\n (el) => el.getAttribute('contenteditable') === 'true'\n ) as HTMLElement | undefined;\n const target = editable ?? (surfaces[0] as HTMLElement | undefined);\n if (!target) return false;\n target.focus();\n if (typeof d.execCommand === 'function') {\n try {\n if (d.execCommand('insertText', false, text)) return true;\n } catch {\n // Fall through to the selection-based path below.\n }\n }\n const selection = d.getSelection?.();\n if (selection) {\n selection.selectAllChildren(target);\n if (typeof d.execCommand === 'function') {\n try {\n if (d.execCommand('insertText', false, text)) return true;\n } catch {\n // No further DOM path; the caller falls back to clipboard.\n }\n }\n }\n } catch {\n // Non-browser environment or DOM denial.\n }\n return false;\n}\n\n/**\n * Updates a React-controlled textarea and properly notifies React's valueTracker\n * so the backdrop and input state immediately reflect the text.\n */\nexport function setReactInputValue(textarea: HTMLTextAreaElement, value: string): void {\n try {\n const nativeSetter = Object.getOwnPropertyDescriptor(\n window.HTMLTextAreaElement.prototype,\n 'value'\n )?.set;\n if (nativeSetter) {\n nativeSetter.call(textarea, value);\n } else {\n textarea.value = value;\n }\n textarea.dispatchEvent(new Event('input', { bubbles: true }));\n textarea.focus();\n } catch {\n textarea.value = value;\n }\n}\n","import { createContext, memo, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport {\n getHostTheme,\n getCssTokens,\n extractHtmlTitle,\n ensureHtmlDocument,\n formatReceiptPrompt,\n fillComposerDom,\n} from './mcp-app.js';\nimport css from './McpAppFrame.module.css';\n\n/**\n * Composer fill channel shared by every McpAppFrame in one Reader tree.\n * Provided by Blocks from the session-scoped Reader face (sanctioned\n * conversation input API); absent outside a Reader, where the DOM fallback\n * applies. React context avoids threading the callback through the whole\n * markdown pipeline (MarkdownText -> render context -> code fence).\n */\nexport type ComposerFill = (text: string) => boolean;\nexport const ComposerFillContext = createContext<ComposerFill | undefined>(undefined);\nexport function useComposerFill(): ComposerFill | undefined {\n return useContext(ComposerFillContext);\n}\n\nexport interface McpAppFrameProps {\n html: string;\n title?: string;\n initialHeight?: number;\n /** Session-scoped composer writer; falls back to context, then DOM. */\n fillComposer?: ComposerFill;\n}\n\nexport const McpAppFrame = memo(function McpAppFrame({\n html,\n title: initialTitle,\n initialHeight = 240,\n fillComposer: fillComposerProp,\n}: McpAppFrameProps) {\n const fillComposerFromContext = useComposerFill();\n const writeComposer = useMemo<ComposerFill>(\n () => fillComposerProp ?? fillComposerFromContext ?? fillComposerDom,\n [fillComposerProp, fillComposerFromContext],\n );\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const lastParamsRef = useRef<Record<string, unknown>>({});\n const [height, setHeight] = useState(() => Math.max(60, Math.min(2400, initialHeight)));\n const [receipt, setReceipt] = useState<string | null>(null);\n const [lastPrompt, setLastPrompt] = useState<string | null>(null);\n const [reloadNonce, setReloadNonce] = useState(0);\n const frameId = useId();\n\n const title = useMemo(() => {\n return initialTitle || extractHtmlTitle(html) || '交互式 MCP App';\n }, [initialTitle, html]);\n\n // Capture the host theme ONCE for the initial srcDoc. Live theme switches\n // are delivered via postMessage (broadcastTheme), so the srcDoc identity\n // stays stable and the iframe never reloads (which would wipe user state\n // such as checked boxes or selected tabs).\n const [initialTheme] = useState(getHostTheme);\n const preparedHtml = useMemo(() => ensureHtmlDocument(html, initialTheme), [html, initialTheme]);\n\n const fillComposer = useCallback((params: Record<string, unknown>) => {\n const prompt = formatReceiptPrompt(params, title);\n setLastPrompt(prompt);\n try {\n if (writeComposer(prompt)) return true;\n // Composer refused: leave the prompt visible in the receipt bar and\n // stash a clipboard copy as a fallback.\n try {\n void navigator.clipboard?.writeText(prompt);\n } catch {\n // Clipboard unavailable; the visible receipt text remains copyable.\n }\n } catch {\n // Ignore DOM query errors in non-browser environments\n }\n return false;\n }, [title, writeComposer]);\n\n const handleUserSubmit = useCallback((params: Record<string, unknown>) => {\n lastParamsRef.current = params;\n let summary: string;\n if (typeof params.choice === 'string') {\n const desc = typeof params.desc === 'string' ? ` (${params.desc})` : '';\n summary = `选择: ${params.choice}${desc}`;\n } else if (typeof params.action === 'string') {\n summary = `操作: ${params.action}${params.payload ? ` (${JSON.stringify(params.payload)})` : ''}`;\n } else if (typeof params.selectedVariant === 'string') {\n summary = `方案: ${params.selectedVariant}`;\n } else {\n summary = JSON.stringify(params);\n }\n setReceipt(summary);\n\n // Populate DSH composer with natural prompt and trigger React input state\n fillComposer(params);\n }, [fillComposer]);\n\n useEffect(() => {\n const handleMessage = (event: MessageEvent) => {\n const iframe = iframeRef.current;\n if (!iframe || event.source !== iframe.contentWindow) return;\n\n const data = event.data;\n if (!data || typeof data !== 'object') return;\n\n // Protocol SEP-1865 JSON-RPC 2.0\n const currentTheme = getHostTheme();\n const cssTokens = getCssTokens(currentTheme);\n\n // 1. ui/initialize (View -> Host)\n if (data.method === 'ui/initialize') {\n const response = {\n jsonrpc: '2.0',\n id: data.id,\n result: {\n protocolVersion: '2026-01-26',\n hostContext: {\n theme: currentTheme,\n locale: 'zh-CN',\n styles: {\n variables: cssTokens,\n },\n },\n },\n };\n iframe.contentWindow?.postMessage(response, '*');\n return;\n }\n\n // ui/ready is a notification. The frame has no ready flag to flip.\n if (data.method === 'ui/ready' || data.method === 'ui/notifications/initialized') return;\n\n // ui/resize\n if (data.method === 'ui/resize' && data.params?.height) {\n const h = Number(data.params.height);\n if (Number.isFinite(h) && h > 0) {\n setHeight(Math.max(60, Math.min(2400, Math.round(h))));\n }\n return;\n }\n\n // ui/submit or ui/update-model-context\n if (data.method === 'ui/submit' || data.method === 'ui/update-model-context') {\n const params = (data.params as Record<string, unknown>) || {};\n handleUserSubmit(params);\n return;\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n // Broadcast live theme changes to running iframe\n const broadcastTheme = () => {\n const newTheme = getHostTheme();\n const tokens = getCssTokens(newTheme);\n iframeRef.current?.contentWindow?.postMessage({\n jsonrpc: '2.0',\n method: 'ui/notifications/host-context-changed',\n params: {\n theme: newTheme,\n styles: { variables: tokens },\n },\n }, '*');\n };\n\n let observer: MutationObserver | null = null;\n if (typeof MutationObserver !== 'undefined' && typeof document !== 'undefined') {\n observer = new MutationObserver(broadcastTheme);\n if (document.body) {\n observer.observe(document.body, { attributes: true, attributeFilter: ['data-ds-dark-theme', 'class', 'style', 'data-theme'] });\n }\n if (document.documentElement) {\n observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme', 'class', 'style'] });\n }\n }\n\n const media = typeof window !== 'undefined' && window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;\n media?.addEventListener?.('change', broadcastTheme);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n observer?.disconnect();\n media?.removeEventListener?.('change', broadcastTheme);\n };\n }, [handleUserSubmit]);\n\n const handleFrameLoad = useCallback(() => {\n const iframe = iframeRef.current;\n if (!iframe) return;\n\n // Proactive Host -> View initialize notification for boilerplate compatibility\n const currentTheme = getHostTheme();\n const cssTokens = getCssTokens(currentTheme);\n iframe.contentWindow?.postMessage({\n jsonrpc: '2.0',\n method: 'ui/initialize',\n params: {\n theme: currentTheme,\n locale: 'zh-CN',\n styles: {\n variables: cssTokens,\n },\n },\n }, '*');\n }, []);\n\n const handleReload = useCallback(() => {\n setReloadNonce(n => n + 1);\n setReceipt(null);\n }, []);\n\n return (\n <div className={css.card} data-mcp-app-card data-testid=\"mcp-app-card\">\n <div className={css.header}>\n <div className={css.titleArea}>\n <span className={css.icon} aria-hidden=\"true\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M9 21V9\" />\n </svg>\n </span>\n <span className={css.title} title={title}>{title}</span>\n </div>\n <div className={css.actions}>\n <button\n type=\"button\"\n className={css.iconBtn}\n onClick={handleReload}\n title=\"重置组件状态\"\n aria-label=\"重置组件状态\"\n >\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\" />\n <path d=\"M16 16h5v5\" />\n </svg>\n </button>\n </div>\n </div>\n\n <div className={css.iframeWrapper} style={{ height: `${height}px` }}>\n <iframe\n key={`${frameId}-${reloadNonce}`}\n ref={iframeRef}\n className={css.iframe}\n title={title}\n srcDoc={preparedHtml}\n sandbox=\"allow-scripts allow-forms\"\n referrerPolicy=\"no-referrer\"\n onLoad={handleFrameLoad}\n />\n </div>\n\n {receipt && (\n <div className={css.receipt} data-testid=\"mcp-app-receipt\">\n <span className={css.receiptSummary}>\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n <span>已就绪:{receipt}</span>\n </span>\n {lastPrompt && (\n <div className={css.receiptPrompt} title={lastPrompt}>\n {lastPrompt}\n </div>\n )}\n <div className={css.receiptHint}>\n <button\n type=\"button\"\n className={css.sendKbd}\n title=\"把这条结果重新填入输入框,然后回车发送\"\n onClick={() => {\n fillComposer(lastParamsRef.current);\n }}\n >\n <span>填入输入框</span>\n <kbd>↵</kbd>\n </button>\n </div>\n </div>\n )}\n </div>\n );\n});\n\n/**\n * Markdown code-fence mount point: picks the session composer writer from\n * React context (provided by Blocks) without changing the markdown\n * pipeline's signatures.\n */\nexport function McpAppCodeBlock({ html, title, initialHeight }: {\n html: string; title?: string; initialHeight?: number;\n}) {\n const fillComposer = useComposerFill();\n return <McpAppFrame html={html} title={title} initialHeight={initialHeight} fillComposer={fillComposer} />;\n}\n\nexport function StreamingMcpAppPlaceholder({ title }: { title?: string }) {\n return (\n <div className={css.streamingPlaceholder}>\n <span className={css.pulseDot} aria-hidden=\"true\" />\n <span>正在生成交互组件{title ? `(${title})` : ''}...</span>\n </div>\n );\n}\n","/** Local clock and run-duration labels for reader message chrome. */\n\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0')\n}\n\n/**\n * Elapsed wall time, matching official Chat `duration.minutes` / `duration.seconds`.\n * @param ms - Elapsed milliseconds (negatives clamp to zero).\n */\nexport function formatRunDuration(ms: number): string {\n const total = Math.max(0, Math.floor(ms / 1000))\n const minutes = Math.floor(total / 60)\n const seconds = total % 60\n return minutes > 0 ? `${minutes}分${pad2(seconds)}秒` : `${seconds}秒`\n}\n\n/**\n * Settled-turn duration pill, matching official `message.ranFor`.\n * @param ms - Elapsed milliseconds.\n */\nexport function formatRanFor(ms: number): string {\n return `用时 ${formatRunDuration(ms)}`\n}\n\n/**\n * Compact local timestamp. Same calendar day → `HH:mm`; earlier this year →\n * `M月D日 HH:mm`; other years → `YYYY年M月D日 HH:mm`.\n * @param time - Unix epoch ms from the source session event.\n * @param now - Reference instant for the day/year cut.\n */\nexport function formatMessageClock(time: number, now: number = Date.now()): string {\n const d = new Date(time)\n const n = new Date(now)\n const clock = `${pad2(d.getHours())}:${pad2(d.getMinutes())}`\n if (\n d.getFullYear() === n.getFullYear()\n && d.getMonth() === n.getMonth()\n && d.getDate() === n.getDate()\n ) {\n return clock\n }\n if (d.getFullYear() === n.getFullYear()) {\n return `${d.getMonth() + 1}月${d.getDate()}日 ${clock}`\n }\n return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日 ${clock}`\n}\n","import type {\n DiffBlockLabels,\n JsonTreeLabels,\n MarkdownLabels,\n ReadBlockLabels,\n SearchBlockLabels,\n TerminalBlockLabels,\n WebBlockLabels,\n} from '@deepseek-ai/dsh-client-ui-primitives';\n\nexport const markdownLabels: MarkdownLabels = {\n code: { copyLabel: '复制', copiedLabel: '已复制' },\n footnotes: '脚注',\n};\n\nexport const readBlockLabels: ReadBlockLabels = {\n codeLabel: '代码', wrapLabel: '自动换行', unwrapLabel: '不换行',\n window: (shown, total) => `显示 ${shown} / ${total} 行`,\n copy: '复制', copied: '已复制', collapseAria: '收起文件内容',\n expandAria: hidden => `展开其余 ${hidden} 行`, collapse: '收起', expand: hidden => `展开其余 ${hidden} 行`,\n};\n\nexport const terminalBlockLabels: TerminalBlockLabels = {\n commandLine: line => `命令第 ${line} 行`,\n signal: signal => `信号 ${signal}`, exitCode: code => `退出码 ${code}`, noExitCode: '无退出码',\n running: '执行中', failed: '失败', done: '已完成', copy: '复制', copied: '已复制',\n noOutput: '没有输出', collapseAria: '收起命令输出', collapse: '收起',\n expandAria: hidden => `展开其余 ${hidden} 行`, expand: hidden => `展开其余 ${hidden} 行`,\n};\n\nexport const diffBlockLabels: DiffBlockLabels = {\n codeLabel: '代码', wrapLabel: '自动换行', unwrapLabel: '不换行',\n copy: '复制', copied: '已复制', collapseAria: '收起差异', collapse: '收起',\n expandAria: hidden => `展开其余 ${hidden} 行`, expand: hidden => `展开其余 ${hidden} 行`,\n};\n\nexport const searchBlockLabels: SearchBlockLabels = {\n pathsSummary: (shown, total, truncated) => `${shown} / ${total} 个路径${truncated ? '(结果已截断)' : ''}`,\n matchesSummary: (shown, total, files, truncated) => `${shown} / ${total} 处匹配 · ${files} 个文件${truncated ? '(结果已截断)' : ''}`,\n copy: '复制', copied: '已复制', noResults: '没有结果', collapseAria: '收起搜索结果', collapse: '收起',\n expandAria: hidden => `展开其余 ${hidden} 行`, expand: hidden => `展开其余 ${hidden} 行`,\n};\n\nexport const webBlockLabels: WebBlockLabels = {\n noResults: '没有结果', sourcesTruncated: '来源已截断', http: 'HTTP', contentTruncated: '内容已截断',\n markdown: markdownLabels,\n};\n\nexport const jsonTreeLabels: JsonTreeLabels = {\n copyValue: '复制值', copyJson: '复制 JSON', copyPath: '复制路径', copyPrettyJson: '复制格式化 JSON',\n copyCompactJson: '复制紧凑 JSON', copied: '已复制', copyFailed: '复制失败', collapseNode: '收起节点',\n expandNode: '展开节点', copyButtonTitle: action => action,\n};\n\nexport const truncatedJsonLabel = (total: number): string => `内容过长,已截断(共 ${total} 个字符)`;\n","/** Presentation only. The original session string remains the source of truth. */\n// The reveal runs at the rate the source is actually producing (feed-forward)\n// plus a proportional term that closes whatever backlog jitter left behind.\n// A proportional-only controller drains exactly one window per window, so the\n// display trails live output by catchUpMs forever — unreadable-but-smooth at\n// 75 chars/s, permanently behind at 1000. The feed-forward term is what makes\n// the pace adapt to the model instead of to a fixed constant.\nexport const STREAM_TIMING = {\n catchUpMs: 520,\n maxQueuedMs: 600,\n finishMs: 96,\n revealMs: 350,\n minimumRate: 260,\n /** Weight of the newest arrival sample in the smoothed source rate. */\n rateWeight: 0.35,\n /** A longer gap is a pause between runs, not a slow model: keep the estimate. */\n rateGapMs: 250,\n} as const;\nconst graphemes = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n\nfunction atOrAfter(values: readonly number[], target: number): number {\n let low = 0;\n let high = values.length - 1;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (values[middle]! < target) low = middle + 1;\n else high = middle;\n }\n return low;\n}\n\nexport class StreamBuffer {\n target: string;\n visible: string;\n revision = 0;\n private boundaries = [0];\n private arrivals: { end: number; at: number }[] = [];\n private lastAt: number | null = null;\n private credit = 0;\n private finishAt: number | null = null;\n private rateEwma = 0;\n private lastArrival: number | null = null;\n\n constructor(initial = '') {\n this.target = initial;\n this.visible = initial;\n this.segment(0);\n }\n\n get pending(): boolean { return this.visible.length < this.target.length; }\n\n private segment(from: number): void {\n const index = atOrAfter(this.boundaries, from);\n this.boundaries.length = index;\n for (const part of graphemes.segment(this.target.slice(from))) this.boundaries.push(from + part.index);\n if (this.boundaries.at(-1) !== this.target.length) this.boundaries.push(this.target.length);\n }\n\n /** Non-append updates, cancellations and hidden/reduced views never replay. */\n update(text: string, now: number, options: { immediate?: boolean; finished?: boolean } = {}): void {\n if (options.immediate || !text.startsWith(this.target)) {\n if (text !== this.target) this.revision++;\n this.target = text;\n this.flush();\n this.boundaries = [0];\n this.segment(0);\n return;\n }\n if (text !== this.target) {\n const wasPending = this.pending;\n const grew = text.length - this.target.length;\n const from = this.boundaries.at(-2) ?? 0;\n this.observe(grew, now);\n this.target = text;\n // Re-segment the previous last cluster: an emoji/combining sequence can\n // itself span transport chunks. Frozen source prefixes are not scanned.\n this.segment(from);\n this.arrivals.push({ end: text.length, at: now });\n if (!wasPending) { this.lastAt = now; this.credit = 0; }\n }\n if (options.finished && this.finishAt === null) this.finishAt = now + STREAM_TIMING.finishMs;\n if (!options.finished) this.finishAt = null;\n if (this.target.length - this.visible.length > 8192) { this.revision++; this.flush(); }\n }\n\n /** Smoothed source rate, so one jittery transport chunk cannot set the pace. */\n private observe(grew: number, now: number): void {\n const previous = this.lastArrival;\n this.lastArrival = now;\n if (previous === null || grew <= 0) return;\n const elapsed = now - previous;\n if (elapsed <= 0 || elapsed > STREAM_TIMING.rateGapMs) return;\n const sample = grew * 1000 / elapsed;\n this.rateEwma = this.rateEwma === 0\n ? sample\n : this.rateEwma * (1 - STREAM_TIMING.rateWeight) + sample * STREAM_TIMING.rateWeight;\n }\n\n flush(): void {\n this.visible = this.target;\n this.arrivals = [];\n this.credit = 0;\n this.lastAt = null;\n this.lastArrival = null;\n this.finishAt = null;\n }\n\n advance(now: number): boolean {\n if (!this.pending) return false;\n const before = this.visible.length;\n const index = atOrAfter(this.boundaries, before);\n const remaining = this.boundaries.length - index - 1;\n const delta = Math.max(0, now - (this.lastAt ?? now));\n this.lastAt = now;\n const windowMs = this.finishAt === null ? STREAM_TIMING.catchUpMs : Math.max(16, Math.min(STREAM_TIMING.catchUpMs, this.finishAt - now));\n // Feed-forward keeps pace with the source; the proportional term then drains\n // whatever backlog is left, so lag decays instead of settling at one window.\n const rate = Math.max(STREAM_TIMING.minimumRate, this.rateEwma + remaining * 1000 / windowMs);\n this.credit += rate * delta / 1000;\n const count = Math.floor(this.credit);\n this.credit -= count;\n let end = this.boundaries[Math.min(this.boundaries.length - 1, index + count)]!;\n for (const item of this.arrivals) {\n if (now - item.at < STREAM_TIMING.maxQueuedMs) break;\n end = Math.max(end, this.boundaries[atOrAfter(this.boundaries, item.end)]!);\n }\n if (this.finishAt !== null && now >= this.finishAt) end = this.target.length;\n // Never expose half of a surrogate pair while the source can still grow.\n if (end && /[\\uD800-\\uDBFF]/.test(this.target[end - 1]!) && this.finishAt === null) end--;\n end = Math.max(before, end);\n this.visible = this.target.slice(0, end);\n this.arrivals = this.arrivals.filter(item => item.end > end);\n if (!this.pending) { this.credit = 0; this.lastAt = null; }\n return end !== before;\n }\n}\n","/** Motion parameters from the public transitions.dev streaming-text recipe. */\nexport const WORD_MOTION = {\n duration: 350,\n gap: 60,\n blur: 1,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n maxDelay: 240,\n /** Floor for the per-word cadence once a batch is compressed. */\n minGap: 3,\n /** One paint's words should land inside this window, however many arrive. */\n batchMs: 90,\n} as const;\n\nconst segmenter = new Intl.Segmenter(undefined, { granularity: 'word' });\nconst closingPunctuation = /^[\\p{Pe}\\p{Pf},.!?:;,。!?、;:%‰…·]+$/u;\nconst openingPunctuation = /^[\\p{Ps}\\p{Pi}]+$/u;\nexport interface RevealingWord { key: number; text: string; born: number | null }\ninterface SourceBirth { end: number; born: number | null }\n\n/** Source-offset identity survives reparsing, frozen blocks, and final formatting. */\nexport class WordTimeline {\n generation = 0;\n hasLiveText = false;\n private source: string | null = null;\n private enabled = false;\n private revision = 0;\n private floor = 0;\n private lastBirth = -Infinity;\n private readonly births: SourceBirth[] = [];\n\n begin(source: string, enabled: boolean, revision: number, now: number): void {\n if (this.source === source && this.enabled === enabled && this.revision === revision) return;\n const replaced = revision !== this.revision || (this.source !== null && !source.startsWith(this.source));\n if (replaced || !enabled) {\n this.births.length = 0;\n this.lastBirth = -Infinity;\n this.generation++;\n this.floor = source.length;\n } else if (this.source === null) {\n // A mounted historical prefix must not replay; a fresh live buffer mounts empty.\n this.floor = source.length;\n } else {\n // Allocate in source order, before Markdown can split/reorder text leaves.\n // Intervals cover every offset, so resegmented CJK words inherit the time\n // of their characters rather than falling through as instant \"history\".\n const from = this.source.length;\n const added = source.slice(from);\n // The cadence follows the batch, not a constant. A fixed per-word gap caps\n // the reveal at ~16 words/second however fast the model actually wrote, so\n // a 500 tok/s answer still dripped out one word at a time. A batch of many\n // words is compressed into one short window instead; a lone word keeps the\n // original typing rhythm.\n let arriving = 0;\n for (const part of segmenter.segment(added)) if (part.segment.trim()) arriving++;\n const gap = arriving > 1\n ? Math.max(WORD_MOTION.minGap, Math.min(WORD_MOTION.gap, WORD_MOTION.batchMs / arriving))\n : WORD_MOTION.gap;\n for (const part of segmenter.segment(added)) {\n let born = Number.isFinite(this.lastBirth) ? this.lastBirth : null;\n if (part.segment.trim()) {\n // Capping at the batch window is what stops a queue from forming: the\n // clock can never run further ahead than one window past the newest text.\n born = Math.min(now + WORD_MOTION.batchMs, Math.max(now, this.lastBirth + gap));\n this.lastBirth = born;\n }\n const end = from + part.index + part.segment.length;\n const previous = this.births.at(-1);\n if (previous && previous.born === born) previous.end = end;\n else this.births.push({ end, born });\n }\n }\n this.source = source;\n this.enabled = enabled;\n this.revision = revision;\n this.hasLiveText = enabled && this.births.length > 0;\n }\n\n bornAt(offset: number): number | null {\n if (!this.enabled || offset < this.floor || this.births.length === 0) return null;\n let low = 0;\n let high = this.births.length - 1;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (this.births[middle]!.end <= offset) low = middle + 1;\n else high = middle;\n }\n return this.births[low]!.born;\n }\n\n words(value: string, offset: number): RevealingWord[] {\n // Atomic inline animation boxes must not turn commas into legal line starts\n // or strand opening quotes at a line end. Keep source-offset identities when\n // punctuation arrives in a later chunk, so the preceding word never replays.\n // Already received text is one inert leaf, not thousands of React Words.\n // Only the newly appended suffix needs word identities and birth times.\n const prefixLength = Math.min(value.length, Math.max(0, this.floor - offset));\n const prefix: RevealingWord[] = prefixLength > 0\n ? [{ key: offset, text: value.slice(0, prefixLength), born: null }]\n : [];\n const parts: { index: number; segment: string }[] = [];\n for (const segment of segmenter.segment(value.slice(prefixLength))) {\n const part = { index: prefixLength + segment.index, segment: segment.segment };\n const previous = parts.at(-1);\n if (previous?.segment.trim() && (closingPunctuation.test(part.segment) || openingPunctuation.test(previous.segment))) {\n previous.segment += part.segment;\n } else parts.push({ index: part.index, segment: part.segment });\n }\n return prefix.concat(parts.map(part => {\n const key = offset + part.index;\n return { key, text: part.segment, born: this.bornAt(key) };\n }));\n }\n}\n","import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { StreamBuffer } from './stream-buffer.js';\nimport { WORD_MOTION } from './word-timeline.js';\n\nexport const StreamMotionContext = createContext<{ enabled: boolean; activatedAt: number; paused?: boolean; resumed?: boolean }>({ enabled: false, activatedAt: 0 });\n\nexport function useStreamingText(source: string, streaming: boolean, options: { startedAt?: number; interrupted: boolean; selected: boolean }) {\n const { enabled, activatedAt, paused = false, resumed = false } = useContext(StreamMotionContext);\n const fresh = resumed || (options.startedAt ?? 0) >= activatedAt;\n const buffer = useRef<StreamBuffer>();\n // Only newly mounted content after a fold uses the catch-up path. History and\n // user-opened drawers stay immediate; already mounted prefixes never replay.\n if (!buffer.current) buffer.current = new StreamBuffer(enabled && (streaming || resumed) && fresh ? '' : source);\n const [display, setDisplay] = useState(() => ({ text: buffer.current!.visible, revision: 0 }));\n const [finalizing, setFinalizing] = useState(streaming);\n const frame = useRef(0);\n const immediate = !enabled || options.interrupted || options.selected;\n const publish = () => {\n const current = buffer.current!;\n setDisplay(previous => previous.text === current.visible && previous.revision === current.revision ? previous : { text: current.visible, revision: current.revision });\n };\n const handoff = useRef(resumed);\n const presentationClock = useRef(performance.now());\n useLayoutEffect(() => {\n cancelAnimationFrame(frame.current);\n const current = buffer.current!;\n // While the choreography holds the reveal, keep the buffer absorbing the\n // source instead of returning early: the target must never lag behind what\n // arrived, or the text would keep catching up long after the fold settled.\n // Dropping the frame loop is what pauses the reveal; the target still tracks.\n if (paused && !immediate && !document.hidden) {\n current.update(source, performance.now(), { immediate: false, finished: !streaming });\n publish();\n return;\n }\n let previous = performance.now();\n current.update(source, handoff.current ? presentationClock.current : previous, { immediate: immediate || document.hidden, finished: !streaming && !resumed });\n publish();\n const tick = (now: number) => {\n // A delayed browser frame must not dump the whole buffered response at\n // first paint. Bound catch-up by visible frame time for this handoff only.\n presentationClock.current += Math.min(32, Math.max(0, now - previous));\n previous = now;\n if (document.hidden) current.flush();\n else current.advance(handoff.current ? presentationClock.current : now);\n publish();\n if (current.pending) frame.current = requestAnimationFrame(tick);\n else handoff.current = false;\n };\n if (current.pending) frame.current = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(frame.current);\n }, [source, streaming, immediate, paused, resumed]);\n useEffect(() => {\n const hidden = () => {\n if (!document.hidden) return;\n cancelAnimationFrame(frame.current);\n buffer.current!.flush(); publish(); setFinalizing(false);\n };\n document.addEventListener('visibilitychange', hidden);\n return () => document.removeEventListener('visibilitychange', hidden);\n }, []);\n const pending = display.text !== source;\n useEffect(() => {\n if (streaming || pending) { setFinalizing(true); return; }\n if (immediate || document.hidden) { setFinalizing(false); return; }\n const timer = setTimeout(() => setFinalizing(false), WORD_MOTION.duration + WORD_MOTION.maxDelay);\n return () => clearTimeout(timer);\n }, [streaming, pending, immediate]);\n return { text: immediate ? source : display.text, pending: !immediate && pending, revision: display.revision, formatStreaming: streaming || (!immediate && (pending || finalizing)), reveal: enabled && !options.interrupted && !options.selected };\n}\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/**\n * Incremental block-level markdown parsing for an append-only text stream.\n *\n * Re-parsing the whole accumulated document on every streaming chunk is\n * quadratic in the final reply length. CommonMark block parsing is line-based\n * and appended text can only reshape the parse frontier — the last top-level\n * block (a paragraph becoming a setext heading or a table, a list continuing\n * after a blank line, an unclosed fence swallowing lines) — so earlier blocks\n * are final. This parser therefore freezes all but the trailing\n * {@link UNSTABLE_TAIL_BLOCKS} blocks and re-parses only the source tail\n * behind them: each source region is parsed O(1) times over the stream\n * instead of once per chunk.\n *\n * The freeze boundary comes from the parser's own `position` offsets, never\n * from custom source scanning. The cut sits at the *end offset* of the last\n * frozen block (not the next block's start): a following block's start offset\n * excludes up to three spaces of insignificant leading indentation, which is\n * harmless to drop, but cutting at the previous end also keeps the\n * inter-block blank lines in the tail so the sliced source stays verbatim.\n *\n * Known deviation, shared with any prefix-freeze scheme: micromark resolves\n * reference-style links and footnotes document-wide at parse time, so a\n * reference whose definition lands on the other side of the freeze boundary\n * renders literally until the settled full parse self-heals it.\n */\n\nimport type { Root, RootContent } from 'mdast'\n\n/**\n * Trailing blocks kept unstable. Appended text reshapes at most the last\n * block; the second-to-last is retained as safety margin so a freeze decision\n * never has to reason about the parse frontier.\n */\nconst UNSTABLE_TAIL_BLOCKS = 2\n\n/** A top-level mdast block plus a render key that is stable across chunks. */\nexport interface PositionedBlock {\n /** The parsed block. Positions inside it are relative to its parse slice. */\n readonly node: RootContent\n /**\n * The block's start offset in the full source text. Stable from the frame\n * a block first appears through freezing, so React reconciles rather than\n * remounts when a block crosses the freeze boundary.\n */\n readonly key: number\n}\n\n/** One {@link IncrementalMarkdownParser.update} result. */\nexport interface IncrementalBlocks {\n /** Blocks that can no longer change; grows monotonically per generation. */\n readonly frozen: readonly PositionedBlock[]\n /** The re-parsed unstable tail (at most {@link UNSTABLE_TAIL_BLOCKS} blocks plus growth). */\n readonly tail: readonly PositionedBlock[]\n /** Bumped whenever non-append input discards the frozen prefix; callers drop caches keyed on it. */\n readonly generation: number\n}\n\n/**\n * A block's render key: its absolute source start offset. A position-less\n * node (a grammar is free to omit positions) falls back to a negative\n * list-index key — unique within one update's tail, which is the only place\n * the fallback can occur: freezing requires the cut block's position, so a\n * position-less parse keeps every block in the tail (real grammars always\n * stamp positions and never take this path).\n */\nfunction blockKey(node: RootContent, base: number, index: number): number {\n const offset = node.position?.start.offset\n return offset === undefined ? -(index + 1) : base + offset\n}\n\n/**\n * Append-only incremental parser over a caller-supplied grammar. One instance\n * accumulates one streaming document; non-append input resets it.\n */\nexport class IncrementalMarkdownParser {\n private prevText = ''\n private tailStart = 0\n private frozen: PositionedBlock[] = []\n private generation = 0\n private cached: IncrementalBlocks | null = null\n\n /** @param parse - Grammar shared with whatever renders the blocks, so boundaries agree. */\n constructor(private readonly parse: (text: string) => Root) {}\n\n /**\n * Fold the current accumulated text and return the frozen/tail split.\n * Idempotent for identical input (the previous result is returned as-is),\n * so callers may invoke it from render paths that re-execute.\n * @param text - The full accumulated markdown source.\n * @returns Frozen and tail blocks with stream-stable render keys.\n */\n update(text: string): IncrementalBlocks {\n if (this.cached !== null && text === this.prevText) return this.cached\n // Deliberate O(prefix) memcmp per update: sound divergence detection has\n // to verify the whole retained prefix, and startsWith compares bytes two\n // orders of magnitude faster than parsing them — the cost this class\n // exists to remove. Passing append/reset deltas instead would push\n // append bookkeeping across the session-projection update boundary for a check\n // that stays sub-millisecond at realistic reply sizes.\n if (!text.startsWith(this.prevText)) {\n this.prevText = ''\n this.tailStart = 0\n this.frozen = []\n this.generation += 1\n }\n this.prevText = text\n const base = this.tailStart\n const blocks = this.parse(text.slice(base)).children\n let firstUnstable = Math.max(0, blocks.length - UNSTABLE_TAIL_BLOCKS)\n if (firstUnstable > 0) {\n const cutEnd = blocks[firstUnstable - 1]?.position?.end.offset\n if (cutEnd === undefined) {\n // A grammar that omits positions leaves nothing to cut at; keep the\n // whole parse in the tail rather than guessing a boundary.\n firstUnstable = 0\n } else {\n for (const node of blocks.slice(0, firstUnstable)) {\n this.frozen.push({ node, key: blockKey(node, base, this.frozen.length) })\n }\n this.tailStart = base + cutEnd\n }\n }\n const tail = blocks.slice(firstUnstable).map((node, index) => ({\n node,\n key: blockKey(node, base, index),\n }))\n this.cached = { frozen: [...this.frozen], tail, generation: this.generation }\n return this.cached\n }\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [includeImageAlt=true]\n * Whether to use `alt` for `image`s (default: `true`).\n * @property {boolean | null | undefined} [includeHtml=true]\n * Whether to use `value` of HTML (default: `true`).\n */\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Get the text content of a node or list of nodes.\n *\n * Prefers the node’s plain-text fields, otherwise serializes its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} [value]\n * Thing to serialize, typically `Node`.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `value`.\n */\nexport function toString(value, options) {\n const settings = options || emptyOptions\n const includeImageAlt =\n typeof settings.includeImageAlt === 'boolean'\n ? settings.includeImageAlt\n : true\n const includeHtml =\n typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true\n\n return one(value, includeImageAlt, includeHtml)\n}\n\n/**\n * One node or several nodes.\n *\n * @param {unknown} value\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized node.\n */\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if ('value' in value) {\n return value.type === 'html' && !includeHtml ? '' : value.value\n }\n\n if (includeImageAlt && 'alt' in value && value.alt) {\n return value.alt\n }\n\n if ('children' in value) {\n return all(value.children, includeImageAlt, includeHtml)\n }\n }\n\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml)\n }\n\n return ''\n}\n\n/**\n * Serialize a list of nodes.\n *\n * @param {Array<unknown>} values\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized nodes.\n */\nfunction all(values, includeImageAlt, includeHtml) {\n /** @type {Array<string>} */\n const result = []\n let index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml)\n }\n\n return result.join('')\n}\n\n/**\n * Check if `value` looks like a node.\n *\n * @param {unknown} value\n * Thing.\n * @returns {value is Nodes}\n * Whether `value` is a node.\n */\nfunction node(value) {\n return Boolean(value && typeof value === 'object')\n}\n","/**\n * Map of named character references.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntities = {\n AElig: 'Æ',\n AMP: '&',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '⁡',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atilde: 'Ã',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ETH: 'Ð',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacute: 'Í',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '⁣',\n InvisibleTimes: '⁢',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '​',\n NegativeThickSpace: '​',\n NegativeThinSpace: '​',\n NegativeVeryThinSpace: '​',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '⁠',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacute: 'Ó',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslash: 'Ø',\n Otilde: 'Õ',\n Otimes: '⨷',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: '  ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '​',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acirc: 'â',\n acute: '´',\n acy: 'а',\n aelig: 'æ',\n af: '⁡',\n afr: '𝔞',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atilde: 'ã',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedil: '¸',\n cemptyv: '⦲',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: '≖',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n eth: 'ð',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacute: 'í',\n ic: '⁣',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n in: '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n int: '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '⁢',\n itilde: 'ĩ',\n iukcy: 'і',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '‎',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacute: 'ó',\n oast: '⊛',\n ocir: '⊚',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: '⩝',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslash: 'ø',\n osol: '⊘',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n ouml: 'ö',\n ovbar: '⌽',\n par: '∥',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '‏',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n shy: '­',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n sup: '⊃',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thorn: 'þ',\n tilde: '˜',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '‍',\n zwnj: '‌'\n}\n","import {characterEntities} from 'character-entities'\n\n// To do: next major: use `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array<T>} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length;\n let chunkStart = 0;\n /** @type {Array<unknown>} */\n let parameters;\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove);\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000);\n parameters.unshift(start, 0);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n chunkStart += 10000;\n start += 10000;\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {Array<T>} items\n * Items to add to `list`.\n * @returns {Array<T>}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items);\n return list;\n }\n return items;\n}","/**\n * @import {\n * Extension,\n * Handles,\n * HtmlExtension,\n * NormalizedExtension\n * } from 'micromark-util-types'\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {ReadonlyArray<Extension>} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record<string, unknown>} */\n const left = maybe || (all[hook] = {})\n /** @type {Record<string, unknown> | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array<unknown>} existing\n * List of constructs to merge into.\n * @param {Array<unknown>} list\n * List of constructs to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array<unknown>} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {ReadonlyArray<HtmlExtension>} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * Single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, \" \")\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase().toUpperCase();\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/);\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n );\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/);\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/);\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2;\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32);\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32;\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/);\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * Expression.\n * @returns {(code: Code) => boolean}\n * Check.\n */\nfunction regexCheck(regex) {\n return check;\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code));\n }\n}","import { asciiAlphanumeric } from 'micromark-util-character';\nimport { encode } from 'micromark-util-encode';\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | null | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''));\n if (!protocol) {\n return value;\n }\n const colon = value.indexOf(':');\n const questionMark = value.indexOf('?');\n const numberSign = value.indexOf('#');\n const slash = value.indexOf('/');\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))) {\n return value;\n }\n return '';\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array<string>} */\n const result = [];\n let index = -1;\n let start = 0;\n let skip = 0;\n while (++index < value.length) {\n const code = value.charCodeAt(index);\n /** @type {string} */\n let replace = '';\n\n // A correct percent encoded value.\n if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) {\n skip = 2;\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code);\n }\n }\n // Astral.\n else if (code > 55_295 && code < 57_344) {\n const next = value.charCodeAt(index + 1);\n\n // A correct surrogate pair.\n if (code < 56_320 && next > 56_319 && next < 57_344) {\n replace = String.fromCharCode(code, next);\n skip = 1;\n }\n // Lone surrogate.\n else {\n replace = \"\\uFFFD\";\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code);\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace));\n start = index + skip + 1;\n replace = '';\n }\n if (skip) {\n index += skip;\n skip = 0;\n }\n }\n return result.join('') + value.slice(start);\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n * Content.\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n let previous;\n return contentStart;\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, contentStart, \"linePrefix\");\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter(\"paragraph\");\n return lineStart(code);\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter(\"chunkText\", {\n contentType: \"text\",\n previous\n });\n if (previous) {\n previous.next = token;\n }\n previous = token;\n return data(code);\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit(\"chunkText\");\n effects.exit(\"paragraph\");\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit(\"chunkText\");\n return lineStart;\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {\n * Construct,\n * ContainerState,\n * InitialConstruct,\n * Initializer,\n * Point,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n * Construct and its state.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n};\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeDocument(effects) {\n const self = this;\n /** @type {Array<StackItem>} */\n const stack = [];\n let continued = 0;\n /** @type {TokenizeContext | undefined} */\n let childFlow;\n /** @type {Token | undefined} */\n let childToken;\n /** @type {number} */\n let lineStartOffset;\n return start;\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n }\n\n // Done.\n return checkNewContainers(code);\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++;\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n if (childFlow) {\n closeFlow();\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {Point | undefined} */\n let point;\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n let index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n return checkNewContainers(code);\n }\n return start(code);\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n }\n\n // Check if there is a new container.\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(continued);\n return documentContinued(code);\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]);\n // Try another.\n return documentContinued(code);\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(0);\n effects.consume(code);\n return;\n }\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter(\"chunkFlow\", {\n _tokenizer: childFlow,\n contentType: \"flow\",\n previous: childToken\n });\n return flowContinue(code);\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit(\"chunkFlow\"), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit(\"chunkFlow\"));\n // Get ready for the next line.\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n effects.consume(code);\n return flowContinue;\n }\n\n /**\n * @param {Token} token\n * Token.\n * @param {boolean | undefined} [endOfFile]\n * Whether the token is at the end of the file (default: `false`).\n * @returns {undefined}\n * Nothing.\n */\n function writeToChild(token, endOfFile) {\n const stream = self.sliceStream(token);\n if (endOfFile) {\n stream.push(null);\n }\n token.previous = childToken;\n if (childToken) {\n childToken.next = token;\n }\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream);\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length;\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && (\n // …and either is not ended yet…\n !childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {boolean | undefined} */\n let seen;\n /** @type {Point | undefined} */\n let point;\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n seen = true;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n }\n }\n\n /**\n * @param {number} size\n * Size.\n * @returns {undefined}\n * Nothing.\n */\n function exitContainers(size) {\n let index = stack.length;\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n stack.length = size;\n }\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n * Tokenizer.\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), \"linePrefix\", this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n if (unicodePunctuation(code)) {\n return 2;\n }\n}","/**\n * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array<Event>} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array<Event>}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array<Resolver>} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"autolink\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.enter(\"autolinkProtocol\");\n return open;\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n if (code === 64) {\n return nok(code);\n }\n return emailAtext(code);\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1;\n return schemeInsideOrEmailAtext(code);\n }\n return emailAtext(code);\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n size = 0;\n return urlInside;\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n size = 0;\n return emailAtext(code);\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit(\"autolinkProtocol\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return urlInside;\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n return emailAtSignOrDot;\n }\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n return nok(code);\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit(\"autolinkProtocol\").type = \"autolinkEmail\";\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n return emailValue(code);\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | a<user.name@ex-ample.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel;\n effects.consume(code);\n return next;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blankLine = {\n partial: true,\n tokenize: tokenizeBlankLine\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLine(effects, ok, nok) {\n return start;\n\n /**\n * Start of blank line.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n return markdownSpace(code) ? factorySpace(effects, after, \"linePrefix\")(code) : after(code);\n }\n\n /**\n * At eof/eol, after optional whitespace.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blockQuote = {\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit,\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState;\n if (!state.open) {\n effects.enter(\"blockQuote\", {\n _container: true\n });\n state.open = true;\n }\n effects.enter(\"blockQuotePrefix\");\n effects.enter(\"blockQuoteMarker\");\n effects.consume(code);\n effects.exit(\"blockQuoteMarker\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter(\"blockQuotePrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"blockQuotePrefixWhitespace\");\n effects.exit(\"blockQuotePrefix\");\n return ok;\n }\n effects.exit(\"blockQuotePrefix\");\n return ok(code);\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this;\n return contStart;\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(effects, contBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return contBefore(code);\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code);\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit(\"blockQuote\");\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterEscape\");\n effects.enter(\"escapeMarker\");\n effects.consume(code);\n effects.exit(\"escapeMarker\");\n return inside;\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter(\"characterEscapeValue\");\n effects.consume(code);\n effects.exit(\"characterEscapeValue\");\n effects.exit(\"characterEscape\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this;\n let size = 0;\n /** @type {number} */\n let max;\n /** @type {(code: Code) => boolean} */\n let test;\n return start;\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterReference\");\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n return open;\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter(\"characterReferenceMarkerNumeric\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerNumeric\");\n return numeric;\n }\n effects.enter(\"characterReferenceValue\");\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter(\"characterReferenceMarkerHexadecimal\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerHexadecimal\");\n effects.enter(\"characterReferenceValue\");\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n effects.enter(\"characterReferenceValue\");\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit(\"characterReferenceValue\");\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n effects.exit(\"characterReference\");\n return ok;\n }\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpaceMinMax } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n\n/** @type {Construct} */\nconst furtherStart = {\n partial: true,\n tokenize: tokenizeFurtherStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n return start;\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter(\"codeIndented\");\n return factorySpaceMinMax(effects, atBreak, nok, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return inside(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return atBreak(code);\n }\n effects.consume(code);\n return inside;\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit(\"codeIndented\");\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this;\n return furtherStart;\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return furtherStart;\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * After not enough of a prefix.\n *\n * A following line ending is another (potentially blank) line to try,\n * anything else means this isn’t a continuation.\n *\n * ```markdown\n * > | aaa\n *\n * | bbb\n * ```\n *\n * @type {State}\n */\n function onNotEnoughPrefix(code) {\n return markdownLineEnding(code) ? furtherStart(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Previous,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n previous,\n resolve: resolveCodeText,\n tokenize: tokenizeCodeText\n};\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === \"codeTextData\") {\n // Then we have padding.\n events[headEnterIndex][1].type = \"codeTextPadding\";\n events[tailExitIndex][1].type = \"codeTextPadding\";\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = \"codeTextData\";\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"codeText\");\n effects.enter(\"codeTextSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n effects.exit(\"codeTextSequence\");\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter(\"codeTextSequence\");\n size = 0;\n return sequenceClose(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter(\"codeTextData\");\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit(\"codeTextData\");\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit(\"codeTextSequence\");\n effects.exit(\"codeText\");\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = \"codeTextData\";\n return data(code);\n }\n}","/**\n * Some of the internal operations of micromark do lots of editing\n * operations on very large arrays. This runs into problems with two\n * properties of most circa-2020 JavaScript interpreters:\n *\n * - Array-length modifications at the high end of an array (push/pop) are\n * expected to be common and are implemented in (amortized) time\n * proportional to the number of elements added or removed, whereas\n * other operations (shift/unshift and splice) are much less efficient.\n * - Function arguments are passed on the stack, so adding tens of thousands\n * of elements to an array with `arr.push(...newElements)` will frequently\n * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)\n *\n * SpliceBuffers are an implementation of gap buffers, which are a\n * generalization of the \"queue made of two stacks\" idea. The splice buffer\n * maintains a cursor, and moving the cursor has cost proportional to the\n * distance the cursor moves, but inserting, deleting, or splicing in\n * new information at the cursor is as efficient as the push/pop operation.\n * This allows for an efficient sequence of splices (or pushes, pops, shifts,\n * or unshifts) as long such edits happen at the same part of the array or\n * generally sweep through the array from the beginning to the end.\n *\n * The interface for splice buffers also supports large numbers of inputs by\n * passing a single array argument rather passing multiple arguments on the\n * function call stack.\n *\n * @template T\n * Item type.\n */\nexport class SpliceBuffer {\n /**\n * @param {ReadonlyArray<T> | null | undefined} [initial]\n * Initial items (optional).\n * @returns\n * Splice buffer.\n */\n constructor(initial) {\n /** @type {Array<T>} */\n this.left = initial ? [...initial] : [];\n /** @type {Array<T>} */\n this.right = [];\n }\n\n /**\n * Array access;\n * does not move the cursor.\n *\n * @param {number} index\n * Index.\n * @return {T}\n * Item.\n */\n get(index) {\n if (index < 0 || index >= this.left.length + this.right.length) {\n throw new RangeError('Cannot access index `' + index + '` in a splice buffer of size `' + (this.left.length + this.right.length) + '`');\n }\n if (index < this.left.length) return this.left[index];\n return this.right[this.right.length - index + this.left.length - 1];\n }\n\n /**\n * The length of the splice buffer, one greater than the largest index in the\n * array.\n */\n get length() {\n return this.left.length + this.right.length;\n }\n\n /**\n * Remove and return `list[0]`;\n * moves the cursor to `0`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n shift() {\n this.setCursor(0);\n return this.right.pop();\n }\n\n /**\n * Slice the buffer to get an array;\n * does not move the cursor.\n *\n * @param {number} start\n * Start.\n * @param {number | null | undefined} [end]\n * End (optional).\n * @returns {Array<T>}\n * Array of items.\n */\n slice(start, end) {\n /** @type {number} */\n const stop = end === null || end === undefined ? Number.POSITIVE_INFINITY : end;\n if (stop < this.left.length) {\n return this.left.slice(start, stop);\n }\n if (start > this.left.length) {\n return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse();\n }\n return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());\n }\n\n /**\n * Mimics the behavior of Array.prototype.splice() except for the change of\n * interface necessary to avoid segfaults when patching in very large arrays.\n *\n * This operation moves cursor is moved to `start` and results in the cursor\n * placed after any inserted items.\n *\n * @param {number} start\n * Start;\n * zero-based index at which to start changing the array;\n * negative numbers count backwards from the end of the array and values\n * that are out-of bounds are clamped to the appropriate end of the array.\n * @param {number | null | undefined} [deleteCount=0]\n * Delete count (default: `0`);\n * maximum number of elements to delete, starting from start.\n * @param {Array<T> | null | undefined} [items=[]]\n * Items to include in place of the deleted items (default: `[]`).\n * @return {Array<T>}\n * Any removed items.\n */\n splice(start, deleteCount, items) {\n /** @type {number} */\n const count = deleteCount || 0;\n this.setCursor(Math.trunc(start));\n const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);\n if (items) chunkedPush(this.left, items);\n return removed.reverse();\n }\n\n /**\n * Remove and return the highest-numbered item in the array, so\n * `list[list.length - 1]`;\n * Moves the cursor to `length`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n pop() {\n this.setCursor(Number.POSITIVE_INFINITY);\n return this.left.pop();\n }\n\n /**\n * Inserts a single item to the high-numbered side of the array;\n * moves the cursor to `length`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n push(item) {\n this.setCursor(Number.POSITIVE_INFINITY);\n this.left.push(item);\n }\n\n /**\n * Inserts many items to the high-numbered side of the array.\n * Moves the cursor to `length`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n pushMany(items) {\n this.setCursor(Number.POSITIVE_INFINITY);\n chunkedPush(this.left, items);\n }\n\n /**\n * Inserts a single item to the low-numbered side of the array;\n * Moves the cursor to `0`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n unshift(item) {\n this.setCursor(0);\n this.right.push(item);\n }\n\n /**\n * Inserts many items to the low-numbered side of the array;\n * moves the cursor to `0`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n unshiftMany(items) {\n this.setCursor(0);\n chunkedPush(this.right, items.reverse());\n }\n\n /**\n * Move the cursor to a specific position in the array. Requires\n * time proportional to the distance moved.\n *\n * If `n < 0`, the cursor will end up at the beginning.\n * If `n > length`, the cursor will end up at the end.\n *\n * @param {number} n\n * Position.\n * @return {undefined}\n * Nothing.\n */\n setCursor(n) {\n if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;\n if (n < this.left.length) {\n // Move cursor to the this.left\n const removed = this.left.splice(n, Number.POSITIVE_INFINITY);\n chunkedPush(this.right, removed.reverse());\n } else {\n // Move cursor to the this.right\n const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);\n chunkedPush(this.left, removed.reverse());\n }\n }\n}\n\n/**\n * Avoid stack overflow by pushing items onto the stack in segments\n *\n * @template T\n * Item type.\n * @param {Array<T>} list\n * List to inject into.\n * @param {ReadonlyArray<T>} right\n * Items to inject.\n * @return {undefined}\n * Nothing.\n */\nfunction chunkedPush(list, right) {\n /** @type {number} */\n let chunkStart = 0;\n if (right.length < 10000) {\n list.push(...right);\n } else {\n while (chunkStart < right.length) {\n list.push(...right.slice(chunkStart, chunkStart + 10000));\n chunkStart += 10000;\n }\n }\n}","/**\n * @import {Chunk, Event, Token} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { SpliceBuffer } from './lib/splice-buffer.js';\n\n// Hidden API exposed for testing.\nexport { SpliceBuffer } from './lib/splice-buffer.js';\n\n/**\n * Tokenize subcontent.\n *\n * @param {Array<Event>} eventsArray\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */\n// eslint-disable-next-line complexity\nexport function subtokenize(eventsArray) {\n /** @type {Record<string, number>} */\n const jumps = {};\n let index = -1;\n /** @type {Event} */\n let event;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number} */\n let otherIndex;\n /** @type {Event} */\n let otherEvent;\n /** @type {Array<Event>} */\n let parameters;\n /** @type {Array<Event>} */\n let subevents;\n /** @type {boolean | undefined} */\n let more;\n const events = new SpliceBuffer(eventsArray);\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n event = events.get(index);\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (index && event[1].type === \"chunkFlow\" && events.get(index - 1)[1].type === \"listItemPrefix\") {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"lineEndingBlank\") {\n otherIndex += 2;\n }\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"content\") {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === \"content\") {\n break;\n }\n if (subevents[otherIndex][1].type === \"chunkText\") {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n while (otherIndex--) {\n otherEvent = events.get(otherIndex);\n if (otherEvent[1].type === \"lineEnding\" || otherEvent[1].type === \"lineEndingBlank\") {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events.get(lineIndex)[1].type = \"lineEndingBlank\";\n }\n otherEvent[1].type = \"lineEnding\";\n lineIndex = otherIndex;\n }\n } else if (otherEvent[1].type === \"linePrefix\" || otherEvent[1].type === \"listItemIndent\") {\n // Move past.\n } else {\n break;\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = {\n ...events.get(lineIndex)[1].start\n };\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n events.splice(lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n // The changes to the `events` buffer must be copied back into the eventsArray\n splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));\n return !more;\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {SpliceBuffer<Event>} events\n * Events.\n * @param {number} eventIndex\n * Index.\n * @returns {Record<string, number>}\n * Gaps.\n */\nfunction subcontent(events, eventIndex) {\n const token = events.get(eventIndex)[1];\n const context = events.get(eventIndex)[2];\n let startPosition = eventIndex - 1;\n /** @type {Array<number>} */\n const startPositions = [];\n let tokenizer = token._tokenizer;\n if (!tokenizer) {\n tokenizer = context.parser[token.contentType](token.start);\n if (token._contentTypeTextTrailing) {\n tokenizer._contentTypeTextTrailing = true;\n }\n }\n const childEvents = tokenizer.events;\n /** @type {Array<[number, number]>} */\n const jumps = [];\n /** @type {Record<string, number>} */\n const gaps = {};\n /** @type {Array<Chunk>} */\n let stream;\n /** @type {Token | undefined} */\n let previous;\n let index = -1;\n /** @type {Token | undefined} */\n let current = token;\n let adjust = 0;\n let start = 0;\n const breaks = [start];\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events.get(++startPosition)[1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition);\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n if (!current.next) {\n stream.push(null);\n }\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n tokenizer.write(stream);\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n }\n\n // Unravel the next token.\n previous = current;\n current = current.next;\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token;\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start);\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n }\n\n // Help GC.\n tokenizer.events = [];\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length;\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1]);\n const start = startPositions.pop();\n jumps.push([start, start + slice.length - 1]);\n events.splice(start, 2, slice);\n }\n jumps.reverse();\n index = -1;\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n return gaps;\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n resolve: resolveContent,\n tokenize: tokenizeContent\n};\n\n/** @type {Construct} */\nconst continuationConstruct = {\n partial: true,\n tokenize: tokenizeContinuation\n};\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous;\n return chunkStart;\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter(\"content\");\n previous = effects.enter(\"chunkContent\", {\n contentType: \"content\"\n });\n return chunkInside(code);\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n }\n\n // Data.\n effects.consume(code);\n return chunkInside;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit(\"chunkContent\");\n effects.exit(\"content\");\n return ok(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code);\n effects.exit(\"chunkContent\");\n previous.next = effects.enter(\"chunkContent\", {\n contentType: \"content\",\n previous\n });\n previous = previous.next;\n return chunkInside;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this;\n return startLookahead;\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit(\"chunkContent\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, prefixed, \"linePrefix\");\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1];\n if (!self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * <a>\n * <a\\>b>\n * <a b>\n * <a)>\n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`<a>` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (`<a>`).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n const limit = max || Number.POSITIVE_INFINITY;\n let balance = 0;\n return start;\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return enclosedBefore;\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return raw(code);\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return enclosed(code);\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n return enclosedBefore(code);\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? enclosedEscape : enclosed;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | <a\\*a>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return enclosed;\n }\n return enclosed(code);\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n if (balance < limit && code === 40) {\n effects.consume(code);\n balance++;\n return raw;\n }\n if (code === 41) {\n effects.consume(code);\n balance--;\n return raw;\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? rawEscape : raw;\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return raw;\n }\n return raw(code);\n }\n}","/**\n * @import {\n * Effects,\n * State,\n * TokenizeContext,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this;\n let size = 0;\n /** @type {boolean} */\n let seen;\n return start;\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (size > 999 || code === null || code === 91 || code === 93 && !seen ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return atBreak;\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return labelInside(code);\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n if (!seen) seen = !markdownSpace(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n}","/**\n * @import {\n * Code,\n * Effects,\n * State,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return begin;\n }\n return nok(code);\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n return atBreak(code);\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return begin(marker);\n }\n if (code === null) {\n return nok(code);\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, atBreak, \"linePrefix\");\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return inside(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n return code === 92 ? escape : inside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return inside;\n }\n return inside(code);\n }\n}","/**\n * @import {Effects, State} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n seen = true;\n return start;\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? \"linePrefix\" : \"lineSuffix\")(code);\n }\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n\n/** @type {Construct} */\nconst titleBefore = {\n partial: true,\n tokenize: tokenizeTitleBefore\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this;\n /** @type {string} */\n let identifier;\n return start;\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter(\"definition\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(self, effects, labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionLabel\", \"definitionLabelMarker\", \"definitionLabelString\")(code);\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n if (code === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code);\n effects.exit(\"definitionMarker\");\n return markerAfter;\n }\n return nok(code);\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code);\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(effects, destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionDestination\", \"definitionDestinationLiteral\", \"definitionDestinationLiteralMarker\", \"definitionDestinationRaw\", \"definitionDestinationString\")(code);\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code);\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code) ? factorySpace(effects, afterWhitespace, \"whitespace\")(code) : afterWhitespace(code);\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"definition\");\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier);\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore;\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code);\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(effects, titleAfter, nok, \"definitionTitle\", \"definitionTitleMarker\", \"definitionTitleString\")(code);\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, \"whitespace\")(code) : titleAfterOptionalWhitespace(code);\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"hardBreakEscape\");\n effects.consume(code);\n return after;\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit(\"hardBreakEscape\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n resolve: resolveHeadingAtx,\n tokenize: tokenizeHeadingAtx\n};\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2;\n let contentStart = 3;\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === \"whitespace\") {\n contentStart += 2;\n }\n\n // Suffix whitespace, part of the closing.\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === \"whitespace\") {\n contentEnd -= 2;\n }\n if (events[contentEnd][1].type === \"atxHeadingSequence\" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === \"whitespace\")) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n if (contentEnd > contentStart) {\n const content = {\n type: \"atxHeadingText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n const text = {\n type: \"chunkText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: \"text\"\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter(\"atxHeading\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return sequenceOpen;\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n return nok(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceFurther(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"atxHeading\");\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, \"whitespace\")(code);\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter(\"atxHeadingText\");\n return data(code);\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code);\n return sequenceFurther;\n }\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingText\");\n return atBreak(code);\n }\n effects.consume(code);\n return data;\n }\n}","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const htmlFlow = {\n concrete: true,\n name: 'htmlFlow',\n resolveTo: resolveToHtmlFlow,\n tokenize: tokenizeHtmlFlow\n};\n\n/** @type {Construct} */\nconst blankLineBefore = {\n partial: true,\n tokenize: tokenizeBlankLineBefore\n};\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length;\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === \"htmlFlow\") {\n break;\n }\n }\n if (index > 1 && events[index - 2][1].type === \"linePrefix\") {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start;\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start;\n // Remove the line prefix.\n events.splice(index - 2, 2);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this;\n /** @type {number} */\n let marker;\n /** @type {boolean} */\n let closingTag;\n /** @type {string} */\n let buffer;\n /** @type {number} */\n let index;\n /** @type {Code} */\n let markerB;\n return start;\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"htmlFlow\");\n effects.enter(\"htmlFlowData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | <x />\n * ^\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n closingTag = true;\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n marker = 3;\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n marker = 2;\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n marker = 5;\n index = 0;\n return cdataOpenInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n marker = 4;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<!-`, inside a comment, at another `-`.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<![`, inside CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | </x>\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | <ab>\n * ^^\n * > | </ab>\n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n const slash = code === 47;\n const name = buffer.toLowerCase();\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6;\n if (slash) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n marker = 7;\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > | <div/>\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | <x/>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n return completeEnd(code);\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | <a />\n * ^\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * > | <a >\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n return completeEnd(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n return completeAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | <a b>\n * ^\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n return completeAttributeNameBefore(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n markerB = code;\n return completeAttributeValueQuoted;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n return completeAttributeValueUnquoted(code);\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * > | <a b='c'>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code);\n markerB = null;\n return completeAttributeValueQuotedAfter;\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | <x>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n if (code === 60 && marker === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n if (code === 62 && marker === 4) {\n effects.consume(code);\n return continuationClose;\n }\n if (code === 63 && marker === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n if (code === 93 && marker === 5) {\n effects.consume(code);\n return continuationCdataInside;\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit(\"htmlFlowData\");\n return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationStart(code);\n }\n effects.consume(code);\n return continuation;\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code);\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return continuationBefore;\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | <x>\n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code);\n }\n effects.enter(\"htmlFlowData\");\n return continuation(code);\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `</`, in a raw tag name.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | <!-->\n * ^\n * > | <?>\n * ^\n * > | <!q>\n * ^\n * > | <!--ab-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > | <div>\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code> | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * > | a <![CDATA[>&<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after `<!-`, at another `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After `<![`, in CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a <!b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After `</x`, in a tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After `<x`, in opening tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a <!--a\n * ^\n * | b-->\n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array<Event>} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array<Event>} */\n let media;\n\n // Find an opening.\n while (index--) {\n const token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n const labelStarts = self._labelStarts;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n if (labelStarts) {\n // Discard ones that failed to close,\n // they’re not needed anymore.\n while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {\n labelStarts.pop();\n }\n labelStart = labelStarts[labelStarts.length - 1];\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n // This label start is now used up: discard it so it’s never found again.\n\n labelStarts.pop();\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelImage;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelImage = effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n * <p>!<a href=\\\"b\\\">^a</a></p>\n * <p>!<a href=\\\"c\\\">^a</a></p>\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelImage);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelLink;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelLink = effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelLink);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n const editMap = new EditMap();\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n editMap.add(index, 1, []);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n editMap.add(text, 0, [['enter', heading, context]]);\n editMap.add(definition + 1, 0, [['exit', events[content][1], context]]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n editMap.add(events.length, 0, [['exit', heading, context]]);\n editMap.consume(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { EditMap } from 'micromark-util-edit-map';\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n const editMap = new EditMap();\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) {\n break;\n }\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n editMap.add(eventIndex, 0, [['enter', token, context], ['exit', token, context]]);\n }\n }\n eventIndex++;\n }\n }\n editMap.consume(events);\n return events;\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record<string, number>} */\n const columnStart = {};\n /** @type {Array<Construct>} */\n const resolveAllConstructs = [];\n /** @type {Array<Chunk>} */\n let chunks = [];\n /** @type {Array<Token>} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n const chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array<Construct> | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray<Construct>} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray<Construct>} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {Pick<Token, 'end' | 'start'>} token\n * Token.\n * @returns {Array<Chunk>}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array<Chunk>} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array<string>} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else {\n switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) {\n continue;\n }\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array<Event>} events\n * Events.\n * @returns {Array<Event>}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n\n /** @type {Array<Chunk>} */\n const chunks = [];\n let startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n const match = search.exec(value);\n const endPosition = match && match.index !== undefined ? match.index : value.length;\n const code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n const next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) {\n chunks.push(-1);\n }\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) {\n chunks.push(-5);\n }\n if (buffer) {\n chunks.push(buffer);\n }\n chunks.push(null);\n }\n return chunks;\n }\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n afterExit: [],\n beforeEnter: [],\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array<Event>} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: [],\n position: undefined\n };\n /** @type {Omit<CompileContext, 'sliceSerialize'>} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array<number>} */\n const listStack = [];\n /** @type {Array<Event>} */\n const prepared = [];\n let index = -1;\n\n // Add `listItem` tokens and infer spread.\n // Each list is prepared while it is last in `prepared`, so nothing shifts.\n while (++index < events.length) {\n prepared.push(events[index]);\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(prepared.length - 1);\n } else {\n const tail = listStack.pop();\n prepareList(prepared, tail);\n }\n }\n }\n events = prepared;\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (events[index][0] === 'enter' && config.beforeEnter.length > 0) {\n callListeners(config.beforeEnter, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (own.call(handler, events[index][1].type)) {\n // Note: spread first, V8 has optimizations for object shape cloning.\n handler[events[index][1].type].call({\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (events[index][0] === 'exit' && config.afterExit.length > 0) {\n callListeners(config.afterExit, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array<Handle>} listeners\n * Listeners.\n * @param {CompileContext} context\n * Context.\n * @param {Token} token\n * Token.\n * @returns {undefined}\n * Nothing.\n */\n function callListeners(listeners, context, token) {\n let index = -1;\n while (++index < listeners.length) {\n listeners[index].call(context, token);\n }\n }\n\n /**\n * @param {Array<Event>} events\n * Events, ending with the list to prepare.\n * @param {number} start\n * Index of the list enter.\n * @returns {undefined}\n */\n function prepareList(events, start) {\n const end = events.length - 1;\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n /**\n * `listItem` events to insert before the event at `at`, in walk order.\n * Merged in after the walk, as inserting while walking would shift the\n * rest of the list once per item.\n * @type {Array<{at: number, event: Event}>}\n */\n const insertions = [];\n while (++index <= end) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n insertions.push({\n at: lineIndex || index,\n event: ['exit', listItem, event[2]]\n });\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n insertions.push({\n at: index,\n event: ['enter', item, event[2]]\n });\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n\n // The list is at the end of `events`: take it off, then push it back with\n // the insertions merged in.\n // Nothing follows the list, so nothing shifts.\n const listEvents = events.splice(start);\n let insertion = 0;\n index = -1;\n while (++index < listEvents.length) {\n while (insertion < insertions.length && insertions[insertion].at === start + index) {\n events.push(insertions[insertion++].event);\n }\n events.push(listEvents[index]);\n }\n events[start][1]._spread = listSpread;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n }\n if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array<PhrasingContent>} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n // Each node factory pre-declares `position` as undefined as the trailing\n // property. enter() patches it to a real value, but the property already\n // exists, so V8 sees a single hidden class for each node type from\n // construction through the rest of the pipeline. Without the pre-declare,\n // each node took a hidden-class transition when enter() added position.\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: '',\n position: undefined\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: '',\n position: undefined\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break',\n position: undefined\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null,\n position: undefined\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak',\n position: undefined\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array<Array<Extension> | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'afterExit':\n case 'beforeEnter':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n }\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n}","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","export function deprecate(fn) {\n return fn\n}\n\nexport function equal() {}\n\nexport function ok() {}\n\nexport function unreachable() {}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @import {Node, Parent} from 'unist'\n */\n\n/**\n * @template Fn\n * @template Fallback\n * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate\n */\n\n/**\n * @callback Check\n * Check that an arbitrary value is a node.\n * @param {unknown} this\n * The given context.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n *\n * @typedef {Record<string, unknown> | Node} Props\n * Object to check for equivalence.\n *\n * Note: `Node` is included as it is common but is not indexable.\n *\n * @typedef {Array<Props | TestFunction | string> | ReadonlyArray<Props | TestFunction | string> | Props | TestFunction | string | null | undefined} Test\n * Check for an arbitrary node.\n *\n * @callback TestFunction\n * Check if a node passes a test.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | undefined | void}\n * Whether this node passes the test.\n *\n * Note: `void` is included until TS sees no return as `undefined`.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param {unknown} node\n * Thing to check, typically `Node`.\n * @param {Test} test\n * A check for a specific node.\n * @param {number | null | undefined} index\n * The node’s position in its parent.\n * @param {Parent | null | undefined} parent\n * The node’s parent.\n * @param {unknown} context\n * Context object (`this`) to pass to `test` functions.\n * @returns {boolean}\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends ReadonlyArray<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n * (<Condition extends Array<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n * (<Condition extends string>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * (<Condition extends Props>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * (<Condition extends TestFunction>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &\n * ((node?: null | undefined) => false) &\n * ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function (node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n return looksLikeANode(node)\n ? check.call(context, node, index, parent)\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param {Test} test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns {Check}\n * An assertion.\n */\nexport const convert =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &\n * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((test?: Test) => Check)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {Check}\n */\n function (test) {\n if (test === null || test === undefined) {\n return ok\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test)\n ? anyFactory(test)\n : // Cast because `ReadonlyArray` goes into the above but `isArray`\n // narrows to `Array`.\n propertiesFactory(/** @type {Props} */ (test))\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array<Props | TestFunction | string>} tests\n * @returns {Check}\n */\nfunction anyFactory(tests) {\n /** @type {Array<Check>} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @type {TestFunction}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].apply(this, parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {Check}\n */\nfunction propertiesFactory(check) {\n const checkAsRecord = /** @type {Record<string, unknown>} */ (check)\n\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n const nodeAsRecord = /** @type {Record<string, unknown>} */ (\n /** @type {unknown} */ (node)\n )\n\n /** @type {string} */\n let key\n\n for (key in check) {\n if (nodeAsRecord[key] !== checkAsRecord[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {Check}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunction} testFunction\n * @returns {Check}\n */\nfunction castFactory(testFunction) {\n return check\n\n /**\n * @this {unknown}\n * @type {Check}\n */\n function check(value, index, parent) {\n return Boolean(\n looksLikeANode(value) &&\n testFunction.call(\n this,\n value,\n typeof index === 'number' ? index : undefined,\n parent || undefined\n )\n )\n }\n}\n\nfunction ok() {\n return true\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction looksLikeANode(value) {\n return value !== null && typeof value === 'object' && 'type' in value\n}\n","/**\n * Color a string.\n *\n * @param {string} d\n * Value.\n * @returns {string}\n * Colored value.\n */\nexport function color(d) {\n return '\\u001B[33m' + d + '\\u001B[39m'\n}\n","/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate<Check, Value> extends Value\n * ? Predicate<Check, Value>\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends ReadonlyArray<infer T>\n * ? MatchesOne<Value, T>\n * : Check extends Array<infer T>\n * ? MatchesOne<Value, T>\n * : MatchesOne<Value, Check>\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array<infer Children>}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent<Node, Child>\n * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {'skip' | boolean} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from an enter visitor.\n *\n * Like `VisitorResultExit`,\n * but `SKIP` can also be returned,\n * to not walk the children of the node,\n * and `ActionTuple` can be used to combine an action with an index.\n *\n * @typedef {Index | boolean | null | undefined | void} VisitorResultExit\n * Any value that can be returned from an exit visitor.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given) before its children.\n *\n * Changes inside `node` are walked next.\n * Replacing or removing it is easier in `exit`.\n * When replacing or removing it here,\n * return `SKIP` (as otherwise its old children are walked),\n * or `[SKIP, index]` to continue with the node now at `index`.\n * Changing next siblings (in walk order) is fine;\n * changing previous siblings needs a new `Index`.\n * Removing an ancestor or changing its previous siblings is not supported.\n * @param {Visited} node\n * Found node.\n * @param {Array<VisitedParents>} ancestors\n * Ancestors of `node`.\n * @param {number | undefined} index\n * Index of `node` in its parent (the last of `ancestors`),\n * or `undefined` for the tree itself.\n * @returns {VisitorResult}\n * What to do next.\n *\n * Like `VisitorExit`,\n * but `SKIP` can also be returned,\n * to not walk the children of `node`.\n * Passing a tuple back (`ActionTuple`) only makes sense as `[SKIP, Index]`.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @callback VisitorExit\n * Handle a node (matching `test`, if given) after its children.\n *\n * Changes inside `node` are not walked,\n * which makes this a good place to change `node` based on its children,\n * or to replace or remove it.\n * When removing `node` or changing previous siblings (in walk order),\n * return a new `Index`.\n * Removing an ancestor or changing its previous siblings is not supported.\n * @param {Visited} node\n * Found node.\n * @param {Array<VisitedParents>} ancestors\n * Ancestors of `node`.\n * @param {number | undefined} index\n * Index of `node` in its parent (the last of `ancestors`),\n * or `undefined` for the tree itself.\n * @returns {VisitorResultExit}\n * What to do next.\n *\n * `CONTINUE` (`true`, nothing) continues as normal,\n * `EXIT` (`false`) stops traversing,\n * and `Index` continues at that sibling.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n * Ancestor type.\n * @typedef Visitors\n * Handle nodes when entering and exiting them.\n * The `enter` visitor is optional while `exit` is required.\n *\n * Pass an `enter` visitor directly to only handle nodes when entering them.\n *\n * `enter` is called before children (if any) are walked and `exit` after that.\n * `exit` is still called when `enter` returns `SKIP`.\n * Both `enter` and `exit` are only called for nodes that match an optional `test`.\n * @property {Visitor<Visited, VisitedParents> | null | undefined} [enter]\n * Handle a node before its children (optional).\n * @property {VisitorExit<Visited, VisitedParents>} exit\n * Handle a node after its children.\n */\n\n/**\n * @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n * @template {UnistNode} [Tree=UnistNode]\n * Tree type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\n/**\n * @typedef {Visitors<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitors\n * Build typed `Visitors` from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n * @template {UnistNode} [Tree=UnistNode]\n * Tree type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from 'unist-util-visit-parents/do-not-use-color'\n\n/** @type {Readonly<ActionTuple>} */\nconst empty = []\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n * Only works when entering a node.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given,\n * in *reverse preorder* (**NRL**).\n * An `exit` visitor is called in *postorder* (**LRN**)\n * or if `reverse` is given, in *reverse postorder* (**RLN**).\n *\n * You can choose which nodes are visited by passing a `test`.\n * For complex tests, you should test yourself in a visitor, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * Changes inside a node made when entering it are walked,\n * changes made when exiting it are not.\n * See `Visitor` and `VisitorExit` for more info.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {Check} check\n * `unist-util-is`-compatible test.\n * @param {BuildVisitor<Tree, Check>} enter\n * Handle each node when entering it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {Check} check\n * `unist-util-is`-compatible test.\n * @param {BuildVisitors<Tree, Check>} visitors\n * Handle each node when exiting it, and optionally when entering it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {BuildVisitor<Tree>} enter\n * Handle each node when entering it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {BuildVisitors<Tree>} visitors\n * Handle each node when exiting it, and optionally when entering it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Visitors | Test} testOrEnterOrVisitors\n * `unist-util-is`-compatible test, `enter`, or `visitors`.\n * @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]\n * `enter`, `visitors`, or `reverse` after a test.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visitParents(\n tree,\n testOrEnterOrVisitors,\n enterOrVisitorsOrReverse,\n reverse\n) {\n if (!tree || typeof tree !== 'object') {\n throw new Error('Unexpected value `' + tree + '` for `tree`, expected node')\n }\n\n let preorder = true\n /** @type {Test} */\n let check\n /** @type {Visitors | Visitor} */\n let visitors\n /** @type {Visitor | null | undefined} */\n let enter\n /** @type {VisitorExit | null | undefined} */\n let exit\n\n // Third parameter is an enter visitor or a visitors object, so expect a `test` too.\n if (\n typeof enterOrVisitorsOrReverse === 'function' ||\n (enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')\n ) {\n check = /** @type {Test} */ (testOrEnterOrVisitors)\n visitors = enterOrVisitorsOrReverse\n if (reverse) preorder = false\n }\n // Assume no test.\n else {\n visitors = /** @type {Visitors | Visitor} */ (testOrEnterOrVisitors)\n if (enterOrVisitorsOrReverse) preorder = false\n }\n\n if (typeof visitors === 'function') {\n enter = visitors\n } else if (visitors && typeof visitors === 'object') {\n if (visitors.enter === null || visitors.enter === undefined) {\n // Empty.\n } else if (typeof visitors.enter === 'function') {\n enter = visitors.enter\n } else {\n throw new Error(\n 'Unexpected value `' +\n visitors.enter +\n '` for `visitors.enter`, expected optional visitor'\n )\n }\n\n if (typeof visitors.exit === 'function') {\n exit = visitors.exit\n } else {\n throw new Error(\n 'Unexpected value `' +\n visitors.exit +\n '` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)'\n )\n }\n } else {\n throw new Error(\n 'Unexpected value `' +\n visitors +\n '` for `enter` or `visitors`, expected visitor or object with visitors'\n )\n }\n\n const is = convert(check)\n const step = preorder ? 1 : -1\n\n factory(tree, undefined, [])()\n\n /**\n * Create a function to visit a node.\n *\n * @param {UnistNode} node\n * Node to visit.\n * @param {number | undefined} index\n * Index of `node` in its parent.\n * @param {Array<UnistParent>} parents\n * Ancestors of `node`.\n * @returns {() => Readonly<ActionTuple>}\n * Visit `node`.\n */\n function factory(node, index, parents) {\n const value = /** @type {Record<string, unknown>} */ (\n node && typeof node === 'object' ? node : {}\n )\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n const matches =\n !check || is(node, index, parents[parents.length - 1] || undefined)\n /** @type {Readonly<ActionTuple>} */\n let result = empty\n\n if (enter && matches) {\n result = toResult(enter(node, parents, index))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if ('children' in node && node.children) {\n const nodeAsParent = /** @type {UnistParent} */ (node)\n\n if (nodeAsParent.children && result[0] !== SKIP) {\n let offset = (preorder ? -1 : nodeAsParent.children.length) + step\n const grandparents = [...parents, nodeAsParent]\n\n while (offset > -1 && offset < nodeAsParent.children.length) {\n const child = nodeAsParent.children[offset]\n\n const subresult = factory(child, offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n }\n\n if (exit && matches) {\n const exitResult = toResult(exit(node, parents, index))\n\n if (exitResult[0] === SKIP) {\n throw new Error(\n 'Unexpected value `' +\n exitResult[0] +\n '` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing'\n )\n }\n\n // Prefer a result from `exit` over `enter`.\n if (exitResult[0] === EXIT || typeof exitResult[1] === 'number') {\n return exitResult\n }\n }\n\n return result\n }\n }\n}\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {Readonly<ActionTuple>}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return value === null || value === undefined ? empty : [value]\n}\n","/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array<Parents>, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array<string>`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array<Node>`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array<Pair>} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {SKIP, visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, visitor)\n }\n\n /**\n * Handle text nodes and skip ignored nodes.\n *\n * @type {BuildVisitor<Root>}\n */\n function visitor(node, parents, index) {\n if (node.type === 'text' && typeof index === 'number') {\n return handler(node, parents, index)\n }\n\n if (ignored(node, index, parents[parents.length - 1])) return SKIP\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node to search in.\n * @param {Array<Parents>} parents\n * Ancestors of `node`.\n * @param {number} index\n * Index of `node` in its parent.\n * @returns {VisitorResult}\n * Where to continue visiting.\n */\n function handler(node, parents, index) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n let change = false\n /** @type {Array<PhrasingContent>} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n add({type: 'text', value: node.value.slice(start, position)})\n }\n\n if (Array.isArray(value)) {\n for (const child of value) add(child)\n } else if (value) {\n add(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n add({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n\n /**\n * Add a node.\n *\n * @param {PhrasingContent} child\n * Node to add.\n * @returns {undefined}\n * Nothing.\n */\n function add(child) {\n const previous = nodes[nodes.length - 1]\n\n if (previous && previous.type === 'text' && child.type === 'text') {\n previous.value += child.value\n } else {\n nodes.push(child)\n }\n }\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {Pairs} */\n const result = []\n\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? /** @type {FindAndReplaceList} */ (tupleOrList)\n : [/** @type {FindAndReplaceTuple} */ (tupleOrList)]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Pattern to find.\n * @returns {RegExp}\n * Global expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Thing to replace with.\n * @returns {ReplaceFunction}\n * Function that returns that thing.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n","/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array<ConstructName>} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * Handle the start of an autolink literal.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter(\n {type: 'link', title: null, url: '', children: [], position: undefined},\n token\n )\n}\n\n/**\n * Handle the start of an autolink literal value.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * Handle the end of an HTTP autolink literal value.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * Handle the end of a `www` autolink literal value.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * Handle the end of an email autolink literal value.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * Handle the end of an autolink literal.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/**\n * Find autolink literals in text and turn them into links.\n *\n * @type {FromMarkdownTransform}\n */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [\n /(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)/gi,\n findUrl\n ],\n [\n /(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?/g,\n findXmpp\n ],\n [/(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)/g, findMailto],\n [\n /(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)/g,\n findEmail\n ]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * Turn a URL match into a link.\n *\n * @type {ReplaceFunction}\n * @param {string} _\n * Whole match.\n * @param {string} protocol\n * Protocol (`http://`, `https://`) or `www`.\n * @param {string} domain\n * Host name, up to the path.\n * @param {string} path\n * Path, query, and fragment.\n * @param {RegExpMatchObject} match\n * Match object.\n * @returns {Array<PhrasingContent> | Link | false}\n * Link, link and trailing text, or `false` if not a URL.\n */\nfunction findUrl(_, protocol, domain, path, match) {\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n let prefix = ''\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (unicodePunctuation(domain.charCodeAt(0)) || !isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0], position: undefined}],\n position: undefined\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1], position: undefined}]\n }\n\n return result\n}\n\n/**\n * Turn an email match into a link.\n *\n * @type {ReplaceFunction}\n * @param {string} _\n * Whole match.\n * @param {string} atext\n * Local part.\n * @param {string} label\n * Domain.\n * @returns {Link | false}\n * Link, or `false` if not an email.\n */\nfunction findEmail(_, atext, label) {\n if (/[\\d\\-_]$/.test(label)) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label, position: undefined}],\n position: undefined\n }\n}\n\n/**\n * Turn a `mailto:` email match into a link.\n *\n * @type {ReplaceFunction}\n * @param {string} _\n * Whole match.\n * @param {string} atext\n * Local part.\n * @param {string} label\n * Domain.\n * @returns {Link | false}\n * Link, or `false` if not an email.\n */\nfunction findMailto(_, atext, label) {\n if (/[\\d\\-_]$/.test(label)) {\n return false\n }\n\n const value = 'mailto:' + atext + '@' + label\n\n return {\n type: 'link',\n title: null,\n url: value,\n children: [{type: 'text', value, position: undefined}],\n position: undefined\n }\n}\n\n/**\n * Turn an `xmpp:` address match into a link.\n *\n * @type {ReplaceFunction}\n * @param {string} matchValue\n * Whole match.\n * @param {string} atext\n * Local part.\n * @param {string} label\n * Domain.\n * @param {string | undefined} resource\n * Resource (`/` and more), if any.\n * @param {RegExpMatchObject} match\n * Match object.\n * @returns {Link | false}\n * Link, or `false` if not an address.\n */\nfunction findXmpp(matchValue, atext, label, resource, match) {\n if (\n /[\\d\\-_]$/.test(label) ||\n (resource &&\n (!/[A-Za-z]$/.test(resource) ||\n match.input.charAt(match.index + matchValue.length) === '@'))\n ) {\n return false\n }\n\n const value = 'xmpp:' + atext + '@' + label + (resource || '')\n\n return {\n type: 'link',\n title: null,\n url: value,\n children: [{type: 'text', value, position: undefined}],\n position: undefined\n }\n}\n\n/**\n * Check if a domain is valid.\n *\n * @param {string} domain\n * Host name to check.\n * @returns {boolean}\n * Whether the domain is valid.\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[\\dA-Za-z]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[\\dA-Za-z]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * Split trailing punctuation off a URL.\n *\n * @param {string} url\n * Value to split.\n * @returns {[string, string | undefined]}\n * URL and trailing punctuation, if any.\n */\nfunction splitUrl(url) {\n let index = url.length\n\n while (index > 0) {\n const code = url.charCodeAt(index - 1)\n\n if (\n code === 33 /* `!` */ ||\n code === 34 /* `\"` */ ||\n code === 38 /* `&` */ ||\n code === 39 /* `'` */ ||\n code === 41 /* `)` */ ||\n code === 44 /* `,` */ ||\n code === 46 /* `.` */ ||\n code === 58 /* `:` */ ||\n code === 59 /* `;` */ ||\n code === 60 /* `<` */ ||\n code === 62 /* `>` */ ||\n code === 63 /* `?` */ ||\n code === 93 /* `]` */ ||\n code === 125 /* `}` */\n ) {\n index--\n } else {\n break\n }\n }\n\n if (index === url.length) {\n return [url, undefined]\n }\n\n let trail = url.slice(index)\n url = url.slice(0, index)\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * Check if the character before a match is allowed.\n *\n * @param {RegExpMatchObject} match\n * Match object.\n * @returns {boolean}\n * Whether the previous character is allowed.\n */\nfunction previous(match) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n match.index === 0 || unicodeWhitespace(code) || unicodePunctuation(code)\n )\n}\n","/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @import {Delete} from 'mdast'\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {\n * Attention,\n * ConstructName,\n * Handle as ToMarkdownHandle,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>\n *\n * @type {Array<ConstructName>}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.attention = attentionDelete\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n handlers: {delete: handleDelete},\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ]\n }\n}\n\n/**\n * Enter strikethrough.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: [], position: undefined}, token)\n}\n\n/**\n * Exit strikethrough.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * Serialize a delete node.\n *\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n * Node to serialize.\n */\nfunction handleDelete(node, _, state, info) {\n // To do: next major: empty this function, like emphasis and strong handlers,\n // this is no longer needed.\n const tracker = state.createTracker(info)\n const sequence = state.stack.includes('strikethrough') ? '~' : '~~'\n const exit = state.enter('strikethrough')\n let value = tracker.move(sequence)\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/**\n * Serialize a delete node as attention.\n *\n * @type {Attention}\n */\nfunction attentionDelete() {\n return {construct: 'strikethrough', markers: ['~'], sizes: [2, 1]}\n}\n\n/**\n * Peek the first character of a delete node.\n *\n * @type {ToMarkdownHandle}\n */\nfunction peekDelete() {\n return '~'\n}\n","/**\n * @import {Heading, InlineCode, Table, TableCell, TableRow} from 'mdast'\n * @import {Options as MarkdownTableOptions} from 'markdown-table'\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle,\n * } from 'mdast-util-from-markdown'\n * @import {\n * Options as ToMarkdownExtension,\n * Handle as ToMarkdownHandle,\n * Info,\n * Join,\n * State\n * } from 'mdast-util-to-markdown'\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\nimport {toString} from 'mdast-util-to-string'\nimport {EXIT, visit} from 'unist-util-visit'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * Enter a table.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n // Trailing `position: undefined` keeps the table hidden class stable;\n // mdast-util-from-markdown's enter() patches the field to a real value\n // but the property already exists, so no shape transition fires.\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: [],\n position: undefined\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * Exit a table.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * Enter a row.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n // See enterTable above for the rationale on the trailing position field.\n this.enter({type: 'tableRow', children: [], position: undefined}, token)\n}\n\n/**\n * Exit a row or cell.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * Enter a cell.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n // See enterTable above for the rationale on the trailing position field.\n this.enter({type: 'tableCell', children: [], position: undefined}, token)\n}\n\n/**\n * Exit code (text).\n *\n * Overwrites the default code text data handler to unescape escaped pipes\n * when they are in tables.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * Unescape an escaped pipe.\n *\n * @param {string} $0\n * Whole match.\n * @param {string} $1\n * Escaped character.\n * @returns {string}\n * Replacement.\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const {\n tableCellPadding: padding,\n tablePipeAlign: alignDelimiters,\n stringLength\n } = settings\n const around = padding ? ' ' : '|'\n\n return {\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n },\n join: [joinTable],\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>\n {atBreak: true, character: '-', after: '[:|-]'}\n ]\n }\n\n /**\n * Serialize a table.\n *\n * @type {ToMarkdownHandle}\n * @param {Table} node\n * Table.\n */\n function handleTable(node, _, state, info) {\n const matrix = handleTableAsData(node, state, info)\n const head = matrix[0]\n\n if (head) {\n let columns = node.align ? node.align.length : 0\n let index = -1\n\n if (!columns) {\n while (++index < matrix.length) {\n if (matrix[index].length > columns) columns = matrix[index].length\n }\n }\n\n while (head.length < columns) head.push('')\n }\n\n return serializeData(matrix, node.align)\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n * Row.\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * Serialize a cell.\n *\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n * Cell.\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * Serialize serialized cells as a table.\n *\n * @param {Array<Array<string>>} matrix\n * Serialized cells.\n * @param {Array<string | null | undefined> | null | undefined} [align]\n * Alignment.\n * @returns {string}\n * Result.\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n alignDelimiters,\n fillRows: false,\n padding,\n stringLength\n })\n }\n\n /**\n * Serialize the cells of a table.\n *\n * @param {Table} node\n * Table.\n * @param {State} state\n * State.\n * @param {Info} info\n * Info.\n * @returns {Array<Array<string>>}\n * Serialized cells.\n */\n function handleTableAsData(node, state, info) {\n const {children} = node\n let index = -1\n /** @type {Array<Array<string>>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * Serialize the cells of a row.\n *\n * @param {TableRow} node\n * Row.\n * @param {State} state\n * State.\n * @param {Info} info\n * Info.\n * @returns {Array<string>}\n * Serialized cells.\n */\n function handleTableRowAsData(node, state, info) {\n const {children} = node\n let index = -1\n /** @type {Array<string>} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * Serialize inline code, escaping pipes in tables.\n *\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n * Inline code.\n */\n function inlineCodeWithTable(node, parent, state) {\n const value = defaultHandlers.inlineCode(node, parent, state)\n\n if (!state.stack.includes('tableCell')) return value\n\n // In a cell, the backslash before a pipe is dropped, also in code.\n // GitHub keeps a pipe in the cell when any backslash precedes it,\n // but micromark only when an odd number do,\n // as it sees `\\\\` as an escaped backslash\n // (see <https://github.com/github/cmark-gfm/issues/277>).\n /** @type {Array<string>} */\n const result = []\n let start = 0\n let index = value.indexOf('|')\n\n while (index !== -1) {\n let before = index\n\n while (before > start && value.charCodeAt(before - 1) === 92 /* `\\` */) {\n before--\n }\n\n result.push(value.slice(start, index))\n if ((index - before) % 2 === 0) result.push('\\\\')\n start = index\n index = value.indexOf('|', index + 1)\n }\n\n result.push(value.slice(start))\n\n return result.join('')\n }\n}\n\n/**\n * Join a table and the flow after it.\n *\n * In a tight list item there are no blank lines between flow,\n * but text right after a table would be read as rows of it.\n *\n * @type {Join}\n */\nfunction joinTable(left, right, parent, state) {\n if (\n left.type === 'table' &&\n parent.type === 'listItem' &&\n parent.spread === false &&\n (right.type === 'definition' ||\n (right.type === 'heading' && formatHeadingAsSetext(right, state)) ||\n right.type === 'paragraph' ||\n right.type === 'table')\n ) {\n return 1\n }\n}\n\n/**\n * Check whether a heading is serialized as a setext heading,\n * like `mdast-util-to-markdown` does.\n *\n * @param {Heading} node\n * Heading.\n * @param {State} state\n * Info passed around.\n * @returns {boolean}\n * Whether the heading is serialized as a setext heading.\n */\nfunction formatHeadingAsSetext(node, state) {\n let literalWithBreak = false\n\n visit(node, function (node) {\n if (\n node.type === 'break' ||\n ('value' in node && /\\r?\\n|\\r/.test(node.value))\n ) {\n literalWithBreak = true\n return EXIT\n }\n })\n\n return Boolean(\n (!node.depth || node.depth < 3) &&\n toString(node) &&\n (state.options.setext || literalWithBreak)\n )\n}\n","/**\n * @import {ListItem, Paragraph, Parents} from 'mdast'\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {\n * Handle as ToMarkdownHandle,\n * Join as ToMarkdownJoin,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n handlers: {paragraph: paragraphWithTaskListItem},\n join: [joinDefinitionsBeforeTaskListItemParagraph]\n }\n}\n\n/**\n * Exit a check.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * Exit a paragraph, removing the whitespace after a check.\n *\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParagraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParagraph = sibling\n break\n }\n }\n\n if (firstParagraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = {...head.position.start}\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * Serialize a paragraph,\n * with a check if it is the paragraph of a task list item.\n *\n * @type {ToMarkdownHandle}\n * @param {Paragraph} node\n * Paragraph.\n * @param {Parents | undefined} parent\n * Parent.\n */\nfunction paragraphWithTaskListItem(node, parent, state, info) {\n if (\n !parent ||\n parent.type !== 'listItem' ||\n taskListItemParagraph(parent) !== node\n ) {\n return defaultHandlers.paragraph(node, parent, state, info)\n }\n\n const checkbox = '[' + (parent.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n tracker.move(checkbox)\n // Check needs content after it, use an encoded space if there is no content\n // but there is `checked`.\n const value = defaultHandlers.paragraph(\n node.children.length > 0\n ? node\n : {type: 'paragraph', children: [{type: 'text', value: ' '}]},\n parent,\n state,\n {...info, ...tracker.current()}\n )\n\n return checkbox + value\n}\n\n/**\n * Join definitions before the paragraph of a task list item without blank\n * lines,\n * as a check is only seen at the start of the first content of a list item.\n *\n * @type {ToMarkdownJoin}\n */\nfunction joinDefinitionsBeforeTaskListItemParagraph(left, _, parent) {\n if (!(left.type === 'definition' && parent.type === 'listItem')) {\n return\n }\n\n const paragraph = taskListItemParagraph(parent)\n\n if (\n paragraph &&\n parent.children.indexOf(left) < parent.children.indexOf(paragraph)\n ) {\n return 0\n }\n}\n\n/**\n * Find the paragraph of a task list item that can start with a check.\n *\n * @param {ListItem} node\n * List item.\n * @returns {Paragraph | undefined}\n * Paragraph, if `node` is checkable.\n */\nfunction taskListItemParagraph(node) {\n if (typeof node.checked !== 'boolean') {\n return\n }\n\n for (const child of node.children) {\n if (child.type === 'paragraph') {\n return child\n }\n\n if (child.type !== 'definition') {\n return\n }\n }\n}\n","/**\n * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'\n * @import {Options} from 'mdast-util-gfm'\n * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array<FromMarkdownExtension>}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('../index.js').InlineMath} InlineMath\n * @typedef {import('../index.js').Math} Math\n *\n * @typedef ToOptions\n * Configuration.\n * @property {boolean | null | undefined} [singleDollarTextMath=true]\n * Whether to support math (text) with a single dollar (default: `true`).\n *\n * Single dollars work in Pandoc and many other places, but often interfere\n * with “normal” dollars in text.\n * If you turn this off, you can still use two or more dollars for text math.\n */\n\nimport {ok as assert} from 'devlop'\nimport {longestStreak} from 'longest-streak'\n\n/**\n * Create an extension for `mdast-util-from-markdown`.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function mathFromMarkdown() {\n return {\n enter: {\n mathFlow: enterMathFlow,\n mathFlowFenceMeta: enterMathFlowMeta,\n mathText: enterMathText\n },\n exit: {\n mathFlow: exitMathFlow,\n mathFlowFence: exitMathFlowFence,\n mathFlowFenceMeta: exitMathFlowMeta,\n mathFlowValue: exitMathData,\n mathText: exitMathText,\n mathTextData: exitMathData\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathFlow(token) {\n /** @type {HastElement} */\n const code = {\n type: 'element',\n tagName: 'code',\n properties: {className: ['language-math', 'math-display']},\n children: []\n }\n this.enter(\n {\n type: 'math',\n meta: null,\n value: '',\n data: {hName: 'pre', hChildren: [code]}\n },\n token\n )\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathFlowMeta() {\n this.buffer()\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlowMeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'math')\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlowFence() {\n // Exit if this is the closing fence.\n if (this.data.mathFlowInside) return\n this.buffer()\n this.data.mathFlowInside = true\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlow(token) {\n const data = this.resume().replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'math')\n this.exit(token)\n node.value = data\n // @ts-expect-error: we defined it in `enterMathFlow`.\n const code = /** @type {HastElement} */ (node.data.hChildren[0])\n assert(code.type === 'element')\n assert(code.tagName === 'code')\n code.children.push({type: 'text', value: data})\n this.data.mathFlowInside = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathText(token) {\n this.enter(\n {\n type: 'inlineMath',\n value: '',\n data: {\n hName: 'code',\n hProperties: {className: ['language-math', 'math-inline']},\n hChildren: []\n }\n },\n token\n )\n this.buffer()\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathText(token) {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineMath')\n this.exit(token)\n node.value = data\n const children = /** @type {Array<HastElementContent>} */ (\n // @ts-expect-error: we defined it in `enterMathFlow`.\n node.data.hChildren\n )\n children.push({type: 'text', value: data})\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathData(token) {\n this.config.enter.data.call(this, token)\n this.config.exit.data.call(this, token)\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown`.\n *\n * @param {ToOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function mathToMarkdown(options) {\n let single = (options || {}).singleDollarTextMath\n\n if (single === null || single === undefined) {\n single = true\n }\n\n inlineMath.peek = inlineMathPeek\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'mathFlowMeta'},\n {character: '\\n', inConstruct: 'mathFlowMeta'},\n {\n character: '$',\n after: single ? undefined : '\\\\$',\n inConstruct: 'phrasing'\n },\n {character: '$', inConstruct: 'mathFlowMeta'},\n {atBreak: true, character: '$', after: '\\\\$'}\n ],\n handlers: {math, inlineMath}\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Math} node\n */\n // Note: fixing this code? Please also fix the similar code for code:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/code.js>\n function math(node, _, state, info) {\n const raw = node.value || ''\n const tracker = state.createTracker(info)\n const sequence = '$'.repeat(Math.max(longestStreak(raw, '$') + 1, 2))\n const exit = state.enter('mathFlow')\n let value = tracker.move(sequence)\n\n if (node.meta) {\n const subexit = state.enter('mathFlowMeta')\n value += tracker.move(\n state.safe(node.meta, {\n after: '\\n',\n before: value,\n encode: ['$'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineMath} node\n */\n // Note: fixing this code? Please also fix the similar code for inline code:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/inline-code.js>\n function inlineMath(node, _, state) {\n let value = node.value || ''\n let size = 1\n\n if (!single) size++\n\n // If there is a single dollar sign on its own in the math, use a fence of\n // two.\n // If there are two in a row, use one.\n while (\n new RegExp('(^|[^$])' + '\\\\$'.repeat(size) + '([^$]|$)').test(value)\n ) {\n size++\n }\n\n const sequence = '$'.repeat(size)\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first and last character are a space or eol, or the first or last\n // character are dollar signs, then pad with spaces.\n if (\n // Contains non-space.\n /[^ \\r\\n]/.test(value) &&\n // Starts with space and ends with space.\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) ||\n // Starts or ends with dollar.\n /^\\$|\\$$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n let index = -1\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineMath`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.codePointAt(position) === 10 /* `\\n` */ &&\n value.codePointAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n }\n\n /**\n * @returns {string}\n */\n function inlineMathPeek() {\n return '$'\n }\n}\n","/**\n * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: 'wwwAutolink',\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: 'protocolAutolink',\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: 'emailAutolink',\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\n\n/** @type {ConstructRecord} */\nconst text = {};\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n };\n}\n\n/** @type {Code} */\nlet code = 48;\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this;\n /** @type {boolean | undefined} */\n let dot;\n /** @type {boolean} */\n let data;\n return start;\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkEmail');\n return atext(code);\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code);\n return atext;\n }\n if (code === 64) {\n effects.consume(code);\n return emailDomain;\n }\n return nok(code);\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true;\n effects.consume(code);\n return emailDomain;\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code);\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code);\n dot = true;\n return emailDomain;\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail');\n effects.exit('literalAutolink');\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this;\n return wwwStart;\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkWww');\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this;\n let buffer = '';\n let seen = false;\n return protocolStart;\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkHttp');\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n return nok(code);\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code);\n return protocolSlashesInside;\n }\n }\n return nok(code);\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code);\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0;\n return wwwPrefixInside;\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++;\n effects.consume(code);\n return wwwPrefixInside;\n }\n if (code === 46 && size === 3) {\n effects.consume(code);\n return wwwPrefixAfter;\n }\n return nok(code);\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code);\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment;\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment;\n /** @type {boolean | undefined} */\n let seen;\n return domainInside;\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code);\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {\n return domainAfter(code);\n }\n seen = true;\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true;\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = undefined;\n }\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // <https://github.com/github/cmark-gfm/issues/279>\n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code);\n }\n return ok(code);\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++;\n effects.consume(code);\n return pathInside;\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code);\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {\n return effects.check(trail, ok, pathAtPunctuation)(code);\n }\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n effects.consume(code);\n return pathInside;\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++;\n }\n effects.consume(code);\n return pathInside;\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail;\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {\n effects.consume(code);\n return trail;\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code);\n return trailCharacterReferenceStart;\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // <https://github.com/github/cmark-gfm/issues/278>.\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return trail(code);\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code);\n return trail;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return trailCharacterReferenceInside;\n }\n\n // It’s not a trail.\n return nok(code);\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start;\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code);\n return after;\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code);\n }\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code);\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code));\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);\n}\n\n/**\n * @param {Array<Event>} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {\n result = true;\n break;\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}","/**\n * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { blankLine } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n name: 'gfmFootnoteDefinition',\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: 'gfmFootnoteCall',\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: 'gfmPotentialFootnoteCall',\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {Token} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n\n // Exit if we’ve walked far enough.\n if (token.type === 'gfmFootnoteCall' || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return ok(code);\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n /** @type {Token | undefined} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === 'enter') {\n labelStart = events[index][1];\n break;\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n // Increment the end 1 character.\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n /** @type {Token} */\n const chunk = {\n type: \"chunkString\",\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n\n /** @type {Array<Event>} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1], events[index + 2], ['enter', call, context],\n // The `[`\n events[index + 3], events[index + 4],\n // The `^`.\n ['enter', marker, context], ['exit', marker, context],\n // Everything in between.\n ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2], events[events.length - 1], ['exit', call, context]];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n /** @type {boolean} */\n let data;\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start;\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall');\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return callStart;\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code);\n effects.enter('gfmFootnoteCallMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallMarker');\n effects.enter('gfmFootnoteCallString');\n effects.enter('chunkString').contentType = 'string';\n return callData;\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteCallString');\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n effects.exit('gfmFootnoteCall');\n return ok;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? callEscape : callData;\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return callData;\n }\n return callData(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {string} */\n let identifier;\n let size = 0;\n /** @type {boolean | undefined} */\n let data;\n return start;\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true;\n effects.enter('gfmFootnoteDefinitionLabel');\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n return labelAtMarker;\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionMarker');\n effects.enter('gfmFootnoteDefinitionLabelString');\n effects.enter('chunkString').contentType = 'string';\n return labelInside;\n }\n return nok(code);\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteDefinitionLabelString');\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n effects.exit('gfmFootnoteDefinitionLabel');\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > <https://github.com/github/cmark-gfm/issues/240>\n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker');\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');\n }\n return nok(code);\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition');\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);\n }\n}","/**\n * @import {Options} from 'micromark-extension-gfm-strikethrough'\n * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: 'strikethrough',\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n };\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'strikethroughSequenceTemporary' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'strikethroughSequenceTemporary' && events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = 'strikethroughSequence';\n events[open][1].type = 'strikethroughSequence';\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n\n // Opening.\n /** @type {Array<Event>} */\n const nextEvents = [['enter', strikethrough, context], ['enter', events[open][1], context], ['exit', events[open][1], context], ['enter', text, context]];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n // Between.\n splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [['exit', text, context], ['enter', events[index][1], context], ['exit', events[index][1], context], ['exit', strikethrough, context]]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = \"data\";\n }\n }\n return events;\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous;\n const events = this.events;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (previous === 126 && events[events.length - 1][1].type !== \"characterEscape\") {\n return nok(code);\n }\n effects.enter('strikethroughSequenceTemporary');\n return more(code);\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous);\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code);\n effects.consume(code);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code);\n const token = effects.exit('strikethroughSequenceTemporary');\n const after = classifyCharacter(code);\n token._open = !after || after === 2 && Boolean(before);\n token._close = !before || before === 2 && Boolean(after);\n return ok(code);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n\n /**\n * Changes by index, so `add` does not scan `map` (quadratic on\n * table-heavy documents).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImplementation(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add) {\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...existing[2])\n // existing[2] = add\n // } else {\n existing[2].push(...add);\n // }\n\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {'center' | 'left' | 'none' | 'right'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Readonly<Array<Event>>} events\n * List of events.\n * @param {number} index\n * Table enter event.\n * @returns {Array<Align>}\n * List of aligns.\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false;\n /** @type {Array<Align>} */\n const align = [];\n while (index < events.length) {\n const event = events[index];\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(events[index + 1][1].type === 'tableDelimiterMarker' ? 'left' : 'none');\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1;\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right';\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break;\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true;\n }\n index += 1;\n }\n return align;\n}","/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * Tokenizer for GFM tables.\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const {\n type\n } = self.events[index][1];\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") {\n index--;\n } else {\n break;\n }\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * Edit map to apply to.\n * @param {Readonly<TokenizeContext>} context\n * Tokenize context.\n * @param {Readonly<Range>} range\n * Range of the cell within events.\n * @param {RowKind} rowKind\n * Type of row.\n * @param {number | undefined} rowEnd\n * Index of the end of the row, if known.\n * @param {Token | undefined} previousCell\n * Previous cell token, if any.\n * @returns {Token | undefined}\n * Current cell token after flushing, if any.\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly<EditMap>} map\n * Edit map to apply to.\n * @param {Readonly<TokenizeContext>} context\n * Tokenize context.\n * @param {number} index\n * Index within the events where the table end should be inserted.\n * @param {Token} table\n * Table token.\n * @param {Token | undefined} tableBody\n * Table body token, if any.\n * @returns {undefined}\n * Nothing.\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array<Event>} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * Get the point (start or end) for a given event in the list of events.\n *\n * @param {Readonly<Array<Event>>} events\n * List of events.\n * @param {number} index\n * Index of the event to get the point for.\n * @returns {Readonly<Point>}\n * Start point for enter and end point for exit.\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}","/**\n * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nconst tasklistCheck = {\n name: 'tasklistCheck',\n tokenize: tokenizeTasklistCheck\n};\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this;\n return open;\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem) {\n return nok(code);\n }\n effects.enter('taskListCheck');\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n return inside;\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked');\n effects.consume(code);\n effects.exit('taskListCheckValueUnchecked');\n return close;\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked');\n effects.consume(code);\n effects.exit('taskListCheckValueChecked');\n return close;\n }\n return nok(code);\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n effects.exit('taskListCheck');\n return after;\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code);\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok, nok)(code);\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, \"whitespace\");\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code);\n }\n}","/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml(),\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml(),\n gfmTableHtml(),\n gfmTagfilterHtml(),\n gfmTaskListItemHtml()\n ])\n}\n","/**\n * @import {Construct, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const mathFlow = {\n tokenize: tokenizeMathFenced,\n concrete: true,\n name: 'mathFlow'\n};\n\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n};\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeMathFenced(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n const initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let sizeOpen = 0;\n return start;\n\n /**\n * Start of math.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('mathFlow');\n effects.enter('mathFlowFence');\n effects.enter('mathFlowFenceSequence');\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 36) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n if (sizeOpen < 2) {\n return nok(code);\n }\n effects.exit('mathFlowFenceSequence');\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n\n /**\n * In opening fence, before meta.\n *\n * ```markdown\n * > | $$asciimath\n * ^\n * | x < y\n * | $$\n * ```\n *\n * @type {State}\n */\n\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return metaAfter(code);\n }\n effects.enter('mathFlowFenceMeta');\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | $$asciimath\n * ^\n * | x < y\n * | $$\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit('mathFlowFenceMeta');\n return metaAfter(code);\n }\n if (code === 36) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * After meta.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function metaAfter(code) {\n // Guaranteed to be eol/eof.\n effects.exit('mathFlowFence');\n if (self.interrupt) {\n return ok(code);\n }\n return effects.attempt(nonLazyContinuation, beforeNonLazyContinuation, after)(code);\n }\n\n /**\n * After eol/eof in math, at a non-lazy closing fence or content.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeNonLazyContinuation(code) {\n return effects.attempt({\n tokenize: tokenizeClosingFence,\n partial: true\n }, after, contentStart)(code);\n }\n\n /**\n * Before math content, definitely not before a closing fence.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return (initialSize ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialSize + 1) : beforeContentChunk)(code);\n }\n\n /**\n * Before math content, after optional prefix.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(nonLazyContinuation, beforeNonLazyContinuation, after)(code);\n }\n effects.enter('mathFlowValue');\n return contentChunk(code);\n }\n\n /**\n * In math content.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('mathFlowValue');\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After math (ha!).\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('mathFlow');\n return ok(code);\n }\n\n /** @type {Tokenizer} */\n function tokenizeClosingFence(effects, ok, nok) {\n let size = 0;\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n */\n return factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n effects.enter('mathFlowFence');\n effects.enter('mathFlowFenceSequence');\n return sequenceClose(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === 36) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size < sizeOpen) {\n return nok(code);\n }\n effects.exit('mathFlowFenceSequence');\n return factorySpace(effects, afterSequenceClose, \"whitespace\")(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function afterSequenceClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('mathFlowFence');\n return ok(code);\n }\n return nok(code);\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (code === null) {\n return ok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineStart;\n }\n\n /** @type {State} */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {Options} from 'micromark-extension-math'\n * @import {Construct, Previous, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n// To do: next major: clean spaces in HTML compiler.\n// This has to be coordinated together with `mdast-util-math`.\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * @param {Options | null | undefined} [options={}]\n * Configuration (default: `{}`).\n * @returns {Construct}\n * Construct.\n */\nexport function mathText(options) {\n const options_ = options || {};\n let single = options_.singleDollarTextMath;\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n tokenize: tokenizeMathText,\n resolve: resolveMathText,\n previous,\n name: 'mathText'\n };\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeMathText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of math (text).\n *\n * ```markdown\n * > | $a$\n * ^\n * > | \\$a$\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('mathText');\n effects.enter('mathTextSequence');\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | $a$\n * ^\n * ```\n *\n * @type {State}\n */\n\n function sequenceOpen(code) {\n if (code === 36) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n\n // Not enough markers in the sequence.\n if (sizeOpen < 2 && !single) {\n return nok(code);\n }\n effects.exit('mathTextSequence');\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | $a$\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 36) {\n token = effects.enter('mathTextSequence');\n size = 0;\n return sequenceClose(code);\n }\n\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter('mathTextData');\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | $a$\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 36 || markdownLineEnding(code)) {\n effects.exit('mathTextData');\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n\n function sequenceClose(code) {\n // More.\n if (code === 36) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('mathTextSequence');\n effects.exit('mathText');\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = 'mathTextData';\n return data(code);\n }\n }\n}\n\n/** @type {Resolver} */\nfunction resolveMathText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'mathTextData') {\n // Then we have padding.\n events[tailExitIndex][1].type = 'mathTextPadding';\n events[headEnterIndex][1].type = 'mathTextPadding';\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = 'mathTextData';\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 36 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}","/**\n * @import {Options} from 'micromark-extension-math'\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { mathFlow } from './math-flow.js';\nimport { mathText } from './math-text.js';\n\n/**\n * Create an extension for `micromark` to enable math syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration (default: `{}`).\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable math syntax.\n */\nexport function math(options) {\n return {\n flow: {\n [36]: mathFlow\n },\n text: {\n [36]: mathText(options)\n }\n };\n}","/**\n * Character codes.\n *\n * This module is compiled away!\n *\n * micromark works based on character codes.\n * This module contains constants for the ASCII block and the replacement\n * character.\n * A couple of them are handled in a special way, such as the line endings\n * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal\n * tab) and its expansion based on what column it’s at (virtual space),\n * and the end-of-file (eof) character.\n * As values are preprocessed before handling them, the actual characters LF,\n * CR, HT, and NUL (which is present as the replacement character), are\n * guaranteed to not exist.\n *\n * Unicode basic latin block.\n */\nexport const codes = /** @type {const} */ ({\n carriageReturn: -5,\n lineFeed: -4,\n carriageReturnLineFeed: -3,\n horizontalTab: -2,\n virtualSpace: -1,\n eof: null,\n nul: 0,\n soh: 1,\n stx: 2,\n etx: 3,\n eot: 4,\n enq: 5,\n ack: 6,\n bel: 7,\n bs: 8,\n ht: 9, // `\\t`\n lf: 10, // `\\n`\n vt: 11, // `\\v`\n ff: 12, // `\\f`\n cr: 13, // `\\r`\n so: 14,\n si: 15,\n dle: 16,\n dc1: 17,\n dc2: 18,\n dc3: 19,\n dc4: 20,\n nak: 21,\n syn: 22,\n etb: 23,\n can: 24,\n em: 25,\n sub: 26,\n esc: 27,\n fs: 28,\n gs: 29,\n rs: 30,\n us: 31,\n space: 32,\n exclamationMark: 33, // `!`\n quotationMark: 34, // `\"`\n numberSign: 35, // `#`\n dollarSign: 36, // `$`\n percentSign: 37, // `%`\n ampersand: 38, // `&`\n apostrophe: 39, // `'`\n leftParenthesis: 40, // `(`\n rightParenthesis: 41, // `)`\n asterisk: 42, // `*`\n plusSign: 43, // `+`\n comma: 44, // `,`\n dash: 45, // `-`\n dot: 46, // `.`\n slash: 47, // `/`\n digit0: 48, // `0`\n digit1: 49, // `1`\n digit2: 50, // `2`\n digit3: 51, // `3`\n digit4: 52, // `4`\n digit5: 53, // `5`\n digit6: 54, // `6`\n digit7: 55, // `7`\n digit8: 56, // `8`\n digit9: 57, // `9`\n colon: 58, // `:`\n semicolon: 59, // `;`\n lessThan: 60, // `<`\n equalsTo: 61, // `=`\n greaterThan: 62, // `>`\n questionMark: 63, // `?`\n atSign: 64, // `@`\n uppercaseA: 65, // `A`\n uppercaseB: 66, // `B`\n uppercaseC: 67, // `C`\n uppercaseD: 68, // `D`\n uppercaseE: 69, // `E`\n uppercaseF: 70, // `F`\n uppercaseG: 71, // `G`\n uppercaseH: 72, // `H`\n uppercaseI: 73, // `I`\n uppercaseJ: 74, // `J`\n uppercaseK: 75, // `K`\n uppercaseL: 76, // `L`\n uppercaseM: 77, // `M`\n uppercaseN: 78, // `N`\n uppercaseO: 79, // `O`\n uppercaseP: 80, // `P`\n uppercaseQ: 81, // `Q`\n uppercaseR: 82, // `R`\n uppercaseS: 83, // `S`\n uppercaseT: 84, // `T`\n uppercaseU: 85, // `U`\n uppercaseV: 86, // `V`\n uppercaseW: 87, // `W`\n uppercaseX: 88, // `X`\n uppercaseY: 89, // `Y`\n uppercaseZ: 90, // `Z`\n leftSquareBracket: 91, // `[`\n backslash: 92, // `\\`\n rightSquareBracket: 93, // `]`\n caret: 94, // `^`\n underscore: 95, // `_`\n graveAccent: 96, // `` ` ``\n lowercaseA: 97, // `a`\n lowercaseB: 98, // `b`\n lowercaseC: 99, // `c`\n lowercaseD: 100, // `d`\n lowercaseE: 101, // `e`\n lowercaseF: 102, // `f`\n lowercaseG: 103, // `g`\n lowercaseH: 104, // `h`\n lowercaseI: 105, // `i`\n lowercaseJ: 106, // `j`\n lowercaseK: 107, // `k`\n lowercaseL: 108, // `l`\n lowercaseM: 109, // `m`\n lowercaseN: 110, // `n`\n lowercaseO: 111, // `o`\n lowercaseP: 112, // `p`\n lowercaseQ: 113, // `q`\n lowercaseR: 114, // `r`\n lowercaseS: 115, // `s`\n lowercaseT: 116, // `t`\n lowercaseU: 117, // `u`\n lowercaseV: 118, // `v`\n lowercaseW: 119, // `w`\n lowercaseX: 120, // `x`\n lowercaseY: 121, // `y`\n lowercaseZ: 122, // `z`\n leftCurlyBrace: 123, // `{`\n verticalBar: 124, // `|`\n rightCurlyBrace: 125, // `}`\n tilde: 126, // `~`\n del: 127,\n // Unicode Specials block.\n byteOrderMarker: 65_279,\n // Unicode Specials block.\n replacementCharacter: 65_533 // `�`\n})\n","/**\n * This module is compiled away!\n *\n * Parsing markdown comes with a couple of constants, such as minimum or maximum\n * sizes of certain sequences.\n * Additionally, there are a couple symbols used inside micromark.\n * These are all defined here, but compiled away by scripts.\n */\nexport const constants = /** @type {const} */ ({\n attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*`\n attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a`\n atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t.\n autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many.\n autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many.\n cdataOpeningString: 'CDATA[', // And preceded by `<![`.\n characterGroupPunctuation: 2, // Symbol used to indicate a character is punctuation\n characterGroupWhitespace: 1, // Symbol used to indicate a character is whitespace\n characterReferenceDecimalSizeMax: 7, // `�`.\n characterReferenceHexadecimalSizeMax: 6, // `�`.\n characterReferenceNamedSizeMax: 31, // `∳`.\n codeFencedSequenceSizeMin: 3, // At least 3 ticks or tildes are needed.\n contentTypeContent: 'content',\n contentTypeDocument: 'document',\n contentTypeFlow: 'flow',\n contentTypeString: 'string',\n contentTypeText: 'text',\n hardBreakPrefixSizeMin: 2, // At least 2 trailing spaces are needed.\n htmlBasic: 6, // Symbol for `<div`\n htmlCdata: 5, // Symbol for `<![CDATA[]]>`\n htmlComment: 2, // Symbol for `<!---->`\n htmlComplete: 7, // Symbol for `<x>`\n htmlDeclaration: 4, // Symbol for `<!doctype>`\n htmlInstruction: 3, // Symbol for `<?php?>`\n htmlRawSizeMax: 8, // Length of `textarea`.\n htmlRaw: 1, // Symbol for `<script>`\n linkResourceDestinationBalanceMax: 32, // See: <https://spec.commonmark.org/0.30/#link-destination>, <https://github.com/remarkjs/react-markdown/issues/658#issuecomment-984345577>\n linkReferenceSizeMax: 999, // See: <https://spec.commonmark.org/0.30/#link-label>\n listItemValueSizeMax: 10, // See: <https://spec.commonmark.org/0.30/#ordered-list-marker>\n numericBaseDecimal: 10,\n numericBaseHexadecimal: 0x10,\n tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark.\n thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed.\n v8MaxSafeChunkSize: 10_000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks.\n})\n","/**\n * This module is compiled away!\n *\n * Here is the list of all types of tokens exposed by micromark, with a short\n * explanation of what they include and where they are found.\n * In picking names, generally, the rule is to be as explicit as possible\n * instead of reusing names.\n * For example, there is a `definitionDestination` and a `resourceDestination`,\n * instead of one shared name.\n */\n\n// Note: when changing the next record, you must also change `TokenTypeMap`\n// in `micromark-util-types/index.d.ts`.\nexport const types = /** @type {const} */ ({\n // Generic type for data, such as in a title, a destination, etc.\n data: 'data',\n\n // Generic type for syntactic whitespace (tabs, virtual spaces, spaces).\n // Such as, between a fenced code fence and an info string.\n whitespace: 'whitespace',\n\n // Generic type for line endings (line feed, carriage return, carriage return +\n // line feed).\n lineEnding: 'lineEnding',\n\n // A line ending, but ending a blank line.\n lineEndingBlank: 'lineEndingBlank',\n\n // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a\n // line.\n linePrefix: 'linePrefix',\n\n // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a\n // line.\n lineSuffix: 'lineSuffix',\n\n // Whole ATX heading:\n //\n // ```markdown\n // #\n // ## Alpha\n // ### Bravo ###\n // ```\n //\n // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`.\n atxHeading: 'atxHeading',\n\n // Sequence of number signs in an ATX heading (`###`).\n atxHeadingSequence: 'atxHeadingSequence',\n\n // Content in an ATX heading (`alpha`).\n // Includes text.\n atxHeadingText: 'atxHeadingText',\n\n // Whole autolink (`<https://example.com>` or `<admin@example.com>`)\n // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`.\n autolink: 'autolink',\n\n // Email autolink w/o markers (`admin@example.com`)\n autolinkEmail: 'autolinkEmail',\n\n // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`).\n autolinkMarker: 'autolinkMarker',\n\n // Protocol autolink w/o markers (`https://example.com`)\n autolinkProtocol: 'autolinkProtocol',\n\n // A whole character escape (`\\-`).\n // Includes `escapeMarker` and `characterEscapeValue`.\n characterEscape: 'characterEscape',\n\n // The escaped character (`-`).\n characterEscapeValue: 'characterEscapeValue',\n\n // A whole character reference (`&`, `≠`, or `𝌆`).\n // Includes `characterReferenceMarker`, an optional\n // `characterReferenceMarkerNumeric`, in which case an optional\n // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`.\n characterReference: 'characterReference',\n\n // The start or end marker (`&` or `;`).\n characterReferenceMarker: 'characterReferenceMarker',\n\n // Mark reference as numeric (`#`).\n characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric',\n\n // Mark reference as numeric (`x` or `X`).\n characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal',\n\n // Value of character reference w/o markers (`amp`, `8800`, or `1D306`).\n characterReferenceValue: 'characterReferenceValue',\n\n // Whole fenced code:\n //\n // ````markdown\n // ```js\n // alert(1)\n // ```\n // ````\n codeFenced: 'codeFenced',\n\n // A fenced code fence, including whitespace, sequence, info, and meta\n // (` ```js `).\n codeFencedFence: 'codeFencedFence',\n\n // Sequence of grave accent or tilde characters (` ``` `) in a fence.\n codeFencedFenceSequence: 'codeFencedFenceSequence',\n\n // Info word (`js`) in a fence.\n // Includes string.\n codeFencedFenceInfo: 'codeFencedFenceInfo',\n\n // Meta words (`highlight=\"1\"`) in a fence.\n // Includes string.\n codeFencedFenceMeta: 'codeFencedFenceMeta',\n\n // A line of code.\n codeFlowValue: 'codeFlowValue',\n\n // Whole indented code:\n //\n // ```markdown\n // alert(1)\n // ```\n //\n // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`.\n codeIndented: 'codeIndented',\n\n // A text code (``` `alpha` ```).\n // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include\n // `codeTextPadding`.\n codeText: 'codeText',\n\n codeTextData: 'codeTextData',\n\n // A space or line ending right after or before a tick.\n codeTextPadding: 'codeTextPadding',\n\n // A text code fence (` `` `).\n codeTextSequence: 'codeTextSequence',\n\n // Whole content:\n //\n // ```markdown\n // [a]: b\n // c\n // =\n // d\n // ```\n //\n // Includes `paragraph` and `definition`.\n content: 'content',\n // Whole definition:\n //\n // ```markdown\n // [micromark]: https://github.com/micromark/micromark\n // ```\n //\n // Includes `definitionLabel`, `definitionMarker`, `whitespace`,\n // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`.\n definition: 'definition',\n\n // Destination of a definition (`https://github.com/micromark/micromark` or\n // `<https://github.com/micromark/micromark>`).\n // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`.\n definitionDestination: 'definitionDestination',\n\n // Enclosed destination of a definition\n // (`<https://github.com/micromark/micromark>`).\n // Includes `definitionDestinationLiteralMarker` and optionally\n // `definitionDestinationString`.\n definitionDestinationLiteral: 'definitionDestinationLiteral',\n\n // Markers of an enclosed definition destination (`<` or `>`).\n definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker',\n\n // Unenclosed destination of a definition\n // (`https://github.com/micromark/micromark`).\n // Includes `definitionDestinationString`.\n definitionDestinationRaw: 'definitionDestinationRaw',\n\n // Text in an destination (`https://github.com/micromark/micromark`).\n // Includes string.\n definitionDestinationString: 'definitionDestinationString',\n\n // Label of a definition (`[micromark]`).\n // Includes `definitionLabelMarker` and `definitionLabelString`.\n definitionLabel: 'definitionLabel',\n\n // Markers of a definition label (`[` or `]`).\n definitionLabelMarker: 'definitionLabelMarker',\n\n // Value of a definition label (`micromark`).\n // Includes string.\n definitionLabelString: 'definitionLabelString',\n\n // Marker between a label and a destination (`:`).\n definitionMarker: 'definitionMarker',\n\n // Title of a definition (`\"x\"`, `'y'`, or `(z)`).\n // Includes `definitionTitleMarker` and optionally `definitionTitleString`.\n definitionTitle: 'definitionTitle',\n\n // Marker around a title of a definition (`\"`, `'`, `(`, or `)`).\n definitionTitleMarker: 'definitionTitleMarker',\n\n // Data without markers in a title (`z`).\n // Includes string.\n definitionTitleString: 'definitionTitleString',\n\n // Emphasis (`*alpha*`).\n // Includes `emphasisSequence` and `emphasisText`.\n emphasis: 'emphasis',\n\n // Sequence of emphasis markers (`*` or `_`).\n emphasisSequence: 'emphasisSequence',\n\n // Emphasis text (`alpha`).\n // Includes text.\n emphasisText: 'emphasisText',\n\n // The character escape marker (`\\`).\n escapeMarker: 'escapeMarker',\n\n // A hard break created with a backslash (`\\\\n`).\n // Note: does not include the line ending.\n hardBreakEscape: 'hardBreakEscape',\n\n // A hard break created with trailing spaces (` \\n`).\n // Does not include the line ending.\n hardBreakTrailing: 'hardBreakTrailing',\n\n // Flow HTML:\n //\n // ```markdown\n // <div\n // ```\n //\n // Inlcudes `lineEnding`, `htmlFlowData`.\n htmlFlow: 'htmlFlow',\n\n htmlFlowData: 'htmlFlowData',\n\n // HTML in text (the tag in `a <i> b`).\n // Includes `lineEnding`, `htmlTextData`.\n htmlText: 'htmlText',\n\n htmlTextData: 'htmlTextData',\n\n // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or\n // `![alpha]`).\n // Includes `label` and an optional `resource` or `reference`.\n image: 'image',\n\n // Whole link label (`[*alpha*]`).\n // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`.\n label: 'label',\n\n // Text in an label (`*alpha*`).\n // Includes text.\n labelText: 'labelText',\n\n // Start a link label (`[`).\n // Includes a `labelMarker`.\n labelLink: 'labelLink',\n\n // Start an image label (`![`).\n // Includes `labelImageMarker` and `labelMarker`.\n labelImage: 'labelImage',\n\n // Marker of a label (`[` or `]`).\n labelMarker: 'labelMarker',\n\n // Marker to start an image (`!`).\n labelImageMarker: 'labelImageMarker',\n\n // End a label (`]`).\n // Includes `labelMarker`.\n labelEnd: 'labelEnd',\n\n // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`).\n // Includes `label` and an optional `resource` or `reference`.\n link: 'link',\n\n // Whole paragraph:\n //\n // ```markdown\n // alpha\n // bravo.\n // ```\n //\n // Includes text.\n paragraph: 'paragraph',\n\n // A reference (`[alpha]` or `[]`).\n // Includes `referenceMarker` and an optional `referenceString`.\n reference: 'reference',\n\n // A reference marker (`[` or `]`).\n referenceMarker: 'referenceMarker',\n\n // Reference text (`alpha`).\n // Includes string.\n referenceString: 'referenceString',\n\n // A resource (`(https://example.com \"alpha\")`).\n // Includes `resourceMarker`, an optional `resourceDestination` with an optional\n // `whitespace` and `resourceTitle`.\n resource: 'resource',\n\n // A resource destination (`https://example.com`).\n // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`.\n resourceDestination: 'resourceDestination',\n\n // A literal resource destination (`<https://example.com>`).\n // Includes `resourceDestinationLiteralMarker` and optionally\n // `resourceDestinationString`.\n resourceDestinationLiteral: 'resourceDestinationLiteral',\n\n // A resource destination marker (`<` or `>`).\n resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker',\n\n // A raw resource destination (`https://example.com`).\n // Includes `resourceDestinationString`.\n resourceDestinationRaw: 'resourceDestinationRaw',\n\n // Resource destination text (`https://example.com`).\n // Includes string.\n resourceDestinationString: 'resourceDestinationString',\n\n // A resource marker (`(` or `)`).\n resourceMarker: 'resourceMarker',\n\n // A resource title (`\"alpha\"`, `'alpha'`, or `(alpha)`).\n // Includes `resourceTitleMarker` and optionally `resourceTitleString`.\n resourceTitle: 'resourceTitle',\n\n // A resource title marker (`\"`, `'`, `(`, or `)`).\n resourceTitleMarker: 'resourceTitleMarker',\n\n // Resource destination title (`alpha`).\n // Includes string.\n resourceTitleString: 'resourceTitleString',\n\n // Whole setext heading:\n //\n // ```markdown\n // alpha\n // bravo\n // =====\n // ```\n //\n // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and\n // `setextHeadingLine`.\n setextHeading: 'setextHeading',\n\n // Content in a setext heading (`alpha\\nbravo`).\n // Includes text.\n setextHeadingText: 'setextHeadingText',\n\n // Underline in a setext heading, including whitespace suffix (`==`).\n // Includes `setextHeadingLineSequence`.\n setextHeadingLine: 'setextHeadingLine',\n\n // Sequence of equals or dash characters in underline in a setext heading (`-`).\n setextHeadingLineSequence: 'setextHeadingLineSequence',\n\n // Strong (`**alpha**`).\n // Includes `strongSequence` and `strongText`.\n strong: 'strong',\n\n // Sequence of strong markers (`**` or `__`).\n strongSequence: 'strongSequence',\n\n // Strong text (`alpha`).\n // Includes text.\n strongText: 'strongText',\n\n // Whole thematic break:\n //\n // ```markdown\n // * * *\n // ```\n //\n // Includes `thematicBreakSequence` and `whitespace`.\n thematicBreak: 'thematicBreak',\n\n // A sequence of one or more thematic break markers (`***`).\n thematicBreakSequence: 'thematicBreakSequence',\n\n // Whole block quote:\n //\n // ```markdown\n // > a\n // >\n // > b\n // ```\n //\n // Includes `blockQuotePrefix` and flow.\n blockQuote: 'blockQuote',\n // The `>` or `> ` of a block quote.\n blockQuotePrefix: 'blockQuotePrefix',\n // The `>` of a block quote prefix.\n blockQuoteMarker: 'blockQuoteMarker',\n // The optional ` ` of a block quote prefix.\n blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace',\n\n // Whole ordered list:\n //\n // ```markdown\n // 1. a\n // b\n // ```\n //\n // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further\n // lines.\n listOrdered: 'listOrdered',\n\n // Whole unordered list:\n //\n // ```markdown\n // - a\n // b\n // ```\n //\n // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further\n // lines.\n listUnordered: 'listUnordered',\n\n // The indent of further list item lines.\n listItemIndent: 'listItemIndent',\n\n // A marker, as in, `*`, `+`, `-`, `.`, or `)`.\n listItemMarker: 'listItemMarker',\n\n // The thing that starts a list item, such as `1. `.\n // Includes `listItemValue` if ordered, `listItemMarker`, and\n // `listItemPrefixWhitespace` (unless followed by a line ending).\n listItemPrefix: 'listItemPrefix',\n\n // The whitespace after a marker.\n listItemPrefixWhitespace: 'listItemPrefixWhitespace',\n\n // The numerical value of an ordered item.\n listItemValue: 'listItemValue',\n\n // Internal types used for subtokenizers, compiled away\n chunkDocument: 'chunkDocument',\n chunkContent: 'chunkContent',\n chunkFlow: 'chunkFlow',\n chunkText: 'chunkText',\n chunkString: 'chunkString'\n})\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/** Let asterisk strong emphasis close after punctuation when CJK prose continues without whitespace. */\n\nimport { attention } from 'micromark-core-commonmark'\nimport { unicodePunctuation } from 'micromark-util-character'\nimport { classifyCharacter } from 'micromark-util-classify-character'\nimport { codes, constants } from 'micromark-util-symbol'\nimport type { Construct, Extension, State, Tokenizer } from 'micromark-util-types'\n\nconst cjkCharacter = new RegExp([\n '\\\\p{Script_Extensions=Han}',\n '\\\\p{Script_Extensions=Hiragana}',\n '\\\\p{Script_Extensions=Katakana}',\n '\\\\p{Script_Extensions=Hangul}',\n '\\\\p{Script_Extensions=Bopomofo}',\n].join('|'), 'u')\n\nfunction isCjkCharacter(code: number | null): boolean {\n return code !== null && code >= 0 && cjkCharacter.test(String.fromCodePoint(code))\n}\n\nconst tokenizeCjkFriendlyAttention: Tokenizer = function (effects, ok, nok) {\n const configuredAttentionMarkers = this.parser.constructs.attentionMarkers.null\n if (configuredAttentionMarkers === undefined) {\n throw new Error('micromark CommonMark attention markers are unavailable')\n }\n const attentionMarkers = configuredAttentionMarkers\n const previous = this.previous\n const before = classifyCharacter(previous)\n let marker: number | null = codes.eof\n\n return start\n\n function start(code: number | null): State | undefined {\n /* v8 ignore next -- this text construct is dispatched only for an asterisk. */\n if (code !== codes.asterisk) return nok(code)\n marker = code\n effects.enter('attentionSequence')\n return inside(code)\n }\n\n function inside(code: number | null): State | undefined {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n\n const token = effects.exit('attentionSequence')\n const after = classifyCharacter(code)\n const open = !after || (after === constants.characterGroupPunctuation && Boolean(before))\n || attentionMarkers.includes(code)\n const commonMarkClose = !before\n || (before === constants.characterGroupPunctuation && Boolean(after))\n || attentionMarkers.includes(previous)\n const markerCount = token.end.offset - token.start.offset\n const cjkStrongClose = markerCount >= 2\n && unicodePunctuation(previous)\n && isCjkCharacter(code)\n const close = commonMarkClose || cjkStrongClose\n\n token._open = open\n token._close = close\n return ok(code)\n }\n}\n\nconst cjkFriendlyAttention: Construct = {\n name: 'cjkFriendlyAttention',\n resolveAll: attention.resolveAll,\n tokenize: tokenizeCjkFriendlyAttention,\n}\n\nconst cjkFriendlyStrongExtension: Extension = {\n text: { [codes.asterisk]: cjkFriendlyAttention },\n}\n\n/**\n * Extend CommonMark asterisk strong emphasis for punctuation-delimited CJK\n * prose, as a micromark syntax extension for `fromMarkdown`.\n * @returns The micromark syntax extension.\n */\nexport function cjkFriendlyStrong(): Extension {\n return cjkFriendlyStrongExtension\n}\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/** Extend upstream dollar-only math syntax with TeX delimiters while reusing its token vocabulary. */\n\nimport { factorySpace } from 'micromark-factory-space'\nimport type {} from 'micromark-extension-math'\nimport { markdownLineEnding } from 'micromark-util-character'\nimport { codes, constants, types } from 'micromark-util-symbol'\nimport type { Construct, Extension, Previous, State, Tokenizer } from 'micromark-util-types'\n\n// oxlint-disable typescript/no-this-alias -- micromark binds tokenizer context only on the outer callback.\n\nconst previousBackslash: Previous = function (code) {\n if (code !== codes.backslash) return true\n const tail = this.events.at(-1)\n /* v8 ignore next -- a previous code necessarily has a preceding event. */\n if (tail === undefined) return false\n return tail[1].type === types.characterEscape\n}\n\nconst tokenizeBackslashMathText: Tokenizer = function (effects, ok, nok) {\n return start\n\n function start(code: number | null): State | undefined {\n /* v8 ignore next -- the text construct is dispatched only for a backslash. */\n if (code !== codes.backslash) return nok(code)\n effects.enter('mathText')\n effects.enter('mathTextSequence')\n effects.consume(code)\n return open\n }\n\n function open(code: number | null): State | undefined {\n if (code !== codes.leftParenthesis) return nok(code)\n effects.consume(code)\n effects.exit('mathTextSequence')\n return between\n }\n\n function between(code: number | null): State | undefined {\n if (code === codes.eof) return nok(code)\n if (code === codes.backslash) {\n return effects.attempt({ partial: true, tokenize: tokenizeClose }, close, afterCloseAttempt)(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter(types.lineEnding)\n effects.consume(code)\n effects.exit(types.lineEnding)\n return between\n }\n return dataStart(code)\n }\n\n function afterCloseAttempt(code: number | null): State | undefined {\n return effects.check({ partial: true, tokenize: tokenizeOpen }, nok, dataStart)(code)\n }\n\n function dataStart(code: number | null): State | undefined {\n effects.enter('mathTextData')\n effects.consume(code)\n return code === codes.backslash ? afterDataBackslash : data\n }\n\n function afterDataBackslash(code: number | null): State | undefined {\n if (code === codes.backslash) {\n effects.consume(code)\n return data\n }\n return data(code)\n }\n\n function data(code: number | null): State | undefined {\n if (code === codes.eof || code === codes.backslash || markdownLineEnding(code)) {\n effects.exit('mathTextData')\n return between(code)\n }\n effects.consume(code)\n return data\n }\n\n function close(code: number | null): State | undefined {\n effects.exit('mathText')\n return ok(code)\n }\n\n function tokenizeClose(closeEffects: Parameters<Tokenizer>[0], closeOk: State, closeNok: State): State {\n return slash\n\n function slash(code: number | null): State | undefined {\n /* v8 ignore next -- this partial construct is attempted only at a backslash. */\n if (code !== codes.backslash) return closeNok(code)\n closeEffects.enter('mathTextSequence')\n closeEffects.consume(code)\n return parenthesis\n }\n\n function parenthesis(code: number | null): State | undefined {\n if (code !== codes.rightParenthesis) return closeNok(code)\n closeEffects.consume(code)\n closeEffects.exit('mathTextSequence')\n return closeOk\n }\n }\n\n function tokenizeOpen(openEffects: Parameters<Tokenizer>[0], openOk: State, openNok: State): State {\n return slash\n\n function slash(code: number | null): State | undefined {\n /* v8 ignore next -- the opening check follows a failed close attempt at a backslash. */\n if (code !== codes.backslash) return openNok(code)\n openEffects.enter(types.chunkString)\n openEffects.consume(code)\n return parenthesis\n }\n\n function parenthesis(code: number | null): State | undefined {\n if (code !== codes.leftParenthesis) return openNok(code)\n openEffects.consume(code)\n openEffects.exit(types.chunkString)\n return openOk\n }\n }\n}\n\nfunction createMathFlow(marker: number, openMarker: number, closeMarker: number, multiline: boolean): Construct {\n const tokenize: Tokenizer = function (effects, ok, nok) {\n const self = this\n let oddBackslashRun = false\n const tail = self.events.at(-1)\n const initialSize = tail?.[1].type === types.linePrefix\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n\n return start\n\n function start(code: number | null): State | undefined {\n /* v8 ignore next -- the flow construct is dispatched only for its marker. */\n if (code !== marker) return nok(code)\n effects.enter('mathFlow')\n effects.enter('mathFlowFence')\n effects.enter('mathFlowFenceSequence')\n effects.consume(code)\n return open\n }\n\n function open(code: number | null): State | undefined {\n if (code !== openMarker) return nok(code)\n effects.consume(code)\n effects.exit('mathFlowFenceSequence')\n effects.exit('mathFlowFence')\n return marker === codes.dollarSign ? afterDollarOpen : content\n }\n\n function afterDollarOpen(code: number | null): State | undefined {\n return code === codes.dollarSign ? nok(code) : content(code)\n }\n\n function content(code: number | null): State | undefined {\n if (code === codes.eof) return nok(code)\n if (code === marker && (marker !== codes.dollarSign || !oddBackslashRun)) {\n return effects.attempt(\n { partial: true, tokenize: tokenizeClosingFence },\n closed,\n afterClosingFenceAttempt,\n )(code)\n }\n if (markdownLineEnding(code)) {\n return multiline\n ? effects.attempt(nonLazyContinuation, afterContinuation, nok)(code)\n : nok(code)\n }\n return valueStart(code)\n }\n\n function afterClosingFenceAttempt(code: number | null): State | undefined {\n return marker === codes.backslash\n ? effects.check({ partial: true, tokenize: tokenizeOpeningFence }, nok, markerValueStart)(code)\n : markerValueStart(code)\n }\n\n function afterContinuation(code: number | null): State | undefined {\n return effects.attempt(\n { partial: true, tokenize: tokenizeClosingFence },\n closed,\n initialSize\n ? factorySpace(effects, content, types.linePrefix, initialSize + 1)\n : content,\n )(code)\n }\n\n function valueStart(code: number | null): State | undefined {\n effects.enter('mathFlowValue')\n oddBackslashRun = code === codes.backslash\n effects.consume(code)\n return value\n }\n\n function markerValueStart(code: number | null): State | undefined {\n effects.enter('mathFlowValue')\n oddBackslashRun = false\n effects.consume(code)\n return valueAfterMarker\n }\n\n function valueAfterMarker(code: number | null): State | undefined {\n if (code === marker) {\n effects.consume(code)\n return value\n }\n return value(code)\n }\n\n function value(code: number | null): State | undefined {\n if (code === codes.eof || code === marker || markdownLineEnding(code)) {\n effects.exit('mathFlowValue')\n return content(code)\n }\n oddBackslashRun = code === codes.backslash ? !oddBackslashRun : false\n effects.consume(code)\n return value\n }\n\n function closed(code: number | null): State | undefined {\n effects.exit('mathFlow')\n return ok(code)\n }\n\n function tokenizeClosingFence(\n closeEffects: Parameters<Tokenizer>[0],\n closeOk: State,\n closeNok: State,\n ): State {\n return factorySpace(closeEffects, sequenceStart, types.linePrefix, constants.tabSize)\n\n function sequenceStart(code: number | null): State | undefined {\n if (code !== marker) return closeNok(code)\n closeEffects.enter('mathFlowFence')\n closeEffects.enter('mathFlowFenceSequence')\n closeEffects.consume(code)\n return sequenceEnd\n }\n\n function sequenceEnd(code: number | null): State | undefined {\n if (code !== closeMarker) return closeNok(code)\n closeEffects.consume(code)\n closeEffects.exit('mathFlowFenceSequence')\n return factorySpace(closeEffects, after, types.whitespace)\n }\n\n function after(code: number | null): State | undefined {\n if (code !== codes.eof && !markdownLineEnding(code)) return closeNok(code)\n closeEffects.exit('mathFlowFence')\n return closeOk(code)\n }\n }\n\n function tokenizeOpeningFence(\n openEffects: Parameters<Tokenizer>[0],\n openOk: State,\n openNok: State,\n ): State {\n return sequenceStart\n\n function sequenceStart(code: number | null): State | undefined {\n /* v8 ignore next -- the opening check follows a failed close attempt at the marker. */\n if (code !== marker) return openNok(code)\n openEffects.enter(types.chunkString)\n openEffects.consume(code)\n return sequenceEnd\n }\n\n function sequenceEnd(code: number | null): State | undefined {\n if (code !== openMarker) return openNok(code)\n openEffects.consume(code)\n openEffects.exit(types.chunkString)\n return openOk\n }\n }\n }\n\n return {\n concrete: true,\n name: marker === codes.dollarSign ? 'sameLineDollarMathFlow' : 'backslashMathFlow',\n tokenize,\n }\n}\n\nconst tokenizeNonLazyContinuation: Tokenizer = function (effects, ok, nok) {\n const self = this\n\n return start\n\n function start(code: number | null): State | undefined {\n /* v8 ignore next -- continuation constructs are attempted only after a line ending. */\n if (code === codes.eof) return ok(code)\n /* v8 ignore next -- continuation constructs are attempted only after a line ending. */\n if (!markdownLineEnding(code)) return nok(code)\n effects.enter(types.lineEnding)\n effects.consume(code)\n effects.exit(types.lineEnding)\n return lineStart\n }\n\n function lineStart(code: number | null): State | undefined {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n\nconst nonLazyContinuation: Construct = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation,\n}\n\nconst backslashMathText: Construct = {\n name: 'backslashMathText',\n previous: previousBackslash,\n tokenize: tokenizeBackslashMathText,\n}\n\nconst backslashMathFlow = createMathFlow(\n codes.backslash,\n codes.leftSquareBracket,\n codes.rightSquareBracket,\n true,\n)\n\nconst sameLineDollarMathFlow = createMathFlow(\n codes.dollarSign,\n codes.dollarSign,\n codes.dollarSign,\n false,\n)\n\nconst backslashMath: Extension = {\n flow: {\n [codes.backslash]: backslashMathFlow,\n [codes.dollarSign]: sameLineDollarMathFlow,\n },\n text: { [codes.backslash]: backslashMathText },\n}\n\n/**\n * TeX backslash delimiters and same-line display-dollar blocks as a micromark\n * syntax extension reusing `micromark-extension-math`'s token vocabulary; the\n * caller must also register `math()` on the same parse so the emitted tokens\n * compile to standard math nodes.\n * @returns The micromark syntax extension.\n */\nexport function mathCompatibility(): Extension {\n return backslashMath\n}\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/**\n * The markdown renderer's two mdast grammars, one per rendering arm. Each\n * arm is internally consistent — the incremental tail parses, the one-shot\n * parses, and the plain-text projection of a given grammar always agree on\n * where blocks start and end — and the settled grammar is the streaming one\n * plus the math extensions, so the arms differ only where TeX delimiters\n * begin a math construct (a `$$` block is a paragraph while streaming and a\n * math block once settled, by design).\n */\n\nimport type { Root } from 'mdast'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { gfmFromMarkdown } from 'mdast-util-gfm'\nimport { mathFromMarkdown } from 'mdast-util-math'\nimport { gfm } from 'micromark-extension-gfm'\nimport { math } from 'micromark-extension-math'\nimport { cjkFriendlyStrong } from './cjkFriendlyStrong.js'\nimport { mathCompatibility } from './mathCompatibility.js'\n\n/**\n * Parse GFM markdown (the streaming arm's grammar: no math, so incomplete\n * TeX never flashes KaTeX errors mid-stream).\n * @param text - Markdown source.\n * @returns The mdast root.\n */\nexport function parseGfm(text: string): Root {\n return fromMarkdown(text, {\n extensions: [gfm(), cjkFriendlyStrong()],\n mdastExtensions: [gfmFromMarkdown()],\n })\n}\n\n/**\n * Parse GFM markdown plus TeX math with the compatibility delimiters\n * (the settled arm's grammar).\n * @param text - Markdown source.\n * @returns The mdast root.\n */\nexport function parseGfmWithMath(text: string): Root {\n return fromMarkdown(text, {\n extensions: [gfm(), cjkFriendlyStrong(), mathCompatibility(), math()],\n mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown()],\n })\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\n * This is the ParseError class, which is the main error thrown by KaTeX\n * functions when something has gone wrong. This is used to distinguish internal\n * errors from errors in the expression that the user provided.\n *\n * If possible, a caller should provide a Token or ParseNode with information\n * about where in the source string the problem occurred.\n */\nclass ParseError extends Error {\n // The underlying error message without any context added.\n constructor(message,\n // The error message\n token) {\n var error = \"KaTeX parse error: \" + message;\n var start;\n var end;\n var loc = token && token.loc;\n if (loc && loc.start <= loc.end) {\n // If we have the input and a position, make the error a bit fancier\n // Get the input\n var input = loc.lexer.input;\n // Prepend some information\n start = loc.start;\n end = loc.end;\n if (start === input.length) {\n error += \" at end of input: \";\n } else {\n error += \" at position \" + (start + 1) + \": \";\n }\n // Underline token in question using combining underscores\n var underlined = input.slice(start, end).replace(/[^]/g, \"$&\\u0332\");\n // Extract some context from the input and add it to the error\n var left;\n if (start > 15) {\n left = \"…\" + input.slice(start - 15, start);\n } else {\n left = input.slice(0, start);\n }\n var right;\n if (end + 15 < input.length) {\n right = input.slice(end, end + 15) + \"…\";\n } else {\n right = input.slice(end);\n }\n error += left + underlined + right;\n }\n super(error);\n this.name = \"ParseError\";\n this.position = void 0;\n // Error start position based on passed-in Token or ParseNode.\n this.length = void 0;\n // Length of affected text based on passed-in Token or ParseNode.\n this.rawMessage = void 0;\n Object.setPrototypeOf(this, ParseError.prototype);\n this.position = start;\n if (start != null && end != null) {\n this.length = end - start;\n }\n this.rawMessage = message;\n }\n}\n\n/**\n * This file contains a list of utility functions which are useful in other\n * files.\n */\n// hyphenate and escape adapted from Facebook's React under Apache 2 license\nvar uppercase = /([A-Z])/g;\nvar hyphenate = str => str.replace(uppercase, \"-$1\").toLowerCase();\nvar ESCAPE_LOOKUP = {\n \"&\": \"&\",\n \">\": \">\",\n \"<\": \"<\",\n \"\\\"\": \""\",\n \"'\": \"'\"\n};\nvar ESCAPE_REGEX = /[&><\"']/g;\n/**\n * Escapes text to prevent scripting attacks.\n */\nvar escape = text => String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);\n/**\n * Sometimes we want to pull out the innermost element of a group. In most\n * cases, this will just be the group itself, but when ordgroups and colors have\n * a single element, we want to pull that out.\n */\nvar getBaseElem = group => {\n if (group.type === \"ordgroup\") {\n if (group.body.length === 1) {\n return getBaseElem(group.body[0]);\n } else {\n return group;\n }\n } else if (group.type === \"color\") {\n if (group.body.length === 1) {\n return getBaseElem(group.body[0]);\n } else {\n return group;\n }\n } else if (group.type === \"font\") {\n return getBaseElem(group.body);\n } else {\n return group;\n }\n};\nvar characterNodesTypes = new Set([\"mathord\", \"textord\", \"atom\"]);\n/**\n * TeXbook algorithms often reference \"character boxes\", which are simply groups\n * with a single character in them. To decide if something is a character box,\n * we find its innermost group, and see if it is a single character.\n */\nvar isCharacterBox = group => characterNodesTypes.has(getBaseElem(group).type);\n/**\n * Return the protocol of a URL, or \"_relative\" if the URL does not specify a\n * protocol (and thus is relative), or `null` if URL has invalid protocol\n * (so should be outright rejected).\n */\nvar protocolFromUrl = url => {\n // Check for possible leading protocol.\n // https://url.spec.whatwg.org/#url-parsing strips leading whitespace\n // (U+20) or C0 control (U+00-U+1F) characters.\n var protocol = /^[\\x00-\\x20]*([^\\\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url);\n if (!protocol) {\n return \"_relative\";\n }\n // Reject weird colons\n if (protocol[2] !== \":\") {\n return null;\n }\n // Reject invalid characters in scheme according to\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1\n if (!/^[a-zA-Z][a-zA-Z0-9+\\-.]*$/.test(protocol[1])) {\n return null;\n }\n // Lowercase the protocol\n return protocol[1].toLowerCase();\n};\n\n/* eslint no-console:0 */\n// TODO: automatically generate documentation\n// TODO: check all properties on Settings exist\n// TODO: check the type of a property on Settings matches\nvar SETTINGS_SCHEMA = {\n displayMode: {\n type: \"boolean\",\n description: \"Render math in display mode, which puts the math in \" + \"display style (so \\\\int and \\\\sum are large, for example), and \" + \"centers the math on the page on its own line.\",\n cli: \"-d, --display-mode\"\n },\n output: {\n type: {\n enum: [\"htmlAndMathml\", \"html\", \"mathml\"]\n },\n description: \"Determines the markup language of the output.\",\n cli: \"-F, --format <type>\"\n },\n leqno: {\n type: \"boolean\",\n description: \"Render display math in leqno style (left-justified tags).\"\n },\n fleqn: {\n type: \"boolean\",\n description: \"Render display math flush left.\"\n },\n throwOnError: {\n type: \"boolean\",\n default: true,\n cli: \"-t, --no-throw-on-error\",\n cliDescription: \"Render errors (in the color given by --error-color) ins\" + \"tead of throwing a ParseError exception when encountering an error.\"\n },\n errorColor: {\n type: \"string\",\n default: \"#cc0000\",\n cli: \"-c, --error-color <color>\",\n cliDescription: \"A color string given in the format 'rgb' or 'rrggbb' \" + \"(no #). This option determines the color of errors rendered by the \" + \"-t option.\",\n cliProcessor: color => \"#\" + color\n },\n macros: {\n type: \"object\",\n cli: \"-m, --macro <def>\",\n cliDescription: \"Define custom macro of the form '\\\\foo:expansion' (use \" + \"multiple -m arguments for multiple macros).\",\n cliDefault: [],\n cliProcessor: (def, defs) => {\n defs.push(def);\n return defs;\n }\n },\n minRuleThickness: {\n type: \"number\",\n description: \"Specifies a minimum thickness, in ems, for fraction lines,\" + \" `\\\\sqrt` top lines, `{array}` vertical lines, `\\\\hline`, \" + \"`\\\\hdashline`, `\\\\underline`, `\\\\overline`, and the borders of \" + \"`\\\\fbox`, `\\\\boxed`, and `\\\\fcolorbox`.\",\n processor: t => Math.max(0, t),\n cli: \"--min-rule-thickness <size>\",\n cliProcessor: parseFloat\n },\n colorIsTextColor: {\n type: \"boolean\",\n description: \"Makes \\\\color behave like LaTeX's 2-argument \\\\textcolor, \" + \"instead of LaTeX's one-argument \\\\color mode change.\",\n cli: \"-b, --color-is-text-color\"\n },\n strict: {\n type: [{\n enum: [\"warn\", \"ignore\", \"error\"]\n }, \"boolean\", \"function\"],\n description: \"Turn on strict / LaTeX faithfulness mode, which throws an \" + \"error if the input uses features that are not supported by LaTeX.\",\n cli: \"-S, --strict\",\n cliDefault: false\n },\n trust: {\n type: [\"boolean\", \"function\"],\n description: \"Trust the input, enabling all HTML features such as \\\\url.\",\n cli: \"-T, --trust\"\n },\n maxSize: {\n type: \"number\",\n default: Infinity,\n description: \"If non-zero, all user-specified sizes, e.g. in \" + \"\\\\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, \" + \"elements and spaces can be arbitrarily large\",\n processor: s => Math.max(0, s),\n cli: \"-s, --max-size <n>\",\n cliProcessor: parseInt\n },\n maxExpand: {\n type: \"number\",\n default: 1000,\n description: \"Limit the number of macro expansions to the specified \" + \"number, to prevent e.g. infinite macro loops. If set to Infinity, \" + \"the macro expander will try to fully expand as in LaTeX.\",\n processor: n => Math.max(0, n),\n cli: \"-e, --max-expand <n>\",\n cliProcessor: n => n === \"Infinity\" ? Infinity : parseInt(n)\n },\n globalGroup: {\n type: \"boolean\",\n cli: false\n }\n};\nfunction getImplicitDefault(type) {\n if (typeof type !== 'string') {\n return type.enum[0];\n }\n switch (type) {\n case 'boolean':\n return false;\n case 'string':\n return '';\n case 'number':\n return 0;\n case 'object':\n return {};\n default:\n throw new Error(\"Unexpected schema type; settings must declare an explicit default.\");\n }\n}\nfunction getDefaultValue(schema) {\n if (Object.prototype.hasOwnProperty.call(schema, \"default\") && schema.default !== undefined) {\n return schema.default;\n }\n var type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n return getImplicitDefault(type);\n}\nfunction applySetting(target, prop, options, schema) {\n var optionValue = Object.prototype.hasOwnProperty.call(options, prop) ? options[prop] : undefined;\n var processor = Object.prototype.hasOwnProperty.call(schema, \"processor\") ? schema.processor : undefined;\n target[prop] = optionValue !== undefined ? processor ? processor(optionValue) : optionValue : getDefaultValue(schema);\n}\n/**\n * The main Settings object\n *\n * The current options stored are:\n * - displayMode: Whether the expression should be typeset as inline math\n * (false, the default), meaning that the math starts in\n * \\textstyle and is placed in an inline-block); or as display\n * math (true), meaning that the math starts in \\displaystyle\n * and is placed in a block with vertical margin.\n */\nclass Settings {\n constructor(options) {\n if (options === void 0) {\n options = {};\n }\n this.displayMode = void 0;\n this.output = void 0;\n this.leqno = void 0;\n this.fleqn = void 0;\n this.throwOnError = void 0;\n this.errorColor = void 0;\n this.macros = void 0;\n this.minRuleThickness = void 0;\n this.colorIsTextColor = void 0;\n this.strict = void 0;\n this.trust = void 0;\n this.maxSize = void 0;\n this.maxExpand = void 0;\n this.globalGroup = void 0;\n // allow null options\n options = options || {};\n for (var prop of Object.keys(SETTINGS_SCHEMA)) {\n var schema = SETTINGS_SCHEMA[prop];\n if (schema) {\n // TODO: validate options\n applySetting(this, prop, options, schema);\n }\n }\n }\n /**\n * Check whether to test potentially dangerous input, and return\n * `true` (trusted) or `false` (untrusted). The sole argument `context`\n * should be an object with `command` field specifying the relevant LaTeX\n * command (as a string starting with `\\`), and any other arguments, etc.\n * If `context` has a `url` field, a `protocol` field will automatically\n * get added by this function (changing the specified object).\n */\n isTrusted(context) {\n if (\"url\" in context && context.url && !context.protocol) {\n var protocol = protocolFromUrl(context.url);\n if (protocol == null) {\n return false;\n }\n context.protocol = protocol;\n }\n var trust = typeof this.trust === \"function\" ? this.trust(context) : this.trust;\n return Boolean(trust);\n }\n}\n\n/**\n * This file contains information and classes for the various kinds of styles\n * used in TeX. It provides a generic `Style` class, which holds information\n * about a specific style. It then provides instances of all the different kinds\n * of styles possible, and provides functions to move between them and get\n * information about them.\n */\n/**\n * The main style class. Contains a unique id for the style, a size (which is\n * the same for cramped and uncramped version of a style), and a cramped flag.\n */\nclass Style {\n constructor(id, size, cramped) {\n this.id = void 0;\n this.size = void 0;\n this.cramped = void 0;\n this.id = id;\n this.size = size;\n this.cramped = cramped;\n }\n /**\n * Get the style of a superscript given a base in the current style.\n */\n sup() {\n return styles[sup[this.id]];\n }\n /**\n * Get the style of a subscript given a base in the current style.\n */\n sub() {\n return styles[sub[this.id]];\n }\n /**\n * Get the style of a fraction numerator given the fraction in the current\n * style.\n */\n fracNum() {\n return styles[fracNum[this.id]];\n }\n /**\n * Get the style of a fraction denominator given the fraction in the current\n * style.\n */\n fracDen() {\n return styles[fracDen[this.id]];\n }\n /**\n * Get the cramped version of a style (in particular, cramping a cramped style\n * doesn't change the style).\n */\n cramp() {\n return styles[cramp[this.id]];\n }\n /**\n * Get a text or display version of this style.\n */\n text() {\n return styles[text$1[this.id]];\n }\n /**\n * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)\n */\n isTight() {\n return this.size >= 2;\n }\n}\n// IDs of the different styles\nvar D = 0;\nvar Dc = 1;\nvar T = 2;\nvar Tc = 3;\nvar S = 4;\nvar Sc = 5;\nvar SS = 6;\nvar SSc = 7;\n// Instances of the different styles\nvar styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)];\n// Lookup tables for switching from one style to another\nvar sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];\nvar sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];\nvar fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];\nvar fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];\nvar cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];\nvar text$1 = [D, Dc, T, Tc, T, Tc, T, Tc];\n// We only export some of the styles.\nvar Style$1 = {\n DISPLAY: styles[D],\n TEXT: styles[T],\n SCRIPT: styles[S],\n SCRIPTSCRIPT: styles[SS]\n};\n\n/*\n * This file defines the Unicode scripts and script families that we\n * support. To add new scripts or families, just add a new entry to the\n * scriptData array below. Adding scripts to the scriptData array allows\n * characters from that script to appear in \\text{} environments.\n */\n/**\n * Unicode block data for the families of scripts we support in \\text{}.\n * Scripts only need to appear here if they do not have font metrics.\n */\nvar scriptData = [{\n // Latin characters beyond the Latin-1 characters we have metrics for.\n // Needed for Czech, Hungarian and Turkish text, for example.\n name: 'latin',\n blocks: [[0x0100, 0x024f],\n // Latin Extended-A and Latin Extended-B\n [0x0300, 0x036f] // Combining Diacritical marks\n ]\n}, {\n // The Cyrillic script used by Russian and related languages.\n // A Cyrillic subset used to be supported as explicitly defined\n // symbols in symbols.js\n name: 'cyrillic',\n blocks: [[0x0400, 0x04ff]]\n}, {\n // Armenian\n name: 'armenian',\n blocks: [[0x0530, 0x058F]]\n}, {\n // The Brahmic scripts of South and Southeast Asia\n // Devanagari (0900–097F)\n // Bengali (0980–09FF)\n // Gurmukhi (0A00–0A7F)\n // Gujarati (0A80–0AFF)\n // Oriya (0B00–0B7F)\n // Tamil (0B80–0BFF)\n // Telugu (0C00–0C7F)\n // Kannada (0C80–0CFF)\n // Malayalam (0D00–0D7F)\n // Sinhala (0D80–0DFF)\n // Thai (0E00–0E7F)\n // Lao (0E80–0EFF)\n // Tibetan (0F00–0FFF)\n // Myanmar (1000–109F)\n name: 'brahmic',\n blocks: [[0x0900, 0x109F]]\n}, {\n name: 'georgian',\n blocks: [[0x10A0, 0x10ff]]\n}, {\n // Chinese and Japanese.\n // The \"k\" in cjk is for Korean, but we've separated Korean out\n name: \"cjk\",\n blocks: [[0x3000, 0x30FF],\n // CJK symbols and punctuation, Hiragana, Katakana\n [0x4E00, 0x9FAF],\n // CJK ideograms\n [0xFF00, 0xFF60] // Fullwidth punctuation\n // TODO: add halfwidth Katakana and Romanji glyphs\n ]\n}, {\n // Korean\n name: 'hangul',\n blocks: [[0xAC00, 0xD7AF]]\n}];\n/**\n * Given a codepoint, return the name of the script or script family\n * it is from, or null if it is not part of a known block\n */\nfunction scriptFromCodepoint(codepoint) {\n for (var i = 0; i < scriptData.length; i++) {\n var script = scriptData[i];\n for (var _i = 0; _i < script.blocks.length; _i++) {\n var block = script.blocks[_i];\n if (codepoint >= block[0] && codepoint <= block[1]) {\n return script.name;\n }\n }\n }\n return null;\n}\n/**\n * A flattened version of all the supported blocks in a single array.\n * This is an optimization to make supportedCodepoint() fast.\n */\nvar allBlocks = [];\nscriptData.forEach(s => s.blocks.forEach(b => allBlocks.push(...b)));\n/**\n * Given a codepoint, return true if it falls within one of the\n * scripts or script families defined above and false otherwise.\n *\n * Micro benchmarks shows that this is faster than\n * /[\\u3000-\\u30FF\\u4E00-\\u9FAF\\uFF00-\\uFF60\\uAC00-\\uD7AF\\u0900-\\u109F]/.test()\n * in Firefox, Chrome and Node.\n */\nfunction supportedCodepoint(codepoint) {\n for (var i = 0; i < allBlocks.length; i += 2) {\n if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * This file provides support to domTree.js and delimiter.js.\n * It's a storehouse of path geometry for SVG images.\n */\n// In all paths below, the viewBox-to-em scale is 1000:1.\n// Second Brush Stroke\n// Low resolution monitors struggle to display images in fine detail.\n// So browsers apply anti-aliasing. A long straight arrow shaft therefore\n// will sometimes appear as if it has a blurred edge.\n// To mitigate this, these SVG files contain a second \"brush-stroke\" on the\n// arrow shafts. That is, a second long thin rectangular SVG path has been\n// written directly on top of each arrow shaft. This reinforcement causes\n// some of the screen pixels to display as black instead of the anti-aliased\n// gray pixel that a single path would generate. So we get arrow shafts\n// whose edges appear to be sharper.\nvar doubleBrushStroke = svgPath => svgPath + \" \" + svgPath;\nvar hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping.\n// The vinculum of a \\sqrt can be made thicker by a KaTeX rendering option.\n// Think of variable extraVinculum as two detours in the SVG path.\n// The detour begins at the lower left of the area labeled extraVinculum below.\n// The detour proceeds one extraVinculum distance up and slightly to the right,\n// displacing the radiused corner between surd and vinculum. The radius is\n// traversed as usual, then the detour resumes. It goes right, to the end of\n// the very long vinculum, then down one extraVinculum distance,\n// after which it resumes regular path geometry for the radical.\n/* vinculum\n /\n /▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraVinculum\n / █████████████████████←0.04em (40 unit) std vinculum thickness\n / /\n / /\n / /\\\n / / surd\n*/\nvar sqrtMain = function sqrtMain(extraVinculum, hLinePad) {\n // sqrtMain path geometry is from glyph U221A in the font KaTeX Main\n return \"M95,\" + (622 + extraVinculum + hLinePad) + \"\\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\\nc69,-144,104.5,-217.7,106.5,-221\\nl\" + extraVinculum / 2.075 + \" -\" + extraVinculum + \"\\nc5.3,-9.3,12,-14,20,-14\\nH400000v\" + (40 + extraVinculum) + \"H845.2724\\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\\nM\" + (834 + extraVinculum) + \" \" + hLinePad + \"h400000v\" + (40 + extraVinculum) + \"h-400000z\";\n};\nvar sqrtSize1 = function sqrtSize1(extraVinculum, hLinePad) {\n // size1 is from glyph U221A in the font KaTeX_Size1-Regular\n return \"M263,\" + (601 + extraVinculum + hLinePad) + \"c0.7,0,18,39.7,52,119\\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\\nc340,-704.7,510.7,-1060.3,512,-1067\\nl\" + extraVinculum / 2.084 + \" -\" + extraVinculum + \"\\nc4.7,-7.3,11,-11,19,-11\\nH40000v\" + (40 + extraVinculum) + \"H1012.3\\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\\nM\" + (1001 + extraVinculum) + \" \" + hLinePad + \"h400000v\" + (40 + extraVinculum) + \"h-400000z\";\n};\nvar sqrtSize2 = function sqrtSize2(extraVinculum, hLinePad) {\n // size2 is from glyph U221A in the font KaTeX_Size2-Regular\n return \"M983 \" + (10 + extraVinculum + hLinePad) + \"\\nl\" + extraVinculum / 3.13 + \" -\" + extraVinculum + \"\\nc4,-6.7,10,-10,18,-10 H400000v\" + (40 + extraVinculum) + \"\\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\\nM\" + (1001 + extraVinculum) + \" \" + hLinePad + \"h400000v\" + (40 + extraVinculum) + \"h-400000z\";\n};\nvar sqrtSize3 = function sqrtSize3(extraVinculum, hLinePad) {\n // size3 is from glyph U221A in the font KaTeX_Size3-Regular\n return \"M424,\" + (2398 + extraVinculum + hLinePad) + \"\\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\\nl\" + extraVinculum / 4.223 + \" -\" + extraVinculum + \"c4,-6.7,10,-10,18,-10 H400000\\nv\" + (40 + extraVinculum) + \"H1014.6\\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\\nc-2,6,-10,9,-24,9\\nc-8,0,-12,-0.7,-12,-2z M\" + (1001 + extraVinculum) + \" \" + hLinePad + \"\\nh400000v\" + (40 + extraVinculum) + \"h-400000z\";\n};\nvar sqrtSize4 = function sqrtSize4(extraVinculum, hLinePad) {\n // size4 is from glyph U221A in the font KaTeX_Size4-Regular\n return \"M473,\" + (2713 + extraVinculum + hLinePad) + \"\\nc339.3,-1799.3,509.3,-2700,510,-2702 l\" + extraVinculum / 5.298 + \" -\" + extraVinculum + \"\\nc3.3,-7.3,9.3,-11,18,-11 H400000v\" + (40 + extraVinculum) + \"H1017.7\\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\\n606zM\" + (1001 + extraVinculum) + \" \" + hLinePad + \"h400000v\" + (40 + extraVinculum) + \"H1017.7z\";\n};\nvar phasePath = function phasePath(y) {\n var x = y / 2; // x coordinate at top of angle\n return \"M400000 \" + y + \" H0 L\" + x + \" 0 l65 45 L145 \" + (y - 80) + \" H400000z\";\n};\nvar sqrtTall = function sqrtTall(extraVinculum, hLinePad, viewBoxHeight) {\n // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular\n // One path edge has a variable length. It runs vertically from the vinculum\n // to a point near (14 units) the bottom of the surd. The vinculum\n // is normally 40 units thick. So the length of the line in question is:\n var vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum;\n return \"M702 \" + (extraVinculum + hLinePad) + \"H400000\" + (40 + extraVinculum) + \"\\nH742v\" + vertSegment + \"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\\n219 661 l218 661zM702 \" + hLinePad + \"H400000v\" + (40 + extraVinculum) + \"H742z\";\n};\nvar sqrtPath = function sqrtPath(size, extraVinculum, viewBoxHeight) {\n extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox.\n var path = \"\";\n switch (size) {\n case \"sqrtMain\":\n path = sqrtMain(extraVinculum, hLinePad);\n break;\n case \"sqrtSize1\":\n path = sqrtSize1(extraVinculum, hLinePad);\n break;\n case \"sqrtSize2\":\n path = sqrtSize2(extraVinculum, hLinePad);\n break;\n case \"sqrtSize3\":\n path = sqrtSize3(extraVinculum, hLinePad);\n break;\n case \"sqrtSize4\":\n path = sqrtSize4(extraVinculum, hLinePad);\n break;\n case \"sqrtTall\":\n path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);\n }\n return path;\n};\nvar innerPath = function innerPath(name, height) {\n // The inner part of stretchy tall delimiters\n switch (name) {\n case \"\\u239c\":\n return doubleBrushStroke(\"M291 0 H417 V\" + height + \" H291z\");\n case \"\\u2223\":\n return doubleBrushStroke(\"M145 0 H188 V\" + height + \" H145z\");\n case \"\\u2225\":\n return doubleBrushStroke(\"M145 0 H188 V\" + height + \" H145z\") + doubleBrushStroke(\"M367 0 H410 V\" + height + \" H367z\");\n case \"\\u239f\":\n return doubleBrushStroke(\"M457 0 H583 V\" + height + \" H457z\");\n case \"\\u23a2\":\n return doubleBrushStroke(\"M319 0 H403 V\" + height + \" H319z\");\n case \"\\u23a5\":\n return doubleBrushStroke(\"M263 0 H347 V\" + height + \" H263z\");\n case \"\\u23aa\":\n return doubleBrushStroke(\"M384 0 H504 V\" + height + \" H384z\");\n case \"\\u23d0\":\n return doubleBrushStroke(\"M312 0 H355 V\" + height + \" H312z\");\n case \"\\u2016\":\n return doubleBrushStroke(\"M257 0 H300 V\" + height + \" H257z\") + doubleBrushStroke(\"M478 0 H521 V\" + height + \" H478z\");\n default:\n return \"\";\n }\n};\nvar path = {\n // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main\n doubleleftarrow: \"M262 157\\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\\nm8 0v40h399730v-40zm0 194v40h399730v-40z\",\n // doublerightarrow is from glyph U+21D2 in font KaTeX Main\n doublerightarrow: \"M399738 392l\\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z\",\n // leftarrow is from glyph U+2190 in font KaTeX Main\n leftarrow: \"M400000 241H110l3-3c68.7-52.7 113.7-120\\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\\n l-3-3h399890zM100 241v40h399900v-40z\",\n // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular\n leftbrace: \"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z\",\n leftbraceunder: \"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z\",\n // overgroup is from the MnSymbol package (public domain)\n leftgroup: \"M400000 80\\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\\n 435 0h399565z\",\n leftgroupunder: \"M400000 262\\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\\n 435 219h399565z\",\n // Harpoons are from glyph U+21BD in font KaTeX Main\n leftharpoon: \"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z\",\n leftharpoonplus: \"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\\nm0 0v40h400000v-40z\",\n leftharpoondown: \"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z\",\n leftharpoondownplus: \"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z\",\n // hook is from glyph U+21A9 in font KaTeX Main\n lefthook: \"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\\n 71.5 23h399859zM103 281v-40h399897v40z\",\n leftlinesegment: doubleBrushStroke(\"M40 281 V428 H0 V94 H40 V241 H400000 v40z\"),\n leftbracketunder: doubleBrushStroke(\"M0 0 h120 V290 H399995 v120 H0z\"),\n leftbracketover: doubleBrushStroke(\"M0 440 h120 V150 H399995 v-120 H0z\"),\n leftmapsto: doubleBrushStroke(\"M40 281 V448H0V74H40V241H400000v40z\"),\n // tofrom is from glyph U+21C4 in font KaTeX AMS Regular\n leftToFrom: \"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z\",\n longequal: doubleBrushStroke(\"M0 50 h400000 v40H0z m0 194h40000v40H0z\"),\n midbrace: \"M200428 334\\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z\",\n midbraceunder: \"M199572 214\\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z\",\n oiintSize1: \"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z\",\n oiintSize2: \"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\\nc0 110 84 276 504 276s502.4-166 502.4-276z\",\n oiiintSize1: \"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z\",\n oiiintSize2: \"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z\",\n rightarrow: \"M0 241v40h399891c-47.3 35.3-84 78-110 128\\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\\n 151.7 139 205zm0 0v40h399900v-40z\",\n rightbrace: \"M400000 542l\\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z\",\n rightbraceunder: \"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z\",\n rightgroup: \"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\\n 3-1 3-3v-38c-76-158-257-219-435-219H0z\",\n rightgroupunder: \"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z\",\n rightharpoon: \"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\\n 69.2 92 94.5zm0 0v40h399900v-40z\",\n rightharpoonplus: \"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z\",\n rightharpoondown: \"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z\",\n rightharpoondownplus: \"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\\nm0-194v40h400000v-40zm0 0v40h400000v-40z\",\n righthook: \"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z\",\n rightlinesegment: doubleBrushStroke(\"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\"),\n rightbracketunder: doubleBrushStroke(\"M399995 0 h-120 V290 H0 v120 H400000z\"),\n rightbracketover: doubleBrushStroke(\"M399995 440 h-120 V150 H0 v-120 H399995z\"),\n rightToFrom: \"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z\",\n // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular\n twoheadleftarrow: \"M0 167c68 40\\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z\",\n twoheadrightarrow: \"M400000 167\\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z\",\n // tilde1 is a modified version of a glyph from the MnSymbol package\n tilde1: \"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\\n-68.267.847-113-73.952-191-73.952z\",\n // ditto tilde2, tilde3, & tilde4\n tilde2: \"M344 55.266c-142 0-300.638 81.316-311.5 86.418\\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z\",\n tilde3: \"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\\n -338 0-409-156.573-744-156.573z\",\n tilde4: \"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\\n -175.236-744-175.236z\",\n // vec is from glyph U+20D7 in font KaTeX Main\n vec: \"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\\nc-16-25.333-24-45-24-59z\",\n // widehat1 is a modified version of a glyph from the MnSymbol package\n widehat1: \"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z\",\n // ditto widehat2, widehat3, & widehat4\n widehat2: \"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z\",\n widehat3: \"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z\",\n widehat4: \"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z\",\n // widecheck paths are all inverted versions of widehat\n widecheck1: \"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z\",\n widecheck2: \"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z\",\n widecheck3: \"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z\",\n widecheck4: \"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z\",\n // The next ten paths support reaction arrows from the mhchem package.\n // Arrows for \\ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX\n // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main\n baraboveleftarrow: \"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z\",\n // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main\n rightarrowabovebar: \"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z\",\n // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.\n // Ref from mhchem.sty: \\rlap{\\raisebox{-.22ex}{$\\kern0.5em\n baraboveshortleftharpoon: \"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z\",\n rightharpoonaboveshortbar: \"M0,241 l0,40c399126,0,399993,0,399993,0\\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z\",\n shortbaraboveleftharpoon: \"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z\",\n shortrightharpoonabovebar: \"M53,241l0,40c398570,0,399437,0,399437,0\\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z\"\n};\nvar tallDelim = function tallDelim(label, midHeight) {\n switch (label) {\n case \"lbrack\":\n return \"M403 1759 V84 H666 V0 H319 V1759 v\" + midHeight + \" v1759 v84 h347 v-84\\nH403z M403 1759 V0 H319 V1759 v\" + midHeight + \" v1759 v84 h84z\";\n case \"rbrack\":\n return \"M347 1759 V0 H0 V84 H263 V1759 v\" + midHeight + \" v1759 H0 v84 H347z\\nM347 1759 V0 H263 V1759 v\" + midHeight + \" v1759 h84z\";\n case \"vert\":\n return \"M145 15 v585 v\" + midHeight + \" v585 c2.667,10,9.667,15,21,15\\nc10,0,16.667,-5,20,-15 v-585 v\" + -midHeight + \" v-585 c-2.667,-10,-9.667,-15,-21,-15\\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v\" + midHeight + \" v585 h43z\";\n case \"doublevert\":\n return \"M145 15 v585 v\" + midHeight + \" v585 c2.667,10,9.667,15,21,15\\nc10,0,16.667,-5,20,-15 v-585 v\" + -midHeight + \" v-585 c-2.667,-10,-9.667,-15,-21,-15\\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v\" + midHeight + \" v585 h43z\\nM367 15 v585 v\" + midHeight + \" v585 c2.667,10,9.667,15,21,15\\nc10,0,16.667,-5,20,-15 v-585 v\" + -midHeight + \" v-585 c-2.667,-10,-9.667,-15,-21,-15\\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v\" + midHeight + \" v585 h43z\";\n case \"lfloor\":\n return \"M319 602 V0 H403 V602 v\" + midHeight + \" v1715 h263 v84 H319z\\nMM319 602 V0 H403 V602 v\" + midHeight + \" v1715 H319z\";\n case \"rfloor\":\n return \"M319 602 V0 H403 V602 v\" + midHeight + \" v1799 H0 v-84 H319z\\nMM319 602 V0 H403 V602 v\" + midHeight + \" v1715 H319z\";\n case \"lceil\":\n return \"M403 1759 V84 H666 V0 H319 V1759 v\" + midHeight + \" v602 h84z\\nM403 1759 V0 H319 V1759 v\" + midHeight + \" v602 h84z\";\n case \"rceil\":\n return \"M347 1759 V0 H0 V84 H263 V1759 v\" + midHeight + \" v602 h84z\\nM347 1759 V0 h-84 V1759 v\" + midHeight + \" v602 h84z\";\n case \"lparen\":\n return \"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\\n-36,557 l0,\" + (midHeight + 84) + \"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\\nl0,-\" + (midHeight + 92) + \"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z\";\n case \"rparen\":\n return \"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,\" + (midHeight + 9) + \"\\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\\nl0,-\" + (midHeight + 144) + \"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z\";\n default:\n // We should not ever get here.\n throw new Error(\"Unknown stretchy delimiter.\");\n }\n};\n\nfunction isMathDomNode(node) {\n return 'toText' in node;\n}\n/**\n * This node represents a document fragment, which contains elements, but when\n * placed into the DOM doesn't have any representation itself. It only contains\n * children and doesn't have any DOM node properties.\n */\nclass DocumentFragment {\n // Never used; needed for satisfying interface.\n constructor(children) {\n this.children = void 0;\n this.classes = void 0;\n this.height = void 0;\n this.depth = void 0;\n this.maxFontSize = void 0;\n this.style = void 0;\n this.children = children;\n this.classes = [];\n this.height = 0;\n this.depth = 0;\n this.maxFontSize = 0;\n this.style = {};\n }\n hasClass(className) {\n return this.classes.includes(className);\n }\n /** Convert the fragment into a node. */\n toNode() {\n var frag = document.createDocumentFragment();\n for (var i = 0; i < this.children.length; i++) {\n frag.appendChild(this.children[i].toNode());\n }\n return frag;\n }\n /** Convert the fragment into HTML markup. */\n toMarkup() {\n var markup = \"\";\n // Simply concatenate the markup for the children together.\n for (var i = 0; i < this.children.length; i++) {\n markup += this.children[i].toMarkup();\n }\n return markup;\n }\n /**\n * Converts the math node into a string, similar to innerText. Applies to\n * MathDomNode's only.\n */\n toText() {\n return this.children.map(child => {\n if (isMathDomNode(child)) {\n return child.toText();\n }\n throw new Error(\"Expected MathDomNode with toText, got \" + child.constructor.name);\n }).join(\"\");\n }\n}\n\n/**\n * This file does conversion between units. In particular, it provides\n * calculateSize to convert other units into ems.\n */\n// This table gives the number of TeX pts in one of each *absolute* TeX unit.\n// Thus, multiplying a length by this number converts the length from units\n// into pts. Dividing the result by ptPerEm gives the number of ems\n// *assuming* a font size of ptPerEm (normal size, normal style).\nvar ptPerUnit = {\n // https://en.wikibooks.org/wiki/LaTeX/Lengths and\n // https://tex.stackexchange.com/a/8263\n \"pt\": 1,\n // TeX point\n \"mm\": 7227 / 2540,\n // millimeter\n \"cm\": 7227 / 254,\n // centimeter\n \"in\": 72.27,\n // inch\n \"bp\": 803 / 800,\n // big (PostScript) points\n \"pc\": 12,\n // pica\n \"dd\": 1238 / 1157,\n // didot\n \"cc\": 14856 / 1157,\n // cicero (12 didot)\n \"nd\": 685 / 642,\n // new didot\n \"nc\": 1370 / 107,\n // new cicero (12 new didot)\n \"sp\": 1 / 65536,\n // scaled point (TeX's internal smallest unit)\n // https://tex.stackexchange.com/a/41371\n \"px\": 803 / 800 // \\pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX\n};\n// Dictionary of relative units, for fast validity testing.\nvar relativeUnit = {\n \"ex\": true,\n \"em\": true,\n \"mu\": true\n};\n/**\n * Determine whether the specified unit (either a string defining the unit\n * or a \"size\" parse node containing a unit field) is valid.\n */\nvar validUnit = function validUnit(unit) {\n if (typeof unit !== \"string\") {\n unit = unit.unit;\n }\n return unit in ptPerUnit || unit in relativeUnit || unit === \"ex\";\n};\n/*\n * Convert a \"size\" parse node (with numeric \"number\" and string \"unit\" fields,\n * as parsed by functions.js argType \"size\") into a CSS em value for the\n * current style/scale. `options` gives the current options.\n */\nvar calculateSize = function calculateSize(sizeValue, options) {\n var scale;\n if (sizeValue.unit in ptPerUnit) {\n // Absolute units\n scale = ptPerUnit[sizeValue.unit] // Convert unit to pt\n / options.fontMetrics().ptPerEm // Convert pt to CSS em\n / options.sizeMultiplier; // Unscale to make absolute units\n } else if (sizeValue.unit === \"mu\") {\n // `mu` units scale with scriptstyle/scriptscriptstyle.\n scale = options.fontMetrics().cssEmPerMu;\n } else {\n // Other relative units always refer to the *textstyle* font\n // in the current size.\n var unitOptions;\n if (options.style.isTight()) {\n // isTight() means current style is script/scriptscript.\n unitOptions = options.havingStyle(options.style.text());\n } else {\n unitOptions = options;\n }\n // TODO: In TeX these units are relative to the quad of the current\n // *text* font, e.g. cmr10. KaTeX instead uses values from the\n // comparably-sized *Computer Modern symbol* font. At 10pt, these\n // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641;\n // cmr5=1.361133, cmsy5=1.472241. Consider $\\scriptsize a\\kern1emb$.\n // TeX \\showlists shows a kern of 1.13889 * fontsize;\n // KaTeX shows a kern of 1.171 * fontsize.\n if (sizeValue.unit === \"ex\") {\n scale = unitOptions.fontMetrics().xHeight;\n } else if (sizeValue.unit === \"em\") {\n scale = unitOptions.fontMetrics().quad;\n } else {\n throw new ParseError(\"Invalid unit: '\" + sizeValue.unit + \"'\");\n }\n if (unitOptions !== options) {\n scale *= unitOptions.sizeMultiplier / options.sizeMultiplier;\n }\n }\n return Math.min(sizeValue.number * scale, options.maxSize);\n};\n/**\n * Round `n` to 4 decimal places, or to the nearest 1/10,000th em. See\n * https://github.com/KaTeX/KaTeX/pull/2460.\n */\nvar makeEm = function makeEm(n) {\n return +n.toFixed(4) + \"em\";\n};\n\n/**\n * These objects store the data about the DOM nodes we create, as well as some\n * extra data. They can then be transformed into real DOM nodes with the\n * `toNode` function or HTML markup using `toMarkup`. They are useful for both\n * storing extra properties on the nodes, as well as providing a way to easily\n * work with the DOM.\n *\n * Similar functions for working with MathML nodes exist in mathMLTree.js.\n *\n * TODO: refactor `span` and `anchor` into common superclass when\n * target environments support class inheritance\n */\n/**\n * Create an HTML className based on a list of classes. In addition to joining\n * with spaces, we also remove empty classes.\n */\nvar createClass = function createClass(classes) {\n return classes.filter(cls => cls).join(\" \");\n};\n/**\n * Serialize a CssStyle object into a semicolon-delimited inline-style string\n * (hyphenating camelCase property names). Returns \"\" when no property is set.\n */\nvar cssStyleToString = function cssStyleToString(style) {\n var styles = \"\";\n for (var key of Object.keys(style)) {\n var value = style[key];\n if (value !== undefined) {\n styles += hyphenate(key) + \":\" + value + \";\";\n }\n }\n return styles;\n};\nvar initNode = function initNode(classes, options, style) {\n this.classes = classes || [];\n this.attributes = {};\n this.height = 0;\n this.depth = 0;\n this.maxFontSize = 0;\n this.style = style || {};\n if (options) {\n if (options.style.isTight()) {\n this.classes.push(\"mtight\");\n }\n var color = options.getColor();\n if (color) {\n this.style.color = color;\n }\n }\n};\n/**\n * Convert into an HTML node\n */\nvar toNode = function toNode(tagName) {\n var node = document.createElement(tagName);\n // Apply the class\n node.className = createClass(this.classes);\n // Apply inline styles\n Object.assign(node.style, this.style);\n // Apply attributes\n for (var attr of Object.keys(this.attributes)) {\n node.setAttribute(attr, this.attributes[attr]);\n }\n // Append the children, also as HTML nodes\n for (var i = 0; i < this.children.length; i++) {\n node.appendChild(this.children[i].toNode());\n }\n return node;\n};\n/**\n * https://w3c.github.io/html-reference/syntax.html#syntax-attributes\n *\n * > Attribute Names must consist of one or more characters\n * other than the space characters, U+0000 NULL,\n * '\"', \"'\", \">\", \"/\", \"=\", the control characters,\n * and any characters that are not defined by Unicode.\n */\nvar invalidAttributeNameRegex = /[\\s\"'>/=\\x00-\\x1f]/;\n/**\n * Convert into an HTML markup string\n */\nvar toMarkup = function toMarkup(tagName) {\n var markup = \"<\" + tagName;\n // Add the class\n if (this.classes.length) {\n markup += \" class=\\\"\" + escape(createClass(this.classes)) + \"\\\"\";\n }\n var styles = cssStyleToString(this.style);\n if (styles) {\n markup += \" style=\\\"\" + escape(styles) + \"\\\"\";\n }\n // Add the attributes\n for (var attr of Object.keys(this.attributes)) {\n if (invalidAttributeNameRegex.test(attr)) {\n throw new ParseError(\"Invalid attribute name '\" + attr + \"'\");\n }\n markup += \" \" + attr + \"=\\\"\" + escape(this.attributes[attr]) + \"\\\"\";\n }\n markup += \">\";\n // Add the markup of the children, also as markup\n for (var i = 0; i < this.children.length; i++) {\n markup += this.children[i].toMarkup();\n }\n markup += \"</\" + tagName + \">\";\n return markup;\n};\n/**\n * This node represents a span node, with a className, a list of children, and\n * an inline style. It also contains information about its height, depth, and\n * maxFontSize.\n *\n * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan\n * otherwise. This typesafety is important when HTML builders access a span's\n * children.\n */\nclass Span {\n constructor(classes, children, options, style) {\n this.children = void 0;\n this.attributes = void 0;\n this.classes = void 0;\n this.height = void 0;\n this.depth = void 0;\n this.width = void 0;\n this.maxFontSize = void 0;\n this.style = void 0;\n /**\n * Italic correction carried over from a SymbolNode when the symbol is\n * wrapped in a vlist (e.g. \\oiint / \\oiiint). Read by supsub to adjust\n * subscript positioning. Only set when nonzero; use `?? 0` at read sites.\n */\n this.italic = void 0;\n initNode.call(this, classes, options, style);\n this.children = children || [];\n }\n /**\n * Sets an arbitrary attribute on the span. Warning: use this wisely. Not\n * all browsers support attributes the same, and having too many custom\n * attributes is probably bad.\n */\n setAttribute(attribute, value) {\n this.attributes[attribute] = value;\n }\n hasClass(className) {\n return this.classes.includes(className);\n }\n toNode() {\n return toNode.call(this, \"span\");\n }\n toMarkup() {\n return toMarkup.call(this, \"span\");\n }\n}\n/**\n * This node represents an anchor (<a>) element with a hyperlink. See `span`\n * for further details.\n */\nclass Anchor {\n constructor(href, classes, children, options) {\n this.children = void 0;\n this.attributes = void 0;\n this.classes = void 0;\n this.height = void 0;\n this.depth = void 0;\n this.maxFontSize = void 0;\n this.style = void 0;\n initNode.call(this, classes, options);\n this.children = children || [];\n this.setAttribute('href', href);\n }\n setAttribute(attribute, value) {\n this.attributes[attribute] = value;\n }\n hasClass(className) {\n return this.classes.includes(className);\n }\n toNode() {\n return toNode.call(this, \"a\");\n }\n toMarkup() {\n return toMarkup.call(this, \"a\");\n }\n}\n/**\n * This node represents an image embed (<img>) element.\n */\nclass Img {\n constructor(src, alt, style) {\n this.src = void 0;\n this.alt = void 0;\n this.classes = void 0;\n this.height = void 0;\n this.depth = void 0;\n this.maxFontSize = void 0;\n this.style = void 0;\n this.alt = alt;\n this.src = src;\n this.classes = [\"mord\"];\n this.height = 0;\n this.depth = 0;\n this.maxFontSize = 0;\n this.style = style;\n }\n hasClass(className) {\n return this.classes.includes(className);\n }\n toNode() {\n var node = document.createElement(\"img\");\n node.src = this.src;\n node.alt = this.alt;\n node.className = \"mord\";\n // Apply inline styles\n Object.assign(node.style, this.style);\n return node;\n }\n toMarkup() {\n var markup = \"<img src=\\\"\" + escape(this.src) + \"\\\"\" + (\" alt=\\\"\" + escape(this.alt) + \"\\\"\");\n var styles = cssStyleToString(this.style);\n if (styles) {\n markup += \" style=\\\"\" + escape(styles) + \"\\\"\";\n }\n markup += \"'/>\";\n return markup;\n }\n}\nvar iCombinations = {\n 'î': '\\u0131\\u0302',\n 'ï': '\\u0131\\u0308',\n 'í': '\\u0131\\u0301',\n // 'ī': '\\u0131\\u0304', // enable when we add Extended Latin\n 'ì': '\\u0131\\u0300'\n};\n/**\n * A symbol node contains information about a single symbol. It either renders\n * to a single text node, or a span with a single text node in it, depending on\n * whether it has CSS classes, styles, or needs italic correction.\n */\nclass SymbolNode {\n constructor(text, height, depth, italic, skew, width, classes, style) {\n this.text = void 0;\n this.height = void 0;\n this.depth = void 0;\n this.italic = void 0;\n this.skew = void 0;\n this.width = void 0;\n this.maxFontSize = void 0;\n this.classes = void 0;\n this.style = void 0;\n this.text = text;\n this.height = height || 0;\n this.depth = depth || 0;\n this.italic = italic || 0;\n this.skew = skew || 0;\n this.width = width || 0;\n this.classes = classes || [];\n this.style = style || {};\n this.maxFontSize = 0;\n // Mark text from non-Latin scripts with specific classes so that we\n // can specify which fonts to use. This allows us to render these\n // characters with a serif font in situations where the browser would\n // either default to a sans serif or render a placeholder character.\n // We use CSS class names like cjk_fallback, hangul_fallback and\n // brahmic_fallback. See ./unicodeScripts.js for the set of possible\n // script names\n var script = scriptFromCodepoint(this.text.charCodeAt(0));\n if (script) {\n this.classes.push(script + \"_fallback\");\n }\n if (/[îïíì]/.test(this.text)) {\n // add ī when we add Extended Latin\n this.text = iCombinations[this.text];\n }\n }\n hasClass(className) {\n return this.classes.includes(className);\n }\n /**\n * Creates a text node or span from a symbol node. Note that a span is only\n * created if it is needed.\n */\n toNode() {\n var node = document.createTextNode(this.text);\n var span = null;\n if (this.italic > 0) {\n span = document.createElement(\"span\");\n span.style.marginRight = makeEm(this.italic);\n }\n if (this.classes.length > 0) {\n span = span || document.createElement(\"span\");\n span.className = createClass(this.classes);\n }\n if (Object.keys(this.style).length > 0) {\n span = span || document.createElement(\"span\");\n Object.assign(span.style, this.style);\n }\n if (span) {\n span.appendChild(node);\n return span;\n } else {\n return node;\n }\n }\n /**\n * Creates markup for a symbol node.\n */\n toMarkup() {\n // TODO(alpert): More duplication than I'd like from\n // span.prototype.toMarkup and symbolNode.prototype.toNode...\n var needsSpan = false;\n var markup = \"<span\";\n if (this.classes.length) {\n needsSpan = true;\n markup += \" class=\\\"\";\n markup += escape(createClass(this.classes));\n markup += \"\\\"\";\n }\n var styles = \"\";\n if (this.italic > 0) {\n styles += \"margin-right:\" + makeEm(this.italic) + \";\";\n }\n styles += cssStyleToString(this.style);\n if (styles) {\n needsSpan = true;\n markup += \" style=\\\"\" + escape(styles) + \"\\\"\";\n }\n var escaped = escape(this.text);\n if (needsSpan) {\n markup += \">\";\n markup += escaped;\n markup += \"</span>\";\n return markup;\n } else {\n return escaped;\n }\n }\n}\n/**\n * SVG nodes are used to render stretchy wide elements.\n */\nclass SvgNode {\n constructor(children, attributes) {\n this.children = void 0;\n this.attributes = void 0;\n this.children = children || [];\n this.attributes = attributes || {};\n }\n toNode() {\n var svgNS = \"http://www.w3.org/2000/svg\";\n var node = document.createElementNS(svgNS, \"svg\");\n // Apply attributes\n for (var attr of Object.keys(this.attributes)) {\n node.setAttribute(attr, this.attributes[attr]);\n }\n for (var i = 0; i < this.children.length; i++) {\n node.appendChild(this.children[i].toNode());\n }\n return node;\n }\n toMarkup() {\n var markup = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\"\";\n // Apply attributes\n for (var attr of Object.keys(this.attributes)) {\n markup += \" \" + attr + \"=\\\"\" + escape(this.attributes[attr]) + \"\\\"\";\n }\n markup += \">\";\n for (var i = 0; i < this.children.length; i++) {\n markup += this.children[i].toMarkup();\n }\n markup += \"</svg>\";\n return markup;\n }\n}\nclass PathNode {\n constructor(pathName, alternate) {\n this.pathName = void 0;\n this.alternate = void 0;\n this.pathName = pathName;\n this.alternate = alternate; // Used only for \\sqrt, \\phase, & tall delims\n }\n toNode() {\n var svgNS = \"http://www.w3.org/2000/svg\";\n var node = document.createElementNS(svgNS, \"path\");\n if (this.alternate) {\n node.setAttribute(\"d\", this.alternate);\n } else {\n node.setAttribute(\"d\", path[this.pathName]);\n }\n return node;\n }\n toMarkup() {\n if (this.alternate) {\n return \"<path d=\\\"\" + escape(this.alternate) + \"\\\"/>\";\n } else {\n return \"<path d=\\\"\" + escape(path[this.pathName]) + \"\\\"/>\";\n }\n }\n}\nclass LineNode {\n constructor(attributes) {\n this.attributes = void 0;\n this.attributes = attributes || {};\n }\n toNode() {\n var svgNS = \"http://www.w3.org/2000/svg\";\n var node = document.createElementNS(svgNS, \"line\");\n // Apply attributes\n for (var attr of Object.keys(this.attributes)) {\n node.setAttribute(attr, this.attributes[attr]);\n }\n return node;\n }\n toMarkup() {\n var markup = \"<line\";\n for (var attr of Object.keys(this.attributes)) {\n markup += \" \" + attr + \"=\\\"\" + escape(this.attributes[attr]) + \"\\\"\";\n }\n markup += \"/>\";\n return markup;\n }\n}\nfunction assertSymbolDomNode(group) {\n if (group instanceof SymbolNode) {\n return group;\n } else {\n throw new Error(\"Expected symbolNode but got \" + String(group) + \".\");\n }\n}\nfunction assertSpan(group) {\n if (group instanceof Span) {\n return group;\n } else {\n throw new Error(\"Expected span<HtmlDomNode> but got \" + String(group) + \".\");\n }\n}\n/**\n * Whether an HtmlDomNode has HtmlDomNode children.\n * HtmlDomNode is a base type representing a union of\n * SymbolNode, SvgSpan, DomSpan, Anchor, and documentFragment.\n * In the last three cases, the children are HtmlDomNode[].\n */\nvar hasHtmlDomChildren = node => node instanceof Span || node instanceof Anchor || node instanceof DocumentFragment;\n\n// This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.\nvar fontMetricsData = {\n \"AMS-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"65\": [0, 0.68889, 0, 0, 0.72222],\n \"66\": [0, 0.68889, 0, 0, 0.66667],\n \"67\": [0, 0.68889, 0, 0, 0.72222],\n \"68\": [0, 0.68889, 0, 0, 0.72222],\n \"69\": [0, 0.68889, 0, 0, 0.66667],\n \"70\": [0, 0.68889, 0, 0, 0.61111],\n \"71\": [0, 0.68889, 0, 0, 0.77778],\n \"72\": [0, 0.68889, 0, 0, 0.77778],\n \"73\": [0, 0.68889, 0, 0, 0.38889],\n \"74\": [0.16667, 0.68889, 0, 0, 0.5],\n \"75\": [0, 0.68889, 0, 0, 0.77778],\n \"76\": [0, 0.68889, 0, 0, 0.66667],\n \"77\": [0, 0.68889, 0, 0, 0.94445],\n \"78\": [0, 0.68889, 0, 0, 0.72222],\n \"79\": [0.16667, 0.68889, 0, 0, 0.77778],\n \"80\": [0, 0.68889, 0, 0, 0.61111],\n \"81\": [0.16667, 0.68889, 0, 0, 0.77778],\n \"82\": [0, 0.68889, 0, 0, 0.72222],\n \"83\": [0, 0.68889, 0, 0, 0.55556],\n \"84\": [0, 0.68889, 0, 0, 0.66667],\n \"85\": [0, 0.68889, 0, 0, 0.72222],\n \"86\": [0, 0.68889, 0, 0, 0.72222],\n \"87\": [0, 0.68889, 0, 0, 1.0],\n \"88\": [0, 0.68889, 0, 0, 0.72222],\n \"89\": [0, 0.68889, 0, 0, 0.72222],\n \"90\": [0, 0.68889, 0, 0, 0.66667],\n \"107\": [0, 0.68889, 0, 0, 0.55556],\n \"160\": [0, 0, 0, 0, 0.25],\n \"165\": [0, 0.675, 0.025, 0, 0.75],\n \"174\": [0.15559, 0.69224, 0, 0, 0.94666],\n \"240\": [0, 0.68889, 0, 0, 0.55556],\n \"295\": [0, 0.68889, 0, 0, 0.54028],\n \"710\": [0, 0.825, 0, 0, 2.33334],\n \"732\": [0, 0.9, 0, 0, 2.33334],\n \"770\": [0, 0.825, 0, 0, 2.33334],\n \"771\": [0, 0.9, 0, 0, 2.33334],\n \"989\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"1008\": [0, 0.43056, 0.04028, 0, 0.66667],\n \"8245\": [0, 0.54986, 0, 0, 0.275],\n \"8463\": [0, 0.68889, 0, 0, 0.54028],\n \"8487\": [0, 0.68889, 0, 0, 0.72222],\n \"8498\": [0, 0.68889, 0, 0, 0.55556],\n \"8502\": [0, 0.68889, 0, 0, 0.66667],\n \"8503\": [0, 0.68889, 0, 0, 0.44445],\n \"8504\": [0, 0.68889, 0, 0, 0.66667],\n \"8513\": [0, 0.68889, 0, 0, 0.63889],\n \"8592\": [-0.03598, 0.46402, 0, 0, 0.5],\n \"8594\": [-0.03598, 0.46402, 0, 0, 0.5],\n \"8602\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8603\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8606\": [0.01354, 0.52239, 0, 0, 1.0],\n \"8608\": [0.01354, 0.52239, 0, 0, 1.0],\n \"8610\": [0.01354, 0.52239, 0, 0, 1.11111],\n \"8611\": [0.01354, 0.52239, 0, 0, 1.11111],\n \"8619\": [0, 0.54986, 0, 0, 1.0],\n \"8620\": [0, 0.54986, 0, 0, 1.0],\n \"8621\": [-0.13313, 0.37788, 0, 0, 1.38889],\n \"8622\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8624\": [0, 0.69224, 0, 0, 0.5],\n \"8625\": [0, 0.69224, 0, 0, 0.5],\n \"8630\": [0, 0.43056, 0, 0, 1.0],\n \"8631\": [0, 0.43056, 0, 0, 1.0],\n \"8634\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8635\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8638\": [0.19444, 0.69224, 0, 0, 0.41667],\n \"8639\": [0.19444, 0.69224, 0, 0, 0.41667],\n \"8642\": [0.19444, 0.69224, 0, 0, 0.41667],\n \"8643\": [0.19444, 0.69224, 0, 0, 0.41667],\n \"8644\": [0.1808, 0.675, 0, 0, 1.0],\n \"8646\": [0.1808, 0.675, 0, 0, 1.0],\n \"8647\": [0.1808, 0.675, 0, 0, 1.0],\n \"8648\": [0.19444, 0.69224, 0, 0, 0.83334],\n \"8649\": [0.1808, 0.675, 0, 0, 1.0],\n \"8650\": [0.19444, 0.69224, 0, 0, 0.83334],\n \"8651\": [0.01354, 0.52239, 0, 0, 1.0],\n \"8652\": [0.01354, 0.52239, 0, 0, 1.0],\n \"8653\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8654\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8655\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8666\": [0.13667, 0.63667, 0, 0, 1.0],\n \"8667\": [0.13667, 0.63667, 0, 0, 1.0],\n \"8669\": [-0.13313, 0.37788, 0, 0, 1.0],\n \"8672\": [-0.064, 0.437, 0, 0, 1.334],\n \"8674\": [-0.064, 0.437, 0, 0, 1.334],\n \"8705\": [0, 0.825, 0, 0, 0.5],\n \"8708\": [0, 0.68889, 0, 0, 0.55556],\n \"8709\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8717\": [0, 0.43056, 0, 0, 0.42917],\n \"8722\": [-0.03598, 0.46402, 0, 0, 0.5],\n \"8724\": [0.08198, 0.69224, 0, 0, 0.77778],\n \"8726\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8733\": [0, 0.69224, 0, 0, 0.77778],\n \"8736\": [0, 0.69224, 0, 0, 0.72222],\n \"8737\": [0, 0.69224, 0, 0, 0.72222],\n \"8738\": [0.03517, 0.52239, 0, 0, 0.72222],\n \"8739\": [0.08167, 0.58167, 0, 0, 0.22222],\n \"8740\": [0.25142, 0.74111, 0, 0, 0.27778],\n \"8741\": [0.08167, 0.58167, 0, 0, 0.38889],\n \"8742\": [0.25142, 0.74111, 0, 0, 0.5],\n \"8756\": [0, 0.69224, 0, 0, 0.66667],\n \"8757\": [0, 0.69224, 0, 0, 0.66667],\n \"8764\": [-0.13313, 0.36687, 0, 0, 0.77778],\n \"8765\": [-0.13313, 0.37788, 0, 0, 0.77778],\n \"8769\": [-0.13313, 0.36687, 0, 0, 0.77778],\n \"8770\": [-0.03625, 0.46375, 0, 0, 0.77778],\n \"8774\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8776\": [-0.01688, 0.48312, 0, 0, 0.77778],\n \"8778\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8782\": [0.06062, 0.54986, 0, 0, 0.77778],\n \"8783\": [0.06062, 0.54986, 0, 0, 0.77778],\n \"8785\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8786\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8787\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8790\": [0, 0.69224, 0, 0, 0.77778],\n \"8791\": [0.22958, 0.72958, 0, 0, 0.77778],\n \"8796\": [0.08198, 0.91667, 0, 0, 0.77778],\n \"8806\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"8807\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"8808\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"8809\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"8812\": [0.25583, 0.75583, 0, 0, 0.5],\n \"8814\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8815\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8816\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8817\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8818\": [0.22958, 0.72958, 0, 0, 0.77778],\n \"8819\": [0.22958, 0.72958, 0, 0, 0.77778],\n \"8822\": [0.1808, 0.675, 0, 0, 0.77778],\n \"8823\": [0.1808, 0.675, 0, 0, 0.77778],\n \"8828\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8829\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8830\": [0.22958, 0.72958, 0, 0, 0.77778],\n \"8831\": [0.22958, 0.72958, 0, 0, 0.77778],\n \"8832\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8833\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8840\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8841\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8842\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8843\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8847\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8848\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8858\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8859\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8861\": [0.08198, 0.58198, 0, 0, 0.77778],\n \"8862\": [0, 0.675, 0, 0, 0.77778],\n \"8863\": [0, 0.675, 0, 0, 0.77778],\n \"8864\": [0, 0.675, 0, 0, 0.77778],\n \"8865\": [0, 0.675, 0, 0, 0.77778],\n \"8872\": [0, 0.69224, 0, 0, 0.61111],\n \"8873\": [0, 0.69224, 0, 0, 0.72222],\n \"8874\": [0, 0.69224, 0, 0, 0.88889],\n \"8876\": [0, 0.68889, 0, 0, 0.61111],\n \"8877\": [0, 0.68889, 0, 0, 0.61111],\n \"8878\": [0, 0.68889, 0, 0, 0.72222],\n \"8879\": [0, 0.68889, 0, 0, 0.72222],\n \"8882\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8883\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8884\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8885\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8888\": [0, 0.54986, 0, 0, 1.11111],\n \"8890\": [0.19444, 0.43056, 0, 0, 0.55556],\n \"8891\": [0.19444, 0.69224, 0, 0, 0.61111],\n \"8892\": [0.19444, 0.69224, 0, 0, 0.61111],\n \"8901\": [0, 0.54986, 0, 0, 0.27778],\n \"8903\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8905\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8906\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"8907\": [0, 0.69224, 0, 0, 0.77778],\n \"8908\": [0, 0.69224, 0, 0, 0.77778],\n \"8909\": [-0.03598, 0.46402, 0, 0, 0.77778],\n \"8910\": [0, 0.54986, 0, 0, 0.76042],\n \"8911\": [0, 0.54986, 0, 0, 0.76042],\n \"8912\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8913\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"8914\": [0, 0.54986, 0, 0, 0.66667],\n \"8915\": [0, 0.54986, 0, 0, 0.66667],\n \"8916\": [0, 0.69224, 0, 0, 0.66667],\n \"8918\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8919\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8920\": [0.03517, 0.54986, 0, 0, 1.33334],\n \"8921\": [0.03517, 0.54986, 0, 0, 1.33334],\n \"8922\": [0.38569, 0.88569, 0, 0, 0.77778],\n \"8923\": [0.38569, 0.88569, 0, 0, 0.77778],\n \"8926\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8927\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"8928\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8929\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8934\": [0.23222, 0.74111, 0, 0, 0.77778],\n \"8935\": [0.23222, 0.74111, 0, 0, 0.77778],\n \"8936\": [0.23222, 0.74111, 0, 0, 0.77778],\n \"8937\": [0.23222, 0.74111, 0, 0, 0.77778],\n \"8938\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8939\": [0.20576, 0.70576, 0, 0, 0.77778],\n \"8940\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8941\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"8994\": [0.19444, 0.69224, 0, 0, 0.77778],\n \"8995\": [0.19444, 0.69224, 0, 0, 0.77778],\n \"9416\": [0.15559, 0.69224, 0, 0, 0.90222],\n \"9484\": [0, 0.69224, 0, 0, 0.5],\n \"9488\": [0, 0.69224, 0, 0, 0.5],\n \"9492\": [0, 0.37788, 0, 0, 0.5],\n \"9496\": [0, 0.37788, 0, 0, 0.5],\n \"9585\": [0.19444, 0.68889, 0, 0, 0.88889],\n \"9586\": [0.19444, 0.74111, 0, 0, 0.88889],\n \"9632\": [0, 0.675, 0, 0, 0.77778],\n \"9633\": [0, 0.675, 0, 0, 0.77778],\n \"9650\": [0, 0.54986, 0, 0, 0.72222],\n \"9651\": [0, 0.54986, 0, 0, 0.72222],\n \"9654\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"9660\": [0, 0.54986, 0, 0, 0.72222],\n \"9661\": [0, 0.54986, 0, 0, 0.72222],\n \"9664\": [0.03517, 0.54986, 0, 0, 0.77778],\n \"9674\": [0.11111, 0.69224, 0, 0, 0.66667],\n \"9733\": [0.19444, 0.69224, 0, 0, 0.94445],\n \"10003\": [0, 0.69224, 0, 0, 0.83334],\n \"10016\": [0, 0.69224, 0, 0, 0.83334],\n \"10731\": [0.11111, 0.69224, 0, 0, 0.66667],\n \"10846\": [0.19444, 0.75583, 0, 0, 0.61111],\n \"10877\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"10878\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"10885\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"10886\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"10887\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"10888\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"10889\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10890\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10891\": [0.48256, 0.98256, 0, 0, 0.77778],\n \"10892\": [0.48256, 0.98256, 0, 0, 0.77778],\n \"10901\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"10902\": [0.13667, 0.63667, 0, 0, 0.77778],\n \"10933\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"10934\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"10935\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10936\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10937\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10938\": [0.26167, 0.75726, 0, 0, 0.77778],\n \"10949\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"10950\": [0.25583, 0.75583, 0, 0, 0.77778],\n \"10955\": [0.28481, 0.79383, 0, 0, 0.77778],\n \"10956\": [0.28481, 0.79383, 0, 0, 0.77778],\n \"57350\": [0.08167, 0.58167, 0, 0, 0.22222],\n \"57351\": [0.08167, 0.58167, 0, 0, 0.38889],\n \"57352\": [0.08167, 0.58167, 0, 0, 0.77778],\n \"57353\": [0, 0.43056, 0.04028, 0, 0.66667],\n \"57356\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57357\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57358\": [0.41951, 0.91951, 0, 0, 0.77778],\n \"57359\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"57360\": [0.30274, 0.79383, 0, 0, 0.77778],\n \"57361\": [0.41951, 0.91951, 0, 0, 0.77778],\n \"57366\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57367\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57368\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57369\": [0.25142, 0.75726, 0, 0, 0.77778],\n \"57370\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"57371\": [0.13597, 0.63597, 0, 0, 0.77778]\n },\n \"Caligraphic-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"65\": [0, 0.68333, 0, 0.19445, 0.79847],\n \"66\": [0, 0.68333, 0.03041, 0.13889, 0.65681],\n \"67\": [0, 0.68333, 0.05834, 0.13889, 0.52653],\n \"68\": [0, 0.68333, 0.02778, 0.08334, 0.77139],\n \"69\": [0, 0.68333, 0.08944, 0.11111, 0.52778],\n \"70\": [0, 0.68333, 0.09931, 0.11111, 0.71875],\n \"71\": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],\n \"72\": [0, 0.68333, 0.00965, 0.11111, 0.84452],\n \"73\": [0, 0.68333, 0.07382, 0, 0.54452],\n \"74\": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],\n \"75\": [0, 0.68333, 0.01445, 0.05556, 0.76195],\n \"76\": [0, 0.68333, 0, 0.13889, 0.68972],\n \"77\": [0, 0.68333, 0, 0.13889, 1.2009],\n \"78\": [0, 0.68333, 0.14736, 0.08334, 0.82049],\n \"79\": [0, 0.68333, 0.02778, 0.11111, 0.79611],\n \"80\": [0, 0.68333, 0.08222, 0.08334, 0.69556],\n \"81\": [0.09722, 0.68333, 0, 0.11111, 0.81667],\n \"82\": [0, 0.68333, 0, 0.08334, 0.8475],\n \"83\": [0, 0.68333, 0.075, 0.13889, 0.60556],\n \"84\": [0, 0.68333, 0.25417, 0, 0.54464],\n \"85\": [0, 0.68333, 0.09931, 0.08334, 0.62583],\n \"86\": [0, 0.68333, 0.08222, 0, 0.61278],\n \"87\": [0, 0.68333, 0.08222, 0.08334, 0.98778],\n \"88\": [0, 0.68333, 0.14643, 0.13889, 0.7133],\n \"89\": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],\n \"90\": [0, 0.68333, 0.07944, 0.13889, 0.72473],\n \"160\": [0, 0, 0, 0, 0.25]\n },\n \"Fraktur-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69141, 0, 0, 0.29574],\n \"34\": [0, 0.69141, 0, 0, 0.21471],\n \"38\": [0, 0.69141, 0, 0, 0.73786],\n \"39\": [0, 0.69141, 0, 0, 0.21201],\n \"40\": [0.24982, 0.74947, 0, 0, 0.38865],\n \"41\": [0.24982, 0.74947, 0, 0, 0.38865],\n \"42\": [0, 0.62119, 0, 0, 0.27764],\n \"43\": [0.08319, 0.58283, 0, 0, 0.75623],\n \"44\": [0, 0.10803, 0, 0, 0.27764],\n \"45\": [0.08319, 0.58283, 0, 0, 0.75623],\n \"46\": [0, 0.10803, 0, 0, 0.27764],\n \"47\": [0.24982, 0.74947, 0, 0, 0.50181],\n \"48\": [0, 0.47534, 0, 0, 0.50181],\n \"49\": [0, 0.47534, 0, 0, 0.50181],\n \"50\": [0, 0.47534, 0, 0, 0.50181],\n \"51\": [0.18906, 0.47534, 0, 0, 0.50181],\n \"52\": [0.18906, 0.47534, 0, 0, 0.50181],\n \"53\": [0.18906, 0.47534, 0, 0, 0.50181],\n \"54\": [0, 0.69141, 0, 0, 0.50181],\n \"55\": [0.18906, 0.47534, 0, 0, 0.50181],\n \"56\": [0, 0.69141, 0, 0, 0.50181],\n \"57\": [0.18906, 0.47534, 0, 0, 0.50181],\n \"58\": [0, 0.47534, 0, 0, 0.21606],\n \"59\": [0.12604, 0.47534, 0, 0, 0.21606],\n \"61\": [-0.13099, 0.36866, 0, 0, 0.75623],\n \"63\": [0, 0.69141, 0, 0, 0.36245],\n \"65\": [0, 0.69141, 0, 0, 0.7176],\n \"66\": [0, 0.69141, 0, 0, 0.88397],\n \"67\": [0, 0.69141, 0, 0, 0.61254],\n \"68\": [0, 0.69141, 0, 0, 0.83158],\n \"69\": [0, 0.69141, 0, 0, 0.66278],\n \"70\": [0.12604, 0.69141, 0, 0, 0.61119],\n \"71\": [0, 0.69141, 0, 0, 0.78539],\n \"72\": [0.06302, 0.69141, 0, 0, 0.7203],\n \"73\": [0, 0.69141, 0, 0, 0.55448],\n \"74\": [0.12604, 0.69141, 0, 0, 0.55231],\n \"75\": [0, 0.69141, 0, 0, 0.66845],\n \"76\": [0, 0.69141, 0, 0, 0.66602],\n \"77\": [0, 0.69141, 0, 0, 1.04953],\n \"78\": [0, 0.69141, 0, 0, 0.83212],\n \"79\": [0, 0.69141, 0, 0, 0.82699],\n \"80\": [0.18906, 0.69141, 0, 0, 0.82753],\n \"81\": [0.03781, 0.69141, 0, 0, 0.82699],\n \"82\": [0, 0.69141, 0, 0, 0.82807],\n \"83\": [0, 0.69141, 0, 0, 0.82861],\n \"84\": [0, 0.69141, 0, 0, 0.66899],\n \"85\": [0, 0.69141, 0, 0, 0.64576],\n \"86\": [0, 0.69141, 0, 0, 0.83131],\n \"87\": [0, 0.69141, 0, 0, 1.04602],\n \"88\": [0, 0.69141, 0, 0, 0.71922],\n \"89\": [0.18906, 0.69141, 0, 0, 0.83293],\n \"90\": [0.12604, 0.69141, 0, 0, 0.60201],\n \"91\": [0.24982, 0.74947, 0, 0, 0.27764],\n \"93\": [0.24982, 0.74947, 0, 0, 0.27764],\n \"94\": [0, 0.69141, 0, 0, 0.49965],\n \"97\": [0, 0.47534, 0, 0, 0.50046],\n \"98\": [0, 0.69141, 0, 0, 0.51315],\n \"99\": [0, 0.47534, 0, 0, 0.38946],\n \"100\": [0, 0.62119, 0, 0, 0.49857],\n \"101\": [0, 0.47534, 0, 0, 0.40053],\n \"102\": [0.18906, 0.69141, 0, 0, 0.32626],\n \"103\": [0.18906, 0.47534, 0, 0, 0.5037],\n \"104\": [0.18906, 0.69141, 0, 0, 0.52126],\n \"105\": [0, 0.69141, 0, 0, 0.27899],\n \"106\": [0, 0.69141, 0, 0, 0.28088],\n \"107\": [0, 0.69141, 0, 0, 0.38946],\n \"108\": [0, 0.69141, 0, 0, 0.27953],\n \"109\": [0, 0.47534, 0, 0, 0.76676],\n \"110\": [0, 0.47534, 0, 0, 0.52666],\n \"111\": [0, 0.47534, 0, 0, 0.48885],\n \"112\": [0.18906, 0.52396, 0, 0, 0.50046],\n \"113\": [0.18906, 0.47534, 0, 0, 0.48912],\n \"114\": [0, 0.47534, 0, 0, 0.38919],\n \"115\": [0, 0.47534, 0, 0, 0.44266],\n \"116\": [0, 0.62119, 0, 0, 0.33301],\n \"117\": [0, 0.47534, 0, 0, 0.5172],\n \"118\": [0, 0.52396, 0, 0, 0.5118],\n \"119\": [0, 0.52396, 0, 0, 0.77351],\n \"120\": [0.18906, 0.47534, 0, 0, 0.38865],\n \"121\": [0.18906, 0.47534, 0, 0, 0.49884],\n \"122\": [0.18906, 0.47534, 0, 0, 0.39054],\n \"160\": [0, 0, 0, 0, 0.25],\n \"8216\": [0, 0.69141, 0, 0, 0.21471],\n \"8217\": [0, 0.69141, 0, 0, 0.21471],\n \"58112\": [0, 0.62119, 0, 0, 0.49749],\n \"58113\": [0, 0.62119, 0, 0, 0.4983],\n \"58114\": [0.18906, 0.69141, 0, 0, 0.33328],\n \"58115\": [0.18906, 0.69141, 0, 0, 0.32923],\n \"58116\": [0.18906, 0.47534, 0, 0, 0.50343],\n \"58117\": [0, 0.69141, 0, 0, 0.33301],\n \"58118\": [0, 0.62119, 0, 0, 0.33409],\n \"58119\": [0, 0.47534, 0, 0, 0.50073]\n },\n \"Main-Bold\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0, 0, 0.35],\n \"34\": [0, 0.69444, 0, 0, 0.60278],\n \"35\": [0.19444, 0.69444, 0, 0, 0.95833],\n \"36\": [0.05556, 0.75, 0, 0, 0.575],\n \"37\": [0.05556, 0.75, 0, 0, 0.95833],\n \"38\": [0, 0.69444, 0, 0, 0.89444],\n \"39\": [0, 0.69444, 0, 0, 0.31944],\n \"40\": [0.25, 0.75, 0, 0, 0.44722],\n \"41\": [0.25, 0.75, 0, 0, 0.44722],\n \"42\": [0, 0.75, 0, 0, 0.575],\n \"43\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"44\": [0.19444, 0.15556, 0, 0, 0.31944],\n \"45\": [0, 0.44444, 0, 0, 0.38333],\n \"46\": [0, 0.15556, 0, 0, 0.31944],\n \"47\": [0.25, 0.75, 0, 0, 0.575],\n \"48\": [0, 0.64444, 0, 0, 0.575],\n \"49\": [0, 0.64444, 0, 0, 0.575],\n \"50\": [0, 0.64444, 0, 0, 0.575],\n \"51\": [0, 0.64444, 0, 0, 0.575],\n \"52\": [0, 0.64444, 0, 0, 0.575],\n \"53\": [0, 0.64444, 0, 0, 0.575],\n \"54\": [0, 0.64444, 0, 0, 0.575],\n \"55\": [0, 0.64444, 0, 0, 0.575],\n \"56\": [0, 0.64444, 0, 0, 0.575],\n \"57\": [0, 0.64444, 0, 0, 0.575],\n \"58\": [0, 0.44444, 0, 0, 0.31944],\n \"59\": [0.19444, 0.44444, 0, 0, 0.31944],\n \"60\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"61\": [-0.10889, 0.39111, 0, 0, 0.89444],\n \"62\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"63\": [0, 0.69444, 0, 0, 0.54305],\n \"64\": [0, 0.69444, 0, 0, 0.89444],\n \"65\": [0, 0.68611, 0, 0, 0.86944],\n \"66\": [0, 0.68611, 0, 0, 0.81805],\n \"67\": [0, 0.68611, 0, 0, 0.83055],\n \"68\": [0, 0.68611, 0, 0, 0.88194],\n \"69\": [0, 0.68611, 0, 0, 0.75555],\n \"70\": [0, 0.68611, 0, 0, 0.72361],\n \"71\": [0, 0.68611, 0, 0, 0.90416],\n \"72\": [0, 0.68611, 0, 0, 0.9],\n \"73\": [0, 0.68611, 0, 0, 0.43611],\n \"74\": [0, 0.68611, 0, 0, 0.59444],\n \"75\": [0, 0.68611, 0, 0, 0.90138],\n \"76\": [0, 0.68611, 0, 0, 0.69166],\n \"77\": [0, 0.68611, 0, 0, 1.09166],\n \"78\": [0, 0.68611, 0, 0, 0.9],\n \"79\": [0, 0.68611, 0, 0, 0.86388],\n \"80\": [0, 0.68611, 0, 0, 0.78611],\n \"81\": [0.19444, 0.68611, 0, 0, 0.86388],\n \"82\": [0, 0.68611, 0, 0, 0.8625],\n \"83\": [0, 0.68611, 0, 0, 0.63889],\n \"84\": [0, 0.68611, 0, 0, 0.8],\n \"85\": [0, 0.68611, 0, 0, 0.88472],\n \"86\": [0, 0.68611, 0.01597, 0, 0.86944],\n \"87\": [0, 0.68611, 0.01597, 0, 1.18888],\n \"88\": [0, 0.68611, 0, 0, 0.86944],\n \"89\": [0, 0.68611, 0.02875, 0, 0.86944],\n \"90\": [0, 0.68611, 0, 0, 0.70277],\n \"91\": [0.25, 0.75, 0, 0, 0.31944],\n \"92\": [0.25, 0.75, 0, 0, 0.575],\n \"93\": [0.25, 0.75, 0, 0, 0.31944],\n \"94\": [0, 0.69444, 0, 0, 0.575],\n \"95\": [0.31, 0.13444, 0.03194, 0, 0.575],\n \"97\": [0, 0.44444, 0, 0, 0.55902],\n \"98\": [0, 0.69444, 0, 0, 0.63889],\n \"99\": [0, 0.44444, 0, 0, 0.51111],\n \"100\": [0, 0.69444, 0, 0, 0.63889],\n \"101\": [0, 0.44444, 0, 0, 0.52708],\n \"102\": [0, 0.69444, 0.10903, 0, 0.35139],\n \"103\": [0.19444, 0.44444, 0.01597, 0, 0.575],\n \"104\": [0, 0.69444, 0, 0, 0.63889],\n \"105\": [0, 0.69444, 0, 0, 0.31944],\n \"106\": [0.19444, 0.69444, 0, 0, 0.35139],\n \"107\": [0, 0.69444, 0, 0, 0.60694],\n \"108\": [0, 0.69444, 0, 0, 0.31944],\n \"109\": [0, 0.44444, 0, 0, 0.95833],\n \"110\": [0, 0.44444, 0, 0, 0.63889],\n \"111\": [0, 0.44444, 0, 0, 0.575],\n \"112\": [0.19444, 0.44444, 0, 0, 0.63889],\n \"113\": [0.19444, 0.44444, 0, 0, 0.60694],\n \"114\": [0, 0.44444, 0, 0, 0.47361],\n \"115\": [0, 0.44444, 0, 0, 0.45361],\n \"116\": [0, 0.63492, 0, 0, 0.44722],\n \"117\": [0, 0.44444, 0, 0, 0.63889],\n \"118\": [0, 0.44444, 0.01597, 0, 0.60694],\n \"119\": [0, 0.44444, 0.01597, 0, 0.83055],\n \"120\": [0, 0.44444, 0, 0, 0.60694],\n \"121\": [0.19444, 0.44444, 0.01597, 0, 0.60694],\n \"122\": [0, 0.44444, 0, 0, 0.51111],\n \"123\": [0.25, 0.75, 0, 0, 0.575],\n \"124\": [0.25, 0.75, 0, 0, 0.31944],\n \"125\": [0.25, 0.75, 0, 0, 0.575],\n \"126\": [0.35, 0.34444, 0, 0, 0.575],\n \"160\": [0, 0, 0, 0, 0.25],\n \"163\": [0, 0.69444, 0, 0, 0.86853],\n \"168\": [0, 0.69444, 0, 0, 0.575],\n \"172\": [0, 0.44444, 0, 0, 0.76666],\n \"176\": [0, 0.69444, 0, 0, 0.86944],\n \"177\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"184\": [0.17014, 0, 0, 0, 0.51111],\n \"198\": [0, 0.68611, 0, 0, 1.04166],\n \"215\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"216\": [0.04861, 0.73472, 0, 0, 0.89444],\n \"223\": [0, 0.69444, 0, 0, 0.59722],\n \"230\": [0, 0.44444, 0, 0, 0.83055],\n \"247\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"248\": [0.09722, 0.54167, 0, 0, 0.575],\n \"305\": [0, 0.44444, 0, 0, 0.31944],\n \"338\": [0, 0.68611, 0, 0, 1.16944],\n \"339\": [0, 0.44444, 0, 0, 0.89444],\n \"567\": [0.19444, 0.44444, 0, 0, 0.35139],\n \"710\": [0, 0.69444, 0, 0, 0.575],\n \"711\": [0, 0.63194, 0, 0, 0.575],\n \"713\": [0, 0.59611, 0, 0, 0.575],\n \"714\": [0, 0.69444, 0, 0, 0.575],\n \"715\": [0, 0.69444, 0, 0, 0.575],\n \"728\": [0, 0.69444, 0, 0, 0.575],\n \"729\": [0, 0.69444, 0, 0, 0.31944],\n \"730\": [0, 0.69444, 0, 0, 0.86944],\n \"732\": [0, 0.69444, 0, 0, 0.575],\n \"733\": [0, 0.69444, 0, 0, 0.575],\n \"915\": [0, 0.68611, 0, 0, 0.69166],\n \"916\": [0, 0.68611, 0, 0, 0.95833],\n \"920\": [0, 0.68611, 0, 0, 0.89444],\n \"923\": [0, 0.68611, 0, 0, 0.80555],\n \"926\": [0, 0.68611, 0, 0, 0.76666],\n \"928\": [0, 0.68611, 0, 0, 0.9],\n \"931\": [0, 0.68611, 0, 0, 0.83055],\n \"933\": [0, 0.68611, 0, 0, 0.89444],\n \"934\": [0, 0.68611, 0, 0, 0.83055],\n \"936\": [0, 0.68611, 0, 0, 0.89444],\n \"937\": [0, 0.68611, 0, 0, 0.83055],\n \"8211\": [0, 0.44444, 0.03194, 0, 0.575],\n \"8212\": [0, 0.44444, 0.03194, 0, 1.14999],\n \"8216\": [0, 0.69444, 0, 0, 0.31944],\n \"8217\": [0, 0.69444, 0, 0, 0.31944],\n \"8220\": [0, 0.69444, 0, 0, 0.60278],\n \"8221\": [0, 0.69444, 0, 0, 0.60278],\n \"8224\": [0.19444, 0.69444, 0, 0, 0.51111],\n \"8225\": [0.19444, 0.69444, 0, 0, 0.51111],\n \"8242\": [0, 0.55556, 0, 0, 0.34444],\n \"8407\": [0, 0.72444, 0.15486, 0, 0.575],\n \"8463\": [0, 0.69444, 0, 0, 0.66759],\n \"8465\": [0, 0.69444, 0, 0, 0.83055],\n \"8467\": [0, 0.69444, 0, 0, 0.47361],\n \"8472\": [0.19444, 0.44444, 0, 0, 0.74027],\n \"8476\": [0, 0.69444, 0, 0, 0.83055],\n \"8501\": [0, 0.69444, 0, 0, 0.70277],\n \"8592\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8593\": [0.19444, 0.69444, 0, 0, 0.575],\n \"8594\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8595\": [0.19444, 0.69444, 0, 0, 0.575],\n \"8596\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8597\": [0.25, 0.75, 0, 0, 0.575],\n \"8598\": [0.19444, 0.69444, 0, 0, 1.14999],\n \"8599\": [0.19444, 0.69444, 0, 0, 1.14999],\n \"8600\": [0.19444, 0.69444, 0, 0, 1.14999],\n \"8601\": [0.19444, 0.69444, 0, 0, 1.14999],\n \"8636\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8637\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8640\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8641\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8656\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8657\": [0.19444, 0.69444, 0, 0, 0.70277],\n \"8658\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8659\": [0.19444, 0.69444, 0, 0, 0.70277],\n \"8660\": [-0.10889, 0.39111, 0, 0, 1.14999],\n \"8661\": [0.25, 0.75, 0, 0, 0.70277],\n \"8704\": [0, 0.69444, 0, 0, 0.63889],\n \"8706\": [0, 0.69444, 0.06389, 0, 0.62847],\n \"8707\": [0, 0.69444, 0, 0, 0.63889],\n \"8709\": [0.05556, 0.75, 0, 0, 0.575],\n \"8711\": [0, 0.68611, 0, 0, 0.95833],\n \"8712\": [0.08556, 0.58556, 0, 0, 0.76666],\n \"8715\": [0.08556, 0.58556, 0, 0, 0.76666],\n \"8722\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8723\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8725\": [0.25, 0.75, 0, 0, 0.575],\n \"8726\": [0.25, 0.75, 0, 0, 0.575],\n \"8727\": [-0.02778, 0.47222, 0, 0, 0.575],\n \"8728\": [-0.02639, 0.47361, 0, 0, 0.575],\n \"8729\": [-0.02639, 0.47361, 0, 0, 0.575],\n \"8730\": [0.18, 0.82, 0, 0, 0.95833],\n \"8733\": [0, 0.44444, 0, 0, 0.89444],\n \"8734\": [0, 0.44444, 0, 0, 1.14999],\n \"8736\": [0, 0.69224, 0, 0, 0.72222],\n \"8739\": [0.25, 0.75, 0, 0, 0.31944],\n \"8741\": [0.25, 0.75, 0, 0, 0.575],\n \"8743\": [0, 0.55556, 0, 0, 0.76666],\n \"8744\": [0, 0.55556, 0, 0, 0.76666],\n \"8745\": [0, 0.55556, 0, 0, 0.76666],\n \"8746\": [0, 0.55556, 0, 0, 0.76666],\n \"8747\": [0.19444, 0.69444, 0.12778, 0, 0.56875],\n \"8764\": [-0.10889, 0.39111, 0, 0, 0.89444],\n \"8768\": [0.19444, 0.69444, 0, 0, 0.31944],\n \"8771\": [0.00222, 0.50222, 0, 0, 0.89444],\n \"8773\": [0.027, 0.638, 0, 0, 0.894],\n \"8776\": [0.02444, 0.52444, 0, 0, 0.89444],\n \"8781\": [0.00222, 0.50222, 0, 0, 0.89444],\n \"8801\": [0.00222, 0.50222, 0, 0, 0.89444],\n \"8804\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8805\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8810\": [0.08556, 0.58556, 0, 0, 1.14999],\n \"8811\": [0.08556, 0.58556, 0, 0, 1.14999],\n \"8826\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"8827\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"8834\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"8835\": [0.08556, 0.58556, 0, 0, 0.89444],\n \"8838\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8839\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8846\": [0, 0.55556, 0, 0, 0.76666],\n \"8849\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8850\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"8851\": [0, 0.55556, 0, 0, 0.76666],\n \"8852\": [0, 0.55556, 0, 0, 0.76666],\n \"8853\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8854\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8855\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8856\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8857\": [0.13333, 0.63333, 0, 0, 0.89444],\n \"8866\": [0, 0.69444, 0, 0, 0.70277],\n \"8867\": [0, 0.69444, 0, 0, 0.70277],\n \"8868\": [0, 0.69444, 0, 0, 0.89444],\n \"8869\": [0, 0.69444, 0, 0, 0.89444],\n \"8900\": [-0.02639, 0.47361, 0, 0, 0.575],\n \"8901\": [-0.02639, 0.47361, 0, 0, 0.31944],\n \"8902\": [-0.02778, 0.47222, 0, 0, 0.575],\n \"8968\": [0.25, 0.75, 0, 0, 0.51111],\n \"8969\": [0.25, 0.75, 0, 0, 0.51111],\n \"8970\": [0.25, 0.75, 0, 0, 0.51111],\n \"8971\": [0.25, 0.75, 0, 0, 0.51111],\n \"8994\": [-0.13889, 0.36111, 0, 0, 1.14999],\n \"8995\": [-0.13889, 0.36111, 0, 0, 1.14999],\n \"9651\": [0.19444, 0.69444, 0, 0, 1.02222],\n \"9657\": [-0.02778, 0.47222, 0, 0, 0.575],\n \"9661\": [0.19444, 0.69444, 0, 0, 1.02222],\n \"9667\": [-0.02778, 0.47222, 0, 0, 0.575],\n \"9711\": [0.19444, 0.69444, 0, 0, 1.14999],\n \"9824\": [0.12963, 0.69444, 0, 0, 0.89444],\n \"9825\": [0.12963, 0.69444, 0, 0, 0.89444],\n \"9826\": [0.12963, 0.69444, 0, 0, 0.89444],\n \"9827\": [0.12963, 0.69444, 0, 0, 0.89444],\n \"9837\": [0, 0.75, 0, 0, 0.44722],\n \"9838\": [0.19444, 0.69444, 0, 0, 0.44722],\n \"9839\": [0.19444, 0.69444, 0, 0, 0.44722],\n \"10216\": [0.25, 0.75, 0, 0, 0.44722],\n \"10217\": [0.25, 0.75, 0, 0, 0.44722],\n \"10815\": [0, 0.68611, 0, 0, 0.9],\n \"10927\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"10928\": [0.19667, 0.69667, 0, 0, 0.89444],\n \"57376\": [0.19444, 0.69444, 0, 0, 0]\n },\n \"Main-BoldItalic\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0.11417, 0, 0.38611],\n \"34\": [0, 0.69444, 0.07939, 0, 0.62055],\n \"35\": [0.19444, 0.69444, 0.06833, 0, 0.94444],\n \"37\": [0.05556, 0.75, 0.12861, 0, 0.94444],\n \"38\": [0, 0.69444, 0.08528, 0, 0.88555],\n \"39\": [0, 0.69444, 0.12945, 0, 0.35555],\n \"40\": [0.25, 0.75, 0.15806, 0, 0.47333],\n \"41\": [0.25, 0.75, 0.03306, 0, 0.47333],\n \"42\": [0, 0.75, 0.14333, 0, 0.59111],\n \"43\": [0.10333, 0.60333, 0.03306, 0, 0.88555],\n \"44\": [0.19444, 0.14722, 0, 0, 0.35555],\n \"45\": [0, 0.44444, 0.02611, 0, 0.41444],\n \"46\": [0, 0.14722, 0, 0, 0.35555],\n \"47\": [0.25, 0.75, 0.15806, 0, 0.59111],\n \"48\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"49\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"50\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"51\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"52\": [0.19444, 0.64444, 0.13167, 0, 0.59111],\n \"53\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"54\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"55\": [0.19444, 0.64444, 0.13167, 0, 0.59111],\n \"56\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"57\": [0, 0.64444, 0.13167, 0, 0.59111],\n \"58\": [0, 0.44444, 0.06695, 0, 0.35555],\n \"59\": [0.19444, 0.44444, 0.06695, 0, 0.35555],\n \"61\": [-0.10889, 0.39111, 0.06833, 0, 0.88555],\n \"63\": [0, 0.69444, 0.11472, 0, 0.59111],\n \"64\": [0, 0.69444, 0.09208, 0, 0.88555],\n \"65\": [0, 0.68611, 0, 0, 0.86555],\n \"66\": [0, 0.68611, 0.0992, 0, 0.81666],\n \"67\": [0, 0.68611, 0.14208, 0, 0.82666],\n \"68\": [0, 0.68611, 0.09062, 0, 0.87555],\n \"69\": [0, 0.68611, 0.11431, 0, 0.75666],\n \"70\": [0, 0.68611, 0.12903, 0, 0.72722],\n \"71\": [0, 0.68611, 0.07347, 0, 0.89527],\n \"72\": [0, 0.68611, 0.17208, 0, 0.8961],\n \"73\": [0, 0.68611, 0.15681, 0, 0.47166],\n \"74\": [0, 0.68611, 0.145, 0, 0.61055],\n \"75\": [0, 0.68611, 0.14208, 0, 0.89499],\n \"76\": [0, 0.68611, 0, 0, 0.69777],\n \"77\": [0, 0.68611, 0.17208, 0, 1.07277],\n \"78\": [0, 0.68611, 0.17208, 0, 0.8961],\n \"79\": [0, 0.68611, 0.09062, 0, 0.85499],\n \"80\": [0, 0.68611, 0.0992, 0, 0.78721],\n \"81\": [0.19444, 0.68611, 0.09062, 0, 0.85499],\n \"82\": [0, 0.68611, 0.02559, 0, 0.85944],\n \"83\": [0, 0.68611, 0.11264, 0, 0.64999],\n \"84\": [0, 0.68611, 0.12903, 0, 0.7961],\n \"85\": [0, 0.68611, 0.17208, 0, 0.88083],\n \"86\": [0, 0.68611, 0.18625, 0, 0.86555],\n \"87\": [0, 0.68611, 0.18625, 0, 1.15999],\n \"88\": [0, 0.68611, 0.15681, 0, 0.86555],\n \"89\": [0, 0.68611, 0.19803, 0, 0.86555],\n \"90\": [0, 0.68611, 0.14208, 0, 0.70888],\n \"91\": [0.25, 0.75, 0.1875, 0, 0.35611],\n \"93\": [0.25, 0.75, 0.09972, 0, 0.35611],\n \"94\": [0, 0.69444, 0.06709, 0, 0.59111],\n \"95\": [0.31, 0.13444, 0.09811, 0, 0.59111],\n \"97\": [0, 0.44444, 0.09426, 0, 0.59111],\n \"98\": [0, 0.69444, 0.07861, 0, 0.53222],\n \"99\": [0, 0.44444, 0.05222, 0, 0.53222],\n \"100\": [0, 0.69444, 0.10861, 0, 0.59111],\n \"101\": [0, 0.44444, 0.085, 0, 0.53222],\n \"102\": [0.19444, 0.69444, 0.21778, 0, 0.4],\n \"103\": [0.19444, 0.44444, 0.105, 0, 0.53222],\n \"104\": [0, 0.69444, 0.09426, 0, 0.59111],\n \"105\": [0, 0.69326, 0.11387, 0, 0.35555],\n \"106\": [0.19444, 0.69326, 0.1672, 0, 0.35555],\n \"107\": [0, 0.69444, 0.11111, 0, 0.53222],\n \"108\": [0, 0.69444, 0.10861, 0, 0.29666],\n \"109\": [0, 0.44444, 0.09426, 0, 0.94444],\n \"110\": [0, 0.44444, 0.09426, 0, 0.64999],\n \"111\": [0, 0.44444, 0.07861, 0, 0.59111],\n \"112\": [0.19444, 0.44444, 0.07861, 0, 0.59111],\n \"113\": [0.19444, 0.44444, 0.105, 0, 0.53222],\n \"114\": [0, 0.44444, 0.11111, 0, 0.50167],\n \"115\": [0, 0.44444, 0.08167, 0, 0.48694],\n \"116\": [0, 0.63492, 0.09639, 0, 0.385],\n \"117\": [0, 0.44444, 0.09426, 0, 0.62055],\n \"118\": [0, 0.44444, 0.11111, 0, 0.53222],\n \"119\": [0, 0.44444, 0.11111, 0, 0.76777],\n \"120\": [0, 0.44444, 0.12583, 0, 0.56055],\n \"121\": [0.19444, 0.44444, 0.105, 0, 0.56166],\n \"122\": [0, 0.44444, 0.13889, 0, 0.49055],\n \"126\": [0.35, 0.34444, 0.11472, 0, 0.59111],\n \"160\": [0, 0, 0, 0, 0.25],\n \"168\": [0, 0.69444, 0.11473, 0, 0.59111],\n \"176\": [0, 0.69444, 0, 0, 0.94888],\n \"184\": [0.17014, 0, 0, 0, 0.53222],\n \"198\": [0, 0.68611, 0.11431, 0, 1.02277],\n \"216\": [0.04861, 0.73472, 0.09062, 0, 0.88555],\n \"223\": [0.19444, 0.69444, 0.09736, 0, 0.665],\n \"230\": [0, 0.44444, 0.085, 0, 0.82666],\n \"248\": [0.09722, 0.54167, 0.09458, 0, 0.59111],\n \"305\": [0, 0.44444, 0.09426, 0, 0.35555],\n \"338\": [0, 0.68611, 0.11431, 0, 1.14054],\n \"339\": [0, 0.44444, 0.085, 0, 0.82666],\n \"567\": [0.19444, 0.44444, 0.04611, 0, 0.385],\n \"710\": [0, 0.69444, 0.06709, 0, 0.59111],\n \"711\": [0, 0.63194, 0.08271, 0, 0.59111],\n \"713\": [0, 0.59444, 0.10444, 0, 0.59111],\n \"714\": [0, 0.69444, 0.08528, 0, 0.59111],\n \"715\": [0, 0.69444, 0, 0, 0.59111],\n \"728\": [0, 0.69444, 0.10333, 0, 0.59111],\n \"729\": [0, 0.69444, 0.12945, 0, 0.35555],\n \"730\": [0, 0.69444, 0, 0, 0.94888],\n \"732\": [0, 0.69444, 0.11472, 0, 0.59111],\n \"733\": [0, 0.69444, 0.11472, 0, 0.59111],\n \"915\": [0, 0.68611, 0.12903, 0, 0.69777],\n \"916\": [0, 0.68611, 0, 0, 0.94444],\n \"920\": [0, 0.68611, 0.09062, 0, 0.88555],\n \"923\": [0, 0.68611, 0, 0, 0.80666],\n \"926\": [0, 0.68611, 0.15092, 0, 0.76777],\n \"928\": [0, 0.68611, 0.17208, 0, 0.8961],\n \"931\": [0, 0.68611, 0.11431, 0, 0.82666],\n \"933\": [0, 0.68611, 0.10778, 0, 0.88555],\n \"934\": [0, 0.68611, 0.05632, 0, 0.82666],\n \"936\": [0, 0.68611, 0.10778, 0, 0.88555],\n \"937\": [0, 0.68611, 0.0992, 0, 0.82666],\n \"8211\": [0, 0.44444, 0.09811, 0, 0.59111],\n \"8212\": [0, 0.44444, 0.09811, 0, 1.18221],\n \"8216\": [0, 0.69444, 0.12945, 0, 0.35555],\n \"8217\": [0, 0.69444, 0.12945, 0, 0.35555],\n \"8220\": [0, 0.69444, 0.16772, 0, 0.62055],\n \"8221\": [0, 0.69444, 0.07939, 0, 0.62055]\n },\n \"Main-Italic\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0.12417, 0, 0.30667],\n \"34\": [0, 0.69444, 0.06961, 0, 0.51444],\n \"35\": [0.19444, 0.69444, 0.06616, 0, 0.81777],\n \"37\": [0.05556, 0.75, 0.13639, 0, 0.81777],\n \"38\": [0, 0.69444, 0.09694, 0, 0.76666],\n \"39\": [0, 0.69444, 0.12417, 0, 0.30667],\n \"40\": [0.25, 0.75, 0.16194, 0, 0.40889],\n \"41\": [0.25, 0.75, 0.03694, 0, 0.40889],\n \"42\": [0, 0.75, 0.14917, 0, 0.51111],\n \"43\": [0.05667, 0.56167, 0.03694, 0, 0.76666],\n \"44\": [0.19444, 0.10556, 0, 0, 0.30667],\n \"45\": [0, 0.43056, 0.02826, 0, 0.35778],\n \"46\": [0, 0.10556, 0, 0, 0.30667],\n \"47\": [0.25, 0.75, 0.16194, 0, 0.51111],\n \"48\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"49\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"50\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"51\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"52\": [0.19444, 0.64444, 0.13556, 0, 0.51111],\n \"53\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"54\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"55\": [0.19444, 0.64444, 0.13556, 0, 0.51111],\n \"56\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"57\": [0, 0.64444, 0.13556, 0, 0.51111],\n \"58\": [0, 0.43056, 0.0582, 0, 0.30667],\n \"59\": [0.19444, 0.43056, 0.0582, 0, 0.30667],\n \"61\": [-0.13313, 0.36687, 0.06616, 0, 0.76666],\n \"63\": [0, 0.69444, 0.1225, 0, 0.51111],\n \"64\": [0, 0.69444, 0.09597, 0, 0.76666],\n \"65\": [0, 0.68333, 0, 0, 0.74333],\n \"66\": [0, 0.68333, 0.10257, 0, 0.70389],\n \"67\": [0, 0.68333, 0.14528, 0, 0.71555],\n \"68\": [0, 0.68333, 0.09403, 0, 0.755],\n \"69\": [0, 0.68333, 0.12028, 0, 0.67833],\n \"70\": [0, 0.68333, 0.13305, 0, 0.65277],\n \"71\": [0, 0.68333, 0.08722, 0, 0.77361],\n \"72\": [0, 0.68333, 0.16389, 0, 0.74333],\n \"73\": [0, 0.68333, 0.15806, 0, 0.38555],\n \"74\": [0, 0.68333, 0.14028, 0, 0.525],\n \"75\": [0, 0.68333, 0.14528, 0, 0.76888],\n \"76\": [0, 0.68333, 0, 0, 0.62722],\n \"77\": [0, 0.68333, 0.16389, 0, 0.89666],\n \"78\": [0, 0.68333, 0.16389, 0, 0.74333],\n \"79\": [0, 0.68333, 0.09403, 0, 0.76666],\n \"80\": [0, 0.68333, 0.10257, 0, 0.67833],\n \"81\": [0.19444, 0.68333, 0.09403, 0, 0.76666],\n \"82\": [0, 0.68333, 0.03868, 0, 0.72944],\n \"83\": [0, 0.68333, 0.11972, 0, 0.56222],\n \"84\": [0, 0.68333, 0.13305, 0, 0.71555],\n \"85\": [0, 0.68333, 0.16389, 0, 0.74333],\n \"86\": [0, 0.68333, 0.18361, 0, 0.74333],\n \"87\": [0, 0.68333, 0.18361, 0, 0.99888],\n \"88\": [0, 0.68333, 0.15806, 0, 0.74333],\n \"89\": [0, 0.68333, 0.19383, 0, 0.74333],\n \"90\": [0, 0.68333, 0.14528, 0, 0.61333],\n \"91\": [0.25, 0.75, 0.1875, 0, 0.30667],\n \"93\": [0.25, 0.75, 0.10528, 0, 0.30667],\n \"94\": [0, 0.69444, 0.06646, 0, 0.51111],\n \"95\": [0.31, 0.12056, 0.09208, 0, 0.51111],\n \"97\": [0, 0.43056, 0.07671, 0, 0.51111],\n \"98\": [0, 0.69444, 0.06312, 0, 0.46],\n \"99\": [0, 0.43056, 0.05653, 0, 0.46],\n \"100\": [0, 0.69444, 0.10333, 0, 0.51111],\n \"101\": [0, 0.43056, 0.07514, 0, 0.46],\n \"102\": [0.19444, 0.69444, 0.21194, 0, 0.30667],\n \"103\": [0.19444, 0.43056, 0.08847, 0, 0.46],\n \"104\": [0, 0.69444, 0.07671, 0, 0.51111],\n \"105\": [0, 0.65536, 0.1019, 0, 0.30667],\n \"106\": [0.19444, 0.65536, 0.14467, 0, 0.30667],\n \"107\": [0, 0.69444, 0.10764, 0, 0.46],\n \"108\": [0, 0.69444, 0.10333, 0, 0.25555],\n \"109\": [0, 0.43056, 0.07671, 0, 0.81777],\n \"110\": [0, 0.43056, 0.07671, 0, 0.56222],\n \"111\": [0, 0.43056, 0.06312, 0, 0.51111],\n \"112\": [0.19444, 0.43056, 0.06312, 0, 0.51111],\n \"113\": [0.19444, 0.43056, 0.08847, 0, 0.46],\n \"114\": [0, 0.43056, 0.10764, 0, 0.42166],\n \"115\": [0, 0.43056, 0.08208, 0, 0.40889],\n \"116\": [0, 0.61508, 0.09486, 0, 0.33222],\n \"117\": [0, 0.43056, 0.07671, 0, 0.53666],\n \"118\": [0, 0.43056, 0.10764, 0, 0.46],\n \"119\": [0, 0.43056, 0.10764, 0, 0.66444],\n \"120\": [0, 0.43056, 0.12042, 0, 0.46389],\n \"121\": [0.19444, 0.43056, 0.08847, 0, 0.48555],\n \"122\": [0, 0.43056, 0.12292, 0, 0.40889],\n \"126\": [0.35, 0.31786, 0.11585, 0, 0.51111],\n \"160\": [0, 0, 0, 0, 0.25],\n \"168\": [0, 0.66786, 0.10474, 0, 0.51111],\n \"176\": [0, 0.69444, 0, 0, 0.83129],\n \"184\": [0.17014, 0, 0, 0, 0.46],\n \"198\": [0, 0.68333, 0.12028, 0, 0.88277],\n \"216\": [0.04861, 0.73194, 0.09403, 0, 0.76666],\n \"223\": [0.19444, 0.69444, 0.10514, 0, 0.53666],\n \"230\": [0, 0.43056, 0.07514, 0, 0.71555],\n \"248\": [0.09722, 0.52778, 0.09194, 0, 0.51111],\n \"338\": [0, 0.68333, 0.12028, 0, 0.98499],\n \"339\": [0, 0.43056, 0.07514, 0, 0.71555],\n \"710\": [0, 0.69444, 0.06646, 0, 0.51111],\n \"711\": [0, 0.62847, 0.08295, 0, 0.51111],\n \"713\": [0, 0.56167, 0.10333, 0, 0.51111],\n \"714\": [0, 0.69444, 0.09694, 0, 0.51111],\n \"715\": [0, 0.69444, 0, 0, 0.51111],\n \"728\": [0, 0.69444, 0.10806, 0, 0.51111],\n \"729\": [0, 0.66786, 0.11752, 0, 0.30667],\n \"730\": [0, 0.69444, 0, 0, 0.83129],\n \"732\": [0, 0.66786, 0.11585, 0, 0.51111],\n \"733\": [0, 0.69444, 0.1225, 0, 0.51111],\n \"915\": [0, 0.68333, 0.13305, 0, 0.62722],\n \"916\": [0, 0.68333, 0, 0, 0.81777],\n \"920\": [0, 0.68333, 0.09403, 0, 0.76666],\n \"923\": [0, 0.68333, 0, 0, 0.69222],\n \"926\": [0, 0.68333, 0.15294, 0, 0.66444],\n \"928\": [0, 0.68333, 0.16389, 0, 0.74333],\n \"931\": [0, 0.68333, 0.12028, 0, 0.71555],\n \"933\": [0, 0.68333, 0.11111, 0, 0.76666],\n \"934\": [0, 0.68333, 0.05986, 0, 0.71555],\n \"936\": [0, 0.68333, 0.11111, 0, 0.76666],\n \"937\": [0, 0.68333, 0.10257, 0, 0.71555],\n \"8211\": [0, 0.43056, 0.09208, 0, 0.51111],\n \"8212\": [0, 0.43056, 0.09208, 0, 1.02222],\n \"8216\": [0, 0.69444, 0.12417, 0, 0.30667],\n \"8217\": [0, 0.69444, 0.12417, 0, 0.30667],\n \"8220\": [0, 0.69444, 0.1685, 0, 0.51444],\n \"8221\": [0, 0.69444, 0.06961, 0, 0.51444],\n \"8463\": [0, 0.68889, 0, 0, 0.54028]\n },\n \"Main-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0, 0, 0.27778],\n \"34\": [0, 0.69444, 0, 0, 0.5],\n \"35\": [0.19444, 0.69444, 0, 0, 0.83334],\n \"36\": [0.05556, 0.75, 0, 0, 0.5],\n \"37\": [0.05556, 0.75, 0, 0, 0.83334],\n \"38\": [0, 0.69444, 0, 0, 0.77778],\n \"39\": [0, 0.69444, 0, 0, 0.27778],\n \"40\": [0.25, 0.75, 0, 0, 0.38889],\n \"41\": [0.25, 0.75, 0, 0, 0.38889],\n \"42\": [0, 0.75, 0, 0, 0.5],\n \"43\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"44\": [0.19444, 0.10556, 0, 0, 0.27778],\n \"45\": [0, 0.43056, 0, 0, 0.33333],\n \"46\": [0, 0.10556, 0, 0, 0.27778],\n \"47\": [0.25, 0.75, 0, 0, 0.5],\n \"48\": [0, 0.64444, 0, 0, 0.5],\n \"49\": [0, 0.64444, 0, 0, 0.5],\n \"50\": [0, 0.64444, 0, 0, 0.5],\n \"51\": [0, 0.64444, 0, 0, 0.5],\n \"52\": [0, 0.64444, 0, 0, 0.5],\n \"53\": [0, 0.64444, 0, 0, 0.5],\n \"54\": [0, 0.64444, 0, 0, 0.5],\n \"55\": [0, 0.64444, 0, 0, 0.5],\n \"56\": [0, 0.64444, 0, 0, 0.5],\n \"57\": [0, 0.64444, 0, 0, 0.5],\n \"58\": [0, 0.43056, 0, 0, 0.27778],\n \"59\": [0.19444, 0.43056, 0, 0, 0.27778],\n \"60\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"61\": [-0.13313, 0.36687, 0, 0, 0.77778],\n \"62\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"63\": [0, 0.69444, 0, 0, 0.47222],\n \"64\": [0, 0.69444, 0, 0, 0.77778],\n \"65\": [0, 0.68333, 0, 0, 0.75],\n \"66\": [0, 0.68333, 0, 0, 0.70834],\n \"67\": [0, 0.68333, 0, 0, 0.72222],\n \"68\": [0, 0.68333, 0, 0, 0.76389],\n \"69\": [0, 0.68333, 0, 0, 0.68056],\n \"70\": [0, 0.68333, 0, 0, 0.65278],\n \"71\": [0, 0.68333, 0, 0, 0.78472],\n \"72\": [0, 0.68333, 0, 0, 0.75],\n \"73\": [0, 0.68333, 0, 0, 0.36111],\n \"74\": [0, 0.68333, 0, 0, 0.51389],\n \"75\": [0, 0.68333, 0, 0, 0.77778],\n \"76\": [0, 0.68333, 0, 0, 0.625],\n \"77\": [0, 0.68333, 0, 0, 0.91667],\n \"78\": [0, 0.68333, 0, 0, 0.75],\n \"79\": [0, 0.68333, 0, 0, 0.77778],\n \"80\": [0, 0.68333, 0, 0, 0.68056],\n \"81\": [0.19444, 0.68333, 0, 0, 0.77778],\n \"82\": [0, 0.68333, 0, 0, 0.73611],\n \"83\": [0, 0.68333, 0, 0, 0.55556],\n \"84\": [0, 0.68333, 0, 0, 0.72222],\n \"85\": [0, 0.68333, 0, 0, 0.75],\n \"86\": [0, 0.68333, 0.01389, 0, 0.75],\n \"87\": [0, 0.68333, 0.01389, 0, 1.02778],\n \"88\": [0, 0.68333, 0, 0, 0.75],\n \"89\": [0, 0.68333, 0.025, 0, 0.75],\n \"90\": [0, 0.68333, 0, 0, 0.61111],\n \"91\": [0.25, 0.75, 0, 0, 0.27778],\n \"92\": [0.25, 0.75, 0, 0, 0.5],\n \"93\": [0.25, 0.75, 0, 0, 0.27778],\n \"94\": [0, 0.69444, 0, 0, 0.5],\n \"95\": [0.31, 0.12056, 0.02778, 0, 0.5],\n \"97\": [0, 0.43056, 0, 0, 0.5],\n \"98\": [0, 0.69444, 0, 0, 0.55556],\n \"99\": [0, 0.43056, 0, 0, 0.44445],\n \"100\": [0, 0.69444, 0, 0, 0.55556],\n \"101\": [0, 0.43056, 0, 0, 0.44445],\n \"102\": [0, 0.69444, 0.07778, 0, 0.30556],\n \"103\": [0.19444, 0.43056, 0.01389, 0, 0.5],\n \"104\": [0, 0.69444, 0, 0, 0.55556],\n \"105\": [0, 0.66786, 0, 0, 0.27778],\n \"106\": [0.19444, 0.66786, 0, 0, 0.30556],\n \"107\": [0, 0.69444, 0, 0, 0.52778],\n \"108\": [0, 0.69444, 0, 0, 0.27778],\n \"109\": [0, 0.43056, 0, 0, 0.83334],\n \"110\": [0, 0.43056, 0, 0, 0.55556],\n \"111\": [0, 0.43056, 0, 0, 0.5],\n \"112\": [0.19444, 0.43056, 0, 0, 0.55556],\n \"113\": [0.19444, 0.43056, 0, 0, 0.52778],\n \"114\": [0, 0.43056, 0, 0, 0.39167],\n \"115\": [0, 0.43056, 0, 0, 0.39445],\n \"116\": [0, 0.61508, 0, 0, 0.38889],\n \"117\": [0, 0.43056, 0, 0, 0.55556],\n \"118\": [0, 0.43056, 0.01389, 0, 0.52778],\n \"119\": [0, 0.43056, 0.01389, 0, 0.72222],\n \"120\": [0, 0.43056, 0, 0, 0.52778],\n \"121\": [0.19444, 0.43056, 0.01389, 0, 0.52778],\n \"122\": [0, 0.43056, 0, 0, 0.44445],\n \"123\": [0.25, 0.75, 0, 0, 0.5],\n \"124\": [0.25, 0.75, 0, 0, 0.27778],\n \"125\": [0.25, 0.75, 0, 0, 0.5],\n \"126\": [0.35, 0.31786, 0, 0, 0.5],\n \"160\": [0, 0, 0, 0, 0.25],\n \"163\": [0, 0.69444, 0, 0, 0.76909],\n \"167\": [0.19444, 0.69444, 0, 0, 0.44445],\n \"168\": [0, 0.66786, 0, 0, 0.5],\n \"172\": [0, 0.43056, 0, 0, 0.66667],\n \"176\": [0, 0.69444, 0, 0, 0.75],\n \"177\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"182\": [0.19444, 0.69444, 0, 0, 0.61111],\n \"184\": [0.17014, 0, 0, 0, 0.44445],\n \"198\": [0, 0.68333, 0, 0, 0.90278],\n \"215\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"216\": [0.04861, 0.73194, 0, 0, 0.77778],\n \"223\": [0, 0.69444, 0, 0, 0.5],\n \"230\": [0, 0.43056, 0, 0, 0.72222],\n \"247\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"248\": [0.09722, 0.52778, 0, 0, 0.5],\n \"305\": [0, 0.43056, 0, 0, 0.27778],\n \"338\": [0, 0.68333, 0, 0, 1.01389],\n \"339\": [0, 0.43056, 0, 0, 0.77778],\n \"567\": [0.19444, 0.43056, 0, 0, 0.30556],\n \"710\": [0, 0.69444, 0, 0, 0.5],\n \"711\": [0, 0.62847, 0, 0, 0.5],\n \"713\": [0, 0.56778, 0, 0, 0.5],\n \"714\": [0, 0.69444, 0, 0, 0.5],\n \"715\": [0, 0.69444, 0, 0, 0.5],\n \"728\": [0, 0.69444, 0, 0, 0.5],\n \"729\": [0, 0.66786, 0, 0, 0.27778],\n \"730\": [0, 0.69444, 0, 0, 0.75],\n \"732\": [0, 0.66786, 0, 0, 0.5],\n \"733\": [0, 0.69444, 0, 0, 0.5],\n \"915\": [0, 0.68333, 0, 0, 0.625],\n \"916\": [0, 0.68333, 0, 0, 0.83334],\n \"920\": [0, 0.68333, 0, 0, 0.77778],\n \"923\": [0, 0.68333, 0, 0, 0.69445],\n \"926\": [0, 0.68333, 0, 0, 0.66667],\n \"928\": [0, 0.68333, 0, 0, 0.75],\n \"931\": [0, 0.68333, 0, 0, 0.72222],\n \"933\": [0, 0.68333, 0, 0, 0.77778],\n \"934\": [0, 0.68333, 0, 0, 0.72222],\n \"936\": [0, 0.68333, 0, 0, 0.77778],\n \"937\": [0, 0.68333, 0, 0, 0.72222],\n \"8211\": [0, 0.43056, 0.02778, 0, 0.5],\n \"8212\": [0, 0.43056, 0.02778, 0, 1.0],\n \"8216\": [0, 0.69444, 0, 0, 0.27778],\n \"8217\": [0, 0.69444, 0, 0, 0.27778],\n \"8220\": [0, 0.69444, 0, 0, 0.5],\n \"8221\": [0, 0.69444, 0, 0, 0.5],\n \"8224\": [0.19444, 0.69444, 0, 0, 0.44445],\n \"8225\": [0.19444, 0.69444, 0, 0, 0.44445],\n \"8230\": [0, 0.123, 0, 0, 1.172],\n \"8242\": [0, 0.55556, 0, 0, 0.275],\n \"8407\": [0, 0.71444, 0.15382, 0, 0.5],\n \"8463\": [0, 0.68889, 0, 0, 0.54028],\n \"8465\": [0, 0.69444, 0, 0, 0.72222],\n \"8467\": [0, 0.69444, 0, 0.11111, 0.41667],\n \"8472\": [0.19444, 0.43056, 0, 0.11111, 0.63646],\n \"8476\": [0, 0.69444, 0, 0, 0.72222],\n \"8501\": [0, 0.69444, 0, 0, 0.61111],\n \"8592\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8593\": [0.19444, 0.69444, 0, 0, 0.5],\n \"8594\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8595\": [0.19444, 0.69444, 0, 0, 0.5],\n \"8596\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8597\": [0.25, 0.75, 0, 0, 0.5],\n \"8598\": [0.19444, 0.69444, 0, 0, 1.0],\n \"8599\": [0.19444, 0.69444, 0, 0, 1.0],\n \"8600\": [0.19444, 0.69444, 0, 0, 1.0],\n \"8601\": [0.19444, 0.69444, 0, 0, 1.0],\n \"8614\": [0.011, 0.511, 0, 0, 1.0],\n \"8617\": [0.011, 0.511, 0, 0, 1.126],\n \"8618\": [0.011, 0.511, 0, 0, 1.126],\n \"8636\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8637\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8640\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8641\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8652\": [0.011, 0.671, 0, 0, 1.0],\n \"8656\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8657\": [0.19444, 0.69444, 0, 0, 0.61111],\n \"8658\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8659\": [0.19444, 0.69444, 0, 0, 0.61111],\n \"8660\": [-0.13313, 0.36687, 0, 0, 1.0],\n \"8661\": [0.25, 0.75, 0, 0, 0.61111],\n \"8704\": [0, 0.69444, 0, 0, 0.55556],\n \"8706\": [0, 0.69444, 0.05556, 0.08334, 0.5309],\n \"8707\": [0, 0.69444, 0, 0, 0.55556],\n \"8709\": [0.05556, 0.75, 0, 0, 0.5],\n \"8711\": [0, 0.68333, 0, 0, 0.83334],\n \"8712\": [0.0391, 0.5391, 0, 0, 0.66667],\n \"8715\": [0.0391, 0.5391, 0, 0, 0.66667],\n \"8722\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8723\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8725\": [0.25, 0.75, 0, 0, 0.5],\n \"8726\": [0.25, 0.75, 0, 0, 0.5],\n \"8727\": [-0.03472, 0.46528, 0, 0, 0.5],\n \"8728\": [-0.05555, 0.44445, 0, 0, 0.5],\n \"8729\": [-0.05555, 0.44445, 0, 0, 0.5],\n \"8730\": [0.2, 0.8, 0, 0, 0.83334],\n \"8733\": [0, 0.43056, 0, 0, 0.77778],\n \"8734\": [0, 0.43056, 0, 0, 1.0],\n \"8736\": [0, 0.69224, 0, 0, 0.72222],\n \"8739\": [0.25, 0.75, 0, 0, 0.27778],\n \"8741\": [0.25, 0.75, 0, 0, 0.5],\n \"8743\": [0, 0.55556, 0, 0, 0.66667],\n \"8744\": [0, 0.55556, 0, 0, 0.66667],\n \"8745\": [0, 0.55556, 0, 0, 0.66667],\n \"8746\": [0, 0.55556, 0, 0, 0.66667],\n \"8747\": [0.19444, 0.69444, 0.11111, 0, 0.41667],\n \"8764\": [-0.13313, 0.36687, 0, 0, 0.77778],\n \"8768\": [0.19444, 0.69444, 0, 0, 0.27778],\n \"8771\": [-0.03625, 0.46375, 0, 0, 0.77778],\n \"8773\": [-0.022, 0.589, 0, 0, 0.778],\n \"8776\": [-0.01688, 0.48312, 0, 0, 0.77778],\n \"8781\": [-0.03625, 0.46375, 0, 0, 0.77778],\n \"8784\": [-0.133, 0.673, 0, 0, 0.778],\n \"8801\": [-0.03625, 0.46375, 0, 0, 0.77778],\n \"8804\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8805\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8810\": [0.0391, 0.5391, 0, 0, 1.0],\n \"8811\": [0.0391, 0.5391, 0, 0, 1.0],\n \"8826\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8827\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8834\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8835\": [0.0391, 0.5391, 0, 0, 0.77778],\n \"8838\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8839\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8846\": [0, 0.55556, 0, 0, 0.66667],\n \"8849\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8850\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"8851\": [0, 0.55556, 0, 0, 0.66667],\n \"8852\": [0, 0.55556, 0, 0, 0.66667],\n \"8853\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8854\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8855\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8856\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8857\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"8866\": [0, 0.69444, 0, 0, 0.61111],\n \"8867\": [0, 0.69444, 0, 0, 0.61111],\n \"8868\": [0, 0.69444, 0, 0, 0.77778],\n \"8869\": [0, 0.69444, 0, 0, 0.77778],\n \"8872\": [0.249, 0.75, 0, 0, 0.867],\n \"8900\": [-0.05555, 0.44445, 0, 0, 0.5],\n \"8901\": [-0.05555, 0.44445, 0, 0, 0.27778],\n \"8902\": [-0.03472, 0.46528, 0, 0, 0.5],\n \"8904\": [0.005, 0.505, 0, 0, 0.9],\n \"8942\": [0.03, 0.903, 0, 0, 0.278],\n \"8943\": [-0.19, 0.313, 0, 0, 1.172],\n \"8945\": [-0.1, 0.823, 0, 0, 1.282],\n \"8968\": [0.25, 0.75, 0, 0, 0.44445],\n \"8969\": [0.25, 0.75, 0, 0, 0.44445],\n \"8970\": [0.25, 0.75, 0, 0, 0.44445],\n \"8971\": [0.25, 0.75, 0, 0, 0.44445],\n \"8994\": [-0.14236, 0.35764, 0, 0, 1.0],\n \"8995\": [-0.14236, 0.35764, 0, 0, 1.0],\n \"9136\": [0.244, 0.744, 0, 0, 0.412],\n \"9137\": [0.244, 0.745, 0, 0, 0.412],\n \"9651\": [0.19444, 0.69444, 0, 0, 0.88889],\n \"9657\": [-0.03472, 0.46528, 0, 0, 0.5],\n \"9661\": [0.19444, 0.69444, 0, 0, 0.88889],\n \"9667\": [-0.03472, 0.46528, 0, 0, 0.5],\n \"9711\": [0.19444, 0.69444, 0, 0, 1.0],\n \"9824\": [0.12963, 0.69444, 0, 0, 0.77778],\n \"9825\": [0.12963, 0.69444, 0, 0, 0.77778],\n \"9826\": [0.12963, 0.69444, 0, 0, 0.77778],\n \"9827\": [0.12963, 0.69444, 0, 0, 0.77778],\n \"9837\": [0, 0.75, 0, 0, 0.38889],\n \"9838\": [0.19444, 0.69444, 0, 0, 0.38889],\n \"9839\": [0.19444, 0.69444, 0, 0, 0.38889],\n \"10216\": [0.25, 0.75, 0, 0, 0.38889],\n \"10217\": [0.25, 0.75, 0, 0, 0.38889],\n \"10222\": [0.244, 0.744, 0, 0, 0.412],\n \"10223\": [0.244, 0.745, 0, 0, 0.412],\n \"10229\": [0.011, 0.511, 0, 0, 1.609],\n \"10230\": [0.011, 0.511, 0, 0, 1.638],\n \"10231\": [0.011, 0.511, 0, 0, 1.859],\n \"10232\": [0.024, 0.525, 0, 0, 1.609],\n \"10233\": [0.024, 0.525, 0, 0, 1.638],\n \"10234\": [0.024, 0.525, 0, 0, 1.858],\n \"10236\": [0.011, 0.511, 0, 0, 1.638],\n \"10815\": [0, 0.68333, 0, 0, 0.75],\n \"10927\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"10928\": [0.13597, 0.63597, 0, 0, 0.77778],\n \"57376\": [0.19444, 0.69444, 0, 0, 0]\n },\n \"Math-BoldItalic\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"48\": [0, 0.44444, 0, 0, 0.575],\n \"49\": [0, 0.44444, 0, 0, 0.575],\n \"50\": [0, 0.44444, 0, 0, 0.575],\n \"51\": [0.19444, 0.44444, 0, 0, 0.575],\n \"52\": [0.19444, 0.44444, 0, 0, 0.575],\n \"53\": [0.19444, 0.44444, 0, 0, 0.575],\n \"54\": [0, 0.64444, 0, 0, 0.575],\n \"55\": [0.19444, 0.44444, 0, 0, 0.575],\n \"56\": [0, 0.64444, 0, 0, 0.575],\n \"57\": [0.19444, 0.44444, 0, 0, 0.575],\n \"65\": [0, 0.68611, 0, 0, 0.86944],\n \"66\": [0, 0.68611, 0.04835, 0, 0.8664],\n \"67\": [0, 0.68611, 0.06979, 0, 0.81694],\n \"68\": [0, 0.68611, 0.03194, 0, 0.93812],\n \"69\": [0, 0.68611, 0.05451, 0, 0.81007],\n \"70\": [0, 0.68611, 0.15972, 0, 0.68889],\n \"71\": [0, 0.68611, 0, 0, 0.88673],\n \"72\": [0, 0.68611, 0.08229, 0, 0.98229],\n \"73\": [0, 0.68611, 0.07778, 0, 0.51111],\n \"74\": [0, 0.68611, 0.10069, 0, 0.63125],\n \"75\": [0, 0.68611, 0.06979, 0, 0.97118],\n \"76\": [0, 0.68611, 0, 0, 0.75555],\n \"77\": [0, 0.68611, 0.11424, 0, 1.14201],\n \"78\": [0, 0.68611, 0.11424, 0, 0.95034],\n \"79\": [0, 0.68611, 0.03194, 0, 0.83666],\n \"80\": [0, 0.68611, 0.15972, 0, 0.72309],\n \"81\": [0.19444, 0.68611, 0, 0, 0.86861],\n \"82\": [0, 0.68611, 0.00421, 0, 0.87235],\n \"83\": [0, 0.68611, 0.05382, 0, 0.69271],\n \"84\": [0, 0.68611, 0.15972, 0, 0.63663],\n \"85\": [0, 0.68611, 0.11424, 0, 0.80027],\n \"86\": [0, 0.68611, 0.25555, 0, 0.67778],\n \"87\": [0, 0.68611, 0.15972, 0, 1.09305],\n \"88\": [0, 0.68611, 0.07778, 0, 0.94722],\n \"89\": [0, 0.68611, 0.25555, 0, 0.67458],\n \"90\": [0, 0.68611, 0.06979, 0, 0.77257],\n \"97\": [0, 0.44444, 0, 0, 0.63287],\n \"98\": [0, 0.69444, 0, 0, 0.52083],\n \"99\": [0, 0.44444, 0, 0, 0.51342],\n \"100\": [0, 0.69444, 0, 0, 0.60972],\n \"101\": [0, 0.44444, 0, 0, 0.55361],\n \"102\": [0.19444, 0.69444, 0.11042, 0, 0.56806],\n \"103\": [0.19444, 0.44444, 0.03704, 0, 0.5449],\n \"104\": [0, 0.69444, 0, 0, 0.66759],\n \"105\": [0, 0.69326, 0, 0, 0.4048],\n \"106\": [0.19444, 0.69326, 0.0622, 0, 0.47083],\n \"107\": [0, 0.69444, 0.01852, 0, 0.6037],\n \"108\": [0, 0.69444, 0.0088, 0, 0.34815],\n \"109\": [0, 0.44444, 0, 0, 1.0324],\n \"110\": [0, 0.44444, 0, 0, 0.71296],\n \"111\": [0, 0.44444, 0, 0, 0.58472],\n \"112\": [0.19444, 0.44444, 0, 0, 0.60092],\n \"113\": [0.19444, 0.44444, 0.03704, 0, 0.54213],\n \"114\": [0, 0.44444, 0.03194, 0, 0.5287],\n \"115\": [0, 0.44444, 0, 0, 0.53125],\n \"116\": [0, 0.63492, 0, 0, 0.41528],\n \"117\": [0, 0.44444, 0, 0, 0.68102],\n \"118\": [0, 0.44444, 0.03704, 0, 0.56666],\n \"119\": [0, 0.44444, 0.02778, 0, 0.83148],\n \"120\": [0, 0.44444, 0, 0, 0.65903],\n \"121\": [0.19444, 0.44444, 0.03704, 0, 0.59028],\n \"122\": [0, 0.44444, 0.04213, 0, 0.55509],\n \"160\": [0, 0, 0, 0, 0.25],\n \"915\": [0, 0.68611, 0.15972, 0, 0.65694],\n \"916\": [0, 0.68611, 0, 0, 0.95833],\n \"920\": [0, 0.68611, 0.03194, 0, 0.86722],\n \"923\": [0, 0.68611, 0, 0, 0.80555],\n \"926\": [0, 0.68611, 0.07458, 0, 0.84125],\n \"928\": [0, 0.68611, 0.08229, 0, 0.98229],\n \"931\": [0, 0.68611, 0.05451, 0, 0.88507],\n \"933\": [0, 0.68611, 0.15972, 0, 0.67083],\n \"934\": [0, 0.68611, 0, 0, 0.76666],\n \"936\": [0, 0.68611, 0.11653, 0, 0.71402],\n \"937\": [0, 0.68611, 0.04835, 0, 0.8789],\n \"945\": [0, 0.44444, 0, 0, 0.76064],\n \"946\": [0.19444, 0.69444, 0.03403, 0, 0.65972],\n \"947\": [0.19444, 0.44444, 0.06389, 0, 0.59003],\n \"948\": [0, 0.69444, 0.03819, 0, 0.52222],\n \"949\": [0, 0.44444, 0, 0, 0.52882],\n \"950\": [0.19444, 0.69444, 0.06215, 0, 0.50833],\n \"951\": [0.19444, 0.44444, 0.03704, 0, 0.6],\n \"952\": [0, 0.69444, 0.03194, 0, 0.5618],\n \"953\": [0, 0.44444, 0, 0, 0.41204],\n \"954\": [0, 0.44444, 0, 0, 0.66759],\n \"955\": [0, 0.69444, 0, 0, 0.67083],\n \"956\": [0.19444, 0.44444, 0, 0, 0.70787],\n \"957\": [0, 0.44444, 0.06898, 0, 0.57685],\n \"958\": [0.19444, 0.69444, 0.03021, 0, 0.50833],\n \"959\": [0, 0.44444, 0, 0, 0.58472],\n \"960\": [0, 0.44444, 0.03704, 0, 0.68241],\n \"961\": [0.19444, 0.44444, 0, 0, 0.6118],\n \"962\": [0.09722, 0.44444, 0.07917, 0, 0.42361],\n \"963\": [0, 0.44444, 0.03704, 0, 0.68588],\n \"964\": [0, 0.44444, 0.13472, 0, 0.52083],\n \"965\": [0, 0.44444, 0.03704, 0, 0.63055],\n \"966\": [0.19444, 0.44444, 0, 0, 0.74722],\n \"967\": [0.19444, 0.44444, 0, 0, 0.71805],\n \"968\": [0.19444, 0.69444, 0.03704, 0, 0.75833],\n \"969\": [0, 0.44444, 0.03704, 0, 0.71782],\n \"977\": [0, 0.69444, 0, 0, 0.69155],\n \"981\": [0.19444, 0.69444, 0, 0, 0.7125],\n \"982\": [0, 0.44444, 0.03194, 0, 0.975],\n \"1009\": [0.19444, 0.44444, 0, 0, 0.6118],\n \"1013\": [0, 0.44444, 0, 0, 0.48333],\n \"57649\": [0, 0.44444, 0, 0, 0.39352],\n \"57911\": [0.19444, 0.44444, 0, 0, 0.43889]\n },\n \"Math-Italic\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"48\": [0, 0.43056, 0, 0, 0.5],\n \"49\": [0, 0.43056, 0, 0, 0.5],\n \"50\": [0, 0.43056, 0, 0, 0.5],\n \"51\": [0.19444, 0.43056, 0, 0, 0.5],\n \"52\": [0.19444, 0.43056, 0, 0, 0.5],\n \"53\": [0.19444, 0.43056, 0, 0, 0.5],\n \"54\": [0, 0.64444, 0, 0, 0.5],\n \"55\": [0.19444, 0.43056, 0, 0, 0.5],\n \"56\": [0, 0.64444, 0, 0, 0.5],\n \"57\": [0.19444, 0.43056, 0, 0, 0.5],\n \"65\": [0, 0.68333, 0, 0.13889, 0.75],\n \"66\": [0, 0.68333, 0.05017, 0.08334, 0.75851],\n \"67\": [0, 0.68333, 0.07153, 0.08334, 0.71472],\n \"68\": [0, 0.68333, 0.02778, 0.05556, 0.82792],\n \"69\": [0, 0.68333, 0.05764, 0.08334, 0.7382],\n \"70\": [0, 0.68333, 0.13889, 0.08334, 0.64306],\n \"71\": [0, 0.68333, 0, 0.08334, 0.78625],\n \"72\": [0, 0.68333, 0.08125, 0.05556, 0.83125],\n \"73\": [0, 0.68333, 0.07847, 0.11111, 0.43958],\n \"74\": [0, 0.68333, 0.09618, 0.16667, 0.55451],\n \"75\": [0, 0.68333, 0.07153, 0.05556, 0.84931],\n \"76\": [0, 0.68333, 0, 0.02778, 0.68056],\n \"77\": [0, 0.68333, 0.10903, 0.08334, 0.97014],\n \"78\": [0, 0.68333, 0.10903, 0.08334, 0.80347],\n \"79\": [0, 0.68333, 0.02778, 0.08334, 0.76278],\n \"80\": [0, 0.68333, 0.13889, 0.08334, 0.64201],\n \"81\": [0.19444, 0.68333, 0, 0.08334, 0.79056],\n \"82\": [0, 0.68333, 0.00773, 0.08334, 0.75929],\n \"83\": [0, 0.68333, 0.05764, 0.08334, 0.6132],\n \"84\": [0, 0.68333, 0.13889, 0.08334, 0.58438],\n \"85\": [0, 0.68333, 0.10903, 0.02778, 0.68278],\n \"86\": [0, 0.68333, 0.22222, 0, 0.58333],\n \"87\": [0, 0.68333, 0.13889, 0, 0.94445],\n \"88\": [0, 0.68333, 0.07847, 0.08334, 0.82847],\n \"89\": [0, 0.68333, 0.22222, 0, 0.58056],\n \"90\": [0, 0.68333, 0.07153, 0.08334, 0.68264],\n \"97\": [0, 0.43056, 0, 0, 0.52859],\n \"98\": [0, 0.69444, 0, 0, 0.42917],\n \"99\": [0, 0.43056, 0, 0.05556, 0.43276],\n \"100\": [0, 0.69444, 0, 0.16667, 0.52049],\n \"101\": [0, 0.43056, 0, 0.05556, 0.46563],\n \"102\": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],\n \"103\": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],\n \"104\": [0, 0.69444, 0, 0, 0.57616],\n \"105\": [0, 0.65952, 0, 0, 0.34451],\n \"106\": [0.19444, 0.65952, 0.05724, 0, 0.41181],\n \"107\": [0, 0.69444, 0.03148, 0, 0.5206],\n \"108\": [0, 0.69444, 0.01968, 0.08334, 0.29838],\n \"109\": [0, 0.43056, 0, 0, 0.87801],\n \"110\": [0, 0.43056, 0, 0, 0.60023],\n \"111\": [0, 0.43056, 0, 0.05556, 0.48472],\n \"112\": [0.19444, 0.43056, 0, 0.08334, 0.50313],\n \"113\": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],\n \"114\": [0, 0.43056, 0.02778, 0.05556, 0.45116],\n \"115\": [0, 0.43056, 0, 0.05556, 0.46875],\n \"116\": [0, 0.61508, 0, 0.08334, 0.36111],\n \"117\": [0, 0.43056, 0, 0.02778, 0.57246],\n \"118\": [0, 0.43056, 0.03588, 0.02778, 0.48472],\n \"119\": [0, 0.43056, 0.02691, 0.08334, 0.71592],\n \"120\": [0, 0.43056, 0, 0.02778, 0.57153],\n \"121\": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],\n \"122\": [0, 0.43056, 0.04398, 0.05556, 0.46505],\n \"160\": [0, 0, 0, 0, 0.25],\n \"915\": [0, 0.68333, 0.13889, 0.08334, 0.61528],\n \"916\": [0, 0.68333, 0, 0.16667, 0.83334],\n \"920\": [0, 0.68333, 0.02778, 0.08334, 0.76278],\n \"923\": [0, 0.68333, 0, 0.16667, 0.69445],\n \"926\": [0, 0.68333, 0.07569, 0.08334, 0.74236],\n \"928\": [0, 0.68333, 0.08125, 0.05556, 0.83125],\n \"931\": [0, 0.68333, 0.05764, 0.08334, 0.77986],\n \"933\": [0, 0.68333, 0.13889, 0.05556, 0.58333],\n \"934\": [0, 0.68333, 0, 0.08334, 0.66667],\n \"936\": [0, 0.68333, 0.11, 0.05556, 0.61222],\n \"937\": [0, 0.68333, 0.05017, 0.08334, 0.7724],\n \"945\": [0, 0.43056, 0.0037, 0.02778, 0.6397],\n \"946\": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],\n \"947\": [0.19444, 0.43056, 0.05556, 0, 0.51773],\n \"948\": [0, 0.69444, 0.03785, 0.05556, 0.44444],\n \"949\": [0, 0.43056, 0, 0.08334, 0.46632],\n \"950\": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],\n \"951\": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],\n \"952\": [0, 0.69444, 0.02778, 0.08334, 0.46944],\n \"953\": [0, 0.43056, 0, 0.05556, 0.35394],\n \"954\": [0, 0.43056, 0, 0, 0.57616],\n \"955\": [0, 0.69444, 0, 0, 0.58334],\n \"956\": [0.19444, 0.43056, 0, 0.02778, 0.60255],\n \"957\": [0, 0.43056, 0.06366, 0.02778, 0.49398],\n \"958\": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],\n \"959\": [0, 0.43056, 0, 0.05556, 0.48472],\n \"960\": [0, 0.43056, 0.03588, 0, 0.57003],\n \"961\": [0.19444, 0.43056, 0, 0.08334, 0.51702],\n \"962\": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],\n \"963\": [0, 0.43056, 0.03588, 0, 0.57141],\n \"964\": [0, 0.43056, 0.1132, 0.02778, 0.43715],\n \"965\": [0, 0.43056, 0.03588, 0.02778, 0.54028],\n \"966\": [0.19444, 0.43056, 0, 0.08334, 0.65417],\n \"967\": [0.19444, 0.43056, 0, 0.05556, 0.62569],\n \"968\": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],\n \"969\": [0, 0.43056, 0.03588, 0, 0.62245],\n \"977\": [0, 0.69444, 0, 0.08334, 0.59144],\n \"981\": [0.19444, 0.69444, 0, 0.08334, 0.59583],\n \"982\": [0, 0.43056, 0.02778, 0, 0.82813],\n \"1009\": [0.19444, 0.43056, 0, 0.08334, 0.51702],\n \"1013\": [0, 0.43056, 0, 0.05556, 0.4059],\n \"57649\": [0, 0.43056, 0, 0.02778, 0.32246],\n \"57911\": [0.19444, 0.43056, 0, 0.08334, 0.38403]\n },\n \"SansSerif-Bold\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0, 0, 0.36667],\n \"34\": [0, 0.69444, 0, 0, 0.55834],\n \"35\": [0.19444, 0.69444, 0, 0, 0.91667],\n \"36\": [0.05556, 0.75, 0, 0, 0.55],\n \"37\": [0.05556, 0.75, 0, 0, 1.02912],\n \"38\": [0, 0.69444, 0, 0, 0.83056],\n \"39\": [0, 0.69444, 0, 0, 0.30556],\n \"40\": [0.25, 0.75, 0, 0, 0.42778],\n \"41\": [0.25, 0.75, 0, 0, 0.42778],\n \"42\": [0, 0.75, 0, 0, 0.55],\n \"43\": [0.11667, 0.61667, 0, 0, 0.85556],\n \"44\": [0.10556, 0.13056, 0, 0, 0.30556],\n \"45\": [0, 0.45833, 0, 0, 0.36667],\n \"46\": [0, 0.13056, 0, 0, 0.30556],\n \"47\": [0.25, 0.75, 0, 0, 0.55],\n \"48\": [0, 0.69444, 0, 0, 0.55],\n \"49\": [0, 0.69444, 0, 0, 0.55],\n \"50\": [0, 0.69444, 0, 0, 0.55],\n \"51\": [0, 0.69444, 0, 0, 0.55],\n \"52\": [0, 0.69444, 0, 0, 0.55],\n \"53\": [0, 0.69444, 0, 0, 0.55],\n \"54\": [0, 0.69444, 0, 0, 0.55],\n \"55\": [0, 0.69444, 0, 0, 0.55],\n \"56\": [0, 0.69444, 0, 0, 0.55],\n \"57\": [0, 0.69444, 0, 0, 0.55],\n \"58\": [0, 0.45833, 0, 0, 0.30556],\n \"59\": [0.10556, 0.45833, 0, 0, 0.30556],\n \"61\": [-0.09375, 0.40625, 0, 0, 0.85556],\n \"63\": [0, 0.69444, 0, 0, 0.51945],\n \"64\": [0, 0.69444, 0, 0, 0.73334],\n \"65\": [0, 0.69444, 0, 0, 0.73334],\n \"66\": [0, 0.69444, 0, 0, 0.73334],\n \"67\": [0, 0.69444, 0, 0, 0.70278],\n \"68\": [0, 0.69444, 0, 0, 0.79445],\n \"69\": [0, 0.69444, 0, 0, 0.64167],\n \"70\": [0, 0.69444, 0, 0, 0.61111],\n \"71\": [0, 0.69444, 0, 0, 0.73334],\n \"72\": [0, 0.69444, 0, 0, 0.79445],\n \"73\": [0, 0.69444, 0, 0, 0.33056],\n \"74\": [0, 0.69444, 0, 0, 0.51945],\n \"75\": [0, 0.69444, 0, 0, 0.76389],\n \"76\": [0, 0.69444, 0, 0, 0.58056],\n \"77\": [0, 0.69444, 0, 0, 0.97778],\n \"78\": [0, 0.69444, 0, 0, 0.79445],\n \"79\": [0, 0.69444, 0, 0, 0.79445],\n \"80\": [0, 0.69444, 0, 0, 0.70278],\n \"81\": [0.10556, 0.69444, 0, 0, 0.79445],\n \"82\": [0, 0.69444, 0, 0, 0.70278],\n \"83\": [0, 0.69444, 0, 0, 0.61111],\n \"84\": [0, 0.69444, 0, 0, 0.73334],\n \"85\": [0, 0.69444, 0, 0, 0.76389],\n \"86\": [0, 0.69444, 0.01528, 0, 0.73334],\n \"87\": [0, 0.69444, 0.01528, 0, 1.03889],\n \"88\": [0, 0.69444, 0, 0, 0.73334],\n \"89\": [0, 0.69444, 0.0275, 0, 0.73334],\n \"90\": [0, 0.69444, 0, 0, 0.67223],\n \"91\": [0.25, 0.75, 0, 0, 0.34306],\n \"93\": [0.25, 0.75, 0, 0, 0.34306],\n \"94\": [0, 0.69444, 0, 0, 0.55],\n \"95\": [0.35, 0.10833, 0.03056, 0, 0.55],\n \"97\": [0, 0.45833, 0, 0, 0.525],\n \"98\": [0, 0.69444, 0, 0, 0.56111],\n \"99\": [0, 0.45833, 0, 0, 0.48889],\n \"100\": [0, 0.69444, 0, 0, 0.56111],\n \"101\": [0, 0.45833, 0, 0, 0.51111],\n \"102\": [0, 0.69444, 0.07639, 0, 0.33611],\n \"103\": [0.19444, 0.45833, 0.01528, 0, 0.55],\n \"104\": [0, 0.69444, 0, 0, 0.56111],\n \"105\": [0, 0.69444, 0, 0, 0.25556],\n \"106\": [0.19444, 0.69444, 0, 0, 0.28611],\n \"107\": [0, 0.69444, 0, 0, 0.53056],\n \"108\": [0, 0.69444, 0, 0, 0.25556],\n \"109\": [0, 0.45833, 0, 0, 0.86667],\n \"110\": [0, 0.45833, 0, 0, 0.56111],\n \"111\": [0, 0.45833, 0, 0, 0.55],\n \"112\": [0.19444, 0.45833, 0, 0, 0.56111],\n \"113\": [0.19444, 0.45833, 0, 0, 0.56111],\n \"114\": [0, 0.45833, 0.01528, 0, 0.37222],\n \"115\": [0, 0.45833, 0, 0, 0.42167],\n \"116\": [0, 0.58929, 0, 0, 0.40417],\n \"117\": [0, 0.45833, 0, 0, 0.56111],\n \"118\": [0, 0.45833, 0.01528, 0, 0.5],\n \"119\": [0, 0.45833, 0.01528, 0, 0.74445],\n \"120\": [0, 0.45833, 0, 0, 0.5],\n \"121\": [0.19444, 0.45833, 0.01528, 0, 0.5],\n \"122\": [0, 0.45833, 0, 0, 0.47639],\n \"126\": [0.35, 0.34444, 0, 0, 0.55],\n \"160\": [0, 0, 0, 0, 0.25],\n \"168\": [0, 0.69444, 0, 0, 0.55],\n \"176\": [0, 0.69444, 0, 0, 0.73334],\n \"180\": [0, 0.69444, 0, 0, 0.55],\n \"184\": [0.17014, 0, 0, 0, 0.48889],\n \"305\": [0, 0.45833, 0, 0, 0.25556],\n \"567\": [0.19444, 0.45833, 0, 0, 0.28611],\n \"710\": [0, 0.69444, 0, 0, 0.55],\n \"711\": [0, 0.63542, 0, 0, 0.55],\n \"713\": [0, 0.63778, 0, 0, 0.55],\n \"728\": [0, 0.69444, 0, 0, 0.55],\n \"729\": [0, 0.69444, 0, 0, 0.30556],\n \"730\": [0, 0.69444, 0, 0, 0.73334],\n \"732\": [0, 0.69444, 0, 0, 0.55],\n \"733\": [0, 0.69444, 0, 0, 0.55],\n \"915\": [0, 0.69444, 0, 0, 0.58056],\n \"916\": [0, 0.69444, 0, 0, 0.91667],\n \"920\": [0, 0.69444, 0, 0, 0.85556],\n \"923\": [0, 0.69444, 0, 0, 0.67223],\n \"926\": [0, 0.69444, 0, 0, 0.73334],\n \"928\": [0, 0.69444, 0, 0, 0.79445],\n \"931\": [0, 0.69444, 0, 0, 0.79445],\n \"933\": [0, 0.69444, 0, 0, 0.85556],\n \"934\": [0, 0.69444, 0, 0, 0.79445],\n \"936\": [0, 0.69444, 0, 0, 0.85556],\n \"937\": [0, 0.69444, 0, 0, 0.79445],\n \"8211\": [0, 0.45833, 0.03056, 0, 0.55],\n \"8212\": [0, 0.45833, 0.03056, 0, 1.10001],\n \"8216\": [0, 0.69444, 0, 0, 0.30556],\n \"8217\": [0, 0.69444, 0, 0, 0.30556],\n \"8220\": [0, 0.69444, 0, 0, 0.55834],\n \"8221\": [0, 0.69444, 0, 0, 0.55834]\n },\n \"SansSerif-Italic\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0.05733, 0, 0.31945],\n \"34\": [0, 0.69444, 0.00316, 0, 0.5],\n \"35\": [0.19444, 0.69444, 0.05087, 0, 0.83334],\n \"36\": [0.05556, 0.75, 0.11156, 0, 0.5],\n \"37\": [0.05556, 0.75, 0.03126, 0, 0.83334],\n \"38\": [0, 0.69444, 0.03058, 0, 0.75834],\n \"39\": [0, 0.69444, 0.07816, 0, 0.27778],\n \"40\": [0.25, 0.75, 0.13164, 0, 0.38889],\n \"41\": [0.25, 0.75, 0.02536, 0, 0.38889],\n \"42\": [0, 0.75, 0.11775, 0, 0.5],\n \"43\": [0.08333, 0.58333, 0.02536, 0, 0.77778],\n \"44\": [0.125, 0.08333, 0, 0, 0.27778],\n \"45\": [0, 0.44444, 0.01946, 0, 0.33333],\n \"46\": [0, 0.08333, 0, 0, 0.27778],\n \"47\": [0.25, 0.75, 0.13164, 0, 0.5],\n \"48\": [0, 0.65556, 0.11156, 0, 0.5],\n \"49\": [0, 0.65556, 0.11156, 0, 0.5],\n \"50\": [0, 0.65556, 0.11156, 0, 0.5],\n \"51\": [0, 0.65556, 0.11156, 0, 0.5],\n \"52\": [0, 0.65556, 0.11156, 0, 0.5],\n \"53\": [0, 0.65556, 0.11156, 0, 0.5],\n \"54\": [0, 0.65556, 0.11156, 0, 0.5],\n \"55\": [0, 0.65556, 0.11156, 0, 0.5],\n \"56\": [0, 0.65556, 0.11156, 0, 0.5],\n \"57\": [0, 0.65556, 0.11156, 0, 0.5],\n \"58\": [0, 0.44444, 0.02502, 0, 0.27778],\n \"59\": [0.125, 0.44444, 0.02502, 0, 0.27778],\n \"61\": [-0.13, 0.37, 0.05087, 0, 0.77778],\n \"63\": [0, 0.69444, 0.11809, 0, 0.47222],\n \"64\": [0, 0.69444, 0.07555, 0, 0.66667],\n \"65\": [0, 0.69444, 0, 0, 0.66667],\n \"66\": [0, 0.69444, 0.08293, 0, 0.66667],\n \"67\": [0, 0.69444, 0.11983, 0, 0.63889],\n \"68\": [0, 0.69444, 0.07555, 0, 0.72223],\n \"69\": [0, 0.69444, 0.11983, 0, 0.59722],\n \"70\": [0, 0.69444, 0.13372, 0, 0.56945],\n \"71\": [0, 0.69444, 0.11983, 0, 0.66667],\n \"72\": [0, 0.69444, 0.08094, 0, 0.70834],\n \"73\": [0, 0.69444, 0.13372, 0, 0.27778],\n \"74\": [0, 0.69444, 0.08094, 0, 0.47222],\n \"75\": [0, 0.69444, 0.11983, 0, 0.69445],\n \"76\": [0, 0.69444, 0, 0, 0.54167],\n \"77\": [0, 0.69444, 0.08094, 0, 0.875],\n \"78\": [0, 0.69444, 0.08094, 0, 0.70834],\n \"79\": [0, 0.69444, 0.07555, 0, 0.73611],\n \"80\": [0, 0.69444, 0.08293, 0, 0.63889],\n \"81\": [0.125, 0.69444, 0.07555, 0, 0.73611],\n \"82\": [0, 0.69444, 0.08293, 0, 0.64584],\n \"83\": [0, 0.69444, 0.09205, 0, 0.55556],\n \"84\": [0, 0.69444, 0.13372, 0, 0.68056],\n \"85\": [0, 0.69444, 0.08094, 0, 0.6875],\n \"86\": [0, 0.69444, 0.1615, 0, 0.66667],\n \"87\": [0, 0.69444, 0.1615, 0, 0.94445],\n \"88\": [0, 0.69444, 0.13372, 0, 0.66667],\n \"89\": [0, 0.69444, 0.17261, 0, 0.66667],\n \"90\": [0, 0.69444, 0.11983, 0, 0.61111],\n \"91\": [0.25, 0.75, 0.15942, 0, 0.28889],\n \"93\": [0.25, 0.75, 0.08719, 0, 0.28889],\n \"94\": [0, 0.69444, 0.0799, 0, 0.5],\n \"95\": [0.35, 0.09444, 0.08616, 0, 0.5],\n \"97\": [0, 0.44444, 0.00981, 0, 0.48056],\n \"98\": [0, 0.69444, 0.03057, 0, 0.51667],\n \"99\": [0, 0.44444, 0.08336, 0, 0.44445],\n \"100\": [0, 0.69444, 0.09483, 0, 0.51667],\n \"101\": [0, 0.44444, 0.06778, 0, 0.44445],\n \"102\": [0, 0.69444, 0.21705, 0, 0.30556],\n \"103\": [0.19444, 0.44444, 0.10836, 0, 0.5],\n \"104\": [0, 0.69444, 0.01778, 0, 0.51667],\n \"105\": [0, 0.67937, 0.09718, 0, 0.23889],\n \"106\": [0.19444, 0.67937, 0.09162, 0, 0.26667],\n \"107\": [0, 0.69444, 0.08336, 0, 0.48889],\n \"108\": [0, 0.69444, 0.09483, 0, 0.23889],\n \"109\": [0, 0.44444, 0.01778, 0, 0.79445],\n \"110\": [0, 0.44444, 0.01778, 0, 0.51667],\n \"111\": [0, 0.44444, 0.06613, 0, 0.5],\n \"112\": [0.19444, 0.44444, 0.0389, 0, 0.51667],\n \"113\": [0.19444, 0.44444, 0.04169, 0, 0.51667],\n \"114\": [0, 0.44444, 0.10836, 0, 0.34167],\n \"115\": [0, 0.44444, 0.0778, 0, 0.38333],\n \"116\": [0, 0.57143, 0.07225, 0, 0.36111],\n \"117\": [0, 0.44444, 0.04169, 0, 0.51667],\n \"118\": [0, 0.44444, 0.10836, 0, 0.46111],\n \"119\": [0, 0.44444, 0.10836, 0, 0.68334],\n \"120\": [0, 0.44444, 0.09169, 0, 0.46111],\n \"121\": [0.19444, 0.44444, 0.10836, 0, 0.46111],\n \"122\": [0, 0.44444, 0.08752, 0, 0.43472],\n \"126\": [0.35, 0.32659, 0.08826, 0, 0.5],\n \"160\": [0, 0, 0, 0, 0.25],\n \"168\": [0, 0.67937, 0.06385, 0, 0.5],\n \"176\": [0, 0.69444, 0, 0, 0.73752],\n \"184\": [0.17014, 0, 0, 0, 0.44445],\n \"305\": [0, 0.44444, 0.04169, 0, 0.23889],\n \"567\": [0.19444, 0.44444, 0.04169, 0, 0.26667],\n \"710\": [0, 0.69444, 0.0799, 0, 0.5],\n \"711\": [0, 0.63194, 0.08432, 0, 0.5],\n \"713\": [0, 0.60889, 0.08776, 0, 0.5],\n \"714\": [0, 0.69444, 0.09205, 0, 0.5],\n \"715\": [0, 0.69444, 0, 0, 0.5],\n \"728\": [0, 0.69444, 0.09483, 0, 0.5],\n \"729\": [0, 0.67937, 0.07774, 0, 0.27778],\n \"730\": [0, 0.69444, 0, 0, 0.73752],\n \"732\": [0, 0.67659, 0.08826, 0, 0.5],\n \"733\": [0, 0.69444, 0.09205, 0, 0.5],\n \"915\": [0, 0.69444, 0.13372, 0, 0.54167],\n \"916\": [0, 0.69444, 0, 0, 0.83334],\n \"920\": [0, 0.69444, 0.07555, 0, 0.77778],\n \"923\": [0, 0.69444, 0, 0, 0.61111],\n \"926\": [0, 0.69444, 0.12816, 0, 0.66667],\n \"928\": [0, 0.69444, 0.08094, 0, 0.70834],\n \"931\": [0, 0.69444, 0.11983, 0, 0.72222],\n \"933\": [0, 0.69444, 0.09031, 0, 0.77778],\n \"934\": [0, 0.69444, 0.04603, 0, 0.72222],\n \"936\": [0, 0.69444, 0.09031, 0, 0.77778],\n \"937\": [0, 0.69444, 0.08293, 0, 0.72222],\n \"8211\": [0, 0.44444, 0.08616, 0, 0.5],\n \"8212\": [0, 0.44444, 0.08616, 0, 1.0],\n \"8216\": [0, 0.69444, 0.07816, 0, 0.27778],\n \"8217\": [0, 0.69444, 0.07816, 0, 0.27778],\n \"8220\": [0, 0.69444, 0.14205, 0, 0.5],\n \"8221\": [0, 0.69444, 0.00316, 0, 0.5]\n },\n \"SansSerif-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"33\": [0, 0.69444, 0, 0, 0.31945],\n \"34\": [0, 0.69444, 0, 0, 0.5],\n \"35\": [0.19444, 0.69444, 0, 0, 0.83334],\n \"36\": [0.05556, 0.75, 0, 0, 0.5],\n \"37\": [0.05556, 0.75, 0, 0, 0.83334],\n \"38\": [0, 0.69444, 0, 0, 0.75834],\n \"39\": [0, 0.69444, 0, 0, 0.27778],\n \"40\": [0.25, 0.75, 0, 0, 0.38889],\n \"41\": [0.25, 0.75, 0, 0, 0.38889],\n \"42\": [0, 0.75, 0, 0, 0.5],\n \"43\": [0.08333, 0.58333, 0, 0, 0.77778],\n \"44\": [0.125, 0.08333, 0, 0, 0.27778],\n \"45\": [0, 0.44444, 0, 0, 0.33333],\n \"46\": [0, 0.08333, 0, 0, 0.27778],\n \"47\": [0.25, 0.75, 0, 0, 0.5],\n \"48\": [0, 0.65556, 0, 0, 0.5],\n \"49\": [0, 0.65556, 0, 0, 0.5],\n \"50\": [0, 0.65556, 0, 0, 0.5],\n \"51\": [0, 0.65556, 0, 0, 0.5],\n \"52\": [0, 0.65556, 0, 0, 0.5],\n \"53\": [0, 0.65556, 0, 0, 0.5],\n \"54\": [0, 0.65556, 0, 0, 0.5],\n \"55\": [0, 0.65556, 0, 0, 0.5],\n \"56\": [0, 0.65556, 0, 0, 0.5],\n \"57\": [0, 0.65556, 0, 0, 0.5],\n \"58\": [0, 0.44444, 0, 0, 0.27778],\n \"59\": [0.125, 0.44444, 0, 0, 0.27778],\n \"61\": [-0.13, 0.37, 0, 0, 0.77778],\n \"63\": [0, 0.69444, 0, 0, 0.47222],\n \"64\": [0, 0.69444, 0, 0, 0.66667],\n \"65\": [0, 0.69444, 0, 0, 0.66667],\n \"66\": [0, 0.69444, 0, 0, 0.66667],\n \"67\": [0, 0.69444, 0, 0, 0.63889],\n \"68\": [0, 0.69444, 0, 0, 0.72223],\n \"69\": [0, 0.69444, 0, 0, 0.59722],\n \"70\": [0, 0.69444, 0, 0, 0.56945],\n \"71\": [0, 0.69444, 0, 0, 0.66667],\n \"72\": [0, 0.69444, 0, 0, 0.70834],\n \"73\": [0, 0.69444, 0, 0, 0.27778],\n \"74\": [0, 0.69444, 0, 0, 0.47222],\n \"75\": [0, 0.69444, 0, 0, 0.69445],\n \"76\": [0, 0.69444, 0, 0, 0.54167],\n \"77\": [0, 0.69444, 0, 0, 0.875],\n \"78\": [0, 0.69444, 0, 0, 0.70834],\n \"79\": [0, 0.69444, 0, 0, 0.73611],\n \"80\": [0, 0.69444, 0, 0, 0.63889],\n \"81\": [0.125, 0.69444, 0, 0, 0.73611],\n \"82\": [0, 0.69444, 0, 0, 0.64584],\n \"83\": [0, 0.69444, 0, 0, 0.55556],\n \"84\": [0, 0.69444, 0, 0, 0.68056],\n \"85\": [0, 0.69444, 0, 0, 0.6875],\n \"86\": [0, 0.69444, 0.01389, 0, 0.66667],\n \"87\": [0, 0.69444, 0.01389, 0, 0.94445],\n \"88\": [0, 0.69444, 0, 0, 0.66667],\n \"89\": [0, 0.69444, 0.025, 0, 0.66667],\n \"90\": [0, 0.69444, 0, 0, 0.61111],\n \"91\": [0.25, 0.75, 0, 0, 0.28889],\n \"93\": [0.25, 0.75, 0, 0, 0.28889],\n \"94\": [0, 0.69444, 0, 0, 0.5],\n \"95\": [0.35, 0.09444, 0.02778, 0, 0.5],\n \"97\": [0, 0.44444, 0, 0, 0.48056],\n \"98\": [0, 0.69444, 0, 0, 0.51667],\n \"99\": [0, 0.44444, 0, 0, 0.44445],\n \"100\": [0, 0.69444, 0, 0, 0.51667],\n \"101\": [0, 0.44444, 0, 0, 0.44445],\n \"102\": [0, 0.69444, 0.06944, 0, 0.30556],\n \"103\": [0.19444, 0.44444, 0.01389, 0, 0.5],\n \"104\": [0, 0.69444, 0, 0, 0.51667],\n \"105\": [0, 0.67937, 0, 0, 0.23889],\n \"106\": [0.19444, 0.67937, 0, 0, 0.26667],\n \"107\": [0, 0.69444, 0, 0, 0.48889],\n \"108\": [0, 0.69444, 0, 0, 0.23889],\n \"109\": [0, 0.44444, 0, 0, 0.79445],\n \"110\": [0, 0.44444, 0, 0, 0.51667],\n \"111\": [0, 0.44444, 0, 0, 0.5],\n \"112\": [0.19444, 0.44444, 0, 0, 0.51667],\n \"113\": [0.19444, 0.44444, 0, 0, 0.51667],\n \"114\": [0, 0.44444, 0.01389, 0, 0.34167],\n \"115\": [0, 0.44444, 0, 0, 0.38333],\n \"116\": [0, 0.57143, 0, 0, 0.36111],\n \"117\": [0, 0.44444, 0, 0, 0.51667],\n \"118\": [0, 0.44444, 0.01389, 0, 0.46111],\n \"119\": [0, 0.44444, 0.01389, 0, 0.68334],\n \"120\": [0, 0.44444, 0, 0, 0.46111],\n \"121\": [0.19444, 0.44444, 0.01389, 0, 0.46111],\n \"122\": [0, 0.44444, 0, 0, 0.43472],\n \"126\": [0.35, 0.32659, 0, 0, 0.5],\n \"160\": [0, 0, 0, 0, 0.25],\n \"168\": [0, 0.67937, 0, 0, 0.5],\n \"176\": [0, 0.69444, 0, 0, 0.66667],\n \"184\": [0.17014, 0, 0, 0, 0.44445],\n \"305\": [0, 0.44444, 0, 0, 0.23889],\n \"567\": [0.19444, 0.44444, 0, 0, 0.26667],\n \"710\": [0, 0.69444, 0, 0, 0.5],\n \"711\": [0, 0.63194, 0, 0, 0.5],\n \"713\": [0, 0.60889, 0, 0, 0.5],\n \"714\": [0, 0.69444, 0, 0, 0.5],\n \"715\": [0, 0.69444, 0, 0, 0.5],\n \"728\": [0, 0.69444, 0, 0, 0.5],\n \"729\": [0, 0.67937, 0, 0, 0.27778],\n \"730\": [0, 0.69444, 0, 0, 0.66667],\n \"732\": [0, 0.67659, 0, 0, 0.5],\n \"733\": [0, 0.69444, 0, 0, 0.5],\n \"915\": [0, 0.69444, 0, 0, 0.54167],\n \"916\": [0, 0.69444, 0, 0, 0.83334],\n \"920\": [0, 0.69444, 0, 0, 0.77778],\n \"923\": [0, 0.69444, 0, 0, 0.61111],\n \"926\": [0, 0.69444, 0, 0, 0.66667],\n \"928\": [0, 0.69444, 0, 0, 0.70834],\n \"931\": [0, 0.69444, 0, 0, 0.72222],\n \"933\": [0, 0.69444, 0, 0, 0.77778],\n \"934\": [0, 0.69444, 0, 0, 0.72222],\n \"936\": [0, 0.69444, 0, 0, 0.77778],\n \"937\": [0, 0.69444, 0, 0, 0.72222],\n \"8211\": [0, 0.44444, 0.02778, 0, 0.5],\n \"8212\": [0, 0.44444, 0.02778, 0, 1.0],\n \"8216\": [0, 0.69444, 0, 0, 0.27778],\n \"8217\": [0, 0.69444, 0, 0, 0.27778],\n \"8220\": [0, 0.69444, 0, 0, 0.5],\n \"8221\": [0, 0.69444, 0, 0, 0.5]\n },\n \"Script-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"65\": [0, 0.7, 0.22925, 0, 0.80253],\n \"66\": [0, 0.7, 0.04087, 0, 0.90757],\n \"67\": [0, 0.7, 0.1689, 0, 0.66619],\n \"68\": [0, 0.7, 0.09371, 0, 0.77443],\n \"69\": [0, 0.7, 0.18583, 0, 0.56162],\n \"70\": [0, 0.7, 0.13634, 0, 0.89544],\n \"71\": [0, 0.7, 0.17322, 0, 0.60961],\n \"72\": [0, 0.7, 0.29694, 0, 0.96919],\n \"73\": [0, 0.7, 0.19189, 0, 0.80907],\n \"74\": [0.27778, 0.7, 0.19189, 0, 1.05159],\n \"75\": [0, 0.7, 0.31259, 0, 0.91364],\n \"76\": [0, 0.7, 0.19189, 0, 0.87373],\n \"77\": [0, 0.7, 0.15981, 0, 1.08031],\n \"78\": [0, 0.7, 0.3525, 0, 0.9015],\n \"79\": [0, 0.7, 0.08078, 0, 0.73787],\n \"80\": [0, 0.7, 0.08078, 0, 1.01262],\n \"81\": [0, 0.7, 0.03305, 0, 0.88282],\n \"82\": [0, 0.7, 0.06259, 0, 0.85],\n \"83\": [0, 0.7, 0.19189, 0, 0.86767],\n \"84\": [0, 0.7, 0.29087, 0, 0.74697],\n \"85\": [0, 0.7, 0.25815, 0, 0.79996],\n \"86\": [0, 0.7, 0.27523, 0, 0.62204],\n \"87\": [0, 0.7, 0.27523, 0, 0.80532],\n \"88\": [0, 0.7, 0.26006, 0, 0.94445],\n \"89\": [0, 0.7, 0.2939, 0, 0.70961],\n \"90\": [0, 0.7, 0.24037, 0, 0.8212],\n \"160\": [0, 0, 0, 0, 0.25]\n },\n \"Size1-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"40\": [0.35001, 0.85, 0, 0, 0.45834],\n \"41\": [0.35001, 0.85, 0, 0, 0.45834],\n \"47\": [0.35001, 0.85, 0, 0, 0.57778],\n \"91\": [0.35001, 0.85, 0, 0, 0.41667],\n \"92\": [0.35001, 0.85, 0, 0, 0.57778],\n \"93\": [0.35001, 0.85, 0, 0, 0.41667],\n \"123\": [0.35001, 0.85, 0, 0, 0.58334],\n \"125\": [0.35001, 0.85, 0, 0, 0.58334],\n \"160\": [0, 0, 0, 0, 0.25],\n \"710\": [0, 0.72222, 0, 0, 0.55556],\n \"732\": [0, 0.72222, 0, 0, 0.55556],\n \"770\": [0, 0.72222, 0, 0, 0.55556],\n \"771\": [0, 0.72222, 0, 0, 0.55556],\n \"8214\": [-0.00099, 0.601, 0, 0, 0.77778],\n \"8593\": [1e-05, 0.6, 0, 0, 0.66667],\n \"8595\": [1e-05, 0.6, 0, 0, 0.66667],\n \"8657\": [1e-05, 0.6, 0, 0, 0.77778],\n \"8659\": [1e-05, 0.6, 0, 0, 0.77778],\n \"8719\": [0.25001, 0.75, 0, 0, 0.94445],\n \"8720\": [0.25001, 0.75, 0, 0, 0.94445],\n \"8721\": [0.25001, 0.75, 0, 0, 1.05556],\n \"8730\": [0.35001, 0.85, 0, 0, 1.0],\n \"8739\": [-0.00599, 0.606, 0, 0, 0.33333],\n \"8741\": [-0.00599, 0.606, 0, 0, 0.55556],\n \"8747\": [0.30612, 0.805, 0.19445, 0, 0.47222],\n \"8748\": [0.306, 0.805, 0.19445, 0, 0.47222],\n \"8749\": [0.306, 0.805, 0.19445, 0, 0.47222],\n \"8750\": [0.30612, 0.805, 0.19445, 0, 0.47222],\n \"8896\": [0.25001, 0.75, 0, 0, 0.83334],\n \"8897\": [0.25001, 0.75, 0, 0, 0.83334],\n \"8898\": [0.25001, 0.75, 0, 0, 0.83334],\n \"8899\": [0.25001, 0.75, 0, 0, 0.83334],\n \"8968\": [0.35001, 0.85, 0, 0, 0.47222],\n \"8969\": [0.35001, 0.85, 0, 0, 0.47222],\n \"8970\": [0.35001, 0.85, 0, 0, 0.47222],\n \"8971\": [0.35001, 0.85, 0, 0, 0.47222],\n \"9168\": [-0.00099, 0.601, 0, 0, 0.66667],\n \"10216\": [0.35001, 0.85, 0, 0, 0.47222],\n \"10217\": [0.35001, 0.85, 0, 0, 0.47222],\n \"10752\": [0.25001, 0.75, 0, 0, 1.11111],\n \"10753\": [0.25001, 0.75, 0, 0, 1.11111],\n \"10754\": [0.25001, 0.75, 0, 0, 1.11111],\n \"10756\": [0.25001, 0.75, 0, 0, 0.83334],\n \"10758\": [0.25001, 0.75, 0, 0, 0.83334]\n },\n \"Size2-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"40\": [0.65002, 1.15, 0, 0, 0.59722],\n \"41\": [0.65002, 1.15, 0, 0, 0.59722],\n \"47\": [0.65002, 1.15, 0, 0, 0.81111],\n \"91\": [0.65002, 1.15, 0, 0, 0.47222],\n \"92\": [0.65002, 1.15, 0, 0, 0.81111],\n \"93\": [0.65002, 1.15, 0, 0, 0.47222],\n \"123\": [0.65002, 1.15, 0, 0, 0.66667],\n \"125\": [0.65002, 1.15, 0, 0, 0.66667],\n \"160\": [0, 0, 0, 0, 0.25],\n \"710\": [0, 0.75, 0, 0, 1.0],\n \"732\": [0, 0.75, 0, 0, 1.0],\n \"770\": [0, 0.75, 0, 0, 1.0],\n \"771\": [0, 0.75, 0, 0, 1.0],\n \"8719\": [0.55001, 1.05, 0, 0, 1.27778],\n \"8720\": [0.55001, 1.05, 0, 0, 1.27778],\n \"8721\": [0.55001, 1.05, 0, 0, 1.44445],\n \"8730\": [0.65002, 1.15, 0, 0, 1.0],\n \"8747\": [0.86225, 1.36, 0.44445, 0, 0.55556],\n \"8748\": [0.862, 1.36, 0.44445, 0, 0.55556],\n \"8749\": [0.862, 1.36, 0.44445, 0, 0.55556],\n \"8750\": [0.86225, 1.36, 0.44445, 0, 0.55556],\n \"8896\": [0.55001, 1.05, 0, 0, 1.11111],\n \"8897\": [0.55001, 1.05, 0, 0, 1.11111],\n \"8898\": [0.55001, 1.05, 0, 0, 1.11111],\n \"8899\": [0.55001, 1.05, 0, 0, 1.11111],\n \"8968\": [0.65002, 1.15, 0, 0, 0.52778],\n \"8969\": [0.65002, 1.15, 0, 0, 0.52778],\n \"8970\": [0.65002, 1.15, 0, 0, 0.52778],\n \"8971\": [0.65002, 1.15, 0, 0, 0.52778],\n \"10216\": [0.65002, 1.15, 0, 0, 0.61111],\n \"10217\": [0.65002, 1.15, 0, 0, 0.61111],\n \"10752\": [0.55001, 1.05, 0, 0, 1.51112],\n \"10753\": [0.55001, 1.05, 0, 0, 1.51112],\n \"10754\": [0.55001, 1.05, 0, 0, 1.51112],\n \"10756\": [0.55001, 1.05, 0, 0, 1.11111],\n \"10758\": [0.55001, 1.05, 0, 0, 1.11111]\n },\n \"Size3-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"40\": [0.95003, 1.45, 0, 0, 0.73611],\n \"41\": [0.95003, 1.45, 0, 0, 0.73611],\n \"47\": [0.95003, 1.45, 0, 0, 1.04445],\n \"91\": [0.95003, 1.45, 0, 0, 0.52778],\n \"92\": [0.95003, 1.45, 0, 0, 1.04445],\n \"93\": [0.95003, 1.45, 0, 0, 0.52778],\n \"123\": [0.95003, 1.45, 0, 0, 0.75],\n \"125\": [0.95003, 1.45, 0, 0, 0.75],\n \"160\": [0, 0, 0, 0, 0.25],\n \"710\": [0, 0.75, 0, 0, 1.44445],\n \"732\": [0, 0.75, 0, 0, 1.44445],\n \"770\": [0, 0.75, 0, 0, 1.44445],\n \"771\": [0, 0.75, 0, 0, 1.44445],\n \"8730\": [0.95003, 1.45, 0, 0, 1.0],\n \"8968\": [0.95003, 1.45, 0, 0, 0.58334],\n \"8969\": [0.95003, 1.45, 0, 0, 0.58334],\n \"8970\": [0.95003, 1.45, 0, 0, 0.58334],\n \"8971\": [0.95003, 1.45, 0, 0, 0.58334],\n \"10216\": [0.95003, 1.45, 0, 0, 0.75],\n \"10217\": [0.95003, 1.45, 0, 0, 0.75]\n },\n \"Size4-Regular\": {\n \"32\": [0, 0, 0, 0, 0.25],\n \"40\": [1.25003, 1.75, 0, 0, 0.79167],\n \"41\": [1.25003, 1.75, 0, 0, 0.79167],\n \"47\": [1.25003, 1.75, 0, 0, 1.27778],\n \"91\": [1.25003, 1.75, 0, 0, 0.58334],\n \"92\": [1.25003, 1.75, 0, 0, 1.27778],\n \"93\": [1.25003, 1.75, 0, 0, 0.58334],\n \"123\": [1.25003, 1.75, 0, 0, 0.80556],\n \"125\": [1.25003, 1.75, 0, 0, 0.80556],\n \"160\": [0, 0, 0, 0, 0.25],\n \"710\": [0, 0.825, 0, 0, 1.8889],\n \"732\": [0, 0.825, 0, 0, 1.8889],\n \"770\": [0, 0.825, 0, 0, 1.8889],\n \"771\": [0, 0.825, 0, 0, 1.8889],\n \"8730\": [1.25003, 1.75, 0, 0, 1.0],\n \"8968\": [1.25003, 1.75, 0, 0, 0.63889],\n \"8969\": [1.25003, 1.75, 0, 0, 0.63889],\n \"8970\": [1.25003, 1.75, 0, 0, 0.63889],\n \"8971\": [1.25003, 1.75, 0, 0, 0.63889],\n \"9115\": [0.64502, 1.155, 0, 0, 0.875],\n \"9116\": [1e-05, 0.6, 0, 0, 0.875],\n \"9117\": [0.64502, 1.155, 0, 0, 0.875],\n \"9118\": [0.64502, 1.155, 0, 0, 0.875],\n \"9119\": [1e-05, 0.6, 0, 0, 0.875],\n \"9120\": [0.64502, 1.155, 0, 0, 0.875],\n \"9121\": [0.64502, 1.155, 0, 0, 0.66667],\n \"9122\": [-0.00099, 0.601, 0, 0, 0.66667],\n \"9123\": [0.64502, 1.155, 0, 0, 0.66667],\n \"9124\": [0.64502, 1.155, 0, 0, 0.66667],\n \"9125\": [-0.00099, 0.601, 0, 0, 0.66667],\n \"9126\": [0.64502, 1.155, 0, 0, 0.66667],\n \"9127\": [1e-05, 0.9, 0, 0, 0.88889],\n \"9128\": [0.65002, 1.15, 0, 0, 0.88889],\n \"9129\": [0.90001, 0, 0, 0, 0.88889],\n \"9130\": [0, 0.3, 0, 0, 0.88889],\n \"9131\": [1e-05, 0.9, 0, 0, 0.88889],\n \"9132\": [0.65002, 1.15, 0, 0, 0.88889],\n \"9133\": [0.90001, 0, 0, 0, 0.88889],\n \"9143\": [0.88502, 0.915, 0, 0, 1.05556],\n \"10216\": [1.25003, 1.75, 0, 0, 0.80556],\n \"10217\": [1.25003, 1.75, 0, 0, 0.80556],\n \"57344\": [-0.00499, 0.605, 0, 0, 1.05556],\n \"57345\": [-0.00499, 0.605, 0, 0, 1.05556],\n \"57680\": [0, 0.12, 0, 0, 0.45],\n \"57681\": [0, 0.12, 0, 0, 0.45],\n \"57682\": [0, 0.12, 0, 0, 0.45],\n \"57683\": [0, 0.12, 0, 0, 0.45]\n },\n \"Typewriter-Regular\": {\n \"32\": [0, 0, 0, 0, 0.525],\n \"33\": [0, 0.61111, 0, 0, 0.525],\n \"34\": [0, 0.61111, 0, 0, 0.525],\n \"35\": [0, 0.61111, 0, 0, 0.525],\n \"36\": [0.08333, 0.69444, 0, 0, 0.525],\n \"37\": [0.08333, 0.69444, 0, 0, 0.525],\n \"38\": [0, 0.61111, 0, 0, 0.525],\n \"39\": [0, 0.61111, 0, 0, 0.525],\n \"40\": [0.08333, 0.69444, 0, 0, 0.525],\n \"41\": [0.08333, 0.69444, 0, 0, 0.525],\n \"42\": [0, 0.52083, 0, 0, 0.525],\n \"43\": [-0.08056, 0.53055, 0, 0, 0.525],\n \"44\": [0.13889, 0.125, 0, 0, 0.525],\n \"45\": [-0.08056, 0.53055, 0, 0, 0.525],\n \"46\": [0, 0.125, 0, 0, 0.525],\n \"47\": [0.08333, 0.69444, 0, 0, 0.525],\n \"48\": [0, 0.61111, 0, 0, 0.525],\n \"49\": [0, 0.61111, 0, 0, 0.525],\n \"50\": [0, 0.61111, 0, 0, 0.525],\n \"51\": [0, 0.61111, 0, 0, 0.525],\n \"52\": [0, 0.61111, 0, 0, 0.525],\n \"53\": [0, 0.61111, 0, 0, 0.525],\n \"54\": [0, 0.61111, 0, 0, 0.525],\n \"55\": [0, 0.61111, 0, 0, 0.525],\n \"56\": [0, 0.61111, 0, 0, 0.525],\n \"57\": [0, 0.61111, 0, 0, 0.525],\n \"58\": [0, 0.43056, 0, 0, 0.525],\n \"59\": [0.13889, 0.43056, 0, 0, 0.525],\n \"60\": [-0.05556, 0.55556, 0, 0, 0.525],\n \"61\": [-0.19549, 0.41562, 0, 0, 0.525],\n \"62\": [-0.05556, 0.55556, 0, 0, 0.525],\n \"63\": [0, 0.61111, 0, 0, 0.525],\n \"64\": [0, 0.61111, 0, 0, 0.525],\n \"65\": [0, 0.61111, 0, 0, 0.525],\n \"66\": [0, 0.61111, 0, 0, 0.525],\n \"67\": [0, 0.61111, 0, 0, 0.525],\n \"68\": [0, 0.61111, 0, 0, 0.525],\n \"69\": [0, 0.61111, 0, 0, 0.525],\n \"70\": [0, 0.61111, 0, 0, 0.525],\n \"71\": [0, 0.61111, 0, 0, 0.525],\n \"72\": [0, 0.61111, 0, 0, 0.525],\n \"73\": [0, 0.61111, 0, 0, 0.525],\n \"74\": [0, 0.61111, 0, 0, 0.525],\n \"75\": [0, 0.61111, 0, 0, 0.525],\n \"76\": [0, 0.61111, 0, 0, 0.525],\n \"77\": [0, 0.61111, 0, 0, 0.525],\n \"78\": [0, 0.61111, 0, 0, 0.525],\n \"79\": [0, 0.61111, 0, 0, 0.525],\n \"80\": [0, 0.61111, 0, 0, 0.525],\n \"81\": [0.13889, 0.61111, 0, 0, 0.525],\n \"82\": [0, 0.61111, 0, 0, 0.525],\n \"83\": [0, 0.61111, 0, 0, 0.525],\n \"84\": [0, 0.61111, 0, 0, 0.525],\n \"85\": [0, 0.61111, 0, 0, 0.525],\n \"86\": [0, 0.61111, 0, 0, 0.525],\n \"87\": [0, 0.61111, 0, 0, 0.525],\n \"88\": [0, 0.61111, 0, 0, 0.525],\n \"89\": [0, 0.61111, 0, 0, 0.525],\n \"90\": [0, 0.61111, 0, 0, 0.525],\n \"91\": [0.08333, 0.69444, 0, 0, 0.525],\n \"92\": [0.08333, 0.69444, 0, 0, 0.525],\n \"93\": [0.08333, 0.69444, 0, 0, 0.525],\n \"94\": [0, 0.61111, 0, 0, 0.525],\n \"95\": [0.09514, 0, 0, 0, 0.525],\n \"96\": [0, 0.61111, 0, 0, 0.525],\n \"97\": [0, 0.43056, 0, 0, 0.525],\n \"98\": [0, 0.61111, 0, 0, 0.525],\n \"99\": [0, 0.43056, 0, 0, 0.525],\n \"100\": [0, 0.61111, 0, 0, 0.525],\n \"101\": [0, 0.43056, 0, 0, 0.525],\n \"102\": [0, 0.61111, 0, 0, 0.525],\n \"103\": [0.22222, 0.43056, 0, 0, 0.525],\n \"104\": [0, 0.61111, 0, 0, 0.525],\n \"105\": [0, 0.61111, 0, 0, 0.525],\n \"106\": [0.22222, 0.61111, 0, 0, 0.525],\n \"107\": [0, 0.61111, 0, 0, 0.525],\n \"108\": [0, 0.61111, 0, 0, 0.525],\n \"109\": [0, 0.43056, 0, 0, 0.525],\n \"110\": [0, 0.43056, 0, 0, 0.525],\n \"111\": [0, 0.43056, 0, 0, 0.525],\n \"112\": [0.22222, 0.43056, 0, 0, 0.525],\n \"113\": [0.22222, 0.43056, 0, 0, 0.525],\n \"114\": [0, 0.43056, 0, 0, 0.525],\n \"115\": [0, 0.43056, 0, 0, 0.525],\n \"116\": [0, 0.55358, 0, 0, 0.525],\n \"117\": [0, 0.43056, 0, 0, 0.525],\n \"118\": [0, 0.43056, 0, 0, 0.525],\n \"119\": [0, 0.43056, 0, 0, 0.525],\n \"120\": [0, 0.43056, 0, 0, 0.525],\n \"121\": [0.22222, 0.43056, 0, 0, 0.525],\n \"122\": [0, 0.43056, 0, 0, 0.525],\n \"123\": [0.08333, 0.69444, 0, 0, 0.525],\n \"124\": [0.08333, 0.69444, 0, 0, 0.525],\n \"125\": [0.08333, 0.69444, 0, 0, 0.525],\n \"126\": [0, 0.61111, 0, 0, 0.525],\n \"127\": [0, 0.61111, 0, 0, 0.525],\n \"160\": [0, 0, 0, 0, 0.525],\n \"176\": [0, 0.61111, 0, 0, 0.525],\n \"184\": [0.19445, 0, 0, 0, 0.525],\n \"305\": [0, 0.43056, 0, 0, 0.525],\n \"567\": [0.22222, 0.43056, 0, 0, 0.525],\n \"711\": [0, 0.56597, 0, 0, 0.525],\n \"713\": [0, 0.56555, 0, 0, 0.525],\n \"714\": [0, 0.61111, 0, 0, 0.525],\n \"715\": [0, 0.61111, 0, 0, 0.525],\n \"728\": [0, 0.61111, 0, 0, 0.525],\n \"730\": [0, 0.61111, 0, 0, 0.525],\n \"770\": [0, 0.61111, 0, 0, 0.525],\n \"771\": [0, 0.61111, 0, 0, 0.525],\n \"776\": [0, 0.61111, 0, 0, 0.525],\n \"915\": [0, 0.61111, 0, 0, 0.525],\n \"916\": [0, 0.61111, 0, 0, 0.525],\n \"920\": [0, 0.61111, 0, 0, 0.525],\n \"923\": [0, 0.61111, 0, 0, 0.525],\n \"926\": [0, 0.61111, 0, 0, 0.525],\n \"928\": [0, 0.61111, 0, 0, 0.525],\n \"931\": [0, 0.61111, 0, 0, 0.525],\n \"933\": [0, 0.61111, 0, 0, 0.525],\n \"934\": [0, 0.61111, 0, 0, 0.525],\n \"936\": [0, 0.61111, 0, 0, 0.525],\n \"937\": [0, 0.61111, 0, 0, 0.525],\n \"8216\": [0, 0.61111, 0, 0, 0.525],\n \"8217\": [0, 0.61111, 0, 0, 0.525],\n \"8242\": [0, 0.61111, 0, 0, 0.525],\n \"9251\": [0.11111, 0.21944, 0, 0, 0.525]\n }\n};\n\n/**\n * This file contains metrics regarding fonts and individual symbols. The sigma\n * and xi variables, as well as the metricMap map contain data extracted from\n * TeX, TeX font metrics, and the TTF files. These data are then exposed via the\n * `metrics` variable and the getCharacterMetrics function.\n */\n// In TeX, there are actually three sets of dimensions, one for each of\n// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:\n// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt). These are\n// provided in the arrays below, in that order.\n//\n// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.\n// This was determined by running the following script:\n//\n// latex -interaction=nonstopmode \\\n// '\\documentclass{article}\\usepackage{amsmath}\\begin{document}' \\\n// '$a$ \\expandafter\\show\\the\\textfont2' \\\n// '\\expandafter\\show\\the\\scriptfont2' \\\n// '\\expandafter\\show\\the\\scriptscriptfont2' \\\n// '\\stop'\n//\n// The metrics themselves were retrieved using the following commands:\n//\n// tftopl cmsy10\n// tftopl cmsy7\n// tftopl cmsy5\n//\n// The output of each of these commands is quite lengthy. The only part we\n// care about is the FONTDIMEN section. Each value is measured in EMs.\nvar sigmasAndXis = {\n slant: [0.250, 0.250, 0.250],\n // sigma1\n space: [0.000, 0.000, 0.000],\n // sigma2\n stretch: [0.000, 0.000, 0.000],\n // sigma3\n shrink: [0.000, 0.000, 0.000],\n // sigma4\n xHeight: [0.431, 0.431, 0.431],\n // sigma5\n quad: [1.000, 1.171, 1.472],\n // sigma6\n extraSpace: [0.000, 0.000, 0.000],\n // sigma7\n num1: [0.677, 0.732, 0.925],\n // sigma8\n num2: [0.394, 0.384, 0.387],\n // sigma9\n num3: [0.444, 0.471, 0.504],\n // sigma10\n denom1: [0.686, 0.752, 1.025],\n // sigma11\n denom2: [0.345, 0.344, 0.532],\n // sigma12\n sup1: [0.413, 0.503, 0.504],\n // sigma13\n sup2: [0.363, 0.431, 0.404],\n // sigma14\n sup3: [0.289, 0.286, 0.294],\n // sigma15\n sub1: [0.150, 0.143, 0.200],\n // sigma16\n sub2: [0.247, 0.286, 0.400],\n // sigma17\n supDrop: [0.386, 0.353, 0.494],\n // sigma18\n subDrop: [0.050, 0.071, 0.100],\n // sigma19\n delim1: [2.390, 1.700, 1.980],\n // sigma20\n delim2: [1.010, 1.157, 1.420],\n // sigma21\n axisHeight: [0.250, 0.250, 0.250],\n // sigma22\n // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;\n // they correspond to the font parameters of the extension fonts (family 3).\n // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to\n // match cmex7, we'd use cmex7.tfm values for script and scriptscript\n // values.\n defaultRuleThickness: [0.04, 0.049, 0.049],\n // xi8; cmex7: 0.049\n bigOpSpacing1: [0.111, 0.111, 0.111],\n // xi9\n bigOpSpacing2: [0.166, 0.166, 0.166],\n // xi10\n bigOpSpacing3: [0.2, 0.2, 0.2],\n // xi11\n bigOpSpacing4: [0.6, 0.611, 0.611],\n // xi12; cmex7: 0.611\n bigOpSpacing5: [0.1, 0.143, 0.143],\n // xi13; cmex7: 0.143\n // The \\sqrt rule width is taken from the height of the surd character.\n // Since we use the same font at all sizes, this thickness doesn't scale.\n sqrtRuleThickness: [0.04, 0.04, 0.04],\n // This value determines how large a pt is, for metrics which are defined\n // in terms of pts.\n // This value is also used in katex.scss; if you change it make sure the\n // values match.\n ptPerEm: [10.0, 10.0, 10.0],\n // The space between adjacent `|` columns in an array definition. From\n // `\\showthe\\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.\n doubleRuleSep: [0.2, 0.2, 0.2],\n // The width of separator lines in {array} environments. From\n // `\\showthe\\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.\n arrayRuleWidth: [0.04, 0.04, 0.04],\n // Two values from LaTeX source2e:\n fboxsep: [0.3, 0.3, 0.3],\n // 3 pt / ptPerEm\n fboxrule: [0.04, 0.04, 0.04] // 0.4 pt / ptPerEm\n};\n// These are very rough approximations. We default to Times New Roman which\n// should have Latin-1 and Cyrillic characters, but may not depending on the\n// operating system. The metrics do not account for extra height from the\n// accents. In the case of Cyrillic characters which have both ascenders and\n// descenders we prefer approximations with ascenders, primarily to prevent\n// the fraction bar or root line from intersecting the glyph.\n// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.\nvar extraCharacterMap = {\n // Latin-1\n 'Å': 'A',\n 'Ð': 'D',\n 'Þ': 'o',\n 'å': 'a',\n 'ð': 'd',\n 'þ': 'o',\n // Cyrillic\n 'А': 'A',\n 'Б': 'B',\n 'В': 'B',\n 'Г': 'F',\n 'Д': 'A',\n 'Е': 'E',\n 'Ж': 'K',\n 'З': '3',\n 'И': 'N',\n 'Й': 'N',\n 'К': 'K',\n 'Л': 'N',\n 'М': 'M',\n 'Н': 'H',\n 'О': 'O',\n 'П': 'N',\n 'Р': 'P',\n 'С': 'C',\n 'Т': 'T',\n 'У': 'y',\n 'Ф': 'O',\n 'Х': 'X',\n 'Ц': 'U',\n 'Ч': 'h',\n 'Ш': 'W',\n 'Щ': 'W',\n 'Ъ': 'B',\n 'Ы': 'X',\n 'Ь': 'B',\n 'Э': '3',\n 'Ю': 'X',\n 'Я': 'R',\n 'а': 'a',\n 'б': 'b',\n 'в': 'a',\n 'г': 'r',\n 'д': 'y',\n 'е': 'e',\n 'ж': 'm',\n 'з': 'e',\n 'и': 'n',\n 'й': 'n',\n 'к': 'n',\n 'л': 'n',\n 'м': 'm',\n 'н': 'n',\n 'о': 'o',\n 'п': 'n',\n 'р': 'p',\n 'с': 'c',\n 'т': 'o',\n 'у': 'y',\n 'ф': 'b',\n 'х': 'x',\n 'ц': 'n',\n 'ч': 'n',\n 'ш': 'w',\n 'щ': 'w',\n 'ъ': 'a',\n 'ы': 'm',\n 'ь': 'a',\n 'э': 'e',\n 'ю': 'm',\n 'я': 'r'\n};\n/**\n * This function adds new font metrics to default metricMap\n * It can also override existing metrics\n */\nfunction setFontMetrics(fontName, metrics) {\n fontMetricsData[fontName] = metrics;\n}\n/**\n * This function is a convenience function for looking up information in the\n * metricMap table. It takes a character as a string, and a font.\n *\n * Note: the `width` property may be undefined if fontMetricsData.js wasn't\n * built using `Make extended_metrics`.\n */\nfunction getCharacterMetrics(character, font, mode) {\n if (!fontMetricsData[font]) {\n throw new Error(\"Font metrics not found for font: \" + font + \".\");\n }\n var ch = character.charCodeAt(0);\n var metrics = fontMetricsData[font][ch];\n if (!metrics && character[0] in extraCharacterMap) {\n ch = extraCharacterMap[character[0]].charCodeAt(0);\n metrics = fontMetricsData[font][ch];\n }\n if (!metrics && mode === 'text') {\n // We don't typically have font metrics for Asian scripts.\n // But since we support them in text mode, we need to return\n // some sort of metrics.\n // So if the character is in a script we support but we\n // don't have metrics for it, just use the metrics for\n // the Latin capital letter M. This is close enough because\n // we (currently) only care about the height of the glyph\n // not its width.\n if (supportedCodepoint(ch)) {\n metrics = fontMetricsData[font][77]; // 77 is the charcode for 'M'\n }\n }\n if (metrics) {\n return {\n depth: metrics[0],\n height: metrics[1],\n italic: metrics[2],\n skew: metrics[3],\n width: metrics[4]\n };\n }\n}\nvar fontMetricsBySizeIndex = {};\n/**\n * Get the font metrics for a given size.\n */\nfunction getGlobalMetrics(size) {\n var sizeIndex;\n if (size >= 5) {\n sizeIndex = 0;\n } else if (size >= 3) {\n sizeIndex = 1;\n } else {\n sizeIndex = 2;\n }\n if (!fontMetricsBySizeIndex[sizeIndex]) {\n var metrics = fontMetricsBySizeIndex[sizeIndex] = {\n cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18\n };\n for (var key of Object.keys(sigmasAndXis)) {\n metrics[key] = sigmasAndXis[key][sizeIndex];\n }\n }\n return fontMetricsBySizeIndex[sizeIndex];\n}\n\n/**\n * This file holds a list of all no-argument functions and single-character\n * symbols (like 'a' or ';').\n *\n * For each of the symbols, there are three properties they can have:\n * - font (required): the font to be used for this symbol. Either \"main\" (the\n normal font), or \"ams\" (the ams fonts).\n * - group (required): the ParseNode group type the symbol should have (i.e.\n \"textord\", \"mathord\", etc).\n See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types\n * - replace: the character that this symbol or function should be\n * replaced with (i.e. \"\\phi\" has a replace value of \"\\u03d5\", the phi\n * character in the main font).\n *\n * The outermost map in the table indicates what mode the symbols should be\n * accepted in (e.g. \"math\" or \"text\").\n */\nvar symbols = {\n \"math\": {},\n \"text\": {}\n};\n/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */\nfunction defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = {\n font,\n group,\n replace\n };\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n}\n// Some abbreviations for commonly used strings.\n// This helps minify the code, and also spotting typos using jshint.\n// modes:\nvar math = \"math\";\nvar text = \"text\";\n// fonts:\nvar main = \"main\";\nvar ams = \"ams\";\n// groups:\nvar accent = \"accent-token\";\nvar bin = \"bin\";\nvar close = \"close\";\nvar inner = \"inner\";\nvar mathord = \"mathord\";\nvar op = \"op-token\";\nvar open = \"open\";\nvar punct = \"punct\";\nvar rel = \"rel\";\nvar spacing = \"spacing\";\nvar textord = \"textord\";\n// Now comes the symbol table\n// Relation Symbols\ndefineSymbol(math, main, rel, \"\\u2261\", \"\\\\equiv\", true);\ndefineSymbol(math, main, rel, \"\\u227a\", \"\\\\prec\", true);\ndefineSymbol(math, main, rel, \"\\u227b\", \"\\\\succ\", true);\ndefineSymbol(math, main, rel, \"\\u223c\", \"\\\\sim\", true);\ndefineSymbol(math, main, rel, \"\\u22a5\", \"\\\\perp\");\ndefineSymbol(math, main, rel, \"\\u2aaf\", \"\\\\preceq\", true);\ndefineSymbol(math, main, rel, \"\\u2ab0\", \"\\\\succeq\", true);\ndefineSymbol(math, main, rel, \"\\u2243\", \"\\\\simeq\", true);\ndefineSymbol(math, main, rel, \"\\u2223\", \"\\\\mid\", true);\ndefineSymbol(math, main, rel, \"\\u226a\", \"\\\\ll\", true);\ndefineSymbol(math, main, rel, \"\\u226b\", \"\\\\gg\", true);\ndefineSymbol(math, main, rel, \"\\u224d\", \"\\\\asymp\", true);\ndefineSymbol(math, main, rel, \"\\u2225\", \"\\\\parallel\");\ndefineSymbol(math, main, rel, \"\\u22c8\", \"\\\\bowtie\", true);\ndefineSymbol(math, main, rel, \"\\u2323\", \"\\\\smile\", true);\ndefineSymbol(math, main, rel, \"\\u2291\", \"\\\\sqsubseteq\", true);\ndefineSymbol(math, main, rel, \"\\u2292\", \"\\\\sqsupseteq\", true);\ndefineSymbol(math, main, rel, \"\\u2250\", \"\\\\doteq\", true);\ndefineSymbol(math, main, rel, \"\\u2322\", \"\\\\frown\", true);\ndefineSymbol(math, main, rel, \"\\u220b\", \"\\\\ni\", true);\ndefineSymbol(math, main, rel, \"\\u221d\", \"\\\\propto\", true);\ndefineSymbol(math, main, rel, \"\\u22a2\", \"\\\\vdash\", true);\ndefineSymbol(math, main, rel, \"\\u22a3\", \"\\\\dashv\", true);\ndefineSymbol(math, main, rel, \"\\u220b\", \"\\\\owns\");\n// Punctuation\ndefineSymbol(math, main, punct, \"\\u002e\", \"\\\\ldotp\");\ndefineSymbol(math, main, punct, \"\\u22c5\", \"\\\\cdotp\");\n// The KaTeX fonts do not contain U+00B7. Use the centered dot glyph at U+22C5\n// in both modes, but keep math-mode punctuation spacing only in math mode.\ndefineSymbol(math, main, punct, \"\\u22c5\", \"\\u00b7\");\ndefineSymbol(text, main, textord, \"\\u22c5\", \"\\u00b7\");\n// Misc Symbols\ndefineSymbol(math, main, textord, \"\\u0023\", \"\\\\#\");\ndefineSymbol(text, main, textord, \"\\u0023\", \"\\\\#\");\ndefineSymbol(math, main, textord, \"\\u0026\", \"\\\\&\");\ndefineSymbol(text, main, textord, \"\\u0026\", \"\\\\&\");\ndefineSymbol(math, main, textord, \"\\u2135\", \"\\\\aleph\", true);\ndefineSymbol(math, main, textord, \"\\u2200\", \"\\\\forall\", true);\ndefineSymbol(math, main, textord, \"\\u210f\", \"\\\\hbar\", true);\ndefineSymbol(math, main, textord, \"\\u2203\", \"\\\\exists\", true);\ndefineSymbol(math, main, textord, \"\\u2207\", \"\\\\nabla\", true);\ndefineSymbol(math, main, textord, \"\\u266d\", \"\\\\flat\", true);\ndefineSymbol(math, main, textord, \"\\u2113\", \"\\\\ell\", true);\ndefineSymbol(math, main, textord, \"\\u266e\", \"\\\\natural\", true);\ndefineSymbol(math, main, textord, \"\\u2663\", \"\\\\clubsuit\", true);\ndefineSymbol(math, main, textord, \"\\u2118\", \"\\\\wp\", true);\ndefineSymbol(math, main, textord, \"\\u266f\", \"\\\\sharp\", true);\ndefineSymbol(math, main, textord, \"\\u2662\", \"\\\\diamondsuit\", true);\ndefineSymbol(math, main, textord, \"\\u211c\", \"\\\\Re\", true);\ndefineSymbol(math, main, textord, \"\\u2661\", \"\\\\heartsuit\", true);\ndefineSymbol(math, main, textord, \"\\u2111\", \"\\\\Im\", true);\ndefineSymbol(math, main, textord, \"\\u2660\", \"\\\\spadesuit\", true);\ndefineSymbol(math, main, textord, \"\\u00a7\", \"\\\\S\", true);\ndefineSymbol(text, main, textord, \"\\u00a7\", \"\\\\S\");\ndefineSymbol(math, main, textord, \"\\u00b6\", \"\\\\P\", true);\ndefineSymbol(text, main, textord, \"\\u00b6\", \"\\\\P\");\n// Math and Text\ndefineSymbol(math, main, textord, \"\\u2020\", \"\\\\dag\");\ndefineSymbol(text, main, textord, \"\\u2020\", \"\\\\dag\");\ndefineSymbol(text, main, textord, \"\\u2020\", \"\\\\textdagger\");\ndefineSymbol(math, main, textord, \"\\u2021\", \"\\\\ddag\");\ndefineSymbol(text, main, textord, \"\\u2021\", \"\\\\ddag\");\ndefineSymbol(text, main, textord, \"\\u2021\", \"\\\\textdaggerdbl\");\n// Large Delimiters\ndefineSymbol(math, main, close, \"\\u23b1\", \"\\\\rmoustache\", true);\ndefineSymbol(math, main, open, \"\\u23b0\", \"\\\\lmoustache\", true);\ndefineSymbol(math, main, close, \"\\u27ef\", \"\\\\rgroup\", true);\ndefineSymbol(math, main, open, \"\\u27ee\", \"\\\\lgroup\", true);\n// Binary Operators\ndefineSymbol(math, main, bin, \"\\u2213\", \"\\\\mp\", true);\ndefineSymbol(math, main, bin, \"\\u2296\", \"\\\\ominus\", true);\ndefineSymbol(math, main, bin, \"\\u228e\", \"\\\\uplus\", true);\ndefineSymbol(math, main, bin, \"\\u2293\", \"\\\\sqcap\", true);\ndefineSymbol(math, main, bin, \"\\u2217\", \"\\\\ast\");\ndefineSymbol(math, main, bin, \"\\u2294\", \"\\\\sqcup\", true);\ndefineSymbol(math, main, bin, \"\\u25ef\", \"\\\\bigcirc\", true);\ndefineSymbol(math, main, bin, \"\\u2219\", \"\\\\bullet\", true);\ndefineSymbol(math, main, bin, \"\\u2021\", \"\\\\ddagger\");\ndefineSymbol(math, main, bin, \"\\u2240\", \"\\\\wr\", true);\ndefineSymbol(math, main, bin, \"\\u2a3f\", \"\\\\amalg\");\ndefineSymbol(math, main, bin, \"\\u0026\", \"\\\\And\"); // from amsmath\n// Arrow Symbols\ndefineSymbol(math, main, rel, \"\\u27f5\", \"\\\\longleftarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d0\", \"\\\\Leftarrow\", true);\ndefineSymbol(math, main, rel, \"\\u27f8\", \"\\\\Longleftarrow\", true);\ndefineSymbol(math, main, rel, \"\\u27f6\", \"\\\\longrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d2\", \"\\\\Rightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u27f9\", \"\\\\Longrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u2194\", \"\\\\leftrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u27f7\", \"\\\\longleftrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d4\", \"\\\\Leftrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u27fa\", \"\\\\Longleftrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21a6\", \"\\\\mapsto\", true);\ndefineSymbol(math, main, rel, \"\\u27fc\", \"\\\\longmapsto\", true);\ndefineSymbol(math, main, rel, \"\\u2197\", \"\\\\nearrow\", true);\ndefineSymbol(math, main, rel, \"\\u21a9\", \"\\\\hookleftarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21aa\", \"\\\\hookrightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u2198\", \"\\\\searrow\", true);\ndefineSymbol(math, main, rel, \"\\u21bc\", \"\\\\leftharpoonup\", true);\ndefineSymbol(math, main, rel, \"\\u21c0\", \"\\\\rightharpoonup\", true);\ndefineSymbol(math, main, rel, \"\\u2199\", \"\\\\swarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21bd\", \"\\\\leftharpoondown\", true);\ndefineSymbol(math, main, rel, \"\\u21c1\", \"\\\\rightharpoondown\", true);\ndefineSymbol(math, main, rel, \"\\u2196\", \"\\\\nwarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21cc\", \"\\\\rightleftharpoons\", true);\n// AMS Negated Binary Relations\ndefineSymbol(math, ams, rel, \"\\u226e\", \"\\\\nless\", true);\n// Symbol names preceded by \"@\" each have a corresponding macro.\ndefineSymbol(math, ams, rel, \"\\ue010\", \"\\\\@nleqslant\");\ndefineSymbol(math, ams, rel, \"\\ue011\", \"\\\\@nleqq\");\ndefineSymbol(math, ams, rel, \"\\u2a87\", \"\\\\lneq\", true);\ndefineSymbol(math, ams, rel, \"\\u2268\", \"\\\\lneqq\", true);\ndefineSymbol(math, ams, rel, \"\\ue00c\", \"\\\\@lvertneqq\");\ndefineSymbol(math, ams, rel, \"\\u22e6\", \"\\\\lnsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2a89\", \"\\\\lnapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u2280\", \"\\\\nprec\", true);\n// unicode-math maps \\u22e0 to \\npreccurlyeq. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u22e0\", \"\\\\npreceq\", true);\ndefineSymbol(math, ams, rel, \"\\u22e8\", \"\\\\precnsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2ab9\", \"\\\\precnapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u2241\", \"\\\\nsim\", true);\ndefineSymbol(math, ams, rel, \"\\ue006\", \"\\\\@nshortmid\");\ndefineSymbol(math, ams, rel, \"\\u2224\", \"\\\\nmid\", true);\ndefineSymbol(math, ams, rel, \"\\u22ac\", \"\\\\nvdash\", true);\ndefineSymbol(math, ams, rel, \"\\u22ad\", \"\\\\nvDash\", true);\ndefineSymbol(math, ams, rel, \"\\u22ea\", \"\\\\ntriangleleft\");\ndefineSymbol(math, ams, rel, \"\\u22ec\", \"\\\\ntrianglelefteq\", true);\ndefineSymbol(math, ams, rel, \"\\u228a\", \"\\\\subsetneq\", true);\ndefineSymbol(math, ams, rel, \"\\ue01a\", \"\\\\@varsubsetneq\");\ndefineSymbol(math, ams, rel, \"\\u2acb\", \"\\\\subsetneqq\", true);\ndefineSymbol(math, ams, rel, \"\\ue017\", \"\\\\@varsubsetneqq\");\ndefineSymbol(math, ams, rel, \"\\u226f\", \"\\\\ngtr\", true);\ndefineSymbol(math, ams, rel, \"\\ue00f\", \"\\\\@ngeqslant\");\ndefineSymbol(math, ams, rel, \"\\ue00e\", \"\\\\@ngeqq\");\ndefineSymbol(math, ams, rel, \"\\u2a88\", \"\\\\gneq\", true);\ndefineSymbol(math, ams, rel, \"\\u2269\", \"\\\\gneqq\", true);\ndefineSymbol(math, ams, rel, \"\\ue00d\", \"\\\\@gvertneqq\");\ndefineSymbol(math, ams, rel, \"\\u22e7\", \"\\\\gnsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2a8a\", \"\\\\gnapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u2281\", \"\\\\nsucc\", true);\n// unicode-math maps \\u22e1 to \\nsucccurlyeq. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u22e1\", \"\\\\nsucceq\", true);\ndefineSymbol(math, ams, rel, \"\\u22e9\", \"\\\\succnsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2aba\", \"\\\\succnapprox\", true);\n// unicode-math maps \\u2246 to \\simneqq. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u2246\", \"\\\\ncong\", true);\ndefineSymbol(math, ams, rel, \"\\ue007\", \"\\\\@nshortparallel\");\ndefineSymbol(math, ams, rel, \"\\u2226\", \"\\\\nparallel\", true);\ndefineSymbol(math, ams, rel, \"\\u22af\", \"\\\\nVDash\", true);\ndefineSymbol(math, ams, rel, \"\\u22eb\", \"\\\\ntriangleright\");\ndefineSymbol(math, ams, rel, \"\\u22ed\", \"\\\\ntrianglerighteq\", true);\ndefineSymbol(math, ams, rel, \"\\ue018\", \"\\\\@nsupseteqq\");\ndefineSymbol(math, ams, rel, \"\\u228b\", \"\\\\supsetneq\", true);\ndefineSymbol(math, ams, rel, \"\\ue01b\", \"\\\\@varsupsetneq\");\ndefineSymbol(math, ams, rel, \"\\u2acc\", \"\\\\supsetneqq\", true);\ndefineSymbol(math, ams, rel, \"\\ue019\", \"\\\\@varsupsetneqq\");\ndefineSymbol(math, ams, rel, \"\\u22ae\", \"\\\\nVdash\", true);\ndefineSymbol(math, ams, rel, \"\\u2ab5\", \"\\\\precneqq\", true);\ndefineSymbol(math, ams, rel, \"\\u2ab6\", \"\\\\succneqq\", true);\ndefineSymbol(math, ams, rel, \"\\ue016\", \"\\\\@nsubseteqq\");\ndefineSymbol(math, ams, bin, \"\\u22b4\", \"\\\\unlhd\");\ndefineSymbol(math, ams, bin, \"\\u22b5\", \"\\\\unrhd\");\n// AMS Negated Arrows\ndefineSymbol(math, ams, rel, \"\\u219a\", \"\\\\nleftarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u219b\", \"\\\\nrightarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21cd\", \"\\\\nLeftarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21cf\", \"\\\\nRightarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21ae\", \"\\\\nleftrightarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21ce\", \"\\\\nLeftrightarrow\", true);\n// AMS Misc\ndefineSymbol(math, ams, rel, \"\\u25b3\", \"\\\\vartriangle\");\ndefineSymbol(math, ams, textord, \"\\u210f\", \"\\\\hslash\");\ndefineSymbol(math, ams, textord, \"\\u25bd\", \"\\\\triangledown\");\ndefineSymbol(math, ams, textord, \"\\u25ca\", \"\\\\lozenge\");\ndefineSymbol(math, ams, textord, \"\\u24c8\", \"\\\\circledS\");\ndefineSymbol(math, ams, textord, \"\\u00ae\", \"\\\\circledR\");\ndefineSymbol(text, ams, textord, \"\\u00ae\", \"\\\\circledR\");\ndefineSymbol(math, ams, textord, \"\\u2221\", \"\\\\measuredangle\", true);\ndefineSymbol(math, ams, textord, \"\\u2204\", \"\\\\nexists\");\ndefineSymbol(math, ams, textord, \"\\u2127\", \"\\\\mho\");\ndefineSymbol(math, ams, textord, \"\\u2132\", \"\\\\Finv\", true);\ndefineSymbol(math, ams, textord, \"\\u2141\", \"\\\\Game\", true);\ndefineSymbol(math, ams, textord, \"\\u2035\", \"\\\\backprime\");\ndefineSymbol(math, ams, textord, \"\\u25b2\", \"\\\\blacktriangle\");\ndefineSymbol(math, ams, textord, \"\\u25bc\", \"\\\\blacktriangledown\");\ndefineSymbol(math, ams, textord, \"\\u25a0\", \"\\\\blacksquare\");\ndefineSymbol(math, ams, textord, \"\\u29eb\", \"\\\\blacklozenge\");\ndefineSymbol(math, ams, textord, \"\\u2605\", \"\\\\bigstar\");\ndefineSymbol(math, ams, textord, \"\\u2222\", \"\\\\sphericalangle\", true);\ndefineSymbol(math, ams, textord, \"\\u2201\", \"\\\\complement\", true);\n// unicode-math maps U+F0 to \\matheth. We map to AMS function \\eth\ndefineSymbol(math, ams, textord, \"\\u00f0\", \"\\\\eth\", true);\ndefineSymbol(text, main, textord, \"\\u00f0\", \"\\u00f0\");\ndefineSymbol(math, ams, textord, \"\\u2571\", \"\\\\diagup\");\ndefineSymbol(math, ams, textord, \"\\u2572\", \"\\\\diagdown\");\ndefineSymbol(math, ams, textord, \"\\u25a1\", \"\\\\square\");\ndefineSymbol(math, ams, textord, \"\\u25a1\", \"\\\\Box\");\ndefineSymbol(math, ams, textord, \"\\u25ca\", \"\\\\Diamond\");\n// unicode-math maps U+A5 to \\mathyen. We map to AMS function \\yen\ndefineSymbol(math, ams, textord, \"\\u00a5\", \"\\\\yen\", true);\ndefineSymbol(text, ams, textord, \"\\u00a5\", \"\\\\yen\", true);\ndefineSymbol(math, ams, textord, \"\\u2713\", \"\\\\checkmark\", true);\ndefineSymbol(text, ams, textord, \"\\u2713\", \"\\\\checkmark\");\n// AMS Hebrew\ndefineSymbol(math, ams, textord, \"\\u2136\", \"\\\\beth\", true);\ndefineSymbol(math, ams, textord, \"\\u2138\", \"\\\\daleth\", true);\ndefineSymbol(math, ams, textord, \"\\u2137\", \"\\\\gimel\", true);\n// AMS Greek\ndefineSymbol(math, ams, textord, \"\\u03dd\", \"\\\\digamma\", true);\ndefineSymbol(math, ams, textord, \"\\u03f0\", \"\\\\varkappa\");\n// AMS Delimiters\ndefineSymbol(math, ams, open, \"\\u250c\", \"\\\\@ulcorner\", true);\ndefineSymbol(math, ams, close, \"\\u2510\", \"\\\\@urcorner\", true);\ndefineSymbol(math, ams, open, \"\\u2514\", \"\\\\@llcorner\", true);\ndefineSymbol(math, ams, close, \"\\u2518\", \"\\\\@lrcorner\", true);\n// AMS Binary Relations\ndefineSymbol(math, ams, rel, \"\\u2266\", \"\\\\leqq\", true);\ndefineSymbol(math, ams, rel, \"\\u2a7d\", \"\\\\leqslant\", true);\ndefineSymbol(math, ams, rel, \"\\u2a95\", \"\\\\eqslantless\", true);\ndefineSymbol(math, ams, rel, \"\\u2272\", \"\\\\lesssim\", true);\ndefineSymbol(math, ams, rel, \"\\u2a85\", \"\\\\lessapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u224a\", \"\\\\approxeq\", true);\ndefineSymbol(math, ams, bin, \"\\u22d6\", \"\\\\lessdot\");\ndefineSymbol(math, ams, rel, \"\\u22d8\", \"\\\\lll\", true);\ndefineSymbol(math, ams, rel, \"\\u2276\", \"\\\\lessgtr\", true);\ndefineSymbol(math, ams, rel, \"\\u22da\", \"\\\\lesseqgtr\", true);\ndefineSymbol(math, ams, rel, \"\\u2a8b\", \"\\\\lesseqqgtr\", true);\ndefineSymbol(math, ams, rel, \"\\u2251\", \"\\\\doteqdot\");\ndefineSymbol(math, ams, rel, \"\\u2253\", \"\\\\risingdotseq\", true);\ndefineSymbol(math, ams, rel, \"\\u2252\", \"\\\\fallingdotseq\", true);\ndefineSymbol(math, ams, rel, \"\\u223d\", \"\\\\backsim\", true);\ndefineSymbol(math, ams, rel, \"\\u22cd\", \"\\\\backsimeq\", true);\ndefineSymbol(math, ams, rel, \"\\u2ac5\", \"\\\\subseteqq\", true);\ndefineSymbol(math, ams, rel, \"\\u22d0\", \"\\\\Subset\", true);\ndefineSymbol(math, ams, rel, \"\\u228f\", \"\\\\sqsubset\", true);\ndefineSymbol(math, ams, rel, \"\\u227c\", \"\\\\preccurlyeq\", true);\ndefineSymbol(math, ams, rel, \"\\u22de\", \"\\\\curlyeqprec\", true);\ndefineSymbol(math, ams, rel, \"\\u227e\", \"\\\\precsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2ab7\", \"\\\\precapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u22b2\", \"\\\\vartriangleleft\");\ndefineSymbol(math, ams, rel, \"\\u22b4\", \"\\\\trianglelefteq\");\ndefineSymbol(math, ams, rel, \"\\u22a8\", \"\\\\vDash\", true);\ndefineSymbol(math, ams, rel, \"\\u22aa\", \"\\\\Vvdash\", true);\ndefineSymbol(math, ams, rel, \"\\u2323\", \"\\\\smallsmile\");\ndefineSymbol(math, ams, rel, \"\\u2322\", \"\\\\smallfrown\");\ndefineSymbol(math, ams, rel, \"\\u224f\", \"\\\\bumpeq\", true);\ndefineSymbol(math, ams, rel, \"\\u224e\", \"\\\\Bumpeq\", true);\ndefineSymbol(math, ams, rel, \"\\u2267\", \"\\\\geqq\", true);\ndefineSymbol(math, ams, rel, \"\\u2a7e\", \"\\\\geqslant\", true);\ndefineSymbol(math, ams, rel, \"\\u2a96\", \"\\\\eqslantgtr\", true);\ndefineSymbol(math, ams, rel, \"\\u2273\", \"\\\\gtrsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2a86\", \"\\\\gtrapprox\", true);\ndefineSymbol(math, ams, bin, \"\\u22d7\", \"\\\\gtrdot\");\ndefineSymbol(math, ams, rel, \"\\u22d9\", \"\\\\ggg\", true);\ndefineSymbol(math, ams, rel, \"\\u2277\", \"\\\\gtrless\", true);\ndefineSymbol(math, ams, rel, \"\\u22db\", \"\\\\gtreqless\", true);\ndefineSymbol(math, ams, rel, \"\\u2a8c\", \"\\\\gtreqqless\", true);\ndefineSymbol(math, ams, rel, \"\\u2256\", \"\\\\eqcirc\", true);\ndefineSymbol(math, ams, rel, \"\\u2257\", \"\\\\circeq\", true);\ndefineSymbol(math, ams, rel, \"\\u225c\", \"\\\\triangleq\", true);\ndefineSymbol(math, ams, rel, \"\\u223c\", \"\\\\thicksim\");\ndefineSymbol(math, ams, rel, \"\\u2248\", \"\\\\thickapprox\");\ndefineSymbol(math, ams, rel, \"\\u2ac6\", \"\\\\supseteqq\", true);\ndefineSymbol(math, ams, rel, \"\\u22d1\", \"\\\\Supset\", true);\ndefineSymbol(math, ams, rel, \"\\u2290\", \"\\\\sqsupset\", true);\ndefineSymbol(math, ams, rel, \"\\u227d\", \"\\\\succcurlyeq\", true);\ndefineSymbol(math, ams, rel, \"\\u22df\", \"\\\\curlyeqsucc\", true);\ndefineSymbol(math, ams, rel, \"\\u227f\", \"\\\\succsim\", true);\ndefineSymbol(math, ams, rel, \"\\u2ab8\", \"\\\\succapprox\", true);\ndefineSymbol(math, ams, rel, \"\\u22b3\", \"\\\\vartriangleright\");\ndefineSymbol(math, ams, rel, \"\\u22b5\", \"\\\\trianglerighteq\");\ndefineSymbol(math, ams, rel, \"\\u22a9\", \"\\\\Vdash\", true);\ndefineSymbol(math, ams, rel, \"\\u2223\", \"\\\\shortmid\");\ndefineSymbol(math, ams, rel, \"\\u2225\", \"\\\\shortparallel\");\ndefineSymbol(math, ams, rel, \"\\u226c\", \"\\\\between\", true);\ndefineSymbol(math, ams, rel, \"\\u22d4\", \"\\\\pitchfork\", true);\ndefineSymbol(math, ams, rel, \"\\u221d\", \"\\\\varpropto\");\ndefineSymbol(math, ams, rel, \"\\u25c0\", \"\\\\blacktriangleleft\");\n// unicode-math says that \\therefore is a mathord atom.\n// We kept the amssymb atom type, which is rel.\ndefineSymbol(math, ams, rel, \"\\u2234\", \"\\\\therefore\", true);\ndefineSymbol(math, ams, rel, \"\\u220d\", \"\\\\backepsilon\");\ndefineSymbol(math, ams, rel, \"\\u25b6\", \"\\\\blacktriangleright\");\n// unicode-math says that \\because is a mathord atom.\n// We kept the amssymb atom type, which is rel.\ndefineSymbol(math, ams, rel, \"\\u2235\", \"\\\\because\", true);\ndefineSymbol(math, ams, rel, \"\\u22d8\", \"\\\\llless\");\ndefineSymbol(math, ams, rel, \"\\u22d9\", \"\\\\gggtr\");\ndefineSymbol(math, ams, bin, \"\\u22b2\", \"\\\\lhd\");\ndefineSymbol(math, ams, bin, \"\\u22b3\", \"\\\\rhd\");\ndefineSymbol(math, ams, rel, \"\\u2242\", \"\\\\eqsim\", true);\ndefineSymbol(math, main, rel, \"\\u22c8\", \"\\\\Join\");\ndefineSymbol(math, ams, rel, \"\\u2251\", \"\\\\Doteq\", true);\n// AMS Binary Operators\ndefineSymbol(math, ams, bin, \"\\u2214\", \"\\\\dotplus\", true);\ndefineSymbol(math, ams, bin, \"\\u2216\", \"\\\\smallsetminus\");\ndefineSymbol(math, ams, bin, \"\\u22d2\", \"\\\\Cap\", true);\ndefineSymbol(math, ams, bin, \"\\u22d3\", \"\\\\Cup\", true);\ndefineSymbol(math, ams, bin, \"\\u2a5e\", \"\\\\doublebarwedge\", true);\ndefineSymbol(math, ams, bin, \"\\u229f\", \"\\\\boxminus\", true);\ndefineSymbol(math, ams, bin, \"\\u229e\", \"\\\\boxplus\", true);\ndefineSymbol(math, ams, bin, \"\\u22c7\", \"\\\\divideontimes\", true);\ndefineSymbol(math, ams, bin, \"\\u22c9\", \"\\\\ltimes\", true);\ndefineSymbol(math, ams, bin, \"\\u22ca\", \"\\\\rtimes\", true);\ndefineSymbol(math, ams, bin, \"\\u22cb\", \"\\\\leftthreetimes\", true);\ndefineSymbol(math, ams, bin, \"\\u22cc\", \"\\\\rightthreetimes\", true);\ndefineSymbol(math, ams, bin, \"\\u22cf\", \"\\\\curlywedge\", true);\ndefineSymbol(math, ams, bin, \"\\u22ce\", \"\\\\curlyvee\", true);\ndefineSymbol(math, ams, bin, \"\\u229d\", \"\\\\circleddash\", true);\ndefineSymbol(math, ams, bin, \"\\u229b\", \"\\\\circledast\", true);\ndefineSymbol(math, ams, bin, \"\\u22c5\", \"\\\\centerdot\");\ndefineSymbol(math, ams, bin, \"\\u22ba\", \"\\\\intercal\", true);\ndefineSymbol(math, ams, bin, \"\\u22d2\", \"\\\\doublecap\");\ndefineSymbol(math, ams, bin, \"\\u22d3\", \"\\\\doublecup\");\ndefineSymbol(math, ams, bin, \"\\u22a0\", \"\\\\boxtimes\", true);\n// AMS Arrows\n// Note: unicode-math maps \\u21e2 to their own function \\rightdasharrow.\n// We'll map it to AMS function \\dashrightarrow. It produces the same atom.\ndefineSymbol(math, ams, rel, \"\\u21e2\", \"\\\\dashrightarrow\", true);\n// unicode-math maps \\u21e0 to \\leftdasharrow. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u21e0\", \"\\\\dashleftarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21c7\", \"\\\\leftleftarrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21c6\", \"\\\\leftrightarrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21da\", \"\\\\Lleftarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u219e\", \"\\\\twoheadleftarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21a2\", \"\\\\leftarrowtail\", true);\ndefineSymbol(math, ams, rel, \"\\u21ab\", \"\\\\looparrowleft\", true);\ndefineSymbol(math, ams, rel, \"\\u21cb\", \"\\\\leftrightharpoons\", true);\ndefineSymbol(math, ams, rel, \"\\u21b6\", \"\\\\curvearrowleft\", true);\n// unicode-math maps \\u21ba to \\acwopencirclearrow. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u21ba\", \"\\\\circlearrowleft\", true);\ndefineSymbol(math, ams, rel, \"\\u21b0\", \"\\\\Lsh\", true);\ndefineSymbol(math, ams, rel, \"\\u21c8\", \"\\\\upuparrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21bf\", \"\\\\upharpoonleft\", true);\ndefineSymbol(math, ams, rel, \"\\u21c3\", \"\\\\downharpoonleft\", true);\ndefineSymbol(math, main, rel, \"\\u22b6\", \"\\\\origof\", true); // not in font\ndefineSymbol(math, main, rel, \"\\u22b7\", \"\\\\imageof\", true); // not in font\ndefineSymbol(math, ams, rel, \"\\u22b8\", \"\\\\multimap\", true);\ndefineSymbol(math, ams, rel, \"\\u21ad\", \"\\\\leftrightsquigarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21c9\", \"\\\\rightrightarrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21c4\", \"\\\\rightleftarrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21a0\", \"\\\\twoheadrightarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21a3\", \"\\\\rightarrowtail\", true);\ndefineSymbol(math, ams, rel, \"\\u21ac\", \"\\\\looparrowright\", true);\ndefineSymbol(math, ams, rel, \"\\u21b7\", \"\\\\curvearrowright\", true);\n// unicode-math maps \\u21bb to \\cwopencirclearrow. We'll use the AMS synonym.\ndefineSymbol(math, ams, rel, \"\\u21bb\", \"\\\\circlearrowright\", true);\ndefineSymbol(math, ams, rel, \"\\u21b1\", \"\\\\Rsh\", true);\ndefineSymbol(math, ams, rel, \"\\u21ca\", \"\\\\downdownarrows\", true);\ndefineSymbol(math, ams, rel, \"\\u21be\", \"\\\\upharpoonright\", true);\ndefineSymbol(math, ams, rel, \"\\u21c2\", \"\\\\downharpoonright\", true);\ndefineSymbol(math, ams, rel, \"\\u21dd\", \"\\\\rightsquigarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21dd\", \"\\\\leadsto\");\ndefineSymbol(math, ams, rel, \"\\u21db\", \"\\\\Rrightarrow\", true);\ndefineSymbol(math, ams, rel, \"\\u21be\", \"\\\\restriction\");\ndefineSymbol(math, main, textord, \"\\u2018\", \"`\");\ndefineSymbol(math, main, textord, \"$\", \"\\\\$\");\ndefineSymbol(text, main, textord, \"$\", \"\\\\$\");\ndefineSymbol(text, main, textord, \"$\", \"\\\\textdollar\");\ndefineSymbol(math, main, textord, \"%\", \"\\\\%\");\ndefineSymbol(text, main, textord, \"%\", \"\\\\%\");\ndefineSymbol(math, main, textord, \"_\", \"\\\\_\");\ndefineSymbol(text, main, textord, \"_\", \"\\\\_\");\ndefineSymbol(text, main, textord, \"_\", \"\\\\textunderscore\");\ndefineSymbol(math, main, textord, \"\\u2220\", \"\\\\angle\", true);\ndefineSymbol(math, main, textord, \"\\u221e\", \"\\\\infty\", true);\ndefineSymbol(math, main, textord, \"\\u2032\", \"\\\\prime\");\ndefineSymbol(math, main, textord, \"\\u25b3\", \"\\\\triangle\");\ndefineSymbol(math, main, textord, \"\\u0393\", \"\\\\Gamma\", true);\ndefineSymbol(math, main, textord, \"\\u0394\", \"\\\\Delta\", true);\ndefineSymbol(math, main, textord, \"\\u0398\", \"\\\\Theta\", true);\ndefineSymbol(math, main, textord, \"\\u039b\", \"\\\\Lambda\", true);\ndefineSymbol(math, main, textord, \"\\u039e\", \"\\\\Xi\", true);\ndefineSymbol(math, main, textord, \"\\u03a0\", \"\\\\Pi\", true);\ndefineSymbol(math, main, textord, \"\\u03a3\", \"\\\\Sigma\", true);\ndefineSymbol(math, main, textord, \"\\u03a5\", \"\\\\Upsilon\", true);\ndefineSymbol(math, main, textord, \"\\u03a6\", \"\\\\Phi\", true);\ndefineSymbol(math, main, textord, \"\\u03a8\", \"\\\\Psi\", true);\ndefineSymbol(math, main, textord, \"\\u03a9\", \"\\\\Omega\", true);\ndefineSymbol(math, main, textord, \"A\", \"\\u0391\");\ndefineSymbol(math, main, textord, \"B\", \"\\u0392\");\ndefineSymbol(math, main, textord, \"E\", \"\\u0395\");\ndefineSymbol(math, main, textord, \"Z\", \"\\u0396\");\ndefineSymbol(math, main, textord, \"H\", \"\\u0397\");\ndefineSymbol(math, main, textord, \"I\", \"\\u0399\");\ndefineSymbol(math, main, textord, \"K\", \"\\u039A\");\ndefineSymbol(math, main, textord, \"M\", \"\\u039C\");\ndefineSymbol(math, main, textord, \"N\", \"\\u039D\");\ndefineSymbol(math, main, textord, \"O\", \"\\u039F\");\ndefineSymbol(math, main, textord, \"P\", \"\\u03A1\");\ndefineSymbol(math, main, textord, \"T\", \"\\u03A4\");\ndefineSymbol(math, main, textord, \"X\", \"\\u03A7\");\ndefineSymbol(math, main, textord, \"\\u00ac\", \"\\\\neg\", true);\ndefineSymbol(math, main, textord, \"\\u00ac\", \"\\\\lnot\");\ndefineSymbol(math, main, textord, \"\\u22a4\", \"\\\\top\");\ndefineSymbol(math, main, textord, \"\\u22a5\", \"\\\\bot\");\ndefineSymbol(math, main, textord, \"\\u2205\", \"\\\\emptyset\");\ndefineSymbol(math, ams, textord, \"\\u2205\", \"\\\\varnothing\");\ndefineSymbol(math, main, mathord, \"\\u03b1\", \"\\\\alpha\", true);\ndefineSymbol(math, main, mathord, \"\\u03b2\", \"\\\\beta\", true);\ndefineSymbol(math, main, mathord, \"\\u03b3\", \"\\\\gamma\", true);\ndefineSymbol(math, main, mathord, \"\\u03b4\", \"\\\\delta\", true);\ndefineSymbol(math, main, mathord, \"\\u03f5\", \"\\\\epsilon\", true);\ndefineSymbol(math, main, mathord, \"\\u03b6\", \"\\\\zeta\", true);\ndefineSymbol(math, main, mathord, \"\\u03b7\", \"\\\\eta\", true);\ndefineSymbol(math, main, mathord, \"\\u03b8\", \"\\\\theta\", true);\ndefineSymbol(math, main, mathord, \"\\u03b9\", \"\\\\iota\", true);\ndefineSymbol(math, main, mathord, \"\\u03ba\", \"\\\\kappa\", true);\ndefineSymbol(math, main, mathord, \"\\u03bb\", \"\\\\lambda\", true);\ndefineSymbol(math, main, mathord, \"\\u03bc\", \"\\\\mu\", true);\ndefineSymbol(math, main, mathord, \"\\u03bd\", \"\\\\nu\", true);\ndefineSymbol(math, main, mathord, \"\\u03be\", \"\\\\xi\", true);\ndefineSymbol(math, main, mathord, \"\\u03bf\", \"\\\\omicron\", true);\ndefineSymbol(math, main, mathord, \"\\u03c0\", \"\\\\pi\", true);\ndefineSymbol(math, main, mathord, \"\\u03c1\", \"\\\\rho\", true);\ndefineSymbol(math, main, mathord, \"\\u03c3\", \"\\\\sigma\", true);\ndefineSymbol(math, main, mathord, \"\\u03c4\", \"\\\\tau\", true);\ndefineSymbol(math, main, mathord, \"\\u03c5\", \"\\\\upsilon\", true);\ndefineSymbol(math, main, mathord, \"\\u03d5\", \"\\\\phi\", true);\ndefineSymbol(math, main, mathord, \"\\u03c7\", \"\\\\chi\", true);\ndefineSymbol(math, main, mathord, \"\\u03c8\", \"\\\\psi\", true);\ndefineSymbol(math, main, mathord, \"\\u03c9\", \"\\\\omega\", true);\ndefineSymbol(math, main, mathord, \"\\u03b5\", \"\\\\varepsilon\", true);\ndefineSymbol(math, main, mathord, \"\\u03d1\", \"\\\\vartheta\", true);\ndefineSymbol(math, main, mathord, \"\\u03d6\", \"\\\\varpi\", true);\ndefineSymbol(math, main, mathord, \"\\u03f1\", \"\\\\varrho\", true);\ndefineSymbol(math, main, mathord, \"\\u03c2\", \"\\\\varsigma\", true);\ndefineSymbol(math, main, mathord, \"\\u03c6\", \"\\\\varphi\", true);\ndefineSymbol(math, main, bin, \"\\u2217\", \"*\", true);\ndefineSymbol(math, main, bin, \"+\", \"+\");\ndefineSymbol(math, main, bin, \"\\u2212\", \"-\", true);\ndefineSymbol(math, main, bin, \"\\u22c5\", \"\\\\cdot\", true);\ndefineSymbol(math, main, bin, \"\\u2218\", \"\\\\circ\", true);\ndefineSymbol(math, main, bin, \"\\u00f7\", \"\\\\div\", true);\ndefineSymbol(math, main, bin, \"\\u00b1\", \"\\\\pm\", true);\ndefineSymbol(math, main, bin, \"\\u00d7\", \"\\\\times\", true);\ndefineSymbol(math, main, bin, \"\\u2229\", \"\\\\cap\", true);\ndefineSymbol(math, main, bin, \"\\u222a\", \"\\\\cup\", true);\ndefineSymbol(math, main, bin, \"\\u2216\", \"\\\\setminus\", true);\ndefineSymbol(math, main, bin, \"\\u2227\", \"\\\\land\");\ndefineSymbol(math, main, bin, \"\\u2228\", \"\\\\lor\");\ndefineSymbol(math, main, bin, \"\\u2227\", \"\\\\wedge\", true);\ndefineSymbol(math, main, bin, \"\\u2228\", \"\\\\vee\", true);\ndefineSymbol(math, main, textord, \"\\u221a\", \"\\\\surd\");\ndefineSymbol(math, main, open, \"\\u27e8\", \"\\\\langle\", true);\ndefineSymbol(math, main, open, \"\\u2223\", \"\\\\lvert\");\ndefineSymbol(math, main, open, \"\\u2225\", \"\\\\lVert\");\ndefineSymbol(math, main, close, \"?\", \"?\");\ndefineSymbol(math, main, close, \"!\", \"!\");\ndefineSymbol(math, main, close, \"\\u27e9\", \"\\\\rangle\", true);\ndefineSymbol(math, main, close, \"\\u2223\", \"\\\\rvert\");\ndefineSymbol(math, main, close, \"\\u2225\", \"\\\\rVert\");\ndefineSymbol(math, main, rel, \"=\", \"=\");\ndefineSymbol(math, main, rel, \":\", \":\");\ndefineSymbol(math, main, rel, \"\\u2248\", \"\\\\approx\", true);\ndefineSymbol(math, main, rel, \"\\u2245\", \"\\\\cong\", true);\ndefineSymbol(math, main, rel, \"\\u2265\", \"\\\\ge\");\ndefineSymbol(math, main, rel, \"\\u2265\", \"\\\\geq\", true);\ndefineSymbol(math, main, rel, \"\\u2190\", \"\\\\gets\");\ndefineSymbol(math, main, rel, \">\", \"\\\\gt\", true);\ndefineSymbol(math, main, rel, \"\\u2208\", \"\\\\in\", true);\ndefineSymbol(math, main, rel, \"\\ue020\", \"\\\\@not\");\ndefineSymbol(math, main, rel, \"\\u2282\", \"\\\\subset\", true);\ndefineSymbol(math, main, rel, \"\\u2283\", \"\\\\supset\", true);\ndefineSymbol(math, main, rel, \"\\u2286\", \"\\\\subseteq\", true);\ndefineSymbol(math, main, rel, \"\\u2287\", \"\\\\supseteq\", true);\ndefineSymbol(math, ams, rel, \"\\u2288\", \"\\\\nsubseteq\", true);\ndefineSymbol(math, ams, rel, \"\\u2289\", \"\\\\nsupseteq\", true);\ndefineSymbol(math, main, rel, \"\\u22a8\", \"\\\\models\");\ndefineSymbol(math, main, rel, \"\\u2190\", \"\\\\leftarrow\", true);\ndefineSymbol(math, main, rel, \"\\u2264\", \"\\\\le\");\ndefineSymbol(math, main, rel, \"\\u2264\", \"\\\\leq\", true);\ndefineSymbol(math, main, rel, \"<\", \"\\\\lt\", true);\ndefineSymbol(math, main, rel, \"\\u2192\", \"\\\\rightarrow\", true);\ndefineSymbol(math, main, rel, \"\\u2192\", \"\\\\to\");\ndefineSymbol(math, ams, rel, \"\\u2271\", \"\\\\ngeq\", true);\ndefineSymbol(math, ams, rel, \"\\u2270\", \"\\\\nleq\", true);\ndefineSymbol(math, main, spacing, \"\\u00a0\", \"\\\\ \");\ndefineSymbol(math, main, spacing, \"\\u00a0\", \"\\\\space\");\n// Ref: LaTeX Source 2e: \\DeclareRobustCommand{\\nobreakspace}{%\ndefineSymbol(math, main, spacing, \"\\u00a0\", \"\\\\nobreakspace\");\ndefineSymbol(text, main, spacing, \"\\u00a0\", \"\\\\ \");\ndefineSymbol(text, main, spacing, \"\\u00a0\", \" \");\ndefineSymbol(text, main, spacing, \"\\u00a0\", \"\\\\space\");\ndefineSymbol(text, main, spacing, \"\\u00a0\", \"\\\\nobreakspace\");\ndefineSymbol(math, main, spacing, \"\", \"\\\\nobreak\");\ndefineSymbol(math, main, spacing, \"\", \"\\\\allowbreak\");\ndefineSymbol(math, main, punct, \",\", \",\");\ndefineSymbol(math, main, punct, \";\", \";\");\ndefineSymbol(math, ams, bin, \"\\u22bc\", \"\\\\barwedge\", true);\ndefineSymbol(math, ams, bin, \"\\u22bb\", \"\\\\veebar\", true);\ndefineSymbol(math, main, bin, \"\\u2299\", \"\\\\odot\", true);\ndefineSymbol(math, main, bin, \"\\u2295\", \"\\\\oplus\", true);\ndefineSymbol(math, main, bin, \"\\u2297\", \"\\\\otimes\", true);\ndefineSymbol(math, main, textord, \"\\u2202\", \"\\\\partial\", true);\ndefineSymbol(math, main, bin, \"\\u2298\", \"\\\\oslash\", true);\ndefineSymbol(math, ams, bin, \"\\u229a\", \"\\\\circledcirc\", true);\ndefineSymbol(math, ams, bin, \"\\u22a1\", \"\\\\boxdot\", true);\ndefineSymbol(math, main, bin, \"\\u25b3\", \"\\\\bigtriangleup\");\ndefineSymbol(math, main, bin, \"\\u25bd\", \"\\\\bigtriangledown\");\ndefineSymbol(math, main, bin, \"\\u2020\", \"\\\\dagger\");\ndefineSymbol(math, main, bin, \"\\u22c4\", \"\\\\diamond\");\ndefineSymbol(math, main, bin, \"\\u22c6\", \"\\\\star\");\ndefineSymbol(math, main, bin, \"\\u25c3\", \"\\\\triangleleft\");\ndefineSymbol(math, main, bin, \"\\u25b9\", \"\\\\triangleright\");\ndefineSymbol(math, main, open, \"{\", \"\\\\{\");\ndefineSymbol(text, main, textord, \"{\", \"\\\\{\");\ndefineSymbol(text, main, textord, \"{\", \"\\\\textbraceleft\");\ndefineSymbol(math, main, close, \"}\", \"\\\\}\");\ndefineSymbol(text, main, textord, \"}\", \"\\\\}\");\ndefineSymbol(text, main, textord, \"}\", \"\\\\textbraceright\");\ndefineSymbol(math, main, open, \"{\", \"\\\\lbrace\");\ndefineSymbol(math, main, close, \"}\", \"\\\\rbrace\");\ndefineSymbol(math, main, open, \"[\", \"\\\\lbrack\", true);\ndefineSymbol(text, main, textord, \"[\", \"\\\\lbrack\", true);\ndefineSymbol(math, main, close, \"]\", \"\\\\rbrack\", true);\ndefineSymbol(text, main, textord, \"]\", \"\\\\rbrack\", true);\ndefineSymbol(math, main, open, \"(\", \"\\\\lparen\", true);\ndefineSymbol(math, main, close, \")\", \"\\\\rparen\", true);\ndefineSymbol(text, main, textord, \"<\", \"\\\\textless\", true); // in T1 fontenc\ndefineSymbol(text, main, textord, \">\", \"\\\\textgreater\", true); // in T1 fontenc\ndefineSymbol(math, main, open, \"\\u230a\", \"\\\\lfloor\", true);\ndefineSymbol(math, main, close, \"\\u230b\", \"\\\\rfloor\", true);\ndefineSymbol(math, main, open, \"\\u2308\", \"\\\\lceil\", true);\ndefineSymbol(math, main, close, \"\\u2309\", \"\\\\rceil\", true);\ndefineSymbol(math, main, textord, \"\\\\\", \"\\\\backslash\");\ndefineSymbol(math, main, textord, \"\\u2223\", \"|\");\ndefineSymbol(math, main, textord, \"\\u2223\", \"\\\\vert\");\ndefineSymbol(text, main, textord, \"|\", \"\\\\textbar\", true); // in T1 fontenc\ndefineSymbol(math, main, textord, \"\\u2225\", \"\\\\|\");\ndefineSymbol(math, main, textord, \"\\u2225\", \"\\\\Vert\");\ndefineSymbol(text, main, textord, \"\\u2225\", \"\\\\textbardbl\");\ndefineSymbol(text, main, textord, \"~\", \"\\\\textasciitilde\");\ndefineSymbol(text, main, textord, \"\\\\\", \"\\\\textbackslash\");\ndefineSymbol(text, main, textord, \"^\", \"\\\\textasciicircum\");\ndefineSymbol(math, main, rel, \"\\u2191\", \"\\\\uparrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d1\", \"\\\\Uparrow\", true);\ndefineSymbol(math, main, rel, \"\\u2193\", \"\\\\downarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d3\", \"\\\\Downarrow\", true);\ndefineSymbol(math, main, rel, \"\\u2195\", \"\\\\updownarrow\", true);\ndefineSymbol(math, main, rel, \"\\u21d5\", \"\\\\Updownarrow\", true);\ndefineSymbol(math, main, op, \"\\u2210\", \"\\\\coprod\");\ndefineSymbol(math, main, op, \"\\u22c1\", \"\\\\bigvee\");\ndefineSymbol(math, main, op, \"\\u22c0\", \"\\\\bigwedge\");\ndefineSymbol(math, main, op, \"\\u2a04\", \"\\\\biguplus\");\ndefineSymbol(math, main, op, \"\\u22c2\", \"\\\\bigcap\");\ndefineSymbol(math, main, op, \"\\u22c3\", \"\\\\bigcup\");\ndefineSymbol(math, main, op, \"\\u222b\", \"\\\\int\");\ndefineSymbol(math, main, op, \"\\u222b\", \"\\\\intop\");\ndefineSymbol(math, main, op, \"\\u222c\", \"\\\\iint\");\ndefineSymbol(math, main, op, \"\\u222d\", \"\\\\iiint\");\ndefineSymbol(math, main, op, \"\\u220f\", \"\\\\prod\");\ndefineSymbol(math, main, op, \"\\u2211\", \"\\\\sum\");\ndefineSymbol(math, main, op, \"\\u2a02\", \"\\\\bigotimes\");\ndefineSymbol(math, main, op, \"\\u2a01\", \"\\\\bigoplus\");\ndefineSymbol(math, main, op, \"\\u2a00\", \"\\\\bigodot\");\ndefineSymbol(math, main, op, \"\\u222e\", \"\\\\oint\");\ndefineSymbol(math, main, op, \"\\u222f\", \"\\\\oiint\");\ndefineSymbol(math, main, op, \"\\u2230\", \"\\\\oiiint\");\ndefineSymbol(math, main, op, \"\\u2a06\", \"\\\\bigsqcup\");\ndefineSymbol(math, main, op, \"\\u222b\", \"\\\\smallint\");\ndefineSymbol(text, main, inner, \"\\u2026\", \"\\\\textellipsis\");\ndefineSymbol(math, main, inner, \"\\u2026\", \"\\\\mathellipsis\");\ndefineSymbol(text, main, inner, \"\\u2026\", \"\\\\ldots\", true);\ndefineSymbol(math, main, inner, \"\\u2026\", \"\\\\ldots\", true);\ndefineSymbol(math, main, inner, \"\\u22ef\", \"\\\\@cdots\", true);\ndefineSymbol(math, main, inner, \"\\u22f1\", \"\\\\ddots\", true);\n// \\vdots is a macro that uses one of these two symbols (with made-up names):\ndefineSymbol(math, main, textord, \"\\u22ee\", \"\\\\varvdots\");\ndefineSymbol(text, main, textord, \"\\u22ee\", \"\\\\varvdots\");\ndefineSymbol(math, main, accent, \"\\u02ca\", \"\\\\acute\");\ndefineSymbol(math, main, accent, \"\\u02cb\", \"\\\\grave\");\ndefineSymbol(math, main, accent, \"\\u00a8\", \"\\\\ddot\");\ndefineSymbol(math, main, accent, \"\\u007e\", \"\\\\tilde\");\ndefineSymbol(math, main, accent, \"\\u02c9\", \"\\\\bar\");\ndefineSymbol(math, main, accent, \"\\u02d8\", \"\\\\breve\");\ndefineSymbol(math, main, accent, \"\\u02c7\", \"\\\\check\");\ndefineSymbol(math, main, accent, \"\\u005e\", \"\\\\hat\");\ndefineSymbol(math, main, accent, \"\\u20d7\", \"\\\\vec\");\ndefineSymbol(math, main, accent, \"\\u02d9\", \"\\\\dot\");\ndefineSymbol(math, main, accent, \"\\u02da\", \"\\\\mathring\");\n// \\imath and \\jmath should be invariant to \\mathrm, \\mathbf, etc., so use PUA\ndefineSymbol(math, main, mathord, \"\\ue131\", \"\\\\@imath\");\ndefineSymbol(math, main, mathord, \"\\ue237\", \"\\\\@jmath\");\ndefineSymbol(math, main, textord, \"\\u0131\", \"\\u0131\");\ndefineSymbol(math, main, textord, \"\\u0237\", \"\\u0237\");\ndefineSymbol(text, main, textord, \"\\u0131\", \"\\\\i\", true);\ndefineSymbol(text, main, textord, \"\\u0237\", \"\\\\j\", true);\ndefineSymbol(text, main, textord, \"\\u00df\", \"\\\\ss\", true);\ndefineSymbol(text, main, textord, \"\\u00e6\", \"\\\\ae\", true);\ndefineSymbol(text, main, textord, \"\\u0153\", \"\\\\oe\", true);\ndefineSymbol(text, main, textord, \"\\u00f8\", \"\\\\o\", true);\ndefineSymbol(text, main, textord, \"\\u00c6\", \"\\\\AE\", true);\ndefineSymbol(text, main, textord, \"\\u0152\", \"\\\\OE\", true);\ndefineSymbol(text, main, textord, \"\\u00d8\", \"\\\\O\", true);\ndefineSymbol(text, main, accent, \"\\u02ca\", \"\\\\'\"); // acute\ndefineSymbol(text, main, accent, \"\\u02cb\", \"\\\\`\"); // grave\ndefineSymbol(text, main, accent, \"\\u02c6\", \"\\\\^\"); // circumflex\ndefineSymbol(text, main, accent, \"\\u02dc\", \"\\\\~\"); // tilde\ndefineSymbol(text, main, accent, \"\\u02c9\", \"\\\\=\"); // macron\ndefineSymbol(text, main, accent, \"\\u02d8\", \"\\\\u\"); // breve\ndefineSymbol(text, main, accent, \"\\u02d9\", \"\\\\.\"); // dot above\ndefineSymbol(text, main, accent, \"\\u00b8\", \"\\\\c\"); // cedilla\ndefineSymbol(text, main, accent, \"\\u02da\", \"\\\\r\"); // ring above\ndefineSymbol(text, main, accent, \"\\u02c7\", \"\\\\v\"); // caron\ndefineSymbol(text, main, accent, \"\\u00a8\", '\\\\\"'); // diaeresis\ndefineSymbol(text, main, accent, \"\\u02dd\", \"\\\\H\"); // double acute\ndefineSymbol(text, main, accent, \"\\u25ef\", \"\\\\textcircled\"); // \\bigcirc glyph\n// These ligatures are detected and created in Parser.js's `formLigatures`.\nvar ligatures = {\n \"--\": true,\n \"---\": true,\n \"``\": true,\n \"''\": true\n};\ndefineSymbol(text, main, textord, \"\\u2013\", \"--\", true);\ndefineSymbol(text, main, textord, \"\\u2013\", \"\\\\textendash\");\ndefineSymbol(text, main, textord, \"\\u2014\", \"---\", true);\ndefineSymbol(text, main, textord, \"\\u2014\", \"\\\\textemdash\");\ndefineSymbol(text, main, textord, \"\\u2018\", \"`\", true);\ndefineSymbol(text, main, textord, \"\\u2018\", \"\\\\textquoteleft\");\ndefineSymbol(text, main, textord, \"\\u2019\", \"'\", true);\ndefineSymbol(text, main, textord, \"\\u2019\", \"\\\\textquoteright\");\ndefineSymbol(text, main, textord, \"\\u201c\", \"``\", true);\ndefineSymbol(text, main, textord, \"\\u201c\", \"\\\\textquotedblleft\");\ndefineSymbol(text, main, textord, \"\\u201d\", \"''\", true);\ndefineSymbol(text, main, textord, \"\\u201d\", \"\\\\textquotedblright\");\n// \\degree from gensymb package\ndefineSymbol(math, main, textord, \"\\u00b0\", \"\\\\degree\", true);\ndefineSymbol(text, main, textord, \"\\u00b0\", \"\\\\degree\");\n// \\textdegree from inputenc package\ndefineSymbol(text, main, textord, \"\\u00b0\", \"\\\\textdegree\", true);\n// TODO: In LaTeX, \\pounds can generate a different character in text and math\n// mode, but among our fonts, only Main-Regular defines this character \"163\".\ndefineSymbol(math, main, textord, \"\\u00a3\", \"\\\\pounds\");\ndefineSymbol(math, main, textord, \"\\u00a3\", \"\\\\mathsterling\", true);\ndefineSymbol(text, main, textord, \"\\u00a3\", \"\\\\pounds\");\ndefineSymbol(text, main, textord, \"\\u00a3\", \"\\\\textsterling\", true);\ndefineSymbol(math, ams, textord, \"\\u2720\", \"\\\\maltese\");\ndefineSymbol(text, ams, textord, \"\\u2720\", \"\\\\maltese\");\n// There are lots of symbols which are the same, so we add them in afterwards.\n// All of these are textords in math mode\nvar mathTextSymbols = \"0123456789/@.\\\"\";\nfor (var i = 0; i < mathTextSymbols.length; i++) {\n var ch = mathTextSymbols.charAt(i);\n defineSymbol(math, main, textord, ch, ch);\n}\n// All of these are textords in text mode\nvar textSymbols = \"0123456789!@*()-=+\\\";:?/.,\";\nfor (var _i = 0; _i < textSymbols.length; _i++) {\n var _ch = textSymbols.charAt(_i);\n defineSymbol(text, main, textord, _ch, _ch);\n}\n// All of these are textords in text mode, and mathords in math mode\nvar letters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nfor (var _i2 = 0; _i2 < letters.length; _i2++) {\n var _ch2 = letters.charAt(_i2);\n defineSymbol(math, main, mathord, _ch2, _ch2);\n defineSymbol(text, main, textord, _ch2, _ch2);\n}\n// Blackboard bold and script letters in Unicode range\ndefineSymbol(math, ams, textord, \"C\", \"\\u2102\"); // blackboard bold\ndefineSymbol(text, ams, textord, \"C\", \"\\u2102\");\ndefineSymbol(math, ams, textord, \"H\", \"\\u210D\");\ndefineSymbol(text, ams, textord, \"H\", \"\\u210D\");\ndefineSymbol(math, ams, textord, \"N\", \"\\u2115\");\ndefineSymbol(text, ams, textord, \"N\", \"\\u2115\");\ndefineSymbol(math, ams, textord, \"P\", \"\\u2119\");\ndefineSymbol(text, ams, textord, \"P\", \"\\u2119\");\ndefineSymbol(math, ams, textord, \"Q\", \"\\u211A\");\ndefineSymbol(text, ams, textord, \"Q\", \"\\u211A\");\ndefineSymbol(math, ams, textord, \"R\", \"\\u211D\");\ndefineSymbol(text, ams, textord, \"R\", \"\\u211D\");\ndefineSymbol(math, ams, textord, \"Z\", \"\\u2124\");\ndefineSymbol(text, ams, textord, \"Z\", \"\\u2124\");\ndefineSymbol(math, main, mathord, \"h\", \"\\u210E\"); // italic h, Planck constant\ndefineSymbol(text, main, mathord, \"h\", \"\\u210E\");\n// The next loop loads wide (surrogate pair) characters.\n// We support some letters in the Unicode range U+1D400 to U+1D7FF,\n// Mathematical Alphanumeric Symbols.\n// Some editors do not deal well with wide characters. So don't write the\n// string into this file. Instead, create the string from the surrogate pair.\nvar wideChar;\nfor (var _i3 = 0; _i3 < letters.length; _i3++) {\n var _ch3 = letters.charAt(_i3);\n // The hex numbers in the next line are a surrogate pair.\n // 0xD835 is the high surrogate for all letters in the range we support.\n // 0xDC00 is the low surrogate for bold A.\n wideChar = String.fromCharCode(0xD835, 0xDC00 + _i3); // A-Z a-z bold\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDC34 + _i3); // A-Z a-z italic\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDC68 + _i3); // A-Z a-z bold italic\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fraktur\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDD6C + _i3); // A-Z a-z bold Fraktur\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDDA0 + _i3); // A-Z a-z sans-serif\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDDD4 + _i3); // A-Z a-z sans bold\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDE08 + _i3); // A-Z a-z sans italic\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDE70 + _i3); // A-Z a-z monospace\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n if (_i3 < 26) {\n // KaTeX fonts have only capital letters for blackboard bold and script.\n // See exception for k below.\n wideChar = String.fromCharCode(0xD835, 0xDD38 + _i3); // A-Z double struck\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDC9C + _i3); // A-Z script\n defineSymbol(math, main, mathord, _ch3, wideChar);\n defineSymbol(text, main, textord, _ch3, wideChar);\n }\n // TODO: Add bold script when it is supported by a KaTeX font.\n}\n// \"k\" is the only double struck lower case letter in the KaTeX fonts.\nwideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck\ndefineSymbol(math, main, mathord, \"k\", wideChar);\ndefineSymbol(text, main, textord, \"k\", wideChar);\n// Next, some wide character numerals\nfor (var _i4 = 0; _i4 < 10; _i4++) {\n var _ch4 = _i4.toString();\n wideChar = String.fromCharCode(0xD835, 0xDFCE + _i4); // 0-9 bold\n defineSymbol(math, main, mathord, _ch4, wideChar);\n defineSymbol(text, main, textord, _ch4, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDFE2 + _i4); // 0-9 sans serif\n defineSymbol(math, main, mathord, _ch4, wideChar);\n defineSymbol(text, main, textord, _ch4, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDFEC + _i4); // 0-9 bold sans\n defineSymbol(math, main, mathord, _ch4, wideChar);\n defineSymbol(text, main, textord, _ch4, wideChar);\n wideChar = String.fromCharCode(0xD835, 0xDFF6 + _i4); // 0-9 monospace\n defineSymbol(math, main, mathord, _ch4, wideChar);\n defineSymbol(text, main, textord, _ch4, wideChar);\n}\n// We add these Latin-1 letters as symbols for backwards-compatibility,\n// but they are not actually in the font, nor are they supported by the\n// Unicode accent mechanism, so they fall back to Times font and look ugly.\n// TODO(edemaine): Fix this.\nvar extraLatin = \"\\u00d0\\u00de\\u00fe\";\nfor (var _i5 = 0; _i5 < extraLatin.length; _i5++) {\n var _ch5 = extraLatin.charAt(_i5);\n defineSymbol(math, main, mathord, _ch5, _ch5);\n defineSymbol(text, main, textord, _ch5, _ch5);\n}\n\n/**\n * This file provides support for Unicode range U+1D400 to U+1D7FF,\n * Mathematical Alphanumeric Symbols.\n *\n * Function wideCharacterFont takes a wide character as input and returns\n * the font information necessary to render it properly.\n */\nvar boldUpright = {\n mathClass: \"mathbf\",\n textClass: \"textbf\",\n font: \"Main-Bold\"\n};\nvar italic = {\n mathClass: \"mathnormal\",\n textClass: \"textit\",\n font: \"Math-Italic\"\n};\nvar boldItalic = {\n mathClass: \"boldsymbol\",\n textClass: \"boldsymbol\",\n font: \"Main-BoldItalic\"\n};\nvar script = {\n mathClass: \"mathscr\",\n textClass: \"textscr\",\n font: \"Script-Regular\"\n};\nvar noFont = {\n mathClass: \"\",\n textClass: \"\",\n font: \"\"\n};\nvar fraktur = {\n mathClass: \"mathfrak\",\n textClass: \"textfrak\",\n font: \"Fraktur-Regular\"\n};\nvar doubleStruck = {\n mathClass: \"mathbb\",\n textClass: \"textbb\",\n font: \"AMS-Regular\"\n};\nvar boldFraktur = {\n mathClass: \"mathboldfrak\",\n textClass: \"textboldfrak\",\n font: \"Fraktur-Regular\"\n};\nvar sansSerif = {\n mathClass: \"mathsf\",\n textClass: \"textsf\",\n font: \"SansSerif-Regular\"\n};\nvar boldSansSerif = {\n mathClass: \"mathboldsf\",\n textClass: \"textboldsf\",\n font: \"SansSerif-Bold\"\n};\nvar italicSansSerif = {\n mathClass: \"mathitsf\",\n textClass: \"textitsf\",\n font: \"SansSerif-Italic\"\n};\nvar monospace = {\n mathClass: \"mathtt\",\n textClass: \"texttt\",\n font: \"Typewriter-Regular\"\n};\n/**\n * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf\n * That document sorts characters into groups by font type, say bold or italic.\n *\n * In the arrays below, each object consists of three properties:\n * * The CSS class of that group when in math mode.\n * * The CSS class of that group when in text mode.\n * * The font name, so that KaTeX can get font metrics.\n */\nvar wideLatinLetterData = [boldUpright, boldUpright,\n// A-Z, a-z\nitalic, italic,\n// A-Z, a-z\nboldItalic, boldItalic,\n// A-Z, a-z\n// Map fancy A-Z letters to script, not calligraphic.\n// This aligns with unicode-math and math fonts (except Cambria Math).\nscript, noFont,\n// A-Z script, a-z — no font\nnoFont, noFont,\n// A-Z bold script, a-z bold script — no font\nfraktur, fraktur,\n// A-Z, a-z\ndoubleStruck, doubleStruck,\n// A-Z double-struck, k double-struck\n// Note that we are using a bold font, but font metrics for regular Fraktur.\nboldFraktur, boldFraktur,\n// A-Z, a-z\nsansSerif, sansSerif,\n// A-Z, a-z\nboldSansSerif, boldSansSerif,\n// A-Z, a-z\nitalicSansSerif, italicSansSerif,\n// A-Z, a-z\nnoFont, noFont,\n// A-Z bold italic sans, a-z bold italic sans - no font\nmonospace, monospace // A-Z, a-z\n];\nvar wideNumeralData = [boldUpright,\n// 0-9\nnoFont,\n// 0-9 double-struck. No KaTeX font.\nsansSerif,\n// 0-9\nboldSansSerif,\n// 0-9\nmonospace // 0-9\n];\nvar wideCharacterFont = wideChar => {\n // IE doesn't support codePointAt(). So work with the surrogate pair.\n var H = wideChar.charCodeAt(0); // high surrogate\n var L = wideChar.charCodeAt(1); // low surrogate\n var codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000;\n if (0x1D400 <= codePoint && codePoint < 0x1D6A4) {\n // wideLatinLetterData contains exactly 26 chars on each row.\n // So we can calculate the relevant row. No traverse necessary.\n var i = Math.floor((codePoint - 0x1D400) / 26);\n return wideLatinLetterData[i];\n } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {\n // Numerals, ten per row.\n var _i = Math.floor((codePoint - 0x1D7CE) / 10);\n return wideNumeralData[_i];\n } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {\n // dotless i or j\n return wideLatinLetterData[0];\n } else if (0x1D6A6 < codePoint && codePoint < 0x1D7CE) {\n // Greek letters. Not supported, yet.\n return noFont;\n } else {\n // We don't support any wide characters outside 1D400–1D7FF.\n throw new ParseError(\"Unsupported character: \" + wideChar);\n }\n};\n\nfunction handleStrict(params) {\n var strict = params.strict,\n errorCode = params.errorCode,\n errorMsg = params.errorMsg,\n token = params.token,\n report = params.report;\n var behavior = strict;\n if (typeof strict === \"function\") {\n if (report) {\n behavior = strict(errorCode, errorMsg, token);\n } else {\n try {\n behavior = strict(errorCode, errorMsg, token);\n } catch (error) {\n behavior = \"error\";\n }\n }\n }\n switch (behavior) {\n case true:\n case \"error\":\n if (report) {\n throw new ParseError(\"LaTeX-incompatible input and strict mode is set to 'error': \" + (errorMsg + \" [\" + errorCode + \"]\"), token);\n } else {\n return true;\n }\n case false:\n case \"ignore\":\n if (!report) {\n return false;\n }\n break;\n case \"warn\":\n default:\n typeof console !== \"undefined\" && console.warn(\"LaTeX-incompatible input and strict mode is set to 'warn': \" + (errorMsg + \" [\" + errorCode + \"]\"));\n if (!report) {\n return false;\n }\n break;\n }\n}\n\n/**\n * This module contains general functions that can be used for building\n * different kinds of domTree nodes in a consistent manner.\n */\n/**\n * Looks up the given symbol in fontMetrics, after applying any symbol\n * replacements defined in symbol.js\n */\nvar lookupSymbol = function lookupSymbol(value, fontName, mode) {\n // Replace the value with its replaced value from symbol.js\n if (symbols[mode][value]) {\n var replacement = symbols[mode][value].replace;\n if (replacement) {\n value = replacement;\n }\n }\n return {\n value,\n metrics: getCharacterMetrics(value, fontName, mode)\n };\n};\n/**\n * Makes a symbolNode after translation via the list of symbols in symbols.js.\n * Correctly pulls out metrics for the character, and optionally takes a list of\n * classes to be attached to the node.\n *\n * TODO: make argument order closer to makeSpan\n * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which\n * should if present come first in `classes`.\n */\nvar makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {\n var lookup = lookupSymbol(value, fontName, mode);\n var metrics = lookup.metrics;\n value = lookup.value;\n var symbolNode;\n if (metrics) {\n var italic = metrics.italic;\n if (mode === \"text\" || options && options.font === \"mathit\") {\n italic = 0;\n }\n symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);\n } else {\n handleStrict({\n strict: options.strict,\n errorCode: \"symbolNotInFont\",\n errorMsg: \"No character metrics for '\" + value + \"' in style '\" + fontName + \"' and mode '\" + mode + \"'\",\n report: true\n });\n symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);\n }\n symbolNode.maxFontSize = options.sizeMultiplier;\n if (options.style.isTight()) {\n symbolNode.classes.push(\"mtight\");\n }\n var color = options.getColor();\n if (color) {\n symbolNode.style.color = color;\n }\n return symbolNode;\n};\n/**\n * Makes a symbol in Main-Regular or AMS-Regular.\n * Used for rel, bin, open, close, inner, and punct.\n */\nvar mathsym = function mathsym(value, mode, options, classes) {\n if (classes === void 0) {\n classes = [];\n }\n // Decide what font to render the symbol in by its entry in the symbols\n // table.\n // Have a special case for when the value = \\ because the \\ is used as a\n // textord in unsupported command errors but cannot be parsed as a regular\n // text ordinal and is therefore not present as a symbol in the symbols\n // table for text, as well as a special case for boldsymbol because it\n // can be used for bold + and -\n if (options.font === \"boldsymbol\" && lookupSymbol(value, \"Main-Bold\", mode).metrics) {\n return makeSymbol(value, \"Main-Bold\", mode, options, classes.concat([\"mathbf\"]));\n } else if (value === \"\\\\\" || symbols[mode][value].font === \"main\") {\n return makeSymbol(value, \"Main-Regular\", mode, options, classes);\n } else {\n return makeSymbol(value, \"AMS-Regular\", mode, options, classes.concat([\"amsrm\"]));\n }\n};\n/**\n * Determines which of the two font names (Main-Bold and Math-BoldItalic) and\n * corresponding style tags (mathbf or boldsymbol) to use for font \"boldsymbol\",\n * depending on the symbol. Use this function instead of fontMap for font\n * \"boldsymbol\".\n */\nvar boldSymbol = function boldSymbol(value, mode, type) {\n if (type !== \"textord\" && lookupSymbol(value, \"Math-BoldItalic\", mode).metrics) {\n return {\n fontName: \"Math-BoldItalic\",\n fontClass: \"boldsymbol\"\n };\n } else {\n // Some glyphs do not exist in Math-BoldItalic so we need to use\n // Main-Bold instead.\n return {\n fontName: \"Main-Bold\",\n fontClass: \"mathbf\"\n };\n }\n};\n/**\n * Makes either a mathord or textord in the correct font and color.\n */\nvar makeOrd = function makeOrd(group, options) {\n // Spacing nodes are rendered as textord.\n var type = group.type === \"mathord\" ? \"mathord\" : \"textord\";\n var mode = group.mode;\n var text = group.text;\n var classes = [\"mord\"];\n var font = options.font,\n fontFamily = options.fontFamily,\n fontWeight = options.fontWeight,\n fontShape = options.fontShape;\n // Math mode or Old font (i.e. \\rm)\n var useFont = mode === \"math\" || mode === \"text\" && !!font;\n var fontOrFamily = useFont ? font : fontFamily;\n var wideFontName = \"\";\n var wideFontClass = \"\";\n if (text.charCodeAt(0) === 0xD835) {\n var wideCharData = wideCharacterFont(text);\n wideFontName = wideCharData.font;\n wideFontClass = wideCharData[mode + \"Class\"];\n }\n if (wideFontName) {\n // surrogate pairs get special treatment\n return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass));\n } else if (fontOrFamily) {\n var fontName;\n var fontClasses;\n if (fontOrFamily === \"boldsymbol\") {\n var fontData = boldSymbol(text, mode, type);\n fontName = fontData.fontName;\n fontClasses = [fontData.fontClass];\n } else if (useFont) {\n fontName = fontMap[font].fontName;\n fontClasses = [font];\n } else {\n fontName = retrieveTextFontName(fontFamily, fontWeight, fontShape);\n fontClasses = [fontFamily, fontWeight, fontShape];\n }\n if (lookupSymbol(text, fontName, mode).metrics) {\n return makeSymbol(text, fontName, mode, options, classes.concat(fontClasses));\n } else if (Object.prototype.hasOwnProperty.call(ligatures, text) && fontName.slice(0, 10) === \"Typewriter\") {\n // Deconstruct ligatures in monospace fonts (\\texttt, \\tt).\n var parts = [];\n for (var i = 0; i < text.length; i++) {\n parts.push(makeSymbol(text[i], fontName, mode, options, classes.concat(fontClasses)));\n }\n return makeFragment(parts);\n }\n }\n // Makes a symbol in the default font for mathords and textords.\n if (type === \"mathord\") {\n return makeSymbol(text, \"Math-Italic\", mode, options, classes.concat([\"mathnormal\"]));\n } else if (type === \"textord\") {\n var _font = symbols[mode][text] && symbols[mode][text].font;\n if (_font === \"ams\") {\n var _fontName = retrieveTextFontName(\"amsrm\", fontWeight, fontShape);\n return makeSymbol(text, _fontName, mode, options, classes.concat(\"amsrm\", fontWeight, fontShape));\n } else if (_font === \"main\" || !_font) {\n var _fontName2 = retrieveTextFontName(\"textrm\", fontWeight, fontShape);\n return makeSymbol(text, _fontName2, mode, options, classes.concat(fontWeight, fontShape));\n } else {\n // fonts added by plugins\n var _fontName3 = retrieveTextFontName(_font, fontWeight, fontShape);\n // We add font name as a css class\n return makeSymbol(text, _fontName3, mode, options, classes.concat(_fontName3, fontWeight, fontShape));\n }\n } else {\n throw new Error(\"unexpected type: \" + type + \" in makeOrd\");\n }\n};\n/**\n * Returns true if subsequent symbolNodes have the same classes, skew, maxFont,\n * and styles. For mathnormal text, the left node must also have zero italic\n * correction so we don't lose spacing between combined glyphs.\n */\nvar canCombine = (prev, next) => {\n if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize || prev.italic !== 0 && prev.hasClass(\"mathnormal\")) {\n return false;\n }\n // If prev and next both are just \"mbin\"s or \"mord\"s we don't combine them\n // so that the proper spacing can be preserved.\n if (prev.classes.length === 1) {\n var cls = prev.classes[0];\n if (cls === \"mbin\" || cls === \"mord\") {\n return false;\n }\n }\n for (var key of Object.keys(prev.style)) {\n if (prev.style[key] !== next.style[key]) {\n return false;\n }\n }\n for (var _key of Object.keys(next.style)) {\n if (prev.style[_key] !== next.style[_key]) {\n return false;\n }\n }\n return true;\n};\n/**\n * Combine consecutive domTree.symbolNodes into a single symbolNode.\n * Note: this function mutates the argument.\n */\nvar tryCombineChars = chars => {\n for (var i = 0; i < chars.length - 1; i++) {\n var prev = chars[i];\n var next = chars[i + 1];\n if (prev instanceof SymbolNode && next instanceof SymbolNode && canCombine(prev, next)) {\n prev.text += next.text;\n prev.height = Math.max(prev.height, next.height);\n prev.depth = Math.max(prev.depth, next.depth);\n // Use the last character's italic correction since we use\n // it to add padding to the right of the span created from\n // the combined characters.\n prev.italic = next.italic;\n chars.splice(i + 1, 1);\n i--;\n }\n }\n return chars;\n};\n/**\n * Calculate the height, depth, and maxFontSize of an element based on its\n * children.\n */\nvar sizeElementFromChildren = function sizeElementFromChildren(elem) {\n var height = 0;\n var depth = 0;\n var maxFontSize = 0;\n for (var i = 0; i < elem.children.length; i++) {\n var child = elem.children[i];\n if (child.height > height) {\n height = child.height;\n }\n if (child.depth > depth) {\n depth = child.depth;\n }\n if (child.maxFontSize > maxFontSize) {\n maxFontSize = child.maxFontSize;\n }\n }\n elem.height = height;\n elem.depth = depth;\n elem.maxFontSize = maxFontSize;\n};\n/**\n * Makes a span with the given list of classes, list of children, and options.\n *\n * TODO(#953): Ensure that `options` is always provided (currently some call\n * sites don't pass it) and make the type below mandatory.\n * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which\n * should if present come first in `classes`.\n */\nvar makeSpan = function makeSpan(classes, children, options, style) {\n var span = new Span(classes, children, options, style);\n sizeElementFromChildren(span);\n return span;\n};\n// SVG one is simpler -- doesn't require height, depth, max-font setting.\n// This is also a separate method for typesafety.\nvar makeSvgSpan = (classes, children, options, style) => new Span(classes, children, options, style);\nvar makeLineSpan = function makeLineSpan(className, options, thickness) {\n var line = makeSpan([className], [], options);\n line.height = Math.max(thickness || options.fontMetrics().defaultRuleThickness, options.minRuleThickness);\n line.style.borderBottomWidth = makeEm(line.height);\n line.maxFontSize = 1.0;\n return line;\n};\n/**\n * Makes an anchor with the given href, list of classes, list of children,\n * and options.\n */\nvar makeAnchor = function makeAnchor(href, classes, children, options) {\n var anchor = new Anchor(href, classes, children, options);\n sizeElementFromChildren(anchor);\n return anchor;\n};\n/**\n * Makes a document fragment with the given list of children.\n */\nvar makeFragment = function makeFragment(children) {\n var fragment = new DocumentFragment(children);\n sizeElementFromChildren(fragment);\n return fragment;\n};\n/**\n * Wraps group in a span if it's a document fragment, allowing to apply classes\n * and styles\n */\nvar wrapFragment = function wrapFragment(group, options) {\n if (group instanceof DocumentFragment) {\n return makeSpan([], [group], options);\n }\n return group;\n};\n// Computes the updated `children` list and the overall depth.\n//\n// This helper function for makeVList makes it easier to enforce type safety by\n// allowing early exits (returns) in the logic.\nvar getVListChildrenAndDepth = function getVListChildrenAndDepth(params) {\n if (params.positionType === \"individualShift\") {\n var oldChildren = params.children;\n var children = [oldChildren[0]];\n // Add in kerns to the list of params.children to get each element to be\n // shifted to the correct specified shift\n var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth;\n var currPos = _depth;\n for (var i = 1; i < oldChildren.length; i++) {\n var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth;\n var size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth);\n currPos = currPos + diff;\n children.push({\n type: \"kern\",\n size\n });\n children.push(oldChildren[i]);\n }\n return {\n children,\n depth: _depth\n };\n }\n var depth;\n if (params.positionType === \"top\") {\n // We always start at the bottom, so calculate the bottom by adding up\n // all the sizes\n var bottom = params.positionData;\n for (var _i = 0; _i < params.children.length; _i++) {\n var child = params.children[_i];\n bottom -= child.type === \"kern\" ? child.size : child.elem.height + child.elem.depth;\n }\n depth = bottom;\n } else if (params.positionType === \"bottom\") {\n depth = -params.positionData;\n } else {\n var firstChild = params.children[0];\n if (firstChild.type !== \"elem\") {\n throw new Error('First child must have type \"elem\".');\n }\n if (params.positionType === \"shift\") {\n depth = -firstChild.elem.depth - params.positionData;\n } else if (params.positionType === \"firstBaseline\") {\n depth = -firstChild.elem.depth;\n } else {\n throw new Error(\"Invalid positionType \" + params.positionType + \".\");\n }\n }\n return {\n children: params.children,\n depth\n };\n};\n/**\n * Makes a vertical list by stacking elements and kerns on top of each other.\n * Allows for many different ways of specifying the positioning method.\n *\n * See VListParam documentation above.\n */\nvar makeVList = function makeVList(params, options) {\n var _getVListChildrenAndD = getVListChildrenAndDepth(params),\n children = _getVListChildrenAndD.children,\n depth = _getVListChildrenAndD.depth;\n // Create a strut that is taller than any list item. The strut is added to\n // each item, where it will determine the item's baseline. Since it has\n // `overflow:hidden`, the strut's top edge will sit on the item's line box's\n // top edge and the strut's bottom edge will sit on the item's baseline,\n // with no additional line-height spacing. This allows the item baseline to\n // be positioned precisely without worrying about font ascent and\n // line-height.\n var pstrutSize = 0;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.type === \"elem\") {\n var elem = child.elem;\n pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height);\n }\n }\n pstrutSize += 2;\n var pstrut = makeSpan([\"pstrut\"], []);\n pstrut.style.height = makeEm(pstrutSize);\n // Create a new list of actual children at the correct offsets\n var realChildren = [];\n var minPos = depth;\n var maxPos = depth;\n var currPos = depth;\n for (var _i2 = 0; _i2 < children.length; _i2++) {\n var _child = children[_i2];\n if (_child.type === \"kern\") {\n currPos += _child.size;\n } else {\n var _elem = _child.elem;\n var classes = _child.wrapperClasses || [];\n var style = _child.wrapperStyle || {};\n var childWrap = makeSpan(classes, [pstrut, _elem], undefined, style);\n childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth);\n if (_child.marginLeft) {\n childWrap.style.marginLeft = _child.marginLeft;\n }\n if (_child.marginRight) {\n childWrap.style.marginRight = _child.marginRight;\n }\n realChildren.push(childWrap);\n currPos += _elem.height + _elem.depth;\n }\n minPos = Math.min(minPos, currPos);\n maxPos = Math.max(maxPos, currPos);\n }\n // The vlist contents go in a table-cell with `vertical-align:bottom`.\n // This cell's bottom edge will determine the containing table's baseline\n // without overly expanding the containing line-box.\n var vlist = makeSpan([\"vlist\"], realChildren);\n vlist.style.height = makeEm(maxPos);\n // A second row is used if necessary to represent the vlist's depth.\n var rows;\n if (minPos < 0) {\n // We will define depth in an empty span with display: table-cell.\n // It should render with the height that we define. But Chrome, in\n // contenteditable mode only, treats that span as if it contains some\n // text content. And that min-height over-rides our desired height.\n // So we put another empty span inside the depth strut span.\n var emptySpan = makeSpan([], []);\n var depthStrut = makeSpan([\"vlist\"], [emptySpan]);\n depthStrut.style.height = makeEm(-minPos);\n // Safari wants the first row to have inline content; otherwise it\n // puts the bottom of the *second* row on the baseline.\n var topStrut = makeSpan([\"vlist-s\"], [new SymbolNode(\"\\u200b\")]);\n rows = [makeSpan([\"vlist-r\"], [vlist, topStrut]), makeSpan([\"vlist-r\"], [depthStrut])];\n } else {\n rows = [makeSpan([\"vlist-r\"], [vlist])];\n }\n var vtable = makeSpan([\"vlist-t\"], rows);\n if (rows.length === 2) {\n vtable.classes.push(\"vlist-t2\");\n }\n vtable.height = maxPos;\n vtable.depth = -minPos;\n return vtable;\n};\n// Glue is a concept from TeX which is a flexible space between elements in\n// either a vertical or horizontal list. In KaTeX, at least for now, it's\n// static space between elements in a horizontal layout.\nvar makeGlue = (measurement, options) => {\n // Make an empty span for the space\n var rule = makeSpan([\"mspace\"], [], options);\n var size = calculateSize(measurement, options);\n rule.style.marginRight = makeEm(size);\n return rule;\n};\n// Takes font options, and returns the appropriate fontLookup name\nvar retrieveTextFontName = (fontFamily, fontWeight, fontShape) => {\n var baseFontName;\n var fontStylesName;\n switch (fontFamily) {\n case \"amsrm\":\n baseFontName = \"AMS\";\n break;\n case \"textrm\":\n baseFontName = \"Main\";\n break;\n case \"textsf\":\n baseFontName = \"SansSerif\";\n break;\n case \"texttt\":\n baseFontName = \"Typewriter\";\n break;\n default:\n baseFontName = fontFamily;\n // use fonts added by a plugin\n }\n if (fontWeight === \"textbf\" && fontShape === \"textit\") {\n fontStylesName = \"BoldItalic\";\n } else if (fontWeight === \"textbf\") {\n fontStylesName = \"Bold\";\n } else if (fontShape === \"textit\") {\n fontStylesName = \"Italic\";\n } else {\n fontStylesName = \"Regular\";\n }\n return baseFontName + \"-\" + fontStylesName;\n};\n/**\n * Maps TeX font commands to objects containing:\n * - variant: string used for \"mathvariant\" attribute in buildMathML.js\n * - fontName: the \"style\" parameter to fontMetrics.getCharacterMetrics\n */\n// A map between tex font commands an MathML mathvariant attribute values\nvar fontMap = {\n // styles\n \"mathbf\": {\n variant: \"bold\",\n fontName: \"Main-Bold\"\n },\n \"mathrm\": {\n variant: \"normal\",\n fontName: \"Main-Regular\"\n },\n \"textit\": {\n variant: \"italic\",\n fontName: \"Main-Italic\"\n },\n \"mathit\": {\n variant: \"italic\",\n fontName: \"Main-Italic\"\n },\n \"mathnormal\": {\n variant: \"italic\",\n fontName: \"Math-Italic\"\n },\n \"mathsfit\": {\n variant: \"sans-serif-italic\",\n fontName: \"SansSerif-Italic\"\n },\n // \"boldsymbol\" is missing because they require the use of multiple fonts:\n // Math-BoldItalic and Main-Bold. This is handled by a special case in\n // makeOrd which ends up calling boldsymbol.\n // families\n \"mathbb\": {\n variant: \"double-struck\",\n fontName: \"AMS-Regular\"\n },\n \"mathcal\": {\n variant: \"script\",\n fontName: \"Caligraphic-Regular\"\n },\n \"mathfrak\": {\n variant: \"fraktur\",\n fontName: \"Fraktur-Regular\"\n },\n \"mathscr\": {\n variant: \"script\",\n fontName: \"Script-Regular\"\n },\n \"mathsf\": {\n variant: \"sans-serif\",\n fontName: \"SansSerif-Regular\"\n },\n \"mathtt\": {\n variant: \"monospace\",\n fontName: \"Typewriter-Regular\"\n }\n};\nvar svgData = {\n // path, width, height\n vec: [\"vec\", 0.471, 0.714],\n // values from the font glyph\n oiintSize1: [\"oiintSize1\", 0.957, 0.499],\n // oval to overlay the integrand\n oiintSize2: [\"oiintSize2\", 1.472, 0.659],\n oiiintSize1: [\"oiiintSize1\", 1.304, 0.499],\n oiiintSize2: [\"oiiintSize2\", 1.98, 0.659]\n};\nvar staticSvg = function staticSvg(value, options) {\n // Create a span with inline SVG for the element.\n var _svgData$value = svgData[value],\n pathName = _svgData$value[0],\n width = _svgData$value[1],\n height = _svgData$value[2];\n var path = new PathNode(pathName);\n var svgNode = new SvgNode([path], {\n \"width\": makeEm(width),\n \"height\": makeEm(height),\n // Override CSS rule `.katex svg { width: 100% }`\n \"style\": \"width:\" + makeEm(width),\n \"viewBox\": \"0 0 \" + 1000 * width + \" \" + 1000 * height,\n \"preserveAspectRatio\": \"xMinYMin\"\n });\n var span = makeSvgSpan([\"katex-overlay\"], [svgNode], options);\n span.height = height;\n span.style.height = makeEm(height);\n span.style.width = makeEm(width);\n return span;\n};\n\n/**\n * Describes spaces between different classes of atoms.\n */\nvar thinspace = {\n number: 3,\n unit: \"mu\"\n};\nvar mediumspace = {\n number: 4,\n unit: \"mu\"\n};\nvar thickspace = {\n number: 5,\n unit: \"mu\"\n};\n// Spacing relationships for display and text styles\nvar spacings = {\n mord: {\n mop: thinspace,\n mbin: mediumspace,\n mrel: thickspace,\n minner: thinspace\n },\n mop: {\n mord: thinspace,\n mop: thinspace,\n mrel: thickspace,\n minner: thinspace\n },\n mbin: {\n mord: mediumspace,\n mop: mediumspace,\n mopen: mediumspace,\n minner: mediumspace\n },\n mrel: {\n mord: thickspace,\n mop: thickspace,\n mopen: thickspace,\n minner: thickspace\n },\n mopen: {},\n mclose: {\n mop: thinspace,\n mbin: mediumspace,\n mrel: thickspace,\n minner: thinspace\n },\n mpunct: {\n mord: thinspace,\n mop: thinspace,\n mrel: thickspace,\n mopen: thinspace,\n mclose: thinspace,\n mpunct: thinspace,\n minner: thinspace\n },\n minner: {\n mord: thinspace,\n mop: thinspace,\n mbin: mediumspace,\n mrel: thickspace,\n mopen: thinspace,\n mpunct: thinspace,\n minner: thinspace\n }\n};\n// Spacing relationships for script and scriptscript styles\nvar tightSpacings = {\n mord: {\n mop: thinspace\n },\n mop: {\n mord: thinspace,\n mop: thinspace\n },\n mbin: {},\n mrel: {},\n mopen: {},\n mclose: {\n mop: thinspace\n },\n mpunct: {},\n minner: {\n mop: thinspace\n }\n};\n\n/**\n * All registered functions.\n * `functions.js` just exports this same dictionary again and makes it public.\n * `Parser.js` requires this dictionary.\n */\nvar _functions = {};\n/**\n * All HTML builders. Should be only used in the `define*` and the `build*ML`\n * functions.\n *\n * Builders for different node types are stored side by side, but\n * `HtmlBuilder<T>` is contravariant in `T`, so there is no single type\n * argument that makes storing/retrieving them typecheck. `any` is used\n * as an existential-quantifier escape hatch.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nvar _htmlGroupBuilders = {};\n/**\n * All MathML builders. Should be only used in the `define*` and the `build*ML`\n * functions. See `_htmlGroupBuilders` above for the rationale behind `any`.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nvar _mathmlGroupBuilders = {};\nfunction defineFunction(data) {\n var type = data.type,\n names = data.names,\n htmlBuilder = data.htmlBuilder,\n mathmlBuilder = data.mathmlBuilder;\n for (var i = 0; i < names.length; ++i) {\n // To avoid destructuring and rebuilding an object,\n // we store the entire FunctionDefSpec object,\n // even though Parser only needs the FunctionSpec fields.\n _functions[names[i]] = data;\n }\n if (type) {\n if (htmlBuilder) {\n _htmlGroupBuilders[type] = htmlBuilder;\n }\n if (mathmlBuilder) {\n _mathmlGroupBuilders[type] = mathmlBuilder;\n }\n }\n}\n/**\n * Use this to register only the HTML and MathML builders for a function (e.g.\n * if the function's ParseNode is generated in Parser.js rather than via a\n * stand-alone handler provided to `defineFunction`).\n */\nfunction defineFunctionBuilders(_ref) {\n var type = _ref.type,\n htmlBuilder = _ref.htmlBuilder,\n mathmlBuilder = _ref.mathmlBuilder;\n if (htmlBuilder) {\n _htmlGroupBuilders[type] = htmlBuilder;\n }\n if (mathmlBuilder) {\n _mathmlGroupBuilders[type] = mathmlBuilder;\n }\n}\nvar normalizeArgument = function normalizeArgument(arg) {\n return arg.type === \"ordgroup\" && arg.body.length === 1 ? arg.body[0] : arg;\n};\n// Since the corresponding buildHTML/buildMathML function expects a\n// list of elements, we normalize for different kinds of arguments\nvar ordargument = function ordargument(arg) {\n return arg.type === \"ordgroup\" ? arg.body : [arg];\n};\n\n/**\n * This file does the main work of building a domTree structure from a parse\n * tree. The entry point is the `buildHTML` function, which takes a parse tree.\n * Then, the buildExpression, buildGroup, and various groupBuilders functions\n * are called, to produce a final HTML tree.\n */\n// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`)\n// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,\n// and the text before Rule 19.\nvar binLeftCanceller = new Set([\"leftmost\", \"mbin\", \"mopen\", \"mrel\", \"mop\", \"mpunct\"]);\nvar binRightCanceller = new Set([\"rightmost\", \"mrel\", \"mclose\", \"mpunct\"]);\nvar styleMap$1 = {\n \"display\": Style$1.DISPLAY,\n \"text\": Style$1.TEXT,\n \"script\": Style$1.SCRIPT,\n \"scriptscript\": Style$1.SCRIPTSCRIPT\n};\nvar DomEnum = {\n mord: \"mord\",\n mop: \"mop\",\n mbin: \"mbin\",\n mrel: \"mrel\",\n mopen: \"mopen\",\n mclose: \"mclose\",\n mpunct: \"mpunct\",\n minner: \"minner\"\n};\n/**\n * Take a list of nodes, build them in order, and return a list of the built\n * nodes. documentFragments are flattened into their contents, so the\n * returned list contains no fragments. `isRealGroup` is true if `expression`\n * is a real group (no atoms will be added on either side), as opposed to\n * a partial group (e.g. one created by \\color). `surrounding` is an array\n * consisting type of nodes that will be added to the left and right.\n */\nvar buildExpression$1 = function buildExpression(expression, options, isRealGroup, surrounding) {\n if (surrounding === void 0) {\n surrounding = [null, null];\n }\n // Parse expressions into `groups`.\n var groups = [];\n for (var i = 0; i < expression.length; i++) {\n var output = buildGroup$1(expression[i], options);\n if (output instanceof DocumentFragment) {\n var children = output.children;\n groups.push(...children);\n } else {\n groups.push(output);\n }\n }\n // Combine consecutive domTree.symbolNodes into a single symbolNode.\n tryCombineChars(groups);\n // If `expression` is a partial group, let the parent handle spacings\n // to avoid processing groups multiple times.\n if (!isRealGroup) {\n return groups;\n }\n var glueOptions = options;\n if (expression.length === 1) {\n var node = expression[0];\n if (node.type === \"sizing\") {\n glueOptions = options.havingSize(node.size);\n } else if (node.type === \"styling\") {\n glueOptions = options.havingStyle(styleMap$1[node.style]);\n }\n }\n // Dummy spans for determining spacings between surrounding atoms.\n // If `expression` has no atoms on the left or right, class \"leftmost\"\n // or \"rightmost\", respectively, is used to indicate it.\n var dummyPrev = makeSpan([surrounding[0] || \"leftmost\"], [], options);\n var dummyNext = makeSpan([surrounding[1] || \"rightmost\"], [], options);\n // TODO: These code assumes that a node's math class is the first element\n // of its `classes` array. A later cleanup should ensure this, for\n // instance by changing the signature of `makeSpan`.\n // Before determining what spaces to insert, perform bin cancellation.\n // Binary operators change to ordinary symbols in some contexts.\n var isRoot = isRealGroup === \"root\";\n _traverseNonSpaceNodes(groups, (node, prev) => {\n var prevType = prev.classes[0];\n var type = node.classes[0];\n if (prevType === \"mbin\" && binRightCanceller.has(type)) {\n prev.classes[0] = \"mord\";\n } else if (type === \"mbin\" && binLeftCanceller.has(prevType)) {\n node.classes[0] = \"mord\";\n }\n }, {\n node: dummyPrev\n }, dummyNext, isRoot);\n _traverseNonSpaceNodes(groups, (node, prev) => {\n var _tightSpacings$prevTy, _spacings$prevType;\n var prevType = getTypeOfDomTree(prev);\n var type = getTypeOfDomTree(node);\n // 'mtight' indicates that the node is script or scriptscript style.\n var space = prevType && type ? node.hasClass(\"mtight\") ? (_tightSpacings$prevTy = tightSpacings[prevType]) == null ? void 0 : _tightSpacings$prevTy[type] : (_spacings$prevType = spacings[prevType]) == null ? void 0 : _spacings$prevType[type] : null;\n if (space) {\n // Insert glue (spacing) after the `prev`.\n return makeGlue(space, glueOptions);\n }\n }, {\n node: dummyPrev\n }, dummyNext, isRoot);\n return groups;\n};\n// Depth-first traverse non-space `nodes`, calling `callback` with the current and\n// previous node as arguments, optionally returning a node to insert after the\n// previous node. `prev` is an object with the previous node and `insertAfter`\n// function to insert after it. `next` is a node that will be added to the right.\n// Used for bin cancellation and inserting spacings.\nvar _traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev, next, isRoot) {\n if (next) {\n // temporarily append the right node, if exists\n nodes.push(next);\n }\n var i = 0;\n for (; i < nodes.length; i++) {\n var node = nodes[i];\n var partialGroup = checkPartialGroup(node);\n if (partialGroup) {\n // Recursive DFS\n // TODO(ts): partialGroup.children is ReadonlyArray but this\n // function mutates the array (insertAfter splices into it).\n _traverseNonSpaceNodes(partialGroup.children, callback, prev, null, isRoot);\n continue;\n }\n // Ignore explicit spaces (e.g., \\;, \\,) when determining what implicit\n // spacing should go between atoms of different classes\n var nonspace = !node.hasClass(\"mspace\");\n if (nonspace) {\n var result = callback(node, prev.node);\n if (result) {\n if (prev.insertAfter) {\n prev.insertAfter(result);\n } else {\n // insert at front\n nodes.unshift(result);\n i++;\n }\n }\n }\n if (nonspace) {\n prev.node = node;\n } else if (isRoot && node.hasClass(\"katex-newline\")) {\n prev.node = makeSpan([\"leftmost\"]); // treat like beginning of line\n }\n prev.insertAfter = (index => n => {\n nodes.splice(index + 1, 0, n);\n i++;\n })(i);\n }\n if (next) {\n nodes.pop();\n }\n};\n// Check if given node is a partial group, i.e., does not affect spacing around.\nvar checkPartialGroup = function checkPartialGroup(node) {\n if (node instanceof DocumentFragment || node instanceof Anchor || node instanceof Span && node.hasClass(\"enclosing\")) {\n return node;\n }\n return null;\n};\n// Return the outermost node of a domTree.\nvar _getOutermostNode = function getOutermostNode(node, side) {\n var partialGroup = checkPartialGroup(node);\n if (partialGroup) {\n var children = partialGroup.children;\n if (children.length) {\n if (side === \"right\") {\n return _getOutermostNode(children[children.length - 1], \"right\");\n } else if (side === \"left\") {\n return _getOutermostNode(children[0], \"left\");\n }\n }\n }\n return node;\n};\n// Return math atom class (mclass) of a domTree.\n// If `side` is given, it will get the type of the outermost node at given side.\nvar getTypeOfDomTree = function getTypeOfDomTree(node, side) {\n if (!node) {\n return null;\n }\n if (side) {\n node = _getOutermostNode(node, side);\n }\n // This makes a lot of assumptions as to where the type of atom\n // appears. We should do a better job of enforcing this.\n var className = node.classes[0];\n return DomEnum[className] || null;\n};\nvar makeNullDelimiter = function makeNullDelimiter(options, classes) {\n var moreClasses = [\"nulldelimiter\"].concat(options.baseSizingClasses());\n return makeSpan(classes.concat(moreClasses));\n};\n/**\n * buildGroup is the function that takes a group and calls the correct groupType\n * function for it. It also handles the interaction of size and style changes\n * between parents and children.\n */\nvar buildGroup$1 = function buildGroup(group, options, baseOptions) {\n if (!group) {\n return makeSpan();\n }\n if (_htmlGroupBuilders[group.type]) {\n // TODO(ts): groupBuilders is Record<string, HtmlBuilder<any>>;\n // a type-safe registry would need a mapped type keyed by NodeType.\n var groupNode = _htmlGroupBuilders[group.type](group, options);\n // If the size changed between the parent and the current group, account\n // for that size difference.\n if (baseOptions && options.size !== baseOptions.size) {\n groupNode = makeSpan(options.sizingClasses(baseOptions), [groupNode], options);\n var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;\n groupNode.height *= multiplier;\n groupNode.depth *= multiplier;\n }\n return groupNode;\n } else {\n throw new ParseError(\"Got group of unknown type: '\" + group.type + \"'\");\n }\n};\n/**\n * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`)\n * into an unbreakable HTML node of class .katex-base, with proper struts to\n * guarantee correct vertical extent. `buildHTML` calls this repeatedly to\n * make up the entire expression as a sequence of unbreakable units.\n */\nfunction buildHTMLUnbreakable(children, options) {\n // Compute height and depth of this chunk.\n var body = makeSpan([\"katex-base\"], children, options);\n // Add strut, which ensures that the top of the HTML element falls at\n // the height of the expression, and the bottom of the HTML element\n // falls at the depth of the expression.\n var strut = makeSpan([\"katex-strut\"]);\n strut.style.height = makeEm(body.height + body.depth);\n if (body.depth) {\n strut.style.verticalAlign = makeEm(-body.depth);\n }\n body.children.unshift(strut);\n return body;\n}\n/**\n * Take an entire parse tree, and build it into an appropriate set of HTML\n * nodes.\n */\nfunction buildHTML(tree, options) {\n // Strip off outer tag wrapper for processing below.\n var tag = null;\n if (tree.length === 1 && tree[0].type === \"tag\") {\n tag = tree[0].tag;\n tree = tree[0].body;\n }\n // Build the expression contained in the tree\n var expression = buildExpression$1(tree, options, \"root\");\n var eqnNum;\n if (expression.length === 2 && expression[1].hasClass(\"katex-tag\")) {\n // An environment with automatic equation numbers, e.g. {gather}.\n eqnNum = expression.pop();\n }\n var children = [];\n // Create one base node for each chunk between potential line breaks.\n // The TeXBook [p.173] says \"A formula will be broken only after a\n // relation symbol like $=$ or $<$ or $\\rightarrow$, or after a binary\n // operation symbol like $+$ or $-$ or $\\times$, where the relation or\n // binary operation is on the ``outer level'' of the formula (i.e., not\n // enclosed in {...} and not part of an \\over construction).\"\n var parts = [];\n for (var i = 0; i < expression.length; i++) {\n parts.push(expression[i]);\n if (expression[i].hasClass(\"mbin\") || expression[i].hasClass(\"mrel\") || expression[i].hasClass(\"allowbreak\")) {\n // Put any post-operator glue on same line as operator.\n // Watch for \\nobreak along the way, and stop at \\newline.\n var nobreak = false;\n while (i < expression.length - 1 && expression[i + 1].hasClass(\"mspace\") && !expression[i + 1].hasClass(\"katex-newline\")) {\n i++;\n parts.push(expression[i]);\n if (expression[i].hasClass(\"nobreak\")) {\n nobreak = true;\n }\n }\n // Don't allow break if \\nobreak among the post-operator glue.\n if (!nobreak) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n }\n } else if (expression[i].hasClass(\"katex-newline\")) {\n // Write the line except the newline\n parts.pop();\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n parts = [];\n }\n // Put the newline at the top level\n children.push(expression[i]);\n }\n }\n if (parts.length > 0) {\n children.push(buildHTMLUnbreakable(parts, options));\n }\n // Now, if there was a tag, build it too and append it as a final child.\n var tagChild;\n if (tag) {\n tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options, true), options);\n tagChild.classes = [\"katex-tag\"];\n children.push(tagChild);\n } else if (eqnNum) {\n children.push(eqnNum);\n }\n var htmlNode = makeSpan([\"katex-html\"], children);\n htmlNode.setAttribute(\"aria-hidden\", \"true\");\n // Adjust the strut of the tag to be the maximum height of all children\n // (the height of the enclosing htmlNode) for proper vertical alignment.\n if (tagChild) {\n var strut = tagChild.children[0];\n strut.style.height = makeEm(htmlNode.height + htmlNode.depth);\n if (htmlNode.depth) {\n strut.style.verticalAlign = makeEm(-htmlNode.depth);\n }\n }\n return htmlNode;\n}\n\n/**\n * These objects store data about MathML nodes. This is the MathML equivalent\n * of the types in domTree.js. Since MathML handles its own rendering, and\n * since we're mainly using MathML to improve accessibility, we don't manage\n * any of the styling state that the plain DOM nodes do.\n *\n * The `toNode` and `toMarkup` functions work similarly to how they do in\n * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.\n */\nfunction newDocumentFragment(children) {\n return new DocumentFragment(children);\n}\n/**\n * This node represents a general purpose MathML node of any type. The\n * constructor requires the type of node to create (for example, `\"mo\"` or\n * `\"mspace\"`, corresponding to `<mo>` and `<mspace>` tags).\n */\nclass MathNode {\n constructor(type, children, classes) {\n this.type = void 0;\n this.attributes = void 0;\n this.children = void 0;\n this.classes = void 0;\n this.type = type;\n this.attributes = {};\n this.children = children || [];\n this.classes = classes || [];\n }\n /**\n * Sets an attribute on a MathML node. MathML depends on attributes to convey a\n * semantic content, so this is used heavily.\n */\n setAttribute(name, value) {\n this.attributes[name] = value;\n }\n /**\n * Gets an attribute on a MathML node.\n */\n getAttribute(name) {\n return this.attributes[name];\n }\n /**\n * Converts the math node into a MathML-namespaced DOM element.\n */\n toNode() {\n var node = document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", this.type);\n for (var _ref2 of Object.entries(this.attributes)) {\n var attr = _ref2[0];\n var value = _ref2[1];\n node.setAttribute(attr, value);\n }\n if (this.classes.length > 0) {\n node.className = createClass(this.classes);\n }\n for (var i = 0; i < this.children.length; i++) {\n // Combine multiple TextNodes into one TextNode, to prevent\n // screen readers from reading each as a separate word [#3995]\n if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {\n var text = this.children[i].toText() + this.children[++i].toText();\n while (this.children[i + 1] instanceof TextNode) {\n text += this.children[++i].toText();\n }\n node.appendChild(new TextNode(text).toNode());\n } else {\n node.appendChild(this.children[i].toNode());\n }\n }\n return node;\n }\n /**\n * Converts the math node into an HTML markup string.\n */\n toMarkup() {\n var markup = \"<\" + this.type;\n // Add the attributes\n for (var _ref4 of Object.entries(this.attributes)) {\n var attr = _ref4[0];\n var value = _ref4[1];\n markup += \" \" + attr + \"=\\\"\";\n markup += escape(value);\n markup += \"\\\"\";\n }\n if (this.classes.length > 0) {\n markup += \" class =\\\"\" + escape(createClass(this.classes)) + \"\\\"\";\n }\n markup += \">\";\n for (var i = 0; i < this.children.length; i++) {\n markup += this.children[i].toMarkup();\n }\n markup += \"</\" + this.type + \">\";\n return markup;\n }\n /**\n * Converts the math node into a string, similar to innerText, but escaped.\n */\n toText() {\n return this.children.map(child => child.toText()).join(\"\");\n }\n}\n/**\n * This node represents a piece of text.\n */\nclass TextNode {\n constructor(text) {\n this.text = void 0;\n this.text = text;\n }\n /**\n * Converts the text node into a DOM text node.\n */\n toNode() {\n return document.createTextNode(this.text);\n }\n /**\n * Converts the text node into escaped HTML markup\n * (representing the text itself).\n */\n toMarkup() {\n return escape(this.toText());\n }\n /**\n * Converts the text node into a string\n * (representing the text itself).\n */\n toText() {\n return this.text;\n }\n}\n/**\n * This node represents a space, but may render as <mspace.../> or as text,\n * depending on the width.\n */\nclass SpaceNode {\n /**\n * Create a Space node with width given in CSS ems.\n */\n constructor(width) {\n this.width = void 0;\n this.character = void 0;\n this.width = width;\n // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html\n // for a table of space-like characters. We use Unicode\n // representations instead of &LongNames; as it's not clear how to\n // make the latter via document.createTextNode.\n if (width >= 0.05555 && width <= 0.05556) {\n this.character = \"\\u200a\"; //  \n } else if (width >= 0.1666 && width <= 0.1667) {\n this.character = \"\\u2009\"; //  \n } else if (width >= 0.2222 && width <= 0.2223) {\n this.character = \"\\u2005\"; //  \n } else if (width >= 0.2777 && width <= 0.2778) {\n this.character = \"\\u2005\\u200a\"; //   \n } else if (width >= -0.05556 && width <= -0.05555) {\n this.character = \"\\u200a\\u2063\"; // ​\n } else if (width >= -0.1667 && width <= -0.1666) {\n this.character = \"\\u2009\\u2063\"; // ​\n } else if (width >= -0.2223 && width <= -0.2222) {\n this.character = \"\\u205f\\u2063\"; // ​\n } else if (width >= -0.2778 && width <= -0.2777) {\n this.character = \"\\u2005\\u2063\"; // ​\n } else {\n this.character = null;\n }\n }\n /**\n * Converts the math node into a MathML-namespaced DOM element.\n */\n toNode() {\n if (this.character) {\n return document.createTextNode(this.character);\n } else {\n var node = document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", \"mspace\");\n node.setAttribute(\"width\", makeEm(this.width));\n return node;\n }\n }\n /**\n * Converts the math node into an HTML markup string.\n */\n toMarkup() {\n if (this.character) {\n return \"<mtext>\" + this.character + \"</mtext>\";\n } else {\n return \"<mspace width=\\\"\" + makeEm(this.width) + \"\\\"/>\";\n }\n }\n /**\n * Converts the math node into a string, similar to innerText.\n */\n toText() {\n if (this.character) {\n return this.character;\n } else {\n return \" \";\n }\n }\n}\n\n/**\n * This file converts a parse tree into a corresponding MathML tree. The main\n * entry point is the `buildMathML` function, which takes a parse tree from the\n * parser.\n */\nvar noVariantSymbols = new Set([\"\\\\imath\", \"\\\\jmath\"]);\nvar rowLikeTypes = new Set([\"mrow\", \"mtable\"]);\n/**\n * Takes a symbol and converts it into a MathML text node after performing\n * optional replacement from symbols.js.\n */\nvar makeText = function makeText(text, mode, options) {\n var _options$fontFamily, _options$font;\n if (symbols[mode][text] && symbols[mode][text].replace && text.charCodeAt(0) !== 0xD835 && !(Object.prototype.hasOwnProperty.call(ligatures, text) && ((options == null || (_options$fontFamily = options.fontFamily) == null ? void 0 : _options$fontFamily.slice(4, 6)) === \"tt\" || (options == null || (_options$font = options.font) == null ? void 0 : _options$font.slice(4, 6)) === \"tt\"))) {\n text = symbols[mode][text].replace;\n }\n return new TextNode(text);\n};\n/**\n * Wrap the given array of nodes in an <mrow> node if needed, i.e.,\n * unless the array has length 1. Always returns a single node.\n */\nvar makeRow = function makeRow(body) {\n if (body.length === 1) {\n return body[0];\n } else {\n return new MathNode(\"mrow\", body);\n }\n};\nvar mathFontVariants = {\n mathit: \"italic\",\n boldsymbol: group => group.type === \"textord\" ? \"bold\" : \"bold-italic\",\n mathbf: \"bold\",\n mathbb: \"double-struck\",\n mathsfit: \"sans-serif-italic\",\n mathfrak: \"fraktur\",\n mathscr: \"script\",\n mathcal: \"script\",\n mathsf: \"sans-serif\",\n mathtt: \"monospace\"\n};\n/**\n * Returns the math variant as a string or null if none is required.\n */\nvar getVariant = (group, options) => {\n // Handle \\text... font specifiers as best we can.\n // MathML has a limited list of allowable mathvariant specifiers; see\n // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt\n if (group.mode === \"text\") {\n if (options.fontFamily === \"texttt\") {\n return \"monospace\";\n } else if (options.fontFamily === \"textsf\") {\n if (options.fontShape === \"textit\" && options.fontWeight === \"textbf\") {\n return \"sans-serif-bold-italic\";\n } else if (options.fontShape === \"textit\") {\n return \"sans-serif-italic\";\n } else if (options.fontWeight === \"textbf\") {\n return \"bold-sans-serif\";\n } else {\n return \"sans-serif\";\n }\n } else if (options.fontShape === \"textit\" && options.fontWeight === \"textbf\") {\n return \"bold-italic\";\n } else if (options.fontShape === \"textit\") {\n return \"italic\";\n } else if (options.fontWeight === \"textbf\") {\n return \"bold\";\n }\n }\n var font = options.font;\n if (!font || font === \"mathnormal\") {\n return null;\n }\n var mode = group.mode;\n var mathVariant = mathFontVariants[font];\n if (mathVariant) {\n return typeof mathVariant === \"function\" ? mathVariant(group) : mathVariant;\n }\n var text = group.text;\n if (noVariantSymbols.has(text)) {\n return null;\n }\n if (symbols[mode][text]) {\n var replacement = symbols[mode][text].replace;\n if (replacement) {\n text = replacement;\n }\n }\n var fontName = fontMap[font].fontName;\n if (getCharacterMetrics(text, fontName, mode)) {\n return fontMap[font].variant;\n }\n return null;\n};\n/**\n * Check for <mi>.</mi> which is how a dot renders in MathML,\n * or <mo separator=\"true\" lspace=\"0em\" rspace=\"0em\">,</mo>\n * which is how a braced comma {,} renders in MathML\n */\nfunction isNumberPunctuation(group) {\n if (!group) {\n return false;\n }\n if (group.type === 'mi' && group.children.length === 1) {\n var child = group.children[0];\n return child instanceof TextNode && child.text === '.';\n } else if (group.type === 'mo' && group.children.length === 1 && group.getAttribute('separator') === 'true' && group.getAttribute('lspace') === '0em' && group.getAttribute('rspace') === '0em') {\n var _child = group.children[0];\n return _child instanceof TextNode && _child.text === ',';\n } else {\n return false;\n }\n}\n/**\n * Takes a list of nodes, builds them, and returns a list of the generated\n * MathML nodes. Also combine consecutive <mtext> outputs into a single\n * <mtext> tag.\n */\nvar buildExpression = function buildExpression(expression, options, isOrdgroup) {\n if (expression.length === 1) {\n var group = buildGroup(expression[0], options);\n if (isOrdgroup && group instanceof MathNode && group.type === \"mo\") {\n // When TeX writers want to suppress spacing on an operator,\n // they often put the operator by itself inside braces.\n group.setAttribute(\"lspace\", \"0em\");\n group.setAttribute(\"rspace\", \"0em\");\n }\n return [group];\n }\n var groups = [];\n var lastGroup;\n for (var i = 0; i < expression.length; i++) {\n var _group = buildGroup(expression[i], options);\n if (_group instanceof MathNode && lastGroup instanceof MathNode) {\n // Concatenate adjacent <mtext>s\n if (_group.type === 'mtext' && lastGroup.type === 'mtext' && _group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) {\n lastGroup.children.push(..._group.children);\n continue;\n // Concatenate adjacent <mn>s\n } else if (_group.type === 'mn' && lastGroup.type === 'mn') {\n lastGroup.children.push(..._group.children);\n continue;\n // Concatenate <mn>...</mn> followed by <mi>.</mi>\n } else if (isNumberPunctuation(_group) && lastGroup.type === 'mn') {\n lastGroup.children.push(..._group.children);\n continue;\n // Concatenate <mi>.</mi> followed by <mn>...</mn>\n } else if (_group.type === 'mn' && isNumberPunctuation(lastGroup)) {\n _group.children = [...lastGroup.children, ..._group.children];\n groups.pop();\n // Put preceding <mn>...</mn> or <mi>.</mi> inside base of\n // <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)\n } else if ((_group.type === 'msup' || _group.type === 'msub') && _group.children.length >= 1 && (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {\n var base = _group.children[0];\n if (base instanceof MathNode && base.type === 'mn') {\n base.children = [...lastGroup.children, ...base.children];\n groups.pop();\n }\n // \\not\n } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {\n var lastChild = lastGroup.children[0];\n if (lastChild instanceof TextNode && lastChild.text === '\\u0338' && (_group.type === 'mo' || _group.type === 'mi' || _group.type === 'mn')) {\n var child = _group.children[0];\n if (child instanceof TextNode && child.text.length > 0) {\n // Overlay with combining character long solidus\n child.text = child.text.slice(0, 1) + \"\\u0338\" + child.text.slice(1);\n groups.pop();\n }\n }\n }\n }\n groups.push(_group);\n lastGroup = _group;\n }\n return groups;\n};\n/**\n * Equivalent to buildExpression, but wraps the elements in an <mrow>\n * if there's more than one. Returns a single node instead of an array.\n */\nvar buildExpressionRow = function buildExpressionRow(expression, options, isOrdgroup) {\n return makeRow(buildExpression(expression, options, isOrdgroup));\n};\n/**\n * Takes a group from the parser and calls the appropriate groupBuilders function\n * on it to produce a MathML node.\n */\nvar buildGroup = function buildGroup(group, options) {\n if (!group) {\n return new MathNode(\"mrow\");\n }\n if (_mathmlGroupBuilders[group.type]) {\n // TODO(ts): MathMLBuilder returns MathDomNode but all concrete\n // builders return MathNode. Widening the return type here would\n // require updating all callers that assume MathNode.\n return _mathmlGroupBuilders[group.type](group, options);\n } else {\n throw new ParseError(\"Got group of unknown type: '\" + group.type + \"'\");\n }\n};\n/**\n * Takes a full parse tree and settings and builds a MathML representation of\n * it. In particular, we put the elements from building the parse tree into a\n * <semantics> tag so we can also include that TeX source as an annotation.\n *\n * Note that we actually return a domTree element with a `<math>` inside it so\n * we can do appropriate styling.\n */\nfunction buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) {\n var expression = buildExpression(tree, options);\n // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes\n // and add spacing nodes. This is necessary only adjacent to math operators\n // like \\sin or \\lim or to subsup elements that contain math operators.\n // MathML takes care of the other spacing issues.\n // Wrap up the expression in an mrow so it is presented in the semantics\n // tag correctly, unless it's a single <mrow> or <mtable>.\n var wrapper;\n if (expression.length === 1 && expression[0] instanceof MathNode && rowLikeTypes.has(expression[0].type)) {\n wrapper = expression[0];\n } else {\n wrapper = new MathNode(\"mrow\", expression);\n }\n // Build a TeX annotation of the source\n var annotation = new MathNode(\"annotation\", [new TextNode(texExpression)]);\n annotation.setAttribute(\"encoding\", \"application/x-tex\");\n var semantics = new MathNode(\"semantics\", [wrapper, annotation]);\n var math = new MathNode(\"math\", [semantics]);\n math.setAttribute(\"xmlns\", \"http://www.w3.org/1998/Math/MathML\");\n if (isDisplayMode) {\n math.setAttribute(\"display\", \"block\");\n }\n // You can't style <math> nodes, so we wrap the node in a span.\n // NOTE: The span class is not typed to have <math> nodes as children, and\n // we don't want to make the children type more generic since the children\n // of span are expected to have more fields in `buildHtml` contexts.\n // The MathNode implements VirtualNode (toNode/toMarkup) which is all that\n // Span needs from its children for rendering.\n // TODO(ts): Span's child type is HtmlDomNode, but MathNode only implements\n // VirtualNode. The double-cast acknowledges this architectural limitation.\n var wrapperClass = forMathmlOnly ? \"katex\" : \"katex-mathml\";\n return makeSpan([wrapperClass], [math]);\n}\n\n/**\n * This file contains information about the options that the Parser carries\n * around with it while parsing. Data is held in an `Options` object, and when\n * recursing, a new `Options` object can be created with the `.with*` and\n * `.reset` functions.\n */\nvar sizeStyleMap = [\n// Each element contains [textsize, scriptsize, scriptscriptsize].\n// The size mappings are taken from TeX with \\normalsize=10pt.\n[1, 1, 1],\n// size1: [5, 5, 5] \\tiny\n[2, 1, 1],\n// size2: [6, 5, 5]\n[3, 1, 1],\n// size3: [7, 5, 5] \\scriptsize\n[4, 2, 1],\n// size4: [8, 6, 5] \\footnotesize\n[5, 2, 1],\n// size5: [9, 6, 5] \\small\n[6, 3, 1],\n// size6: [10, 7, 5] \\normalsize\n[7, 4, 2],\n// size7: [12, 8, 6] \\large\n[8, 6, 3],\n// size8: [14.4, 10, 7] \\Large\n[9, 7, 6],\n// size9: [17.28, 12, 10] \\LARGE\n[10, 8, 7],\n// size10: [20.74, 14.4, 12] \\huge\n[11, 10, 9] // size11: [24.88, 20.74, 17.28] \\HUGE\n];\nvar sizeMultipliers = [\n// fontMetrics.js:getGlobalMetrics also uses size indexes, so if\n// you change size indexes, change that function.\n0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488];\nvar sizeAtStyle = function sizeAtStyle(size, style) {\n return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1];\n};\n/**\n * This is the main options class. It contains the current style, size, color,\n * and font.\n *\n * Options objects should not be modified. To create a new Options with\n * different properties, call a `.having*` method.\n */\nclass Options {\n constructor(data) {\n this.style = void 0;\n this.color = void 0;\n this.size = void 0;\n this.textSize = void 0;\n this.phantom = void 0;\n // A font family applies to a group of fonts (i.e. SansSerif), while a font\n // represents a specific font (i.e. SansSerif Bold).\n // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm\n this.font = void 0;\n this.fontFamily = void 0;\n this.fontWeight = void 0;\n this.fontShape = void 0;\n this.sizeMultiplier = void 0;\n this.maxSize = void 0;\n this.minRuleThickness = void 0;\n this._fontMetrics = void 0;\n this.strict = void 0;\n this.style = data.style;\n this.color = data.color;\n this.size = data.size || Options.BASESIZE;\n this.textSize = data.textSize || this.size;\n this.phantom = !!data.phantom;\n this.font = data.font || \"\";\n this.fontFamily = data.fontFamily || \"\";\n this.fontWeight = data.fontWeight || \"\";\n this.fontShape = data.fontShape || \"\";\n this.sizeMultiplier = sizeMultipliers[this.size - 1];\n this.maxSize = data.maxSize;\n this.minRuleThickness = data.minRuleThickness;\n this.strict = data.strict;\n this._fontMetrics = undefined;\n }\n /**\n * Returns a new options object with the same properties as \"this\". Properties\n * from \"extension\" will be copied to the new options object.\n */\n extend(extension) {\n var data = {\n style: this.style,\n size: this.size,\n textSize: this.textSize,\n color: this.color,\n phantom: this.phantom,\n font: this.font,\n fontFamily: this.fontFamily,\n fontWeight: this.fontWeight,\n fontShape: this.fontShape,\n maxSize: this.maxSize,\n minRuleThickness: this.minRuleThickness,\n strict: this.strict\n };\n Object.assign(data, extension);\n return new Options(data);\n }\n /**\n * Return an options object with the given style. If `this.style === style`,\n * returns `this`.\n */\n havingStyle(style) {\n if (this.style === style) {\n return this;\n } else {\n return this.extend({\n style: style,\n size: sizeAtStyle(this.textSize, style)\n });\n }\n }\n /**\n * Return an options object with a cramped version of the current style. If\n * the current style is cramped, returns `this`.\n */\n havingCrampedStyle() {\n return this.havingStyle(this.style.cramp());\n }\n /**\n * Return an options object with the given size and in at least `\\textstyle`.\n * Returns `this` if appropriate.\n */\n havingSize(size) {\n if (this.size === size && this.textSize === size) {\n return this;\n } else {\n return this.extend({\n style: this.style.text(),\n size: size,\n textSize: size,\n sizeMultiplier: sizeMultipliers[size - 1]\n });\n }\n }\n /**\n * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,\n * changes to at least `\\textstyle`.\n */\n havingBaseStyle(style) {\n style = style || this.style.text();\n var wantSize = sizeAtStyle(Options.BASESIZE, style);\n if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) {\n return this;\n } else {\n return this.extend({\n style: style,\n size: wantSize\n });\n }\n }\n /**\n * Remove the effect of sizing changes such as \\Huge.\n * Keep the effect of the current style, such as \\scriptstyle.\n */\n havingBaseSizing() {\n var size;\n switch (this.style.id) {\n case 4:\n case 5:\n size = 3; // normalsize in scriptstyle\n break;\n case 6:\n case 7:\n size = 1; // normalsize in scriptscriptstyle\n break;\n default:\n size = 6;\n // normalsize in textstyle or displaystyle\n }\n return this.extend({\n style: this.style.text(),\n size: size\n });\n }\n /**\n * Create a new options object with the given color.\n */\n withColor(color) {\n return this.extend({\n color: color\n });\n }\n /**\n * Create a new options object with \"phantom\" set to true.\n */\n withPhantom() {\n return this.extend({\n phantom: true\n });\n }\n /**\n * Creates a new options object with the given math font or old text font.\n * @type {[type]}\n */\n withFont(font) {\n return this.extend({\n font\n });\n }\n /**\n * Create a new options objects with the given fontFamily.\n */\n withTextFontFamily(fontFamily) {\n return this.extend({\n fontFamily,\n font: \"\"\n });\n }\n /**\n * Creates a new options object with the given font weight\n */\n withTextFontWeight(fontWeight) {\n return this.extend({\n fontWeight,\n font: \"\"\n });\n }\n /**\n * Creates a new options object with the given font weight\n */\n withTextFontShape(fontShape) {\n return this.extend({\n fontShape,\n font: \"\"\n });\n }\n /**\n * Return the CSS sizing classes required to switch from enclosing options\n * `oldOptions` to `this`. Returns an array of classes.\n */\n sizingClasses(oldOptions) {\n if (oldOptions.size !== this.size) {\n return [\"katex-sizing\", \"reset-size\" + oldOptions.size, \"size\" + this.size];\n } else {\n return [];\n }\n }\n /**\n * Return the CSS sizing classes required to switch to the base size. Like\n * `this.havingSize(BASESIZE).sizingClasses(this)`.\n */\n baseSizingClasses() {\n if (this.size !== Options.BASESIZE) {\n return [\"katex-sizing\", \"reset-size\" + this.size, \"size\" + Options.BASESIZE];\n } else {\n return [];\n }\n }\n /**\n * Return the font metrics for this size.\n */\n fontMetrics() {\n if (!this._fontMetrics) {\n this._fontMetrics = getGlobalMetrics(this.size);\n }\n return this._fontMetrics;\n }\n /**\n * Gets the CSS color of the current options object\n */\n getColor() {\n if (this.phantom) {\n return \"transparent\";\n } else {\n return this.color;\n }\n }\n}\n/**\n * The base size index.\n */\nOptions.BASESIZE = 6;\n\nvar optionsFromSettings = settings => new Options({\n style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,\n maxSize: settings.maxSize,\n minRuleThickness: settings.minRuleThickness,\n strict: settings.strict\n});\nvar displayWrap = function displayWrap(node, settings) {\n if (settings.displayMode) {\n var classes = [\"katex-display\"];\n if (settings.leqno) {\n classes.push(\"leqno\");\n }\n if (settings.fleqn) {\n classes.push(\"fleqn\");\n }\n node = makeSpan(classes, [node]);\n }\n return node;\n};\nvar buildTree = function buildTree(tree, expression, settings) {\n var options = optionsFromSettings(settings);\n var katexNode;\n if (settings.output === \"mathml\") {\n return buildMathML(tree, expression, options, settings.displayMode, true);\n } else if (settings.output === \"html\") {\n var htmlNode = buildHTML(tree, options);\n katexNode = makeSpan([\"katex\"], [htmlNode]);\n } else {\n var mathMLNode = buildMathML(tree, expression, options, settings.displayMode, false);\n var _htmlNode = buildHTML(tree, options);\n katexNode = makeSpan([\"katex\"], [mathMLNode, _htmlNode]);\n }\n return displayWrap(katexNode, settings);\n};\nvar buildHTMLTree = function buildHTMLTree(tree, settings) {\n var options = optionsFromSettings(settings);\n var htmlNode = buildHTML(tree, options);\n var katexNode = makeSpan([\"katex\"], [htmlNode]);\n return displayWrap(katexNode, settings);\n};\n\n/**\n * This file provides support to buildMathML.js and buildHTML.js\n * for stretchy wide elements rendered from SVG files\n * and other CSS trickery.\n */\nvar stretchyCodePoint = {\n widehat: \"^\",\n widecheck: \"ˇ\",\n widetilde: \"~\",\n utilde: \"~\",\n overleftarrow: \"\\u2190\",\n underleftarrow: \"\\u2190\",\n xleftarrow: \"\\u2190\",\n overrightarrow: \"\\u2192\",\n underrightarrow: \"\\u2192\",\n xrightarrow: \"\\u2192\",\n underbrace: \"\\u23df\",\n overbrace: \"\\u23de\",\n underbracket: \"\\u23b5\",\n overbracket: \"\\u23b4\",\n overgroup: \"\\u23e0\",\n undergroup: \"\\u23e1\",\n overleftrightarrow: \"\\u2194\",\n underleftrightarrow: \"\\u2194\",\n xleftrightarrow: \"\\u2194\",\n Overrightarrow: \"\\u21d2\",\n xRightarrow: \"\\u21d2\",\n overleftharpoon: \"\\u21bc\",\n xleftharpoonup: \"\\u21bc\",\n overrightharpoon: \"\\u21c0\",\n xrightharpoonup: \"\\u21c0\",\n xLeftarrow: \"\\u21d0\",\n xLeftrightarrow: \"\\u21d4\",\n xhookleftarrow: \"\\u21a9\",\n xhookrightarrow: \"\\u21aa\",\n xmapsto: \"\\u21a6\",\n xrightharpoondown: \"\\u21c1\",\n xleftharpoondown: \"\\u21bd\",\n xrightleftharpoons: \"\\u21cc\",\n xleftrightharpoons: \"\\u21cb\",\n xtwoheadleftarrow: \"\\u219e\",\n xtwoheadrightarrow: \"\\u21a0\",\n xlongequal: \"=\",\n xtofrom: \"\\u21c4\",\n xrightleftarrows: \"\\u21c4\",\n xrightequilibrium: \"\\u21cc\",\n // Not a perfect match.\n xleftequilibrium: \"\\u21cb\",\n // None better available.\n \"\\\\cdrightarrow\": \"\\u2192\",\n \"\\\\cdleftarrow\": \"\\u2190\",\n \"\\\\cdlongequal\": \"=\"\n};\nvar stretchyMathML = function stretchyMathML(label) {\n var node = new MathNode(\"mo\", [new TextNode(stretchyCodePoint[label.replace(/^\\\\/, '')])]);\n node.setAttribute(\"stretchy\", \"true\");\n return node;\n};\nvar katexImagesData = {\n // path(s), minWidth, height, align\n overrightarrow: [[\"rightarrow\"], 0.888, 522, \"xMaxYMin\"],\n overleftarrow: [[\"leftarrow\"], 0.888, 522, \"xMinYMin\"],\n underrightarrow: [[\"rightarrow\"], 0.888, 522, \"xMaxYMin\"],\n underleftarrow: [[\"leftarrow\"], 0.888, 522, \"xMinYMin\"],\n xrightarrow: [[\"rightarrow\"], 1.469, 522, \"xMaxYMin\"],\n \"\\\\cdrightarrow\": [[\"rightarrow\"], 3.0, 522, \"xMaxYMin\"],\n // CD minwwidth2.5pc\n xleftarrow: [[\"leftarrow\"], 1.469, 522, \"xMinYMin\"],\n \"\\\\cdleftarrow\": [[\"leftarrow\"], 3.0, 522, \"xMinYMin\"],\n Overrightarrow: [[\"doublerightarrow\"], 0.888, 560, \"xMaxYMin\"],\n xRightarrow: [[\"doublerightarrow\"], 1.526, 560, \"xMaxYMin\"],\n xLeftarrow: [[\"doubleleftarrow\"], 1.526, 560, \"xMinYMin\"],\n overleftharpoon: [[\"leftharpoon\"], 0.888, 522, \"xMinYMin\"],\n xleftharpoonup: [[\"leftharpoon\"], 0.888, 522, \"xMinYMin\"],\n xleftharpoondown: [[\"leftharpoondown\"], 0.888, 522, \"xMinYMin\"],\n overrightharpoon: [[\"rightharpoon\"], 0.888, 522, \"xMaxYMin\"],\n xrightharpoonup: [[\"rightharpoon\"], 0.888, 522, \"xMaxYMin\"],\n xrightharpoondown: [[\"rightharpoondown\"], 0.888, 522, \"xMaxYMin\"],\n xlongequal: [[\"longequal\"], 0.888, 334, \"xMinYMin\"],\n \"\\\\cdlongequal\": [[\"longequal\"], 3.0, 334, \"xMinYMin\"],\n xtwoheadleftarrow: [[\"twoheadleftarrow\"], 0.888, 334, \"xMinYMin\"],\n xtwoheadrightarrow: [[\"twoheadrightarrow\"], 0.888, 334, \"xMaxYMin\"],\n overleftrightarrow: [[\"leftarrow\", \"rightarrow\"], 0.888, 522],\n overbrace: [[\"leftbrace\", \"midbrace\", \"rightbrace\"], 1.6, 548],\n underbrace: [[\"leftbraceunder\", \"midbraceunder\", \"rightbraceunder\"], 1.6, 548],\n underleftrightarrow: [[\"leftarrow\", \"rightarrow\"], 0.888, 522],\n xleftrightarrow: [[\"leftarrow\", \"rightarrow\"], 1.75, 522],\n xLeftrightarrow: [[\"doubleleftarrow\", \"doublerightarrow\"], 1.75, 560],\n xrightleftharpoons: [[\"leftharpoondownplus\", \"rightharpoonplus\"], 1.75, 716],\n xleftrightharpoons: [[\"leftharpoonplus\", \"rightharpoondownplus\"], 1.75, 716],\n xhookleftarrow: [[\"leftarrow\", \"righthook\"], 1.08, 522],\n xhookrightarrow: [[\"lefthook\", \"rightarrow\"], 1.08, 522],\n overlinesegment: [[\"leftlinesegment\", \"rightlinesegment\"], 0.888, 522],\n underlinesegment: [[\"leftlinesegment\", \"rightlinesegment\"], 0.888, 522],\n overbracket: [[\"leftbracketover\", \"rightbracketover\"], 1.6, 440],\n underbracket: [[\"leftbracketunder\", \"rightbracketunder\"], 1.6, 410],\n overgroup: [[\"leftgroup\", \"rightgroup\"], 0.888, 342],\n undergroup: [[\"leftgroupunder\", \"rightgroupunder\"], 0.888, 342],\n xmapsto: [[\"leftmapsto\", \"rightarrow\"], 1.5, 522],\n xtofrom: [[\"leftToFrom\", \"rightToFrom\"], 1.75, 528],\n // The next three arrows are from the mhchem package.\n // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the\n // document as \\xrightarrow or \\xrightleftharpoons. Those have\n // min-length = 1.75em, so we set min-length on these next three to match.\n xrightleftarrows: [[\"baraboveleftarrow\", \"rightarrowabovebar\"], 1.75, 901],\n xrightequilibrium: [[\"baraboveshortleftharpoon\", \"rightharpoonaboveshortbar\"], 1.75, 716],\n xleftequilibrium: [[\"shortbaraboveleftharpoon\", \"shortrightharpoonabovebar\"], 1.75, 716]\n};\nvar wideAccentLabels = new Set([\"widehat\", \"widecheck\", \"widetilde\", \"utilde\"]);\nvar stretchySvg = function stretchySvg(group, options) {\n // Create a span with inline SVG for the element.\n function buildSvgSpan_() {\n var viewBoxWidth = 400000; // default\n var label = group.label.slice(1);\n if (wideAccentLabels.has(label) && 'base' in group) {\n // There are four SVG images available for each function.\n // Choose a taller image when there are more characters.\n var numChars = group.base.type === \"ordgroup\" ? group.base.body.length : 1;\n var viewBoxHeight;\n var pathName;\n var _height;\n if (numChars > 5) {\n if (label === \"widehat\" || label === \"widecheck\") {\n viewBoxHeight = 420;\n viewBoxWidth = 2364;\n _height = 0.42;\n pathName = label + \"4\";\n } else {\n viewBoxHeight = 312;\n viewBoxWidth = 2340;\n _height = 0.34;\n pathName = \"tilde4\";\n }\n } else {\n var imgIndex = [1, 1, 2, 2, 3, 3][numChars];\n if (label === \"widehat\" || label === \"widecheck\") {\n viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];\n viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];\n _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];\n pathName = label + imgIndex;\n } else {\n viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];\n viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];\n _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];\n pathName = \"tilde\" + imgIndex;\n }\n }\n var path = new PathNode(pathName);\n var svgNode = new SvgNode([path], {\n \"width\": \"100%\",\n \"height\": makeEm(_height),\n \"viewBox\": \"0 0 \" + viewBoxWidth + \" \" + viewBoxHeight,\n \"preserveAspectRatio\": \"none\"\n });\n return {\n span: makeSvgSpan([], [svgNode], options),\n minWidth: 0,\n height: _height\n };\n } else {\n var spans = [];\n var data = katexImagesData[label];\n if (!data) {\n throw new Error(\"No SVG data for \\\"\" + label + \"\\\".\");\n }\n var paths = data[0],\n _minWidth = data[1],\n _viewBoxHeight = data[2];\n var _height2 = _viewBoxHeight / 1000;\n var numSvgChildren = paths.length;\n var widthClasses;\n var aligns;\n if (numSvgChildren === 1) {\n if (data.length !== 4) {\n throw new Error(\"Expected 4-tuple for single-path SVG data \\\"\" + label + \"\\\".\");\n }\n widthClasses = [\"hide-tail\"];\n aligns = [data[3]];\n } else if (numSvgChildren === 2) {\n widthClasses = [\"halfarrow-left\", \"halfarrow-right\"];\n aligns = [\"xMinYMin\", \"xMaxYMin\"];\n } else if (numSvgChildren === 3) {\n widthClasses = [\"brace-left\", \"brace-center\", \"brace-right\"];\n aligns = [\"xMinYMin\", \"xMidYMin\", \"xMaxYMin\"];\n } else {\n throw new Error(\"Correct katexImagesData or update code here to support\\n \" + numSvgChildren + \" children.\");\n }\n for (var i = 0; i < numSvgChildren; i++) {\n var _path = new PathNode(paths[i]);\n var _svgNode = new SvgNode([_path], {\n \"width\": \"400em\",\n \"height\": makeEm(_height2),\n \"viewBox\": \"0 0 \" + viewBoxWidth + \" \" + _viewBoxHeight,\n \"preserveAspectRatio\": aligns[i] + \" slice\"\n });\n var _span = makeSvgSpan([widthClasses[i]], [_svgNode], options);\n if (numSvgChildren === 1) {\n return {\n span: _span,\n minWidth: _minWidth,\n height: _height2\n };\n } else {\n _span.style.height = makeEm(_height2);\n spans.push(_span);\n }\n }\n return {\n span: makeSpan([\"katex-stretchy\"], spans, options),\n minWidth: _minWidth,\n height: _height2\n };\n }\n } // buildSvgSpan_()\n var _buildSvgSpan_ = buildSvgSpan_(),\n span = _buildSvgSpan_.span,\n minWidth = _buildSvgSpan_.minWidth,\n height = _buildSvgSpan_.height;\n // Note that we are returning span.depth = 0.\n // Any adjustments relative to the baseline must be done in buildHTML.\n span.height = height;\n span.style.height = makeEm(height);\n if (minWidth > 0) {\n span.style.minWidth = makeEm(minWidth);\n }\n return span;\n};\nvar stretchyEnclose = function stretchyEnclose(inner, label, topPad, bottomPad, options) {\n // Return an image span for \\cancel, \\bcancel, \\xcancel, \\fbox, or \\angl\n var img;\n var totalHeight = inner.height + inner.depth + topPad + bottomPad;\n if (/fbox|color|angl/.test(label)) {\n img = makeSpan([\"katex-stretchy\", label], [], options);\n if (label === \"fbox\") {\n var color = options.color && options.getColor();\n if (color) {\n img.style.borderColor = color;\n }\n }\n } else {\n // \\cancel, \\bcancel, or \\xcancel\n // Since \\cancel's SVG is inline and it omits the viewBox attribute,\n // its stroke-width will not vary with span area.\n var lines = [];\n if (/^[bx]cancel$/.test(label)) {\n lines.push(new LineNode({\n \"x1\": \"0\",\n \"y1\": \"0\",\n \"x2\": \"100%\",\n \"y2\": \"100%\",\n \"stroke-width\": \"0.046em\"\n }));\n }\n if (/^x?cancel$/.test(label)) {\n lines.push(new LineNode({\n \"x1\": \"0\",\n \"y1\": \"100%\",\n \"x2\": \"100%\",\n \"y2\": \"0\",\n \"stroke-width\": \"0.046em\"\n }));\n }\n var svgNode = new SvgNode(lines, {\n \"width\": \"100%\",\n \"height\": makeEm(totalHeight)\n });\n img = makeSvgSpan([], [svgNode], options);\n }\n img.height = totalHeight;\n img.style.height = makeEm(totalHeight);\n return img;\n};\n\n/**\n * Small module for atom-group constants and type guard. Kept separate from\n * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can\n * pull in `isAtom` without dragging in the ~870-line symbol tables.\n */\nvar atomList = [\"bin\", \"close\", \"inner\", \"open\", \"punct\", \"rel\"];\nvar nonAtomList = [\"accent-token\", \"mathord\", \"op-token\", \"spacing\", \"textord\"];\nvar Atoms = new Set(atomList);\nvar NonAtoms = new Set(nonAtomList);\nfunction isAtom(value) {\n return Atoms.has(value);\n}\n\n/**\n * Asserts that the node is of the given type and returns it with stricter\n * typing. Throws if the node's type does not match.\n */\nfunction assertNodeType(node, type) {\n if (!node || node.type !== type) {\n throw new Error(\"Expected node of type \" + type + \", but got \" + (node ? \"node of type \" + node.type : String(node)));\n }\n return node;\n}\n/**\n * Returns the node more strictly typed iff it is of the given type. Otherwise,\n * returns null.\n */\nfunction assertSymbolNodeType(node) {\n var typedNode = checkSymbolNodeType(node);\n if (!typedNode) {\n throw new Error(\"Expected node of symbol group type, but got \" + (node ? \"node of type \" + node.type : String(node)));\n }\n return typedNode;\n}\n/**\n * Returns the node more strictly typed if it is of the given type. Otherwise,\n * returns null.\n */\nfunction checkSymbolNodeType(node) {\n if (node.type === \"atom\" || NonAtoms.has(node.type)) {\n return node;\n }\n return null;\n}\n/**\n * Returns the string spelled out by a group of plain characters, throwing the\n * given ParseError if the group holds anything else. With allowSpaces, a\n * literal space counts as a character; `~` and `\\ ` do not.\n */\nfunction assertCharacterGroup(group, errorMessage, allowSpaces) {\n var text = \"\";\n for (var node of group.body) {\n if (node.type === \"textord\") {\n text += node.text;\n } else if (allowSpaces && node.type === \"spacing\" && node.text === \" \") {\n text += \" \";\n } else {\n throw new ParseError(errorMessage, group);\n }\n }\n return text;\n}\n\nvar getBaseSymbol = group => {\n if (group instanceof SymbolNode) {\n return group;\n }\n if (hasHtmlDomChildren(group) && group.children.length === 1) {\n return getBaseSymbol(group.children[0]);\n }\n};\n// NOTE: Unlike most `htmlBuilder`s, this one handles not only \"accent\", but\n// also \"supsub\" since an accent can affect super/subscripting.\nvar htmlBuilder$a = (grp, options) => {\n // Accents are handled in the TeXbook pg. 443, rule 12.\n var base;\n var group;\n var supSubGroup;\n if (grp && grp.type === \"supsub\") {\n // If our base is a character box, and we have superscripts and\n // subscripts, the supsub will defer to us. In particular, we want\n // to attach the superscripts and subscripts to the inner body (so\n // that the position of the superscripts and subscripts won't be\n // affected by the height of the accent). We accomplish this by\n // sticking the base of the accent into the base of the supsub, and\n // rendering that, while keeping track of where the accent is.\n // The real accent group is the base of the supsub group\n group = assertNodeType(grp.base, \"accent\");\n // The character box is the base of the accent group\n base = group.base;\n // Stick the character box into the base of the supsub group\n grp.base = base;\n // Rerender the supsub group with its new base, and store that\n // result.\n supSubGroup = assertSpan(buildGroup$1(grp, options));\n // reset original base\n grp.base = group;\n } else {\n group = assertNodeType(grp, \"accent\");\n base = group.base;\n }\n // Build the base group\n var body = buildGroup$1(base, options.havingCrampedStyle());\n // Does the accent need to shift for the skew of a character?\n var mustShift = group.isShifty && isCharacterBox(base);\n // Calculate the skew of the accent. This is based on the line \"If the\n // nucleus is not a single character, let s = 0; otherwise set s to the\n // kern amount for the nucleus followed by the \\skewchar of its font.\"\n // Note that our skew metrics are just the kern between each character\n // and the skewchar.\n var skew = 0;\n if (mustShift) {\n var _getBaseSymbol$skew, _getBaseSymbol;\n // Read the skew from the rendered base symbol.\n // This preserves font metrics from font wrappers like \\mathbb.\n skew = (_getBaseSymbol$skew = (_getBaseSymbol = getBaseSymbol(body)) == null ? void 0 : _getBaseSymbol.skew) != null ? _getBaseSymbol$skew : 0;\n }\n var accentBelow = group.label === \"\\\\c\";\n // calculate the amount of space between the body and the accent\n var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight);\n // Build the accent\n var accentBody;\n if (!group.isStretchy) {\n var accent;\n var width;\n if (group.label === \"\\\\vec\") {\n // Before version 0.9, \\vec used the combining font glyph U+20D7.\n // But browsers, especially Safari, are not consistent in how they\n // render combining characters when not preceded by a character.\n // So now we use an SVG.\n // If Safari reforms, we should consider reverting to the glyph.\n accent = staticSvg(\"vec\", options);\n width = svgData.vec[1];\n } else {\n accent = makeOrd({\n type: \"textord\",\n mode: group.mode,\n text: group.label\n }, options);\n accent = assertSymbolDomNode(accent);\n // Remove the italic correction of the accent, because it only serves to\n // shift the accent over to a place we don't want.\n accent.italic = 0;\n width = accent.width;\n if (accentBelow) {\n clearance += accent.depth;\n }\n }\n accentBody = makeSpan([\"accent-body\"], [accent]);\n // \"Full\" accents expand the width of the resulting symbol to be\n // at least the width of the accent, and overlap directly onto the\n // character without any vertical offset.\n var accentFull = group.label === \"\\\\textcircled\";\n if (accentFull) {\n accentBody.classes.push('accent-full');\n clearance = body.height;\n }\n // Shift the accent over by the skew.\n var left = skew;\n // CSS defines `.katex .katex-accent .accent-body:not(.accent-full) { width: 0 }`\n // so that the accent doesn't contribute to the bounding box.\n // We need to shift the character by its width (effectively half\n // its width) to compensate.\n if (!accentFull) {\n left -= width / 2;\n }\n accentBody.style.left = makeEm(left);\n // \\textcircled uses the \\bigcirc glyph, so it needs some\n // vertical adjustment to match LaTeX.\n if (group.label === \"\\\\textcircled\") {\n accentBody.style.top = \".2em\";\n }\n accentBody = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: body\n }, {\n type: \"kern\",\n size: -clearance\n }, {\n type: \"elem\",\n elem: accentBody\n }]\n });\n } else {\n accentBody = stretchySvg(group, options);\n accentBody = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: body\n }, {\n type: \"elem\",\n elem: accentBody,\n wrapperClasses: [\"svg-align\"],\n wrapperStyle: skew > 0 ? {\n width: \"calc(100% - \" + makeEm(2 * skew) + \")\",\n marginLeft: makeEm(2 * skew)\n } : undefined\n }]\n });\n }\n var accentWrap = makeSpan([\"mord\", \"katex-accent\"], [accentBody], options);\n if (supSubGroup) {\n // Here, we replace the \"base\" child of the supsub with our newly\n // generated accent.\n supSubGroup.children[0] = accentWrap;\n // Since we don't rerun the height calculation after replacing the\n // accent, we manually recalculate height.\n supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);\n // Accents should always be ords, even when their innards are not.\n supSubGroup.classes[0] = \"mord\";\n return supSubGroup;\n } else {\n return accentWrap;\n }\n};\nvar mathmlBuilder$9 = (group, options) => {\n var accentNode = group.isStretchy ? stretchyMathML(group.label) : new MathNode(\"mo\", [makeText(group.label, group.mode)]);\n var node = new MathNode(\"mover\", [buildGroup(group.base, options), accentNode]);\n node.setAttribute(\"accent\", \"true\");\n return node;\n};\nvar NON_STRETCHY_ACCENT_REGEX = new RegExp([\"\\\\acute\", \"\\\\grave\", \"\\\\ddot\", \"\\\\tilde\", \"\\\\bar\", \"\\\\breve\", \"\\\\check\", \"\\\\hat\", \"\\\\vec\", \"\\\\dot\", \"\\\\mathring\"].map(accent => \"\\\\\" + accent).join(\"|\"));\n// Accents\ndefineFunction({\n type: \"accent\",\n names: [\"\\\\acute\", \"\\\\grave\", \"\\\\ddot\", \"\\\\tilde\", \"\\\\bar\", \"\\\\breve\", \"\\\\check\", \"\\\\hat\", \"\\\\vec\", \"\\\\dot\", \"\\\\mathring\", \"\\\\widecheck\", \"\\\\widehat\", \"\\\\widetilde\", \"\\\\overrightarrow\", \"\\\\overleftarrow\", \"\\\\Overrightarrow\", \"\\\\overleftrightarrow\", \"\\\\overgroup\", \"\\\\overlinesegment\", \"\\\\overleftharpoon\", \"\\\\overrightharpoon\"],\n numArgs: 1,\n handler: (context, args) => {\n var base = normalizeArgument(args[0]);\n var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);\n var isShifty = !isStretchy || context.funcName === \"\\\\widehat\" || context.funcName === \"\\\\widetilde\" || context.funcName === \"\\\\widecheck\";\n return {\n type: \"accent\",\n mode: context.parser.mode,\n label: context.funcName,\n isStretchy: isStretchy,\n isShifty: isShifty,\n base: base\n };\n },\n htmlBuilder: htmlBuilder$a,\n mathmlBuilder: mathmlBuilder$9\n});\n// Text-mode accents\ndefineFunction({\n type: \"accent\",\n names: [\"\\\\'\", \"\\\\`\", \"\\\\^\", \"\\\\~\", \"\\\\=\", \"\\\\u\", \"\\\\.\", '\\\\\"', \"\\\\c\", \"\\\\r\", \"\\\\H\", \"\\\\v\", \"\\\\textcircled\"],\n numArgs: 1,\n allowedInText: true,\n allowedInMath: true,\n // unless in strict mode\n argTypes: [\"primitive\"],\n handler: (context, args) => {\n var base = args[0];\n var mode = context.parser.mode;\n if (mode === \"math\") {\n handleStrict({\n strict: context.parser.settings.strict,\n errorCode: \"mathVsTextAccents\",\n errorMsg: \"LaTeX's accent \" + context.funcName + \" works only in text mode\",\n report: true\n });\n mode = \"text\";\n }\n return {\n type: \"accent\",\n mode: mode,\n label: context.funcName,\n isStretchy: false,\n isShifty: true,\n base: base\n };\n }\n});\n\n// Horizontal overlap functions\ndefineFunction({\n type: \"accentUnder\",\n names: [\"\\\\underleftarrow\", \"\\\\underrightarrow\", \"\\\\underleftrightarrow\", \"\\\\undergroup\", \"\\\\underlinesegment\", \"\\\\utilde\"],\n numArgs: 1,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var base = args[0];\n return {\n type: \"accentUnder\",\n mode: parser.mode,\n label: funcName,\n base: base\n };\n },\n htmlBuilder: (group, options) => {\n // Treat under accents much like underlines.\n var innerGroup = buildGroup$1(group.base, options);\n var accentBody = stretchySvg(group, options);\n var kern = group.label === \"\\\\utilde\" ? 0.12 : 0;\n // Generate the vlist, with the appropriate kerns\n var vlist = makeVList({\n positionType: \"top\",\n positionData: innerGroup.height,\n children: [{\n type: \"elem\",\n elem: accentBody,\n wrapperClasses: [\"svg-align\"]\n }, {\n type: \"kern\",\n size: kern\n }, {\n type: \"elem\",\n elem: innerGroup\n }]\n });\n return makeSpan([\"mord\", \"accentunder\"], [vlist], options);\n },\n mathmlBuilder: (group, options) => {\n var accentNode = stretchyMathML(group.label);\n var node = new MathNode(\"munder\", [buildGroup(group.base, options), accentNode]);\n node.setAttribute(\"accentunder\", \"true\");\n return node;\n }\n});\n\n// Helper function\nvar paddedNode = group => {\n var node = new MathNode(\"mpadded\", group ? [group] : []);\n node.setAttribute(\"width\", \"+0.6em\");\n node.setAttribute(\"lspace\", \"0.3em\");\n return node;\n};\n// Stretchy arrows with an optional argument\ndefineFunction({\n type: \"xArrow\",\n names: [\"\\\\xleftarrow\", \"\\\\xrightarrow\", \"\\\\xLeftarrow\", \"\\\\xRightarrow\", \"\\\\xleftrightarrow\", \"\\\\xLeftrightarrow\", \"\\\\xhookleftarrow\", \"\\\\xhookrightarrow\", \"\\\\xmapsto\", \"\\\\xrightharpoondown\", \"\\\\xrightharpoonup\", \"\\\\xleftharpoondown\", \"\\\\xleftharpoonup\", \"\\\\xrightleftharpoons\", \"\\\\xleftrightharpoons\", \"\\\\xlongequal\", \"\\\\xtwoheadrightarrow\", \"\\\\xtwoheadleftarrow\", \"\\\\xtofrom\",\n // The next 3 functions are here to support the mhchem extension.\n // Direct use of these functions is discouraged and may break someday.\n \"\\\\xrightleftarrows\", \"\\\\xrightequilibrium\", \"\\\\xleftequilibrium\",\n // The next 3 functions are here only to support the {CD} environment.\n \"\\\\\\\\cdrightarrow\", \"\\\\\\\\cdleftarrow\", \"\\\\\\\\cdlongequal\"],\n numArgs: 1,\n numOptionalArgs: 1,\n handler(_ref, args, optArgs) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n return {\n type: \"xArrow\",\n mode: parser.mode,\n label: funcName,\n body: args[0],\n below: optArgs[0]\n };\n },\n htmlBuilder(group, options) {\n var style = options.style;\n // Build the argument groups in the appropriate style.\n // Ref: amsmath.dtx: \\hbox{$\\scriptstyle\\mkern#3mu{#6}\\mkern#4mu$}%\n // Some groups can return document fragments. Handle those by wrapping\n // them in a span.\n var newOptions = options.havingStyle(style.sup());\n var upperGroup = wrapFragment(buildGroup$1(group.body, newOptions, options), options);\n var arrowPrefix = group.label.slice(0, 2) === \"\\\\x\" ? \"x\" : \"cd\";\n upperGroup.classes.push(arrowPrefix + \"-arrow-pad\");\n var lowerGroup;\n if (group.below) {\n // Build the lower group\n newOptions = options.havingStyle(style.sub());\n lowerGroup = wrapFragment(buildGroup$1(group.below, newOptions, options), options);\n lowerGroup.classes.push(arrowPrefix + \"-arrow-pad\");\n }\n var arrowBody = stretchySvg(group, options);\n // Re shift: Note that stretchySvg returned arrowBody.depth = 0.\n // The point we want on the math axis is at 0.5 * arrowBody.height.\n var arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height;\n // 2 mu kern. Ref: amsmath.dtx: #7\\if0#2\\else\\mkern#2mu\\fi\n var upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu\n if (upperGroup.depth > 0.25 || group.label === \"\\\\xleftequilibrium\") {\n upperShift -= upperGroup.depth; // shift up if depth encroaches\n }\n // Generate the vlist\n var vlist;\n if (lowerGroup) {\n var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111;\n vlist = makeVList({\n positionType: \"individualShift\",\n children: [{\n type: \"elem\",\n elem: upperGroup,\n shift: upperShift\n }, {\n type: \"elem\",\n elem: arrowBody,\n shift: arrowShift,\n wrapperClasses: [\"svg-align\"]\n }, {\n type: \"elem\",\n elem: lowerGroup,\n shift: lowerShift\n }]\n });\n } else {\n vlist = makeVList({\n positionType: \"individualShift\",\n children: [{\n type: \"elem\",\n elem: upperGroup,\n shift: upperShift\n }, {\n type: \"elem\",\n elem: arrowBody,\n shift: arrowShift,\n wrapperClasses: [\"svg-align\"]\n }]\n });\n }\n return makeSpan([\"mrel\", \"x-arrow\"], [vlist], options);\n },\n mathmlBuilder(group, options) {\n var arrowNode = stretchyMathML(group.label);\n arrowNode.setAttribute(\"minsize\", group.label.charAt(0) === \"x\" ? \"1.75em\" : \"3.0em\");\n var node;\n if (group.body) {\n var upperNode = paddedNode(buildGroup(group.body, options));\n if (group.below) {\n var lowerNode = paddedNode(buildGroup(group.below, options));\n node = new MathNode(\"munderover\", [arrowNode, lowerNode, upperNode]);\n } else {\n node = new MathNode(\"mover\", [arrowNode, upperNode]);\n }\n } else if (group.below) {\n var _lowerNode = paddedNode(buildGroup(group.below, options));\n node = new MathNode(\"munder\", [arrowNode, _lowerNode]);\n } else {\n // This should never happen.\n // Parser.js throws an error if there is no argument.\n node = paddedNode();\n node = new MathNode(\"mover\", [arrowNode, node]);\n }\n return node;\n }\n});\n\nfunction htmlBuilder$9(group, options) {\n var elements = buildExpression$1(group.body, options, true);\n return makeSpan([group.mclass], elements, options);\n}\nfunction mathmlBuilder$8(group, options) {\n var node;\n var inner = buildExpression(group.body, options);\n if (group.mclass === \"minner\") {\n node = new MathNode(\"mpadded\", inner);\n } else if (group.mclass === \"mord\") {\n if (group.isCharacterBox) {\n node = inner[0];\n node.type = \"mi\";\n } else {\n node = new MathNode(\"mi\", inner);\n }\n } else {\n if (group.isCharacterBox) {\n node = inner[0];\n node.type = \"mo\";\n } else {\n node = new MathNode(\"mo\", inner);\n }\n // Set spacing based on what is the most likely adjacent atom type.\n // See TeXbook p170.\n if (group.mclass === \"mbin\") {\n node.attributes.lspace = \"0.22em\"; // medium space\n node.attributes.rspace = \"0.22em\";\n } else if (group.mclass === \"mpunct\") {\n node.attributes.lspace = \"0em\";\n node.attributes.rspace = \"0.17em\"; // thinspace\n } else if (group.mclass === \"mopen\" || group.mclass === \"mclose\") {\n node.attributes.lspace = \"0em\";\n node.attributes.rspace = \"0em\";\n }\n // MathML <mo> default space is 5/18 em, so <mrel> needs no action.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo\n }\n return node;\n}\n// Math class commands except \\mathop\ndefineFunction({\n type: \"mclass\",\n names: [\"\\\\mathord\", \"\\\\mathbin\", \"\\\\mathrel\", \"\\\\mathopen\", \"\\\\mathclose\", \"\\\\mathpunct\", \"\\\\mathinner\"],\n numArgs: 1,\n primitive: true,\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var body = args[0];\n return {\n type: \"mclass\",\n mode: parser.mode,\n mclass: \"m\" + funcName.slice(5),\n body: ordargument(body),\n isCharacterBox: isCharacterBox(body)\n };\n },\n htmlBuilder: htmlBuilder$9,\n mathmlBuilder: mathmlBuilder$8\n});\nvar binrelClass = arg => {\n // \\binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.\n // (by rendering separately and with {}s before and after, and measuring\n // the change in spacing). We'll do roughly the same by detecting the\n // atom type directly.\n var atom = arg.type === \"ordgroup\" && arg.body.length ? arg.body[0] : arg;\n if (atom.type === \"atom\" && (atom.family === \"bin\" || atom.family === \"rel\")) {\n return \"m\" + atom.family;\n } else {\n return \"mord\";\n }\n};\n// \\@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.\n// This is equivalent to \\binrel@{x}\\binrel@@{y} in AMSTeX.\ndefineFunction({\n type: \"mclass\",\n names: [\"\\\\@binrel\"],\n numArgs: 2,\n handler(_ref2, args) {\n var parser = _ref2.parser;\n return {\n type: \"mclass\",\n mode: parser.mode,\n mclass: binrelClass(args[0]),\n body: ordargument(args[1]),\n isCharacterBox: isCharacterBox(args[1])\n };\n }\n});\n// Build a relation or stacked op by placing one symbol on top of another\ndefineFunction({\n type: \"mclass\",\n names: [\"\\\\stackrel\", \"\\\\overset\", \"\\\\underset\"],\n numArgs: 2,\n handler(_ref3, args) {\n var parser = _ref3.parser,\n funcName = _ref3.funcName;\n var baseArg = args[1];\n var shiftedArg = args[0];\n var mclass;\n if (funcName !== \"\\\\stackrel\") {\n // LaTeX applies \\binrel spacing to \\overset and \\underset.\n mclass = binrelClass(baseArg);\n } else {\n mclass = \"mrel\"; // for \\stackrel\n }\n var baseOp = {\n type: \"op\",\n mode: baseArg.mode,\n limits: true,\n alwaysHandleSupSub: true,\n parentIsSupSub: false,\n symbol: false,\n suppressBaseShift: funcName !== \"\\\\stackrel\",\n body: ordargument(baseArg)\n };\n var supsub = funcName === \"\\\\underset\" ? {\n type: \"supsub\",\n mode: shiftedArg.mode,\n base: baseOp,\n sub: shiftedArg\n } : {\n type: \"supsub\",\n mode: shiftedArg.mode,\n base: baseOp,\n sup: shiftedArg\n };\n return {\n type: \"mclass\",\n mode: parser.mode,\n mclass,\n body: [supsub],\n isCharacterBox: isCharacterBox(supsub)\n };\n }\n});\n\n// \\pmb is a simulation of bold font.\n// The version of \\pmb in ambsy.sty works by typesetting three copies\n// with small offsets. We use CSS text-shadow.\n// It's a hack. Not as good as a real bold font. Better than nothing.\ndefineFunction({\n type: \"pmb\",\n names: [\"\\\\pmb\"],\n numArgs: 1,\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser;\n return {\n type: \"pmb\",\n mode: parser.mode,\n mclass: binrelClass(args[0]),\n body: ordargument(args[0])\n };\n },\n htmlBuilder(group, options) {\n var elements = buildExpression$1(group.body, options, true);\n var node = makeSpan([group.mclass], elements, options);\n node.style.textShadow = \"0.02em 0.01em 0.04px\";\n return node;\n },\n mathmlBuilder(group, style) {\n var inner = buildExpression(group.body, style);\n // Wrap with an <mstyle> element.\n var node = new MathNode(\"mstyle\", inner);\n node.setAttribute(\"style\", \"text-shadow: 0.02em 0.01em 0.04px\");\n return node;\n }\n});\n\nvar cdArrowFunctionName = {\n \">\": \"\\\\\\\\cdrightarrow\",\n \"<\": \"\\\\\\\\cdleftarrow\",\n \"=\": \"\\\\\\\\cdlongequal\",\n \"A\": \"\\\\uparrow\",\n \"V\": \"\\\\downarrow\",\n \"|\": \"\\\\Vert\",\n \".\": \"no arrow\"\n};\nvar newCell = () => {\n // Create an empty cell, to be filled below with parse nodes.\n // The parseTree from this module must be constructed like the\n // one created by parseArray(), so an empty CD cell must\n // be a ParseNode<\"styling\">. And CD is always displaystyle.\n return {\n type: \"styling\",\n body: [],\n mode: \"math\",\n style: \"display\",\n resetFont: true\n };\n};\nvar isStartOfArrow = node => {\n return node.type === \"textord\" && node.text === \"@\";\n};\nvar isLabelEnd = (node, endChar) => {\n return (node.type === \"mathord\" || node.type === \"atom\") && node.text === endChar;\n};\nfunction cdArrow(arrowChar, labels, parser) {\n // Return a parse tree of an arrow and its labels.\n // This acts in a way similar to a macro expansion.\n var funcName = cdArrowFunctionName[arrowChar];\n switch (funcName) {\n case \"\\\\\\\\cdrightarrow\":\n case \"\\\\\\\\cdleftarrow\":\n return parser.callFunction(funcName, [labels[0]], [labels[1]]);\n case \"\\\\uparrow\":\n case \"\\\\downarrow\":\n {\n var leftLabel = parser.callFunction(\"\\\\\\\\cdleft\", [labels[0]], []);\n var bareArrow = {\n type: \"atom\",\n text: funcName,\n mode: \"math\",\n family: \"rel\"\n };\n var sizedArrow = parser.callFunction(\"\\\\Big\", [bareArrow], []);\n var rightLabel = parser.callFunction(\"\\\\\\\\cdright\", [labels[1]], []);\n var arrowGroup = {\n type: \"ordgroup\",\n mode: \"math\",\n body: [leftLabel, sizedArrow, rightLabel]\n };\n return parser.callFunction(\"\\\\\\\\cdparent\", [arrowGroup], []);\n }\n case \"\\\\\\\\cdlongequal\":\n return parser.callFunction(\"\\\\\\\\cdlongequal\", [], []);\n case \"\\\\Vert\":\n {\n var arrow = {\n type: \"textord\",\n text: \"\\\\Vert\",\n mode: \"math\"\n };\n return parser.callFunction(\"\\\\Big\", [arrow], []);\n }\n default:\n return {\n type: \"textord\",\n text: \" \",\n mode: \"math\"\n };\n }\n}\nfunction parseCD(parser) {\n // Get the array's parse nodes with \\\\ temporarily mapped to \\cr.\n var parsedRows = [];\n parser.gullet.beginGroup();\n parser.gullet.macros.set(\"\\\\cr\", \"\\\\\\\\\\\\relax\");\n parser.gullet.beginGroup();\n while (true) {\n // Get the parse nodes for the next row.\n parsedRows.push(parser.parseExpression(false, \"\\\\\\\\\"));\n parser.gullet.endGroup();\n parser.gullet.beginGroup();\n var next = parser.fetch().text;\n if (next === \"&\" || next === \"\\\\\\\\\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n if (parsedRows[parsedRows.length - 1].length === 0) {\n parsedRows.pop(); // final row ended in \\\\\n }\n break;\n } else {\n throw new ParseError(\"Expected \\\\\\\\ or \\\\cr or \\\\end\", parser.nextToken);\n }\n }\n var row = [];\n var body = [row];\n // Loop thru the parse nodes. Collect them into cells and arrows.\n for (var i = 0; i < parsedRows.length; i++) {\n // Start a new row.\n var rowNodes = parsedRows[i];\n // Create the first cell.\n var cell = newCell();\n for (var j = 0; j < rowNodes.length; j++) {\n if (!isStartOfArrow(rowNodes[j])) {\n // If a parseNode is not an arrow, it goes into a cell.\n cell.body.push(rowNodes[j]);\n } else {\n // Parse node j is an \"@\", the start of an arrow.\n // Before starting on the arrow, push the cell into `row`.\n row.push(cell);\n // Now collect parseNodes into an arrow.\n // The character after \"@\" defines the arrow type.\n j += 1;\n var arrowChar = assertSymbolNodeType(rowNodes[j]).text;\n // Create two empty label nodes. We may or may not use them.\n var labels = new Array(2);\n labels[0] = {\n type: \"ordgroup\",\n mode: \"math\",\n body: []\n };\n labels[1] = {\n type: \"ordgroup\",\n mode: \"math\",\n body: []\n };\n // Process the arrow.\n if (\"=|.\".includes(arrowChar)) ; else if (\"<>AV\".includes(arrowChar)) {\n // Four arrows, `@>>>`, `@<<<`, `@AAA`, and `@VVV`, each take\n // two optional labels. E.g. the right-point arrow syntax is\n // really: @>{optional label}>{optional label}>\n // Collect parseNodes into labels.\n for (var labelNum = 0; labelNum < 2; labelNum++) {\n var inLabel = true;\n for (var k = j + 1; k < rowNodes.length; k++) {\n if (isLabelEnd(rowNodes[k], arrowChar)) {\n inLabel = false;\n j = k;\n break;\n }\n if (isStartOfArrow(rowNodes[k])) {\n throw new ParseError(\"Missing a \" + arrowChar + \" character to complete a CD arrow.\", rowNodes[k]);\n }\n labels[labelNum].body.push(rowNodes[k]);\n }\n if (inLabel) {\n // isLabelEnd never returned a true.\n throw new ParseError(\"Missing a \" + arrowChar + \" character to complete a CD arrow.\", rowNodes[j]);\n }\n }\n } else {\n throw new ParseError(\"Expected one of \\\"<>AV=|.\\\" after @\", rowNodes[j]);\n }\n // Now join the arrow to its labels.\n var arrow = cdArrow(arrowChar, labels, parser);\n // Wrap the arrow in ParseNode<\"styling\">.\n // This is done to match parseArray() behavior.\n var wrappedArrow = {\n type: \"styling\",\n body: [arrow],\n mode: \"math\",\n style: \"display\",\n // CD is always displaystyle.\n resetFont: true\n };\n row.push(wrappedArrow);\n // In CD's syntax, cells are implicit. That is, everything that\n // is not an arrow gets collected into a cell. So create an empty\n // cell now. It will collect upcoming parseNodes.\n cell = newCell();\n }\n }\n if (i % 2 === 0) {\n // Even-numbered rows consist of: cell, arrow, cell, arrow, ... cell\n // The last cell is not yet pushed into `row`, so:\n row.push(cell);\n } else {\n // Odd-numbered rows consist of: vert arrow, empty cell, ... vert arrow\n // Remove the empty cell that was placed at the beginning of `row`.\n row.shift();\n }\n row = [];\n body.push(row);\n }\n // End row group\n parser.gullet.endGroup();\n // End array group defining \\\\\n parser.gullet.endGroup();\n // define column separation.\n var cols = new Array(body[0].length).fill({\n type: \"align\",\n align: \"c\",\n pregap: 0.25,\n // CD package sets \\enskip between columns.\n postgap: 0.25 // So pre and post each get half an \\enskip, i.e. 0.25em.\n });\n return {\n type: \"array\",\n mode: \"math\",\n body,\n arraystretch: 1,\n addJot: true,\n rowGaps: [null],\n cols,\n colSeparationType: \"CD\",\n hLinesBeforeRow: new Array(body.length + 1).fill([])\n };\n}\n// The functions below are not available for general use.\n// They are here only for internal use by the {CD} environment in placing labels\n// next to vertical arrows.\n// We don't need any such functions for horizontal arrows because we can reuse\n// the functionality that already exists for extensible arrows.\ndefineFunction({\n type: \"cdlabel\",\n names: [\"\\\\\\\\cdleft\", \"\\\\\\\\cdright\"],\n numArgs: 1,\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n return {\n type: \"cdlabel\",\n mode: parser.mode,\n side: funcName.slice(4),\n label: args[0]\n };\n },\n htmlBuilder(group, options) {\n var newOptions = options.havingStyle(options.style.sup());\n var label = wrapFragment(buildGroup$1(group.label, newOptions, options), options);\n label.classes.push(\"cd-label-\" + group.side);\n label.style.bottom = makeEm(0.8 - label.depth);\n // Zero out label height & depth, so vertical align of arrow is set\n // by the arrow height, not by the label.\n label.height = 0;\n label.depth = 0;\n return label;\n },\n mathmlBuilder(group, options) {\n var label = new MathNode(\"mrow\", [buildGroup(group.label, options)]);\n label = new MathNode(\"mpadded\", [label]);\n label.setAttribute(\"width\", \"0\");\n if (group.side === \"left\") {\n label.setAttribute(\"lspace\", \"-1width\");\n }\n // We have to guess at vertical alignment. We know the arrow is 1.8em tall,\n // But we don't know the height or depth of the label.\n label.setAttribute(\"voffset\", \"0.7em\");\n label = new MathNode(\"mstyle\", [label]);\n label.setAttribute(\"displaystyle\", \"false\");\n label.setAttribute(\"scriptlevel\", \"1\");\n return label;\n }\n});\ndefineFunction({\n type: \"cdlabelparent\",\n names: [\"\\\\\\\\cdparent\"],\n numArgs: 1,\n handler(_ref2, args) {\n var parser = _ref2.parser;\n return {\n type: \"cdlabelparent\",\n mode: parser.mode,\n fragment: args[0]\n };\n },\n htmlBuilder(group, options) {\n // Wrap the vertical arrow and its labels.\n // The parent gets position: relative. The child gets position: absolute.\n // So CSS can locate the label correctly.\n var parent = wrapFragment(buildGroup$1(group.fragment, options), options);\n parent.classes.push(\"cd-vert-arrow\");\n return parent;\n },\n mathmlBuilder(group, options) {\n return new MathNode(\"mrow\", [buildGroup(group.fragment, options)]);\n }\n});\n\n// \\@char is an internal function that takes a grouped decimal argument like\n// {123} and converts into symbol with code 123. It is used by the *macro*\n// \\char defined in macros.js.\ndefineFunction({\n type: \"textord\",\n names: [\"\\\\@char\"],\n numArgs: 1,\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser;\n var arg = assertNodeType(args[0], \"ordgroup\");\n var number = assertCharacterGroup(arg, \"\\\\@char has non-numeric argument\");\n var code = parseInt(number);\n var text;\n if (isNaN(code)) {\n throw new ParseError(\"\\\\@char has non-numeric argument \" + number);\n // If we drop IE support, the following code could be replaced with\n // text = String.fromCodePoint(code)\n } else if (code < 0 || code > 0x10ffff) {\n throw new ParseError(\"\\\\@char with invalid code point \" + number);\n } else if (code <= 0xffff) {\n text = String.fromCharCode(code);\n } else {\n // Astral code point; split into surrogate halves\n code -= 0x10000;\n text = String.fromCharCode((code >> 10) + 0xd800, (code & 0x3ff) + 0xdc00);\n }\n return {\n type: \"textord\",\n mode: parser.mode,\n text: text\n };\n }\n});\n\nvar htmlBuilder$8 = (group, options) => {\n var elements = buildExpression$1(group.body, options.withColor(group.color), false);\n // \\color isn't supposed to affect the type of the elements it contains.\n // To accomplish this, we wrap the results in a fragment, so the inner\n // elements will be able to directly interact with their neighbors. For\n // example, `\\color{red}{2 +} 3` has the same spacing as `2 + 3`\n return makeFragment(elements);\n};\nvar mathmlBuilder$7 = (group, options) => {\n var inner = buildExpression(group.body, options.withColor(group.color));\n var node = new MathNode(\"mstyle\", inner);\n node.setAttribute(\"mathcolor\", group.color);\n return node;\n};\ndefineFunction({\n type: \"color\",\n names: [\"\\\\textcolor\"],\n numArgs: 2,\n allowedInText: true,\n argTypes: [\"color\", \"original\"],\n handler(_ref, args) {\n var parser = _ref.parser;\n var color = assertNodeType(args[0], \"color-token\").color;\n var body = args[1];\n return {\n type: \"color\",\n mode: parser.mode,\n color,\n body: ordargument(body)\n };\n },\n htmlBuilder: htmlBuilder$8,\n mathmlBuilder: mathmlBuilder$7\n});\ndefineFunction({\n type: \"color\",\n names: [\"\\\\color\"],\n numArgs: 1,\n allowedInText: true,\n argTypes: [\"color\"],\n handler(_ref2, args) {\n var parser = _ref2.parser,\n breakOnTokenText = _ref2.breakOnTokenText;\n var color = assertNodeType(args[0], \"color-token\").color;\n // Set macro \\current@color in current namespace to store the current\n // color, mimicking the behavior of color.sty.\n // This is currently used just to correctly color a \\right\n // that follows a \\color command.\n parser.gullet.macros.set(\"\\\\current@color\", color);\n // Parse out the implicit body that should be colored.\n var body = parser.parseExpression(true, breakOnTokenText);\n return {\n type: \"color\",\n mode: parser.mode,\n color,\n body\n };\n }\n});\n\n// Row breaks within tabular environments, and line breaks at top level\n// \\DeclareRobustCommand\\\\{...\\@xnewline}\ndefineFunction({\n type: \"cr\",\n names: [\"\\\\\\\\\"],\n numArgs: 0,\n numOptionalArgs: 0,\n allowedInText: true,\n handler(_ref) {\n var parser = _ref.parser;\n var size = parser.gullet.future().text === \"[\" ? parser.parseSizeGroup(true) : null;\n var newLine = !parser.settings.displayMode || !handleStrict({\n strict: parser.settings.strict,\n errorCode: \"newLineInDisplayMode\",\n errorMsg: \"In LaTeX, \\\\\\\\ or \\\\newline does nothing in display mode\",\n report: false\n });\n return {\n type: \"cr\",\n mode: parser.mode,\n newLine,\n size: size && assertNodeType(size, \"size\").value\n };\n },\n // The following builders are called only at the top level,\n // not within tabular/array environments.\n htmlBuilder(group, options) {\n var span = makeSpan([\"mspace\"], [], options);\n if (group.newLine) {\n span.classes.push(\"katex-newline\");\n if (group.size) {\n span.style.marginTop = makeEm(calculateSize(group.size, options));\n }\n }\n return span;\n },\n mathmlBuilder(group, options) {\n var node = new MathNode(\"mspace\");\n if (group.newLine) {\n node.setAttribute(\"linebreak\", \"newline\");\n if (group.size) {\n node.setAttribute(\"height\", makeEm(calculateSize(group.size, options)));\n }\n }\n return node;\n }\n});\n\nvar globalMap = {\n \"\\\\global\": \"\\\\global\",\n \"\\\\long\": \"\\\\\\\\globallong\",\n \"\\\\\\\\globallong\": \"\\\\\\\\globallong\",\n \"\\\\def\": \"\\\\gdef\",\n \"\\\\gdef\": \"\\\\gdef\",\n \"\\\\edef\": \"\\\\xdef\",\n \"\\\\xdef\": \"\\\\xdef\",\n \"\\\\let\": \"\\\\\\\\globallet\",\n \"\\\\futurelet\": \"\\\\\\\\globalfuture\"\n};\nvar checkControlSequence = tok => {\n var name = tok.text;\n if (/^(?:[\\\\{}$&#^_]|EOF)$/.test(name)) {\n throw new ParseError(\"Expected a control sequence\", tok);\n }\n return name;\n};\nvar getRHS = parser => {\n var tok = parser.gullet.popToken();\n if (tok.text === \"=\") {\n // consume optional equals\n tok = parser.gullet.popToken();\n if (tok.text === \" \") {\n // consume one optional space\n tok = parser.gullet.popToken();\n }\n }\n return tok;\n};\nvar letCommand = (parser, name, tok, global) => {\n var macro = parser.gullet.macros.get(tok.text);\n if (macro == null) {\n // don't expand it later even if a macro with the same name is defined\n // e.g., \\let\\foo=\\frac \\def\\frac{\\relax} \\frac12\n tok.noexpand = true;\n macro = {\n tokens: [tok],\n numArgs: 0,\n // reproduce the same behavior in expansion\n unexpandable: !parser.gullet.isExpandable(tok.text)\n };\n }\n parser.gullet.macros.set(name, macro, global);\n};\n// <assignment> -> <non-macro assignment>|<macro assignment>\n// <non-macro assignment> -> <simple assignment>|\\global<non-macro assignment>\n// <macro assignment> -> <definition>|<prefix><macro assignment>\n// <prefix> -> \\global|\\long|\\outer\ndefineFunction({\n type: \"internal\",\n names: [\"\\\\global\", \"\\\\long\", \"\\\\\\\\globallong\" // can’t be entered directly\n ],\n numArgs: 0,\n allowedInText: true,\n handler(_ref) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n parser.consumeSpaces();\n var token = parser.fetch();\n if (globalMap[token.text]) {\n // KaTeX doesn't have \\par, so ignore \\long\n if (funcName === \"\\\\global\" || funcName === \"\\\\\\\\globallong\") {\n token.text = globalMap[token.text];\n }\n return assertNodeType(parser.parseFunction(), \"internal\");\n }\n throw new ParseError(\"Invalid token after macro prefix\", token);\n }\n});\n// Basic support for macro definitions: \\def, \\gdef, \\edef, \\xdef\n// <definition> -> <def><control sequence><definition text>\n// <def> -> \\def|\\gdef|\\edef|\\xdef\n// <definition text> -> <parameter text><left brace><balanced text><right brace>\ndefineFunction({\n type: \"internal\",\n names: [\"\\\\def\", \"\\\\gdef\", \"\\\\edef\", \"\\\\xdef\"],\n numArgs: 0,\n allowedInText: true,\n primitive: true,\n handler(_ref2) {\n var parser = _ref2.parser,\n funcName = _ref2.funcName;\n var tok = parser.gullet.popToken();\n var name = tok.text;\n if (/^(?:[\\\\{}$&#^_]|EOF)$/.test(name)) {\n throw new ParseError(\"Expected a control sequence\", tok);\n }\n var numArgs = 0;\n var insert;\n var delimiters = [[]];\n // <parameter text> contains no braces\n while (parser.gullet.future().text !== \"{\") {\n tok = parser.gullet.popToken();\n if (tok.text === \"#\") {\n // If the very last character of the <parameter text> is #, so that\n // this # is immediately followed by {, TeX will behave as if the {\n // had been inserted at the right end of both the parameter text\n // and the replacement text.\n if (parser.gullet.future().text === \"{\") {\n insert = parser.gullet.future();\n delimiters[numArgs].push(\"{\");\n break;\n }\n // A parameter, the first appearance of # must be followed by 1,\n // the next by 2, and so on; up to nine #’s are allowed\n tok = parser.gullet.popToken();\n if (!/^[1-9]$/.test(tok.text)) {\n throw new ParseError(\"Invalid argument number \\\"\" + tok.text + \"\\\"\");\n }\n if (parseInt(tok.text) !== numArgs + 1) {\n throw new ParseError(\"Argument number \\\"\" + tok.text + \"\\\" out of order\");\n }\n numArgs++;\n delimiters.push([]);\n } else if (tok.text === \"EOF\") {\n throw new ParseError(\"Expected a macro definition\");\n } else {\n delimiters[numArgs].push(tok.text);\n }\n }\n // replacement text, enclosed in '{' and '}' and properly nested\n var _parser$gullet$consum = parser.gullet.consumeArg(),\n tokens = _parser$gullet$consum.tokens;\n if (insert) {\n tokens.unshift(insert);\n }\n if (funcName === \"\\\\edef\" || funcName === \"\\\\xdef\") {\n tokens = parser.gullet.expandTokens(tokens);\n tokens.reverse(); // to fit in with stack order\n }\n // Final arg is the expansion of the macro\n parser.gullet.macros.set(name, {\n tokens,\n numArgs,\n delimiters\n }, funcName === globalMap[funcName]);\n return {\n type: \"internal\",\n mode: parser.mode\n };\n }\n});\n// <simple assignment> -> <let assignment>\n// <let assignment> -> \\futurelet<control sequence><token><token>\n// | \\let<control sequence><equals><one optional space><token>\n// <equals> -> <optional spaces>|<optional spaces>=\ndefineFunction({\n type: \"internal\",\n names: [\"\\\\let\", \"\\\\\\\\globallet\" // can’t be entered directly\n ],\n numArgs: 0,\n allowedInText: true,\n primitive: true,\n handler(_ref3) {\n var parser = _ref3.parser,\n funcName = _ref3.funcName;\n var name = checkControlSequence(parser.gullet.popToken());\n parser.gullet.consumeSpaces();\n var tok = getRHS(parser);\n letCommand(parser, name, tok, funcName === \"\\\\\\\\globallet\");\n return {\n type: \"internal\",\n mode: parser.mode\n };\n }\n});\n// ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf\ndefineFunction({\n type: \"internal\",\n names: [\"\\\\futurelet\", \"\\\\\\\\globalfuture\" // can’t be entered directly\n ],\n numArgs: 0,\n allowedInText: true,\n primitive: true,\n handler(_ref4) {\n var parser = _ref4.parser,\n funcName = _ref4.funcName;\n var name = checkControlSequence(parser.gullet.popToken());\n var middle = parser.gullet.popToken();\n var tok = parser.gullet.popToken();\n letCommand(parser, name, tok, funcName === \"\\\\\\\\globalfuture\");\n parser.gullet.pushToken(tok);\n parser.gullet.pushToken(middle);\n return {\n type: \"internal\",\n mode: parser.mode\n };\n }\n});\n\n/**\n * This file deals with creating delimiters of various sizes. The TeXbook\n * discusses these routines on page 441-442, in the \"Another subroutine sets box\n * x to a specified variable delimiter\" paragraph.\n *\n * There are three main routines here. `makeSmallDelim` makes a delimiter in the\n * normal font, but in either text, script, or scriptscript style.\n * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,\n * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of\n * smaller pieces that are stacked on top of one another.\n *\n * The functions take a parameter `center`, which determines if the delimiter\n * should be centered around the axis.\n *\n * Then, there are three exposed functions. `sizedDelim` makes a delimiter in\n * one of the given sizes. This is used for things like `\\bigl`.\n * `customSizedDelim` makes a delimiter with a given total height+depth. It is\n * called in places like `\\sqrt`. `leftRightDelim` makes an appropriate\n * delimiter which surrounds an expression of a given height an depth. It is\n * used in `\\left` and `\\right`.\n */\n/**\n * Get the metrics for a given symbol and font, after transformation (i.e.\n * after following replacement from symbols.js)\n */\nvar getMetrics = function getMetrics(symbol, font, mode) {\n var replace = symbols.math[symbol] && symbols.math[symbol].replace;\n var metrics = getCharacterMetrics(replace || symbol, font, mode);\n if (!metrics) {\n throw new Error(\"Unsupported symbol \" + symbol + \" and font size \" + font + \".\");\n }\n return metrics;\n};\n/**\n * Puts a delimiter span in a given style, and adds appropriate height, depth,\n * and maxFontSizes.\n */\nvar styleWrap = function styleWrap(delim, toStyle, options, classes) {\n var newOptions = options.havingBaseStyle(toStyle);\n var span = makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options);\n var delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier;\n span.height *= delimSizeMultiplier;\n span.depth *= delimSizeMultiplier;\n span.maxFontSize = newOptions.sizeMultiplier;\n return span;\n};\nvar centerSpan = function centerSpan(span, options, style) {\n var newOptions = options.havingBaseStyle(style);\n var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight;\n span.classes.push(\"delimcenter\");\n span.style.top = makeEm(shift);\n span.height -= shift;\n span.depth += shift;\n};\n/**\n * Makes a small delimiter. This is a delimiter that comes in the Main-Regular\n * font, but is restyled to either be in textstyle, scriptstyle, or\n * scriptscriptstyle.\n */\nvar makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) {\n var text = makeSymbol(delim, \"Main-Regular\", mode, options);\n var span = styleWrap(text, style, options, classes);\n if (center) {\n centerSpan(span, options, style);\n }\n return span;\n};\n/**\n * Builds a symbol in the given font size (note size is an integer)\n */\nvar mathrmSize = function mathrmSize(value, size, mode, options) {\n return makeSymbol(value, \"Size\" + size + \"-Regular\", mode, options);\n};\n/**\n * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,\n * Size3, or Size4 fonts. It is always rendered in textstyle.\n */\nvar makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) {\n var inner = mathrmSize(delim, size, mode, options);\n var span = styleWrap(makeSpan([\"delimsizing\", \"size\" + size], [inner], options), Style$1.TEXT, options, classes);\n if (center) {\n centerSpan(span, options, Style$1.TEXT);\n }\n return span;\n};\n/**\n * Make a span from a font glyph with the given offset and in the given font.\n * This is used in makeStackedDelim to make the stacking pieces for the delimiter.\n */\nvar makeGlyphSpan = function makeGlyphSpan(symbol, font, mode, options) {\n var sizeClass;\n // Apply the correct CSS class to choose the right font.\n if (font === \"Size1-Regular\") {\n sizeClass = \"delim-size1\";\n } else /* if (font === \"Size4-Regular\") */{\n sizeClass = \"delim-size4\";\n }\n var corner = makeSpan([\"delimsizinginner\", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode, options)])]);\n // Since this will be passed into `makeVList` in the end, wrap the element\n // in the appropriate tag that VList uses.\n return {\n type: \"elem\",\n elem: corner\n };\n};\nvar makeInner = function makeInner(ch, height, options) {\n // Create a span with inline SVG for the inner part of a tall stacked delimiter.\n var width = fontMetricsData['Size4-Regular'][ch.charCodeAt(0)] ? fontMetricsData['Size4-Regular'][ch.charCodeAt(0)][4] : fontMetricsData['Size1-Regular'][ch.charCodeAt(0)][4];\n var path = new PathNode(\"inner\", innerPath(ch, Math.round(1000 * height)));\n var svgNode = new SvgNode([path], {\n \"width\": makeEm(width),\n \"height\": makeEm(height),\n // Override CSS rule `.katex svg { width: 100% }`\n \"style\": \"width:\" + makeEm(width),\n \"viewBox\": \"0 0 \" + 1000 * width + \" \" + Math.round(1000 * height),\n \"preserveAspectRatio\": \"xMinYMin\"\n });\n var span = makeSvgSpan([], [svgNode], options);\n span.height = height;\n span.style.height = makeEm(height);\n span.style.width = makeEm(width);\n return {\n type: \"elem\",\n elem: span\n };\n};\n// Helpers for makeStackedDelim\nvar lapInEms = 0.008;\nvar lap = {\n type: \"kern\",\n size: -1 * lapInEms\n};\nvar verts = new Set([\"|\", \"\\\\lvert\", \"\\\\rvert\", \"\\\\vert\"]);\nvar doubleVerts = new Set([\"\\\\|\", \"\\\\lVert\", \"\\\\rVert\", \"\\\\Vert\"]);\n/**\n * Make a stacked delimiter out of a given delimiter, with the total height at\n * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.\n */\nvar makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) {\n // There are four parts, the top, an optional middle, a repeated part, and a\n // bottom.\n var top;\n var middle;\n var repeat;\n var bottom;\n var svgLabel = \"\";\n var viewBoxWidth = 0;\n top = repeat = bottom = delim;\n middle = null;\n // Also keep track of what font the delimiters are in\n var font = \"Size1-Regular\";\n // We set the parts and font based on the symbol. Note that we use\n // '\\u23d0' instead of '|' and '\\u2016' instead of '\\\\|' for the\n // repeats of the arrows\n if (delim === \"\\\\uparrow\") {\n repeat = bottom = \"\\u23d0\";\n } else if (delim === \"\\\\Uparrow\") {\n repeat = bottom = \"\\u2016\";\n } else if (delim === \"\\\\downarrow\") {\n top = repeat = \"\\u23d0\";\n } else if (delim === \"\\\\Downarrow\") {\n top = repeat = \"\\u2016\";\n } else if (delim === \"\\\\updownarrow\") {\n top = \"\\\\uparrow\";\n repeat = \"\\u23d0\";\n bottom = \"\\\\downarrow\";\n } else if (delim === \"\\\\Updownarrow\") {\n top = \"\\\\Uparrow\";\n repeat = \"\\u2016\";\n bottom = \"\\\\Downarrow\";\n } else if (verts.has(delim)) {\n repeat = \"\\u2223\";\n svgLabel = \"vert\";\n viewBoxWidth = 333;\n } else if (doubleVerts.has(delim)) {\n repeat = \"\\u2225\";\n svgLabel = \"doublevert\";\n viewBoxWidth = 556;\n } else if (delim === \"[\" || delim === \"\\\\lbrack\") {\n top = \"\\u23a1\";\n repeat = \"\\u23a2\";\n bottom = \"\\u23a3\";\n font = \"Size4-Regular\";\n svgLabel = \"lbrack\";\n viewBoxWidth = 667;\n } else if (delim === \"]\" || delim === \"\\\\rbrack\") {\n top = \"\\u23a4\";\n repeat = \"\\u23a5\";\n bottom = \"\\u23a6\";\n font = \"Size4-Regular\";\n svgLabel = \"rbrack\";\n viewBoxWidth = 667;\n } else if (delim === \"\\\\lfloor\" || delim === \"\\u230a\") {\n repeat = top = \"\\u23a2\";\n bottom = \"\\u23a3\";\n font = \"Size4-Regular\";\n svgLabel = \"lfloor\";\n viewBoxWidth = 667;\n } else if (delim === \"\\\\lceil\" || delim === \"\\u2308\") {\n top = \"\\u23a1\";\n repeat = bottom = \"\\u23a2\";\n font = \"Size4-Regular\";\n svgLabel = \"lceil\";\n viewBoxWidth = 667;\n } else if (delim === \"\\\\rfloor\" || delim === \"\\u230b\") {\n repeat = top = \"\\u23a5\";\n bottom = \"\\u23a6\";\n font = \"Size4-Regular\";\n svgLabel = \"rfloor\";\n viewBoxWidth = 667;\n } else if (delim === \"\\\\rceil\" || delim === \"\\u2309\") {\n top = \"\\u23a4\";\n repeat = bottom = \"\\u23a5\";\n font = \"Size4-Regular\";\n svgLabel = \"rceil\";\n viewBoxWidth = 667;\n } else if (delim === \"(\" || delim === \"\\\\lparen\") {\n top = \"\\u239b\";\n repeat = \"\\u239c\";\n bottom = \"\\u239d\";\n font = \"Size4-Regular\";\n svgLabel = \"lparen\";\n viewBoxWidth = 875;\n } else if (delim === \")\" || delim === \"\\\\rparen\") {\n top = \"\\u239e\";\n repeat = \"\\u239f\";\n bottom = \"\\u23a0\";\n font = \"Size4-Regular\";\n svgLabel = \"rparen\";\n viewBoxWidth = 875;\n } else if (delim === \"\\\\{\" || delim === \"\\\\lbrace\") {\n top = \"\\u23a7\";\n middle = \"\\u23a8\";\n bottom = \"\\u23a9\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n } else if (delim === \"\\\\}\" || delim === \"\\\\rbrace\") {\n top = \"\\u23ab\";\n middle = \"\\u23ac\";\n bottom = \"\\u23ad\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n } else if (delim === \"\\\\lgroup\" || delim === \"\\u27ee\") {\n top = \"\\u23a7\";\n bottom = \"\\u23a9\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n } else if (delim === \"\\\\rgroup\" || delim === \"\\u27ef\") {\n top = \"\\u23ab\";\n bottom = \"\\u23ad\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n } else if (delim === \"\\\\lmoustache\" || delim === \"\\u23b0\") {\n top = \"\\u23a7\";\n bottom = \"\\u23ad\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n } else if (delim === \"\\\\rmoustache\" || delim === \"\\u23b1\") {\n top = \"\\u23ab\";\n bottom = \"\\u23a9\";\n repeat = \"\\u23aa\";\n font = \"Size4-Regular\";\n }\n // Get the metrics of the four sections\n var topMetrics = getMetrics(top, font, mode);\n var topHeightTotal = topMetrics.height + topMetrics.depth;\n var repeatMetrics = getMetrics(repeat, font, mode);\n var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;\n var bottomMetrics = getMetrics(bottom, font, mode);\n var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;\n var middleHeightTotal = 0;\n var middleFactor = 1;\n if (middle !== null) {\n var middleMetrics = getMetrics(middle, font, mode);\n middleHeightTotal = middleMetrics.height + middleMetrics.depth;\n middleFactor = 2; // repeat symmetrically above and below middle\n }\n // Calculate the minimal height that the delimiter can have.\n // It is at least the size of the top, bottom, and optional middle combined.\n var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;\n // Compute the number of copies of the repeat symbol we will need\n var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal)));\n // Compute the total height of the delimiter including all the symbols\n var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal;\n // The center of the delimiter is placed at the center of the axis. Note\n // that in this context, \"center\" means that the delimiter should be\n // centered around the axis in the current style, while normally it is\n // centered around the axis in textstyle.\n var axisHeight = options.fontMetrics().axisHeight;\n if (center) {\n axisHeight *= options.sizeMultiplier;\n }\n // Calculate the depth\n var depth = realHeightTotal / 2 - axisHeight;\n // Now, we start building the pieces that will go into the vlist\n // Keep a list of the pieces of the stacked delimiter\n var stack = [];\n if (svgLabel.length > 0) {\n // Instead of stacking glyphs, create a single SVG.\n // This evades browser problems with imprecise positioning of spans.\n var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal;\n var viewBoxHeight = Math.round(realHeightTotal * 1000);\n var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));\n var path = new PathNode(svgLabel, pathStr);\n var width = makeEm(viewBoxWidth / 1000);\n var height = makeEm(viewBoxHeight / 1000);\n var svg = new SvgNode([path], {\n \"width\": width,\n \"height\": height,\n \"viewBox\": \"0 0 \" + viewBoxWidth + \" \" + viewBoxHeight\n });\n var wrapper = makeSvgSpan([], [svg], options);\n wrapper.height = viewBoxHeight / 1000;\n wrapper.style.width = width;\n wrapper.style.height = height;\n stack.push({\n type: \"elem\",\n elem: wrapper\n });\n } else {\n // Stack glyphs\n // Start by adding the bottom symbol\n stack.push(makeGlyphSpan(bottom, font, mode, options));\n stack.push(lap); // overlap\n if (middle === null) {\n // The middle section will be an SVG. Make it an extra 0.016em tall.\n // We'll overlap by 0.008em at top and bottom.\n var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;\n stack.push(makeInner(repeat, innerHeight, options));\n } else {\n // When there is a middle bit, we need the middle part and two repeated\n // sections\n var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;\n stack.push(makeInner(repeat, _innerHeight, options));\n // Now insert the middle of the brace.\n stack.push(lap);\n stack.push(makeGlyphSpan(middle, font, mode, options));\n stack.push(lap);\n stack.push(makeInner(repeat, _innerHeight, options));\n }\n // Add the top symbol\n stack.push(lap);\n stack.push(makeGlyphSpan(top, font, mode, options));\n }\n // Finally, build the vlist\n var newOptions = options.havingBaseStyle(Style$1.TEXT);\n var inner = makeVList({\n positionType: \"bottom\",\n positionData: depth,\n children: stack\n });\n return styleWrap(makeSpan([\"delimsizing\", \"mult\"], [inner], newOptions), Style$1.TEXT, options, classes);\n};\n// All surds have 0.08em padding above the vinculum inside the SVG.\n// That keeps browser span height rounding error from pinching the line.\nvar vbPad = 80; // padding above the surd, measured inside the viewBox.\nvar emPad = 0.08; // padding, in ems, measured in the document.\nvar sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, extraVinculum, options) {\n var path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);\n var pathNode = new PathNode(sqrtName, path);\n var svg = new SvgNode([pathNode], {\n // Note: 1000:1 ratio of viewBox to document em width.\n \"width\": \"400em\",\n \"height\": makeEm(height),\n \"viewBox\": \"0 0 400000 \" + viewBoxHeight,\n \"preserveAspectRatio\": \"xMinYMin slice\"\n });\n return makeSvgSpan([\"hide-tail\"], [svg], options);\n};\n/**\n * Make a sqrt image of the given height,\n */\nvar makeSqrtImage = function makeSqrtImage(height, options) {\n // Define a newOptions that removes the effect of size changes such as \\Huge.\n // We don't pick different a height surd for \\Huge. For it, we scale up.\n var newOptions = options.havingBaseSizing();\n // Pick the desired surd glyph from a sequence of surds.\n var delim = traverseSequence(\"\\\\surd\", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions);\n var sizeMultiplier = newOptions.sizeMultiplier; // default\n // The standard sqrt SVGs each have a 0.04em thick vinculum.\n // If Settings.minRuleThickness is larger than that, we add extraVinculum.\n var extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);\n // Create a span containing an SVG image of a sqrt symbol.\n var span;\n var spanHeight;\n var texHeight;\n var viewBoxHeight;\n var advanceWidth;\n // We create viewBoxes with 80 units of \"padding\" above each surd.\n // Then browser rounding error on the parent span height will not\n // encroach on the ink of the vinculum. But that padding is not\n // included in the TeX-like `height` used for calculation of\n // vertical alignment. So texHeight = span.height < span.style.height.\n if (delim.type === \"small\") {\n // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.\n // 1000 unit normal glyph height.\n viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;\n if (height < 1.0) {\n sizeMultiplier = 1.0; // mimic a \\textfont radical\n } else if (height < 1.4) {\n sizeMultiplier = 0.7; // mimic a \\scriptfont radical\n }\n spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;\n texHeight = (1.00 + extraVinculum) / sizeMultiplier;\n span = sqrtSvg(\"sqrtMain\", spanHeight, viewBoxHeight, extraVinculum, options);\n span.style.minWidth = \"0.853em\";\n advanceWidth = 0.833 / sizeMultiplier; // from the font.\n } else if (delim.type === \"large\") {\n // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.\n viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];\n texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;\n spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier;\n span = sqrtSvg(\"sqrtSize\" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options);\n span.style.minWidth = \"1.02em\";\n advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.\n } else {\n // Tall sqrt. In TeX, this would be stacked using multiple glyphs.\n // We'll use a single SVG to accomplish the same thing.\n spanHeight = height + extraVinculum + emPad;\n texHeight = height + extraVinculum;\n viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;\n span = sqrtSvg(\"sqrtTall\", spanHeight, viewBoxHeight, extraVinculum, options);\n span.style.minWidth = \"0.742em\";\n advanceWidth = 1.056;\n }\n span.height = texHeight;\n span.style.height = makeEm(spanHeight);\n return {\n span,\n advanceWidth,\n // Calculate the actual line width.\n // This actually should depend on the chosen font -- e.g. \\boldmath\n // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and\n // have thicker rules.\n ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier\n };\n};\n// There are three kinds of delimiters, delimiters that stack when they become\n// too large\nvar stackLargeDelimiters = new Set([\"(\", \"\\\\lparen\", \")\", \"\\\\rparen\", \"[\", \"\\\\lbrack\", \"]\", \"\\\\rbrack\", \"\\\\{\", \"\\\\lbrace\", \"\\\\}\", \"\\\\rbrace\", \"\\\\lfloor\", \"\\\\rfloor\", \"\\u230a\", \"\\u230b\", \"\\\\lceil\", \"\\\\rceil\", \"\\u2308\", \"\\u2309\", \"\\\\surd\"]);\n// delimiters that always stack\nvar stackAlwaysDelimiters = new Set([\"\\\\uparrow\", \"\\\\downarrow\", \"\\\\updownarrow\", \"\\\\Uparrow\", \"\\\\Downarrow\", \"\\\\Updownarrow\", \"|\", \"\\\\|\", \"\\\\vert\", \"\\\\Vert\", \"\\\\lvert\", \"\\\\rvert\", \"\\\\lVert\", \"\\\\rVert\", \"\\\\lgroup\", \"\\\\rgroup\", \"\\u27ee\", \"\\u27ef\", \"\\\\lmoustache\", \"\\\\rmoustache\", \"\\u23b0\", \"\\u23b1\"]);\n// and delimiters that never stack\nvar stackNeverDelimiters = new Set([\"<\", \">\", \"\\\\langle\", \"\\\\rangle\", \"/\", \"\\\\backslash\", \"\\\\lt\", \"\\\\gt\"]);\n// Metrics of the different sizes. Found by looking at TeX's output of\n// $\\bigl| // \\Bigl| \\biggl| \\Biggl| \\showlists$\n// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.\nvar sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];\n/**\n * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.\n */\nvar makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) {\n // < and > turn into \\langle and \\rangle in delimiters\n if (delim === \"<\" || delim === \"\\\\lt\" || delim === \"\\u27e8\") {\n delim = \"\\\\langle\";\n } else if (delim === \">\" || delim === \"\\\\gt\" || delim === \"\\u27e9\") {\n delim = \"\\\\rangle\";\n }\n // Sized delimiters are never centered.\n if (stackLargeDelimiters.has(delim) || stackNeverDelimiters.has(delim)) {\n return makeLargeDelim(delim, size, false, options, mode, classes);\n } else if (stackAlwaysDelimiters.has(delim)) {\n return makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes);\n } else {\n throw new ParseError(\"Illegal delimiter: '\" + delim + \"'\");\n }\n};\n// Delimiters that never stack try small delimiters and large delimiters only\nvar stackNeverDelimiterSequence = [{\n type: \"small\",\n style: Style$1.SCRIPTSCRIPT\n}, {\n type: \"small\",\n style: Style$1.SCRIPT\n}, {\n type: \"small\",\n style: Style$1.TEXT\n}, {\n type: \"large\",\n size: 1\n}, {\n type: \"large\",\n size: 2\n}, {\n type: \"large\",\n size: 3\n}, {\n type: \"large\",\n size: 4\n}];\n// Delimiters that always stack try the small delimiters first, then stack\nvar stackAlwaysDelimiterSequence = [{\n type: \"small\",\n style: Style$1.SCRIPTSCRIPT\n}, {\n type: \"small\",\n style: Style$1.SCRIPT\n}, {\n type: \"small\",\n style: Style$1.TEXT\n}, {\n type: \"stack\"\n}];\n// Delimiters that stack when large try the small and then large delimiters, and\n// stack afterwards\nvar stackLargeDelimiterSequence = [{\n type: \"small\",\n style: Style$1.SCRIPTSCRIPT\n}, {\n type: \"small\",\n style: Style$1.SCRIPT\n}, {\n type: \"small\",\n style: Style$1.TEXT\n}, {\n type: \"large\",\n size: 1\n}, {\n type: \"large\",\n size: 2\n}, {\n type: \"large\",\n size: 3\n}, {\n type: \"large\",\n size: 4\n}, {\n type: \"stack\"\n}];\n/**\n * Get the font used in a delimiter based on what kind of delimiter it is.\n * TODO(#963) Use more specific font family return type once that is introduced.\n */\nvar delimTypeToFont = function delimTypeToFont(type) {\n if (type.type === \"small\") {\n return \"Main-Regular\";\n } else if (type.type === \"large\") {\n return \"Size\" + type.size + \"-Regular\";\n } else if (type.type === \"stack\") {\n return \"Size4-Regular\";\n } else {\n var delimKind = type.type;\n throw new Error(\"Add support for delim type '\" + delimKind + \"' here.\");\n }\n};\n/**\n * Traverse a sequence of types of delimiters to decide what kind of delimiter\n * should be used to create a delimiter of the given height+depth.\n */\nvar traverseSequence = function traverseSequence(delim, height, sequence, options) {\n // Here, we choose the index we should start at in the sequences. In smaller\n // sizes (which correspond to larger numbers in style.size) we start earlier\n // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts\n // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2\n var start = Math.min(2, 3 - options.style.size);\n for (var i = start; i < sequence.length; i++) {\n var delimType = sequence[i];\n if (delimType.type === \"stack\") {\n // This is always the last delimiter, so we just break the loop now.\n break;\n }\n var metrics = getMetrics(delim, delimTypeToFont(delimType), \"math\");\n var heightDepth = metrics.height + metrics.depth;\n // Small delimiters are scaled down versions of the same font, so we\n // account for the style change size.\n if (delimType.type === \"small\") {\n var newOptions = options.havingBaseStyle(delimType.style);\n heightDepth *= newOptions.sizeMultiplier;\n }\n // Check if the delimiter at this size works for the given height.\n if (heightDepth > height) {\n return delimType;\n }\n }\n // If we reached the end of the sequence, return the last sequence element.\n return sequence[sequence.length - 1];\n};\n/**\n * Make a delimiter of a given height+depth, with optional centering. Here, we\n * traverse the sequences, and create a delimiter that the sequence tells us to.\n */\nvar makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) {\n if (delim === \"<\" || delim === \"\\\\lt\" || delim === \"\\u27e8\") {\n delim = \"\\\\langle\";\n } else if (delim === \">\" || delim === \"\\\\gt\" || delim === \"\\u27e9\") {\n delim = \"\\\\rangle\";\n }\n // Decide what sequence to use\n var sequence;\n if (stackNeverDelimiters.has(delim)) {\n sequence = stackNeverDelimiterSequence;\n } else if (stackLargeDelimiters.has(delim)) {\n sequence = stackLargeDelimiterSequence;\n } else {\n sequence = stackAlwaysDelimiterSequence;\n }\n // Look through the sequence\n var delimType = traverseSequence(delim, height, sequence, options);\n // Get the delimiter from font glyphs.\n // Depending on the sequence element we decided on, call the\n // appropriate function.\n if (delimType.type === \"small\") {\n return makeSmallDelim(delim, delimType.style, center, options, mode, classes);\n } else if (delimType.type === \"large\") {\n return makeLargeDelim(delim, delimType.size, center, options, mode, classes);\n } else /* if (delimType.type === \"stack\") */{\n return makeStackedDelim(delim, height, center, options, mode, classes);\n }\n};\n/**\n * Make a delimiter for use with `\\left` and `\\right`, given a height and depth\n * of an expression that the delimiters surround.\n */\nvar makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) {\n // We always center \\left/\\right delimiters, so the axis is always shifted\n var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier;\n // Taken from TeX source, tex.web, function make_left_right\n var delimiterFactor = 901;\n var delimiterExtend = 5.0 / options.fontMetrics().ptPerEm;\n var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight);\n var totalHeight = Math.max(\n // In real TeX, calculations are done using integral values which are\n // 65536 per pt, or 655360 per em. So, the division here truncates in\n // TeX but doesn't here, producing different results. If we wanted to\n // exactly match TeX's calculation, we could do\n // Math.floor(655360 * maxDistFromAxis / 500) *\n // delimiterFactor / 655360\n // (To see the difference, compare\n // x^{x^{\\left(\\rule{0.1em}{0.68em}\\right)}}\n // in TeX and KaTeX)\n maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend);\n // Finally, we defer to `makeCustomSizedDelim` with our calculated total\n // height\n return makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes);\n};\n\n// Extra data needed for the delimiter handler down below\nvar delimiterSizes = {\n \"\\\\bigl\": {\n mclass: \"mopen\",\n size: 1\n },\n \"\\\\Bigl\": {\n mclass: \"mopen\",\n size: 2\n },\n \"\\\\biggl\": {\n mclass: \"mopen\",\n size: 3\n },\n \"\\\\Biggl\": {\n mclass: \"mopen\",\n size: 4\n },\n \"\\\\bigr\": {\n mclass: \"mclose\",\n size: 1\n },\n \"\\\\Bigr\": {\n mclass: \"mclose\",\n size: 2\n },\n \"\\\\biggr\": {\n mclass: \"mclose\",\n size: 3\n },\n \"\\\\Biggr\": {\n mclass: \"mclose\",\n size: 4\n },\n \"\\\\bigm\": {\n mclass: \"mrel\",\n size: 1\n },\n \"\\\\Bigm\": {\n mclass: \"mrel\",\n size: 2\n },\n \"\\\\biggm\": {\n mclass: \"mrel\",\n size: 3\n },\n \"\\\\Biggm\": {\n mclass: \"mrel\",\n size: 4\n },\n \"\\\\big\": {\n mclass: \"mord\",\n size: 1\n },\n \"\\\\Big\": {\n mclass: \"mord\",\n size: 2\n },\n \"\\\\bigg\": {\n mclass: \"mord\",\n size: 3\n },\n \"\\\\Bigg\": {\n mclass: \"mord\",\n size: 4\n }\n};\nvar delimiters = new Set([\"(\", \"\\\\lparen\", \")\", \"\\\\rparen\", \"[\", \"\\\\lbrack\", \"]\", \"\\\\rbrack\", \"\\\\{\", \"\\\\lbrace\", \"\\\\}\", \"\\\\rbrace\", \"\\\\lfloor\", \"\\\\rfloor\", \"\\u230a\", \"\\u230b\", \"\\\\lceil\", \"\\\\rceil\", \"\\u2308\", \"\\u2309\", \"<\", \">\", \"\\\\langle\", \"\\u27e8\", \"\\\\rangle\", \"\\u27e9\", \"\\\\lt\", \"\\\\gt\", \"\\\\lvert\", \"\\\\rvert\", \"\\\\lVert\", \"\\\\rVert\", \"\\\\lgroup\", \"\\\\rgroup\", \"\\u27ee\", \"\\u27ef\", \"\\\\lmoustache\", \"\\\\rmoustache\", \"\\u23b0\", \"\\u23b1\", \"/\", \"\\\\backslash\", \"|\", \"\\\\vert\", \"\\\\|\", \"\\\\Vert\", \"\\\\uparrow\", \"\\\\Uparrow\", \"\\\\downarrow\", \"\\\\Downarrow\", \"\\\\updownarrow\", \"\\\\Updownarrow\", \".\"]);\nfunction isMiddleDelimNode(node) {\n return 'isMiddle' in node;\n}\n// Delimiter functions\nfunction checkDelimiter(delim, context) {\n var symDelim = checkSymbolNodeType(delim);\n if (symDelim && delimiters.has(symDelim.text)) {\n return symDelim;\n } else if (symDelim) {\n throw new ParseError(\"Invalid delimiter '\" + symDelim.text + \"' after '\" + context.funcName + \"'\", delim);\n } else {\n throw new ParseError(\"Invalid delimiter type '\" + delim.type + \"'\", delim);\n }\n}\ndefineFunction({\n type: \"delimsizing\",\n names: [\"\\\\bigl\", \"\\\\Bigl\", \"\\\\biggl\", \"\\\\Biggl\", \"\\\\bigr\", \"\\\\Bigr\", \"\\\\biggr\", \"\\\\Biggr\", \"\\\\bigm\", \"\\\\Bigm\", \"\\\\biggm\", \"\\\\Biggm\", \"\\\\big\", \"\\\\Big\", \"\\\\bigg\", \"\\\\Bigg\"],\n numArgs: 1,\n argTypes: [\"primitive\"],\n handler: (context, args) => {\n var delim = checkDelimiter(normalizeArgument(args[0]), context);\n return {\n type: \"delimsizing\",\n mode: context.parser.mode,\n size: delimiterSizes[context.funcName].size,\n mclass: delimiterSizes[context.funcName].mclass,\n delim: delim.text\n };\n },\n htmlBuilder: (group, options) => {\n if (group.delim === \".\") {\n // Empty delimiters still count as elements, even though they don't\n // show anything.\n return makeSpan([group.mclass]);\n }\n return makeSizedDelim(group.delim, group.size, options, group.mode, [group.mclass]);\n },\n mathmlBuilder: group => {\n var children = [];\n if (group.delim !== \".\") {\n children.push(makeText(group.delim, group.mode));\n }\n var node = new MathNode(\"mo\", children);\n if (group.mclass === \"mopen\" || group.mclass === \"mclose\") {\n // Only some of the delimsizing functions act as fences, and they\n // return \"mopen\" or \"mclose\" mclass.\n node.setAttribute(\"fence\", \"true\");\n } else {\n // Explicitly disable fencing if it's not a fence, to override the\n // defaults.\n node.setAttribute(\"fence\", \"false\");\n }\n node.setAttribute(\"stretchy\", \"true\");\n var size = makeEm(sizeToMaxHeight[group.size]);\n node.setAttribute(\"minsize\", size);\n node.setAttribute(\"maxsize\", size);\n return node;\n }\n});\nfunction assertParsed(group) {\n if (!group.body) {\n throw new Error(\"Bug: The leftright ParseNode wasn't fully parsed.\");\n }\n}\ndefineFunction({\n type: \"leftright-right\",\n names: [\"\\\\right\"],\n numArgs: 1,\n primitive: true,\n handler: (context, args) => {\n // \\left case below triggers parsing of \\right in\n // `const right = parser.parseFunction();`\n // uses this return value.\n var color = context.parser.gullet.macros.get(\"\\\\current@color\");\n if (color && typeof color !== \"string\") {\n throw new ParseError(\"\\\\current@color set to non-string in \\\\right\");\n }\n return {\n type: \"leftright-right\",\n mode: context.parser.mode,\n delim: checkDelimiter(args[0], context).text,\n color // undefined if not set via \\color\n };\n }\n});\ndefineFunction({\n type: \"leftright\",\n names: [\"\\\\left\"],\n numArgs: 1,\n primitive: true,\n handler: (context, args) => {\n var delim = checkDelimiter(args[0], context);\n var parser = context.parser;\n // Parse out the implicit body\n ++parser.leftrightDepth;\n // parseExpression stops before '\\\\right'\n var body = parser.parseExpression(false);\n --parser.leftrightDepth;\n // Check the next token\n parser.expect(\"\\\\right\", false);\n var right = assertNodeType(parser.parseFunction(), \"leftright-right\");\n return {\n type: \"leftright\",\n mode: parser.mode,\n body,\n left: delim.text,\n right: right.delim,\n rightColor: right.color\n };\n },\n htmlBuilder: (group, options) => {\n assertParsed(group);\n // Build the inner expression\n var inner = buildExpression$1(group.body, options, true, [\"mopen\", \"mclose\"]);\n var innerHeight = 0;\n var innerDepth = 0;\n var hadMiddle = false;\n // Calculate its height and depth\n for (var i = 0; i < inner.length; i++) {\n var node = inner[i];\n if (isMiddleDelimNode(node)) {\n hadMiddle = true;\n } else {\n innerHeight = Math.max(inner[i].height, innerHeight);\n innerDepth = Math.max(inner[i].depth, innerDepth);\n }\n }\n // The size of delimiters is the same, regardless of what style we are\n // in. Thus, to correctly calculate the size of delimiter we need around\n // a group, we scale down the inner size based on the size.\n innerHeight *= options.sizeMultiplier;\n innerDepth *= options.sizeMultiplier;\n var leftDelim;\n if (group.left === \".\") {\n // Empty delimiters in \\left and \\right make null delimiter spaces.\n leftDelim = makeNullDelimiter(options, [\"mopen\"]);\n } else {\n // Otherwise, use leftRightDelim to generate the correct sized\n // delimiter.\n leftDelim = makeLeftRightDelim(group.left, innerHeight, innerDepth, options, group.mode, [\"mopen\"]);\n }\n // Add it to the beginning of the expression\n inner.unshift(leftDelim);\n // Handle middle delimiters\n if (hadMiddle) {\n for (var _i = 1; _i < inner.length; _i++) {\n var middleDelim = inner[_i];\n if (isMiddleDelimNode(middleDelim)) {\n var isMiddle = middleDelim.isMiddle;\n // Apply the options that were active when \\middle was called\n inner[_i] = makeLeftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []);\n }\n }\n }\n var rightDelim;\n // Same for the right delimiter, but using color specified by \\color\n if (group.right === \".\") {\n rightDelim = makeNullDelimiter(options, [\"mclose\"]);\n } else {\n var colorOptions = group.rightColor ? options.withColor(group.rightColor) : options;\n rightDelim = makeLeftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, [\"mclose\"]);\n }\n // Add it to the end of the expression.\n inner.push(rightDelim);\n return makeSpan([\"minner\"], inner, options);\n },\n mathmlBuilder: (group, options) => {\n assertParsed(group);\n var inner = buildExpression(group.body, options);\n if (group.left !== \".\") {\n var leftNode = new MathNode(\"mo\", [makeText(group.left, group.mode)]);\n leftNode.setAttribute(\"fence\", \"true\");\n inner.unshift(leftNode);\n }\n if (group.right !== \".\") {\n var rightNode = new MathNode(\"mo\", [makeText(group.right, group.mode)]);\n rightNode.setAttribute(\"fence\", \"true\");\n if (group.rightColor) {\n rightNode.setAttribute(\"mathcolor\", group.rightColor);\n }\n inner.push(rightNode);\n }\n return makeRow(inner);\n }\n});\ndefineFunction({\n type: \"middle\",\n names: [\"\\\\middle\"],\n numArgs: 1,\n primitive: true,\n handler: (context, args) => {\n var delim = checkDelimiter(args[0], context);\n if (!context.parser.leftrightDepth) {\n throw new ParseError(\"\\\\middle without preceding \\\\left\", delim);\n }\n return {\n type: \"middle\",\n mode: context.parser.mode,\n delim: delim.text\n };\n },\n htmlBuilder: (group, options) => {\n var middleDelim;\n if (group.delim === \".\") {\n middleDelim = makeNullDelimiter(options, []);\n } else {\n middleDelim = makeSizedDelim(group.delim, 1, options, group.mode, []);\n // Patch an ad-hoc property onto the node so the \\left/\\right\n // builder can reconstruct appropriately sized middle delimiters.\n // isMiddle is not part of HtmlDomNode; the read side uses\n // isMiddleDelimNode() to check before accessing.\n middleDelim.isMiddle = {\n delim: group.delim,\n options\n };\n }\n return middleDelim;\n },\n mathmlBuilder: (group, options) => {\n // A Firefox \\middle will stretch a character vertically only if it\n // is in the fence part of the operator dictionary at:\n // https://www.w3.org/TR/MathML3/appendixc.html.\n // So we need to avoid U+2223 and use plain \"|\" instead.\n var textNode = group.delim === \"\\\\vert\" || group.delim === \"|\" ? makeText(\"|\", \"text\") : makeText(group.delim, group.mode);\n var middleNode = new MathNode(\"mo\", [textNode]);\n middleNode.setAttribute(\"fence\", \"true\");\n // MathML gives 5/18em spacing to each <mo> element.\n // \\middle should get delimiter spacing instead.\n middleNode.setAttribute(\"lspace\", \"0.05em\");\n middleNode.setAttribute(\"rspace\", \"0.05em\");\n return middleNode;\n }\n});\n\nvar htmlBuilder$7 = (group, options) => {\n // \\cancel, \\bcancel, \\xcancel, \\sout, \\fbox, \\colorbox, \\fcolorbox, \\phase\n // Some groups can return document fragments. Handle those by wrapping\n // them in a span.\n var inner = wrapFragment(buildGroup$1(group.body, options), options);\n var label = group.label.slice(1);\n var scale = options.sizeMultiplier;\n var img;\n var imgShift;\n // In the LaTeX cancel package, line geometry is slightly different\n // depending on whether the subject is wider than it is tall, or vice versa.\n // We don't know the width of a group, so as a proxy, we test if\n // the subject is a single character. This captures most of the\n // subjects that should get the \"tall\" treatment.\n var isSingleChar = isCharacterBox(group.body);\n if (label === \"sout\") {\n img = makeSpan([\"katex-stretchy\", \"katex-sout\"]);\n img.height = options.fontMetrics().defaultRuleThickness / scale;\n imgShift = -0.5 * options.fontMetrics().xHeight;\n } else if (label === \"phase\") {\n // Set a couple of dimensions from the steinmetz package.\n var lineWeight = calculateSize({\n number: 0.6,\n unit: \"pt\"\n }, options);\n var clearance = calculateSize({\n number: 0.35,\n unit: \"ex\"\n }, options);\n // Prevent size changes like \\Huge from affecting line thickness\n var newOptions = options.havingBaseSizing();\n scale = scale / newOptions.sizeMultiplier;\n var angleHeight = inner.height + inner.depth + lineWeight + clearance;\n // Reserve a left pad for the angle.\n inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight);\n // Create an SVG\n var viewBoxHeight = Math.floor(1000 * angleHeight * scale);\n var path = phasePath(viewBoxHeight);\n var svgNode = new SvgNode([new PathNode(\"phase\", path)], {\n \"width\": \"400em\",\n \"height\": makeEm(viewBoxHeight / 1000),\n \"viewBox\": \"0 0 400000 \" + viewBoxHeight,\n \"preserveAspectRatio\": \"xMinYMin slice\"\n });\n // Wrap it in a span with overflow: hidden.\n img = makeSvgSpan([\"hide-tail\"], [svgNode], options);\n img.style.height = makeEm(angleHeight);\n imgShift = inner.depth + lineWeight + clearance;\n } else {\n // Add horizontal padding\n if (/cancel/.test(label)) {\n if (!isSingleChar) {\n inner.classes.push(\"cancel-pad\");\n }\n } else if (label === \"angl\") {\n inner.classes.push(\"anglpad\");\n } else {\n inner.classes.push(\"boxpad\");\n }\n // Add vertical padding\n var topPad;\n var bottomPad;\n var ruleThickness = 0;\n // ref: cancel package: \\advance\\totalheight2\\p@ % \"+2\"\n if (/box/.test(label)) {\n ruleThickness = Math.max(options.fontMetrics().fboxrule,\n // default\n options.minRuleThickness);\n topPad = options.fontMetrics().fboxsep + (label === \"colorbox\" ? 0 : ruleThickness);\n bottomPad = topPad;\n } else if (label === \"angl\") {\n ruleThickness = Math.max(options.fontMetrics().defaultRuleThickness, options.minRuleThickness);\n topPad = 4 * ruleThickness; // gap = 3 × line, plus the line itself.\n bottomPad = Math.max(0, 0.25 - inner.depth);\n } else {\n topPad = isSingleChar ? 0.2 : 0;\n bottomPad = topPad;\n }\n img = stretchyEnclose(inner, label, topPad, bottomPad, options);\n if (/fbox|boxed|fcolorbox/.test(label)) {\n img.style.borderStyle = \"solid\";\n img.style.borderWidth = makeEm(ruleThickness);\n } else if (label === \"angl\" && ruleThickness !== 0.049) {\n img.style.borderTopWidth = makeEm(ruleThickness);\n img.style.borderRightWidth = makeEm(ruleThickness);\n }\n imgShift = inner.depth + bottomPad;\n if (group.backgroundColor) {\n img.style.backgroundColor = group.backgroundColor;\n if (group.borderColor) {\n img.style.borderColor = group.borderColor;\n }\n }\n }\n var vlist;\n if (group.backgroundColor) {\n vlist = makeVList({\n positionType: \"individualShift\",\n children: [\n // Put the color background behind inner;\n {\n type: \"elem\",\n elem: img,\n shift: imgShift\n }, {\n type: \"elem\",\n elem: inner,\n shift: 0\n }]\n });\n } else {\n var classes = /cancel|phase/.test(label) ? [\"svg-align\"] : [];\n vlist = makeVList({\n positionType: \"individualShift\",\n children: [\n // Write the \\cancel stroke on top of inner.\n {\n type: \"elem\",\n elem: inner,\n shift: 0\n }, {\n type: \"elem\",\n elem: img,\n shift: imgShift,\n wrapperClasses: classes\n }]\n });\n }\n if (/cancel/.test(label)) {\n // The cancel package documentation says that cancel lines add their height\n // to the expression, but tests show that isn't how it actually works.\n vlist.height = inner.height;\n vlist.depth = inner.depth;\n }\n if (/cancel/.test(label) && !isSingleChar) {\n // cancel does not create horiz space for its line extension.\n return makeSpan([\"mord\", \"cancel-lap\"], [vlist], options);\n } else {\n return makeSpan([\"mord\"], [vlist], options);\n }\n};\nvar mathmlBuilder$6 = (group, options) => {\n var fboxsep;\n var node = new MathNode(group.label.includes(\"colorbox\") ? \"mpadded\" : \"menclose\", [buildGroup(group.body, options)]);\n switch (group.label) {\n case \"\\\\cancel\":\n node.setAttribute(\"notation\", \"updiagonalstrike\");\n break;\n case \"\\\\bcancel\":\n node.setAttribute(\"notation\", \"downdiagonalstrike\");\n break;\n case \"\\\\phase\":\n node.setAttribute(\"notation\", \"phasorangle\");\n break;\n case \"\\\\sout\":\n node.setAttribute(\"notation\", \"horizontalstrike\");\n break;\n case \"\\\\fbox\":\n node.setAttribute(\"notation\", \"box\");\n break;\n case \"\\\\angl\":\n node.setAttribute(\"notation\", \"actuarial\");\n break;\n case \"\\\\fcolorbox\":\n case \"\\\\colorbox\":\n // <menclose> doesn't have a good notation option. So use <mpadded>\n // instead. Set some attributes that come included with <menclose>.\n fboxsep = options.fontMetrics().fboxsep * options.fontMetrics().ptPerEm;\n node.setAttribute(\"width\", \"+\" + 2 * fboxsep + \"pt\");\n node.setAttribute(\"height\", \"+\" + 2 * fboxsep + \"pt\");\n node.setAttribute(\"lspace\", fboxsep + \"pt\"); //\n node.setAttribute(\"voffset\", fboxsep + \"pt\");\n if (group.label === \"\\\\fcolorbox\") {\n var thk = Math.max(options.fontMetrics().fboxrule,\n // default\n options.minRuleThickness);\n node.setAttribute(\"style\", \"border: \" + makeEm(thk) + \" solid \" + group.borderColor);\n }\n break;\n case \"\\\\xcancel\":\n node.setAttribute(\"notation\", \"updiagonalstrike downdiagonalstrike\");\n break;\n }\n if (group.backgroundColor) {\n node.setAttribute(\"mathbackground\", group.backgroundColor);\n }\n return node;\n};\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\colorbox\"],\n numArgs: 2,\n allowedInText: true,\n argTypes: [\"color\", \"hbox\"],\n handler(_ref, args, optArgs) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var color = assertNodeType(args[0], \"color-token\").color;\n var body = args[1];\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: funcName,\n backgroundColor: color,\n body\n };\n },\n htmlBuilder: htmlBuilder$7,\n mathmlBuilder: mathmlBuilder$6\n});\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\fcolorbox\"],\n numArgs: 3,\n allowedInText: true,\n argTypes: [\"color\", \"color\", \"hbox\"],\n handler(_ref2, args, optArgs) {\n var parser = _ref2.parser,\n funcName = _ref2.funcName;\n var borderColor = assertNodeType(args[0], \"color-token\").color;\n var backgroundColor = assertNodeType(args[1], \"color-token\").color;\n var body = args[2];\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: funcName,\n backgroundColor,\n borderColor,\n body\n };\n }\n});\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\fbox\"],\n numArgs: 1,\n argTypes: [\"hbox\"],\n allowedInText: true,\n handler(_ref3, args) {\n var parser = _ref3.parser;\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: \"\\\\fbox\",\n body: args[0]\n };\n }\n});\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\cancel\", \"\\\\bcancel\", \"\\\\xcancel\", \"\\\\phase\"],\n numArgs: 1,\n handler(_ref4, args) {\n var parser = _ref4.parser,\n funcName = _ref4.funcName;\n var body = args[0];\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: funcName,\n body\n };\n }\n});\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\sout\"],\n numArgs: 1,\n allowedInText: true,\n handler(_ref5, args) {\n var parser = _ref5.parser,\n funcName = _ref5.funcName;\n if (parser.mode === \"math\") {\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"mathVsSout\",\n errorMsg: \"LaTeX's \\\\sout works only in text mode\",\n report: true\n });\n }\n var body = args[0];\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: funcName,\n body\n };\n }\n});\ndefineFunction({\n type: \"enclose\",\n names: [\"\\\\angl\"],\n numArgs: 1,\n argTypes: [\"hbox\"],\n allowedInText: false,\n handler(_ref6, args) {\n var parser = _ref6.parser;\n return {\n type: \"enclose\",\n mode: parser.mode,\n label: \"\\\\angl\",\n body: args[0]\n };\n }\n});\n\n/**\n * All registered environments.\n * `environments.js` exports this same dictionary again and makes it public.\n * `Parser.js` requires this dictionary via `environments.js`.\n */\nvar _environments = {};\nfunction defineEnvironment(_ref) {\n var type = _ref.type,\n names = _ref.names,\n props = _ref.props,\n handler = _ref.handler,\n htmlBuilder = _ref.htmlBuilder,\n mathmlBuilder = _ref.mathmlBuilder;\n // Set default values of environments.\n var data = {\n type,\n numArgs: props.numArgs || 0,\n allowedInText: false,\n numOptionalArgs: 0,\n handler\n };\n for (var i = 0; i < names.length; ++i) {\n // TODO: The value type of _environments should be a type union of all\n // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is\n // an existential type.\n _environments[names[i]] = data;\n }\n if (htmlBuilder) {\n _htmlGroupBuilders[type] = htmlBuilder;\n }\n if (mathmlBuilder) {\n _mathmlGroupBuilders[type] = mathmlBuilder;\n }\n}\n\n/**\n * All registered global/built-in macros.\n * `macros.js` exports this same dictionary again and makes it public.\n * `Parser.js` requires this dictionary via `macros.js`.\n */\nvar _macros = {};\n// This function might one day accept an additional argument and do more things.\nfunction defineMacro(name, body) {\n _macros[name] = body;\n}\n\n/**\n * Lexing or parsing positional information for error reporting.\n * This object is immutable.\n */\nclass SourceLocation {\n // End offset, zero-based exclusive.\n constructor(lexer, start, end) {\n // The + prefix indicates that these fields aren't writeable\n this.lexer = void 0;\n // Lexer holding the input string.\n this.start = void 0;\n // Start offset, zero-based inclusive.\n this.end = void 0;\n this.lexer = lexer;\n this.start = start;\n this.end = end;\n }\n /**\n * Merges two `SourceLocation`s from location providers, given they are\n * provided in order of appearance.\n * - Returns the first one's location if only the first is provided.\n * - Returns a merged range of the first and the last if both are provided\n * and their lexers match.\n * - Otherwise, returns null.\n */\n static range(first, second) {\n if (!second) {\n return first && first.loc;\n } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {\n return null;\n } else {\n return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);\n }\n }\n}\n\n/**\n * The resulting token returned from `lex`.\n *\n * It consists of the token text plus some position information.\n * The position information is essentially a range in an input string,\n * but instead of referencing the bare input string, we refer to the lexer.\n * That way it is possible to attach extra metadata to the input string,\n * like for example a file name or similar.\n *\n * The position information is optional, so it is OK to construct synthetic\n * tokens if appropriate. Not providing available position information may\n * lead to degraded error reporting, though.\n */\nclass Token {\n // used in \\noexpand\n constructor(text,\n // the text of this token\n loc) {\n this.text = void 0;\n this.loc = void 0;\n this.noexpand = void 0;\n // don't expand the token\n this.treatAsRelax = void 0;\n this.text = text;\n this.loc = loc;\n }\n /**\n * Given a pair of tokens (this and endToken), compute a `Token` encompassing\n * the whole input range enclosed by these two.\n */\n range(endToken,\n // last token of the range, inclusive\n text) {\n return new Token(text, SourceLocation.range(this, endToken));\n }\n}\n\n// Helper functions\nfunction getHLines(parser) {\n // Return an array. The array length = number of hlines.\n // Each element in the array tells if the line is dashed.\n var hlineInfo = [];\n parser.consumeSpaces();\n var nxt = parser.fetch().text;\n if (nxt === \"\\\\relax\") {\n // \\relax is an artifact of the \\cr macro below\n parser.consume();\n parser.consumeSpaces();\n nxt = parser.fetch().text;\n }\n while (nxt === \"\\\\hline\" || nxt === \"\\\\hdashline\") {\n parser.consume();\n hlineInfo.push(nxt === \"\\\\hdashline\");\n parser.consumeSpaces();\n nxt = parser.fetch().text;\n }\n return hlineInfo;\n}\nvar validateAmsEnvironmentContext = context => {\n var settings = context.parser.settings;\n if (!settings.displayMode) {\n throw new ParseError(\"{\" + context.envName + \"} can be used only in\" + \" display mode.\");\n }\n};\nvar gatherEnvironments = new Set([\"gather\", \"gather*\"]);\n// autoTag (an argument to parseArray) can be one of three values:\n// * undefined: Regular (not-top-level) array; no tags on each row\n// * true: Automatic equation numbering, overridable by \\tag\n// * false: Tags allowed on each row, but no automatic numbering\n// This function *doesn't* work with the \"split\" environment name.\nfunction getAutoTag(name) {\n if (!name.includes(\"ed\")) {\n return !name.includes(\"*\");\n }\n // return undefined;\n}\n/**\n * Parse the body of the environment, with rows delimited by \\\\ and\n * columns delimited by &, and create a nested list in row-major order\n * with one group per cell. If given an optional argument style\n * (\"text\", \"display\", etc.), then each cell is cast into that style.\n */\nfunction parseArray(parser, _ref, style) {\n var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter,\n addJot = _ref.addJot,\n cols = _ref.cols,\n arraystretch = _ref.arraystretch,\n colSeparationType = _ref.colSeparationType,\n autoTag = _ref.autoTag,\n singleRow = _ref.singleRow,\n emptySingleRow = _ref.emptySingleRow,\n maxNumCols = _ref.maxNumCols,\n leqno = _ref.leqno;\n parser.gullet.beginGroup();\n if (!singleRow) {\n // \\cr is equivalent to \\\\ without the optional size argument (see below)\n // TODO: provide helpful error when \\cr is used outside array environment\n parser.gullet.macros.set(\"\\\\cr\", \"\\\\\\\\\\\\relax\");\n }\n // Get current arraystretch if it's not set by the environment\n if (!arraystretch) {\n var stretch = parser.gullet.expandMacroAsText(\"\\\\arraystretch\");\n if (stretch == null) {\n // Default \\arraystretch from lttab.dtx\n arraystretch = 1;\n } else {\n arraystretch = parseFloat(stretch);\n if (!arraystretch || arraystretch < 0) {\n throw new ParseError(\"Invalid \\\\arraystretch: \" + stretch);\n }\n }\n }\n // Start group for first cell\n parser.gullet.beginGroup();\n var row = [];\n var body = [row];\n var rowGaps = [];\n var hLinesBeforeRow = [];\n var tags = autoTag != null ? [] : undefined;\n // amsmath uses \\global\\@eqnswtrue and \\global\\@eqnswfalse to represent\n // whether this row should have an equation number. Simulate this with\n // a \\@eqnsw macro set to 1 or 0.\n function beginRow() {\n if (autoTag) {\n parser.gullet.macros.set(\"\\\\@eqnsw\", \"1\", true);\n }\n }\n function endRow() {\n if (tags) {\n if (parser.gullet.macros.get(\"\\\\df@tag\")) {\n tags.push(parser.subparse([new Token(\"\\\\df@tag\")]));\n parser.gullet.macros.set(\"\\\\df@tag\", undefined, true);\n } else {\n tags.push(Boolean(autoTag) && parser.gullet.macros.get(\"\\\\@eqnsw\") === \"1\");\n }\n }\n }\n beginRow();\n // Test for \\hline at the top of the array.\n hLinesBeforeRow.push(getHLines(parser));\n while (true) {\n // Parse each cell in its own group (namespace)\n var cellBody = parser.parseExpression(false, singleRow ? \"\\\\end\" : \"\\\\\\\\\");\n parser.gullet.endGroup();\n parser.gullet.beginGroup();\n var cell = {\n type: \"ordgroup\",\n mode: parser.mode,\n body: cellBody\n };\n if (style) {\n cell = {\n type: \"styling\",\n mode: parser.mode,\n style,\n resetFont: true,\n body: [cell]\n };\n }\n row.push(cell);\n var next = parser.fetch().text;\n if (next === \"&\") {\n if (maxNumCols && row.length === maxNumCols) {\n if (singleRow || colSeparationType) {\n // {equation} or {split}\n throw new ParseError(\"Too many tab characters: &\", parser.nextToken);\n } else {\n // {array} environment\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"textEnv\",\n errorMsg: \"Too few columns specified in the {array} column argument.\",\n report: true\n });\n }\n }\n parser.consume();\n } else if (next === \"\\\\end\") {\n endRow();\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty. However, AMS environments keep the\n // empty row if it's the only one, has a manual tag, or is an\n // automatically numbered row explicitly ended with `\\\\`.\n // NOTE: Currently, `cell` is the last item added into `row`.\n if (row.length === 1 && cell.type === \"styling\" && cell.body.length === 1 && cell.body[0].type === \"ordgroup\" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow) && !Array.isArray(tags == null ? void 0 : tags[tags.length - 1]) && !(autoTag && (tags == null ? void 0 : tags[tags.length - 1]) === true)) {\n body.pop();\n }\n if (hLinesBeforeRow.length < body.length + 1) {\n hLinesBeforeRow.push([]);\n }\n break;\n } else if (next === \"\\\\\\\\\") {\n parser.consume();\n var size = void 0;\n // \\def\\Let@{\\let\\\\\\math@cr}\n // \\def\\math@cr{...\\math@cr@}\n // \\def\\math@cr@{\\new@ifnextchar[\\math@cr@@{\\math@cr@@[\\z@]}}\n // \\def\\math@cr@@[#1]{...\\math@cr@@@...}\n // \\def\\math@cr@@@{\\cr}\n if (parser.gullet.future().text !== \" \") {\n size = parser.parseSizeGroup(true);\n }\n rowGaps.push(size ? size.value : null);\n endRow();\n // check for \\hline(s) following the row separator\n hLinesBeforeRow.push(getHLines(parser));\n row = [];\n body.push(row);\n beginRow();\n } else {\n throw new ParseError(\"Expected & or \\\\\\\\ or \\\\cr or \\\\end\", parser.nextToken);\n }\n }\n // End cell group\n parser.gullet.endGroup();\n // End array group defining \\cr\n parser.gullet.endGroup();\n return {\n type: \"array\",\n mode: parser.mode,\n addJot,\n arraystretch,\n body,\n cols,\n rowGaps,\n hskipBeforeAndAfter,\n hLinesBeforeRow,\n colSeparationType,\n tags,\n leqno\n };\n}\n// Decides on a style for cells in an array according to whether the given\n// environment name starts with the letter 'd'.\nfunction dCellStyle(envName) {\n if (envName.slice(0, 1) === \"d\") {\n return \"display\";\n } else {\n return \"text\";\n }\n}\nvar htmlBuilder$6 = function htmlBuilder(group, options) {\n var r;\n var c;\n var nr = group.body.length;\n var hLinesBeforeRow = group.hLinesBeforeRow;\n var nc = 0;\n var body = new Array(nr);\n var hlines = [];\n var ruleThickness = Math.max(\n // From LaTeX \\showthe\\arrayrulewidth. Equals 0.04 em.\n options.fontMetrics().arrayRuleWidth, options.minRuleThickness);\n // Horizontal spacing\n var pt = 1 / options.fontMetrics().ptPerEm;\n var arraycolsep = 5 * pt; // default value, i.e. \\arraycolsep in article.cls\n if (group.colSeparationType && group.colSeparationType === \"small\") {\n // We're in a {smallmatrix}. Default column space is \\thickspace,\n // i.e. 5/18em = 0.2778em, per amsmath.dtx for {smallmatrix}.\n // But that needs adjustment because LaTeX applies \\scriptstyle to the\n // entire array, including the colspace, but this function applies\n // \\scriptstyle only inside each element.\n var localMultiplier = options.havingStyle(Style$1.SCRIPT).sizeMultiplier;\n arraycolsep = 0.2778 * (localMultiplier / options.sizeMultiplier);\n }\n // Vertical spacing\n var baselineskip = group.colSeparationType === \"CD\" ? calculateSize({\n number: 3,\n unit: \"ex\"\n }, options) : 12 * pt; // see size10.clo\n // Default \\jot from ltmath.dtx\n // TODO(edemaine): allow overriding \\jot via \\setlength (#687)\n var jot = 3 * pt;\n var arrayskip = group.arraystretch * baselineskip;\n var arstrutHeight = 0.7 * arrayskip; // \\strutbox in ltfsstrc.dtx and\n var arstrutDepth = 0.3 * arrayskip; // \\@arstrutbox in lttab.dtx\n var totalHeight = 0;\n // Set a position for \\hline(s) at the top of the array, if any.\n function setHLinePos(hlinesInGap) {\n for (var i = 0; i < hlinesInGap.length; ++i) {\n if (i > 0) {\n totalHeight += 0.25;\n }\n hlines.push({\n pos: totalHeight,\n isDashed: hlinesInGap[i]\n });\n }\n }\n setHLinePos(hLinesBeforeRow[0]);\n for (r = 0; r < group.body.length; ++r) {\n var inrow = group.body[r];\n var height = arstrutHeight; // \\@array adds an \\@arstrut\n var depth = arstrutDepth; // to each tow (via the template)\n if (nc < inrow.length) {\n nc = inrow.length;\n }\n var outrow = {\n cells: new Array(inrow.length),\n height: 0,\n depth: 0,\n pos: 0\n };\n for (c = 0; c < inrow.length; ++c) {\n var elt = buildGroup$1(inrow[c], options);\n if (depth < elt.depth) {\n depth = elt.depth;\n }\n if (height < elt.height) {\n height = elt.height;\n }\n outrow.cells[c] = elt;\n }\n var rowGap = group.rowGaps[r];\n var gap = 0;\n if (rowGap) {\n gap = calculateSize(rowGap, options);\n if (gap > 0) {\n // \\@argarraycr\n gap += arstrutDepth;\n if (depth < gap) {\n depth = gap; // \\@xargarraycr\n }\n gap = 0;\n }\n }\n // In AMS multiline environments such as aligned and gathered, rows\n // correspond to lines that have additional \\jot added between lines\n // via \\openup.\n // We simulate this by adding \\jot depth to each row except the last.\n if (group.addJot && r < group.body.length - 1) {\n depth += jot;\n }\n outrow.height = height;\n outrow.depth = depth;\n totalHeight += height;\n outrow.pos = totalHeight;\n totalHeight += depth + gap; // \\@yargarraycr\n body[r] = outrow;\n // Set a position for \\hline(s), if any.\n setHLinePos(hLinesBeforeRow[r + 1]);\n }\n var offset = totalHeight / 2 + options.fontMetrics().axisHeight;\n var colDescriptions = group.cols || [];\n var cols = [];\n var colSep;\n var colDescrNum;\n var tagSpans = [];\n if (group.tags && group.tags.some(tag => tag)) {\n // An environment with manual tags and/or automatic equation numbers.\n // Create node(s), the latter of which trigger CSS counter increment.\n for (r = 0; r < nr; ++r) {\n var rw = body[r];\n var shift = rw.pos - offset;\n var tag = group.tags[r];\n var tagSpan = void 0;\n if (tag === true) {\n // automatic numbering\n tagSpan = makeSpan([\"eqn-num\"], [], options);\n } else if (tag === false) {\n // \\nonumber/\\notag or starred environment\n tagSpan = makeSpan([], [], options);\n } else {\n // manual \\tag\n tagSpan = makeSpan([], buildExpression$1(tag, options, true), options);\n }\n tagSpan.depth = rw.depth;\n tagSpan.height = rw.height;\n tagSpans.push({\n type: \"elem\",\n elem: tagSpan,\n shift\n });\n }\n }\n for (c = 0, colDescrNum = 0;\n // Continue while either there are more columns or more column\n // descriptions, so trailing separators don't get lost.\n c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) {\n var _colDescr3;\n var colDescr = colDescriptions[colDescrNum];\n var firstSeparator = true;\n while (((_colDescr = colDescr) == null ? void 0 : _colDescr.type) === \"separator\") {\n var _colDescr;\n // If there is more than one separator in a row, add a space\n // between them.\n if (!firstSeparator) {\n colSep = makeSpan([\"arraycolsep\"], []);\n colSep.style.width = makeEm(options.fontMetrics().doubleRuleSep);\n cols.push(colSep);\n }\n if (colDescr.separator === \"|\" || colDescr.separator === \":\") {\n var lineType = colDescr.separator === \"|\" ? \"solid\" : \"dashed\";\n var separator = makeSpan([\"vertical-separator\"], [], options);\n separator.style.height = makeEm(totalHeight);\n separator.style.borderRightWidth = makeEm(ruleThickness);\n separator.style.borderRightStyle = lineType;\n separator.style.margin = \"0 \" + makeEm(-ruleThickness / 2);\n var _shift = totalHeight - offset;\n if (_shift) {\n separator.style.verticalAlign = makeEm(-_shift);\n }\n cols.push(separator);\n } else {\n throw new ParseError(\"Invalid separator type: \" + colDescr.separator);\n }\n colDescrNum++;\n colDescr = colDescriptions[colDescrNum];\n firstSeparator = false;\n }\n if (c >= nc) {\n continue;\n }\n var sepwidth = void 0;\n if (c > 0 || group.hskipBeforeAndAfter) {\n var _colDescr$pregap, _colDescr2;\n sepwidth = (_colDescr$pregap = (_colDescr2 = colDescr) == null ? void 0 : _colDescr2.pregap) != null ? _colDescr$pregap : arraycolsep;\n if (sepwidth !== 0) {\n colSep = makeSpan([\"arraycolsep\"], []);\n colSep.style.width = makeEm(sepwidth);\n cols.push(colSep);\n }\n }\n var colElems = [];\n for (r = 0; r < nr; ++r) {\n var row = body[r];\n var elem = row.cells[c];\n if (!elem) {\n continue;\n }\n var _shift2 = row.pos - offset;\n elem.depth = row.depth;\n elem.height = row.height;\n colElems.push({\n type: \"elem\",\n elem: elem,\n shift: _shift2\n });\n }\n var colVList = makeVList({\n positionType: \"individualShift\",\n children: colElems\n });\n var colSpan = makeSpan([\"col-align-\" + (((_colDescr3 = colDescr) == null ? void 0 : _colDescr3.align) || \"c\")], [colVList]);\n cols.push(colSpan);\n if (c < nc - 1 || group.hskipBeforeAndAfter) {\n var _colDescr$postgap, _colDescr4;\n sepwidth = (_colDescr$postgap = (_colDescr4 = colDescr) == null ? void 0 : _colDescr4.postgap) != null ? _colDescr$postgap : arraycolsep;\n if (sepwidth !== 0) {\n colSep = makeSpan([\"arraycolsep\"], []);\n colSep.style.width = makeEm(sepwidth);\n cols.push(colSep);\n }\n }\n }\n var tableBody = makeSpan([\"mtable\"], cols);\n // Add \\hline(s), if any.\n if (hlines.length > 0) {\n var line = makeLineSpan(\"katex-hline\", options, ruleThickness);\n var dashes = makeLineSpan(\"katex-hdashline\", options, ruleThickness);\n var vListElems = [{\n type: \"elem\",\n elem: tableBody,\n shift: 0\n }];\n while (hlines.length > 0) {\n var hline = hlines.pop();\n var lineShift = hline.pos - offset;\n if (hline.isDashed) {\n vListElems.push({\n type: \"elem\",\n elem: dashes,\n shift: lineShift\n });\n } else {\n vListElems.push({\n type: \"elem\",\n elem: line,\n shift: lineShift\n });\n }\n }\n tableBody = makeVList({\n positionType: \"individualShift\",\n children: vListElems\n });\n }\n if (tagSpans.length === 0) {\n return makeSpan([\"mord\"], [tableBody], options);\n } else {\n var eqnNumCol = makeVList({\n positionType: \"individualShift\",\n children: tagSpans\n });\n var tagCol = makeSpan([\"katex-tag\"], [eqnNumCol], options);\n return makeFragment([tableBody, tagCol]);\n }\n};\nvar alignMap = {\n c: \"center \",\n l: \"left \",\n r: \"right \"\n};\nvar mathmlBuilder$5 = function mathmlBuilder(group, options) {\n var tbl = [];\n var glue = new MathNode(\"mtd\", [], [\"mtr-glue\"]);\n var tag = new MathNode(\"mtd\", [], [\"mml-eqn-num\"]);\n for (var i = 0; i < group.body.length; i++) {\n var rw = group.body[i];\n var row = [];\n for (var j = 0; j < rw.length; j++) {\n row.push(new MathNode(\"mtd\", [buildGroup(rw[j], options)]));\n }\n if (group.tags && group.tags[i]) {\n row.unshift(glue);\n row.push(glue);\n if (group.leqno) {\n row.unshift(tag);\n } else {\n row.push(tag);\n }\n }\n tbl.push(new MathNode(\"mtr\", row));\n }\n var table = new MathNode(\"mtable\", tbl);\n // Set column alignment, row spacing, column spacing, and\n // array lines by setting attributes on the table element.\n // Set the row spacing. In MathML, we specify a gap distance.\n // We do not use rowGap[] because MathML automatically increases\n // cell height with the height/depth of the element content.\n // LaTeX \\arraystretch multiplies the row baseline-to-baseline distance.\n // We simulate this by adding (arraystretch - 1)em to the gap. This\n // does a reasonable job of adjusting arrays containing 1 em tall content.\n // The 0.16 and 0.09 values are found empirically. They produce an array\n // similar to LaTeX and in which content does not interfere with \\hlines.\n var gap = group.arraystretch === 0.5 ? 0.1 // {smallmatrix}, {subarray}\n : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0);\n table.setAttribute(\"rowspacing\", makeEm(gap));\n // MathML table lines go only between cells.\n // To place a line on an edge we'll use <menclose>, if necessary.\n var menclose = \"\";\n var align = \"\";\n if (group.cols && group.cols.length > 0) {\n // Find column alignment, column spacing, and vertical lines.\n var cols = group.cols;\n var columnLines = \"\";\n var prevTypeWasAlign = false;\n var iStart = 0;\n var iEnd = cols.length;\n if (cols[0].type === \"separator\") {\n menclose += \"top \";\n iStart = 1;\n }\n if (cols[cols.length - 1].type === \"separator\") {\n menclose += \"bottom \";\n iEnd -= 1;\n }\n for (var _i = iStart; _i < iEnd; _i++) {\n var col = cols[_i];\n if (col.type === \"align\") {\n align += alignMap[col.align];\n if (prevTypeWasAlign) {\n columnLines += \"none \";\n }\n prevTypeWasAlign = true;\n } else if (col.type === \"separator\") {\n // MathML accepts only single lines between cells.\n // So we read only the first of consecutive separators.\n if (prevTypeWasAlign) {\n columnLines += col.separator === \"|\" ? \"solid \" : \"dashed \";\n prevTypeWasAlign = false;\n }\n }\n }\n table.setAttribute(\"columnalign\", align.trim());\n if (/[sd]/.test(columnLines)) {\n table.setAttribute(\"columnlines\", columnLines.trim());\n }\n }\n // Set column spacing.\n if (group.colSeparationType === \"align\") {\n var _cols = group.cols || [];\n var spacing = \"\";\n for (var _i2 = 1; _i2 < _cols.length; _i2++) {\n spacing += _i2 % 2 ? \"0em \" : \"1em \";\n }\n table.setAttribute(\"columnspacing\", spacing.trim());\n } else if (group.colSeparationType === \"alignat\" || group.colSeparationType === \"gather\") {\n table.setAttribute(\"columnspacing\", \"0em\");\n } else if (group.colSeparationType === \"small\") {\n table.setAttribute(\"columnspacing\", \"0.2778em\");\n } else if (group.colSeparationType === \"CD\") {\n table.setAttribute(\"columnspacing\", \"0.5em\");\n } else {\n table.setAttribute(\"columnspacing\", \"1em\");\n }\n // Address \\hline and \\hdashline\n var rowLines = \"\";\n var hlines = group.hLinesBeforeRow;\n menclose += hlines[0].length > 0 ? \"left \" : \"\";\n menclose += hlines[hlines.length - 1].length > 0 ? \"right \" : \"\";\n for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) {\n rowLines += hlines[_i3].length === 0 ? \"none \"\n // MathML accepts only a single line between rows. Read one element.\n : hlines[_i3][0] ? \"dashed \" : \"solid \";\n }\n if (/[sd]/.test(rowLines)) {\n table.setAttribute(\"rowlines\", rowLines.trim());\n }\n if (menclose !== \"\") {\n table = new MathNode(\"menclose\", [table]);\n table.setAttribute(\"notation\", menclose.trim());\n }\n if (group.arraystretch && group.arraystretch < 1) {\n // A small array. Wrap in scriptstyle so row gap is not too large.\n table = new MathNode(\"mstyle\", [table]);\n table.setAttribute(\"scriptlevel\", \"1\");\n }\n return table;\n};\n// Convenience function for align, align*, aligned, alignat, alignat*, alignedat.\nvar alignedHandler = function alignedHandler(context, args) {\n if (!context.envName.includes(\"ed\")) {\n validateAmsEnvironmentContext(context);\n }\n var cols = [];\n var isSplit = context.envName === \"split\";\n var res = parseArray(context.parser, {\n cols,\n addJot: true,\n autoTag: isSplit ? undefined : getAutoTag(context.envName),\n emptySingleRow: true,\n colSeparationType: context.envName.includes(\"at\") ? \"alignat\" : \"align\",\n maxNumCols: isSplit ? 2 : undefined,\n leqno: context.parser.settings.leqno\n }, \"display\");\n // Determining number of columns.\n // 1. If the first argument is given, we use it as a number of columns,\n // and makes sure that each row doesn't exceed that number.\n // 2. Otherwise, just count number of columns = maximum number\n // of cells in each row (\"aligned\" mode -- isAligned will be true).\n //\n // At the same time, prepend empty group {} at beginning of every second\n // cell in each row (starting with second cell) so that operators become\n // binary. This behavior is implemented in amsmath's \\start@aligned.\n var numMaths = 0;\n var numCols = 0;\n var emptyGroup = {\n type: \"ordgroup\",\n mode: context.mode,\n body: []\n };\n if (args[0] && args[0].type === \"ordgroup\") {\n var message = \"Number of columns should be a positive integer\";\n var numColumns = assertCharacterGroup(args[0], message);\n if (!/^[0-9]+$/.test(numColumns) || Number(numColumns) < 1) {\n throw new ParseError(message, args[0]);\n }\n numMaths = Number(numColumns);\n numCols = numMaths * 2;\n }\n var isAligned = !numCols;\n res.body.forEach(function (row) {\n for (var i = 1; i < row.length; i += 2) {\n // Modify ordgroup node within styling node\n var styling = assertNodeType(row[i], \"styling\");\n var ordgroup = assertNodeType(styling.body[0], \"ordgroup\");\n ordgroup.body.unshift(emptyGroup);\n }\n if (!isAligned) {\n // Case 1\n var curMaths = row.length / 2;\n if (numMaths < curMaths) {\n throw new ParseError(\"Too many math in a row: \" + (\"expected \" + numMaths + \", but got \" + curMaths), row[0]);\n }\n } else if (numCols < row.length) {\n // Case 2\n numCols = row.length;\n }\n });\n // Adjusting alignment.\n // In aligned mode, we add one \\qquad between columns;\n // otherwise we add nothing.\n for (var i = 0; i < numCols; ++i) {\n var align = \"r\";\n var pregap = 0;\n if (i % 2 === 1) {\n align = \"l\";\n } else if (i > 0 && isAligned) {\n // \"aligned\" mode.\n pregap = 1; // add one \\quad\n }\n cols[i] = {\n type: \"align\",\n align: align,\n pregap: pregap,\n postgap: 0\n };\n }\n res.colSeparationType = isAligned ? \"align\" : \"alignat\";\n return res;\n};\n// Arrays are part of LaTeX, defined in lttab.dtx so its documentation\n// is part of the source2e.pdf file of LaTeX2e source documentation.\n// {darray} is an {array} environment where cells are set in \\displaystyle,\n// as defined in nccmath.sty.\ndefineEnvironment({\n type: \"array\",\n names: [\"array\", \"darray\"],\n props: {\n numArgs: 1\n },\n handler(context, args) {\n // Since no types are specified above, the two possibilities are\n // - The argument is wrapped in {} or [], in which case Parser's\n // parseGroup() returns an \"ordgroup\" wrapping some symbol node.\n // - The argument is a bare symbol node.\n var symNode = checkSymbolNodeType(args[0]);\n var colalign = symNode ? [args[0]] : assertNodeType(args[0], \"ordgroup\").body;\n var cols = colalign.map(function (nde) {\n var node = assertSymbolNodeType(nde);\n var ca = node.text;\n if (\"lcr\".includes(ca)) {\n return {\n type: \"align\",\n align: ca\n };\n } else if (ca === \"|\") {\n return {\n type: \"separator\",\n separator: \"|\"\n };\n } else if (ca === \":\") {\n return {\n type: \"separator\",\n separator: \":\"\n };\n }\n throw new ParseError(\"Unknown column alignment: \" + ca, nde);\n });\n var res = {\n cols,\n hskipBeforeAndAfter: true,\n // \\@preamble in lttab.dtx\n maxNumCols: cols.length\n };\n return parseArray(context.parser, res, dCellStyle(context.envName));\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\n// The matrix environments of amsmath builds on the array environment\n// of LaTeX, which is discussed above.\n// The mathtools package adds starred versions of the same environments.\n// These have an optional argument to choose left|center|right justification.\ndefineEnvironment({\n type: \"array\",\n names: [\"matrix\", \"pmatrix\", \"bmatrix\", \"Bmatrix\", \"vmatrix\", \"Vmatrix\", \"matrix*\", \"pmatrix*\", \"bmatrix*\", \"Bmatrix*\", \"vmatrix*\", \"Vmatrix*\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n var delimiters = {\n \"matrix\": null,\n \"pmatrix\": [\"(\", \")\"],\n \"bmatrix\": [\"[\", \"]\"],\n \"Bmatrix\": [\"\\\\{\", \"\\\\}\"],\n \"vmatrix\": [\"|\", \"|\"],\n \"Vmatrix\": [\"\\\\Vert\", \"\\\\Vert\"]\n }[context.envName.replace(\"*\", \"\")];\n // \\hskip -\\arraycolsep in amsmath\n var colAlign = \"c\";\n var payload = {\n hskipBeforeAndAfter: false,\n cols: [{\n type: \"align\",\n align: colAlign\n }]\n };\n if (context.envName.charAt(context.envName.length - 1) === \"*\") {\n // It's one of the mathtools starred functions.\n // Parse the optional alignment argument.\n var parser = context.parser;\n parser.consumeSpaces();\n if (parser.fetch().text === \"[\") {\n parser.consume();\n parser.consumeSpaces();\n colAlign = parser.fetch().text;\n if (!\"lcr\".includes(colAlign)) {\n throw new ParseError(\"Expected l or c or r\", parser.nextToken);\n }\n parser.consume();\n parser.consumeSpaces();\n parser.expect(\"]\");\n parser.consume();\n payload.cols = [{\n type: \"align\",\n align: colAlign\n }];\n }\n }\n var res = parseArray(context.parser, payload, dCellStyle(context.envName));\n // Populate cols with the correct number of column alignment specs.\n var numCols = Math.max(0, ...res.body.map(row => row.length));\n res.cols = new Array(numCols).fill({\n type: \"align\",\n align: colAlign\n });\n return delimiters ? {\n type: \"leftright\",\n mode: context.mode,\n body: [res],\n left: delimiters[0],\n right: delimiters[1],\n rightColor: undefined // \\right uninfluenced by \\color in array\n } : res;\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\ndefineEnvironment({\n type: \"array\",\n names: [\"smallmatrix\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n var payload = {\n arraystretch: 0.5\n };\n var res = parseArray(context.parser, payload, \"script\");\n res.colSeparationType = \"small\";\n return res;\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\ndefineEnvironment({\n type: \"array\",\n names: [\"subarray\"],\n props: {\n numArgs: 1\n },\n handler(context, args) {\n // Parsing of {subarray} is similar to {array}\n var symNode = checkSymbolNodeType(args[0]);\n var colalign = symNode ? [args[0]] : assertNodeType(args[0], \"ordgroup\").body;\n var cols = colalign.map(function (nde) {\n var node = assertSymbolNodeType(nde);\n var ca = node.text;\n // {subarray} only recognizes \"l\" & \"c\"\n if (\"lc\".includes(ca)) {\n return {\n type: \"align\",\n align: ca\n };\n }\n throw new ParseError(\"Unknown column alignment: \" + ca, nde);\n });\n if (cols.length > 1) {\n throw new ParseError(\"{subarray} can contain only one column\");\n }\n var payload = {\n cols,\n hskipBeforeAndAfter: false,\n arraystretch: 0.5\n };\n var res = parseArray(context.parser, payload, \"script\");\n if (res.body.length > 0 && res.body[0].length > 1) {\n throw new ParseError(\"{subarray} can contain only one column\");\n }\n return res;\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\n// A cases environment (in amsmath.sty) is almost equivalent to\n// \\def\\arraystretch{1.2}%\n// \\left\\{\\begin{array}{@{}l@{\\quad}l@{}} … \\end{array}\\right.\n// {dcases} is a {cases} environment where cells are set in \\displaystyle,\n// as defined in mathtools.sty.\n// {rcases} is another mathtools environment. It's brace is on the right side.\ndefineEnvironment({\n type: \"array\",\n names: [\"cases\", \"dcases\", \"rcases\", \"drcases\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n var payload = {\n arraystretch: 1.2,\n cols: [{\n type: \"align\",\n align: \"l\",\n pregap: 0,\n // TODO(kevinb) get the current style.\n // For now we use the metrics for TEXT style which is what we were\n // doing before. Before attempting to get the current style we\n // should look at TeX's behavior especially for \\over and matrices.\n postgap: 1.0 /* 1em quad */\n }, {\n type: \"align\",\n align: \"l\",\n pregap: 0,\n postgap: 0\n }]\n };\n var res = parseArray(context.parser, payload, dCellStyle(context.envName));\n return {\n type: \"leftright\",\n mode: context.mode,\n body: [res],\n left: context.envName.includes(\"r\") ? \".\" : \"\\\\{\",\n right: context.envName.includes(\"r\") ? \"\\\\}\" : \".\",\n rightColor: undefined\n };\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\n// In the align environment, one uses ampersands, &, to specify number of\n// columns in each row, and to locate spacing between each column.\n// align gets automatic numbering. align* and aligned do not.\n// The alignedat environment can be used in math mode.\n// Note that we assume \\nomallineskiplimit to be zero,\n// so that \\strut@ is the same as \\strut.\ndefineEnvironment({\n type: \"array\",\n names: [\"align\", \"align*\", \"aligned\", \"split\"],\n props: {\n numArgs: 0\n },\n handler: alignedHandler,\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\n// A gathered environment is like an array environment with one centered\n// column, but where rows are considered lines so get \\jot line spacing\n// and contents are set in \\displaystyle.\ndefineEnvironment({\n type: \"array\",\n names: [\"gathered\", \"gather\", \"gather*\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n if (gatherEnvironments.has(context.envName)) {\n validateAmsEnvironmentContext(context);\n }\n var res = {\n cols: [{\n type: \"align\",\n align: \"c\"\n }],\n addJot: true,\n colSeparationType: \"gather\",\n autoTag: getAutoTag(context.envName),\n emptySingleRow: true,\n leqno: context.parser.settings.leqno\n };\n return parseArray(context.parser, res, \"display\");\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\n// alignat environment is like an align environment, but one must explicitly\n// specify maximum number of columns in each row, and can adjust spacing between\n// each columns.\ndefineEnvironment({\n type: \"array\",\n names: [\"alignat\", \"alignat*\", \"alignedat\"],\n props: {\n numArgs: 1\n },\n handler: alignedHandler,\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\ndefineEnvironment({\n type: \"array\",\n names: [\"equation\", \"equation*\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n validateAmsEnvironmentContext(context);\n var res = {\n autoTag: getAutoTag(context.envName),\n emptySingleRow: true,\n singleRow: true,\n maxNumCols: 1,\n leqno: context.parser.settings.leqno\n };\n return parseArray(context.parser, res, \"display\");\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\ndefineEnvironment({\n type: \"array\",\n names: [\"CD\"],\n props: {\n numArgs: 0\n },\n handler(context) {\n validateAmsEnvironmentContext(context);\n return parseCD(context.parser);\n },\n htmlBuilder: htmlBuilder$6,\n mathmlBuilder: mathmlBuilder$5\n});\ndefineMacro(\"\\\\nonumber\", \"\\\\gdef\\\\@eqnsw{0}\");\ndefineMacro(\"\\\\notag\", \"\\\\nonumber\");\n// Catch \\hline outside array environment\ndefineFunction({\n type: \"text\",\n // Doesn't matter what this is.\n names: [\"\\\\hline\", \"\\\\hdashline\"],\n numArgs: 0,\n allowedInText: true,\n allowedInMath: true,\n handler(context, args) {\n throw new ParseError(context.funcName + \" valid only within array environment\");\n }\n});\n\nvar environments = _environments;\n\n// Environment delimiters. HTML/MathML rendering is defined in the corresponding\n// defineEnvironment definitions.\ndefineFunction({\n type: \"environment\",\n names: [\"\\\\begin\", \"\\\\end\"],\n numArgs: 1,\n argTypes: [\"text\"],\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var nameGroup = args[0];\n if (nameGroup.type !== \"ordgroup\") {\n throw new ParseError(\"Invalid environment name\", nameGroup);\n }\n var envName = assertCharacterGroup(nameGroup, \"Environment name should contain only text characters and spaces\", true);\n if (funcName === \"\\\\begin\") {\n // begin...end is similar to left...right\n if (!Object.prototype.hasOwnProperty.call(environments, envName)) {\n throw new ParseError(\"No such environment: \" + envName, nameGroup);\n }\n // Build the environment object. Arguments and other information will\n // be made available to the begin and end methods using properties.\n var env = environments[envName];\n var _parser$parseArgument = parser.parseArguments(\"\\\\begin{\" + envName + \"}\", env),\n _args = _parser$parseArgument.args,\n optArgs = _parser$parseArgument.optArgs;\n var context = {\n mode: parser.mode,\n envName,\n parser\n };\n var result = env.handler(context, _args, optArgs);\n parser.expect(\"\\\\end\", false);\n var endNameToken = parser.nextToken;\n var end = assertNodeType(parser.parseFunction(), \"environment\");\n if (end.name !== envName) {\n throw new ParseError(\"Mismatch: \\\\begin{\" + envName + \"} matched by \\\\end{\" + end.name + \"}\", endNameToken);\n }\n // env.handler returns the specific node type (e.g. \"array\"),\n // not \"environment\". This cast is unavoidable: defineFunction\n // requires the handler to return ParseNode<\"environment\"> but\n // \\begin delegates to environment handlers with different types.\n return result;\n }\n return {\n type: \"environment\",\n mode: parser.mode,\n name: envName,\n nameGroup\n };\n }\n});\n\n// TODO(kevinb): implement \\\\sl and \\\\sc\nvar htmlBuilder$5 = (group, options) => {\n var font = group.font;\n var newOptions = options.withFont(font);\n return buildGroup$1(group.body, newOptions);\n};\nvar mathmlBuilder$4 = (group, options) => {\n var font = group.font;\n var newOptions = options.withFont(font);\n return buildGroup(group.body, newOptions);\n};\nvar fontAliases = {\n \"\\\\Bbb\": \"\\\\mathbb\",\n \"\\\\bold\": \"\\\\mathbf\",\n \"\\\\frak\": \"\\\\mathfrak\"\n};\ndefineFunction({\n type: \"font\",\n names: [\n // styles, except \\boldsymbol defined below\n \"\\\\mathrm\", \"\\\\mathit\", \"\\\\mathbf\", \"\\\\mathnormal\", \"\\\\mathsfit\",\n // families\n \"\\\\mathbb\", \"\\\\mathcal\", \"\\\\mathfrak\", \"\\\\mathscr\", \"\\\\mathsf\", \"\\\\mathtt\",\n // aliases, except \\bm defined below\n \"\\\\Bbb\", \"\\\\bold\", \"\\\\frak\"],\n numArgs: 1,\n allowedInArgument: true,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var body = normalizeArgument(args[0]);\n var func = funcName in fontAliases ? fontAliases[funcName] : funcName;\n return {\n type: \"font\",\n mode: parser.mode,\n font: func.slice(1),\n body\n };\n },\n htmlBuilder: htmlBuilder$5,\n mathmlBuilder: mathmlBuilder$4\n});\ndefineFunction({\n type: \"mclass\",\n names: [\"\\\\boldsymbol\", \"\\\\bm\"],\n numArgs: 1,\n handler: (_ref2, args) => {\n var parser = _ref2.parser;\n var body = args[0];\n // amsbsy.sty's \\boldsymbol uses \\binrel spacing to inherit the\n // argument's bin|rel|ord status\n return {\n type: \"mclass\",\n mode: parser.mode,\n mclass: binrelClass(body),\n body: [{\n type: \"font\",\n mode: parser.mode,\n font: \"boldsymbol\",\n body\n }],\n isCharacterBox: isCharacterBox(body)\n };\n }\n});\n// Old font changing functions\ndefineFunction({\n type: \"font\",\n names: [\"\\\\rm\", \"\\\\sf\", \"\\\\tt\", \"\\\\bf\", \"\\\\it\", \"\\\\cal\"],\n numArgs: 0,\n allowedInText: true,\n handler: (_ref3, args) => {\n var parser = _ref3.parser,\n funcName = _ref3.funcName,\n breakOnTokenText = _ref3.breakOnTokenText;\n var mode = parser.mode;\n var body = parser.parseExpression(true, breakOnTokenText);\n return {\n type: \"font\",\n mode: mode,\n font: \"math\" + funcName.slice(1),\n body: {\n type: \"ordgroup\",\n mode: parser.mode,\n body\n }\n };\n }\n});\n\nvar htmlBuilder$4 = (group, options) => {\n // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).\n var style = options.style;\n var nstyle = style.fracNum();\n var dstyle = style.fracDen();\n var newOptions;\n newOptions = options.havingStyle(nstyle);\n var numerm = buildGroup$1(group.numer, newOptions, options);\n if (group.continued) {\n // \\cfrac inserts a \\strut into the numerator.\n // Get \\strut dimensions from TeXbook page 353.\n var hStrut = 8.5 / options.fontMetrics().ptPerEm;\n var dStrut = 3.5 / options.fontMetrics().ptPerEm;\n numerm.height = numerm.height < hStrut ? hStrut : numerm.height;\n numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;\n }\n newOptions = options.havingStyle(dstyle);\n var denomm = buildGroup$1(group.denom, newOptions, options);\n var rule;\n var ruleWidth;\n var ruleSpacing;\n if (group.hasBarLine) {\n if (group.barSize) {\n ruleWidth = calculateSize(group.barSize, options);\n rule = makeLineSpan(\"frac-line\", options, ruleWidth);\n } else {\n rule = makeLineSpan(\"frac-line\", options);\n }\n ruleWidth = rule.height;\n ruleSpacing = rule.height;\n } else {\n rule = null;\n ruleWidth = 0;\n ruleSpacing = options.fontMetrics().defaultRuleThickness;\n }\n // Rule 15b\n var numShift;\n var clearance;\n var denomShift;\n if (style.size === Style$1.DISPLAY.size) {\n numShift = options.fontMetrics().num1;\n if (ruleWidth > 0) {\n clearance = 3 * ruleSpacing;\n } else {\n clearance = 7 * ruleSpacing;\n }\n denomShift = options.fontMetrics().denom1;\n } else {\n if (ruleWidth > 0) {\n numShift = options.fontMetrics().num2;\n clearance = ruleSpacing;\n } else {\n numShift = options.fontMetrics().num3;\n clearance = 3 * ruleSpacing;\n }\n denomShift = options.fontMetrics().denom2;\n }\n var frac;\n if (!rule) {\n // Rule 15c\n var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift);\n if (candidateClearance < clearance) {\n numShift += 0.5 * (clearance - candidateClearance);\n denomShift += 0.5 * (clearance - candidateClearance);\n }\n frac = makeVList({\n positionType: \"individualShift\",\n children: [{\n type: \"elem\",\n elem: denomm,\n shift: denomShift\n }, {\n type: \"elem\",\n elem: numerm,\n shift: -numShift\n }]\n });\n } else {\n // Rule 15d\n var axisHeight = options.fontMetrics().axisHeight;\n if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) {\n numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth));\n }\n if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) {\n denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift));\n }\n var midShift = -(axisHeight - 0.5 * ruleWidth);\n frac = makeVList({\n positionType: \"individualShift\",\n children: [{\n type: \"elem\",\n elem: denomm,\n shift: denomShift\n }, {\n type: \"elem\",\n elem: rule,\n shift: midShift\n }, {\n type: \"elem\",\n elem: numerm,\n shift: -numShift\n }]\n });\n }\n // Since we manually change the style sometimes (with \\dfrac or \\tfrac),\n // account for the possible size change here.\n newOptions = options.havingStyle(style);\n frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier;\n frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier;\n // Rule 15e\n var delimSize;\n if (style.size === Style$1.DISPLAY.size) {\n delimSize = options.fontMetrics().delim1;\n } else if (style.size === Style$1.SCRIPTSCRIPT.size) {\n delimSize = options.havingStyle(Style$1.SCRIPT).fontMetrics().delim2;\n } else {\n delimSize = options.fontMetrics().delim2;\n }\n var leftDelim;\n var rightDelim;\n if (group.leftDelim == null) {\n leftDelim = makeNullDelimiter(options, [\"mopen\"]);\n } else {\n leftDelim = makeCustomSizedDelim(group.leftDelim, delimSize, true, options.havingStyle(style), group.mode, [\"mopen\"]);\n }\n if (group.continued) {\n rightDelim = makeSpan([]); // zero width for \\cfrac\n } else if (group.rightDelim == null) {\n rightDelim = makeNullDelimiter(options, [\"mclose\"]);\n } else {\n rightDelim = makeCustomSizedDelim(group.rightDelim, delimSize, true, options.havingStyle(style), group.mode, [\"mclose\"]);\n }\n return makeSpan([\"mord\"].concat(newOptions.sizingClasses(options)), [leftDelim, makeSpan([\"mfrac\"], [frac]), rightDelim], options);\n};\nvar mathmlBuilder$3 = (group, options) => {\n var node = new MathNode(\"mfrac\", [buildGroup(group.numer, options), buildGroup(group.denom, options)]);\n if (!group.hasBarLine) {\n node.setAttribute(\"linethickness\", \"0px\");\n } else if (group.barSize) {\n var ruleWidth = calculateSize(group.barSize, options);\n node.setAttribute(\"linethickness\", makeEm(ruleWidth));\n }\n if (group.leftDelim != null || group.rightDelim != null) {\n var withDelims = [];\n if (group.leftDelim != null) {\n var leftOp = new MathNode(\"mo\", [new TextNode(group.leftDelim.replace(\"\\\\\", \"\"))]);\n leftOp.setAttribute(\"fence\", \"true\");\n withDelims.push(leftOp);\n }\n withDelims.push(node);\n if (group.rightDelim != null) {\n var rightOp = new MathNode(\"mo\", [new TextNode(group.rightDelim.replace(\"\\\\\", \"\"))]);\n rightOp.setAttribute(\"fence\", \"true\");\n withDelims.push(rightOp);\n }\n return makeRow(withDelims);\n }\n return node;\n};\nvar wrapWithStyle = (frac, style) => {\n if (!style) {\n return frac;\n }\n var wrapper = {\n type: \"styling\",\n mode: frac.mode,\n style,\n body: [frac]\n };\n // @ts-ignore defineFunction handler needs to return ParseNode<\"genfrac\">\n return wrapper;\n};\ndefineFunction({\n type: \"genfrac\",\n names: [\"\\\\cfrac\", \"\\\\dfrac\", \"\\\\frac\", \"\\\\tfrac\", \"\\\\dbinom\", \"\\\\binom\", \"\\\\tbinom\", \"\\\\\\\\atopfrac\",\n // can’t be entered directly\n \"\\\\\\\\bracefrac\", \"\\\\\\\\brackfrac\" // ditto\n ],\n numArgs: 2,\n allowedInArgument: true,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var numer = args[0];\n var denom = args[1];\n var hasBarLine;\n var leftDelim = null;\n var rightDelim = null;\n switch (funcName) {\n case \"\\\\cfrac\":\n case \"\\\\dfrac\":\n case \"\\\\frac\":\n case \"\\\\tfrac\":\n hasBarLine = true;\n break;\n case \"\\\\\\\\atopfrac\":\n hasBarLine = false;\n break;\n case \"\\\\dbinom\":\n case \"\\\\binom\":\n case \"\\\\tbinom\":\n hasBarLine = false;\n leftDelim = \"(\";\n rightDelim = \")\";\n break;\n case \"\\\\\\\\bracefrac\":\n hasBarLine = false;\n leftDelim = \"\\\\{\";\n rightDelim = \"\\\\}\";\n break;\n case \"\\\\\\\\brackfrac\":\n hasBarLine = false;\n leftDelim = \"[\";\n rightDelim = \"]\";\n break;\n default:\n throw new Error(\"Unrecognized genfrac command\");\n }\n var continued = funcName === \"\\\\cfrac\";\n var style = null;\n if (continued || funcName.startsWith(\"\\\\d\")) {\n style = \"display\";\n } else if (funcName.startsWith(\"\\\\t\")) {\n style = \"text\";\n }\n return wrapWithStyle({\n type: \"genfrac\",\n mode: parser.mode,\n numer,\n denom,\n continued,\n hasBarLine,\n leftDelim,\n rightDelim,\n barSize: null\n }, style);\n },\n htmlBuilder: htmlBuilder$4,\n mathmlBuilder: mathmlBuilder$3\n});\n// Infix generalized fractions -- these are not rendered directly, but replaced\n// immediately by one of the variants above.\ndefineFunction({\n type: \"infix\",\n names: [\"\\\\over\", \"\\\\choose\", \"\\\\atop\", \"\\\\brace\", \"\\\\brack\"],\n numArgs: 0,\n infix: true,\n handler(_ref2) {\n var parser = _ref2.parser,\n funcName = _ref2.funcName,\n token = _ref2.token;\n var replaceWith;\n switch (funcName) {\n case \"\\\\over\":\n replaceWith = \"\\\\frac\";\n break;\n case \"\\\\choose\":\n replaceWith = \"\\\\binom\";\n break;\n case \"\\\\atop\":\n replaceWith = \"\\\\\\\\atopfrac\";\n break;\n case \"\\\\brace\":\n replaceWith = \"\\\\\\\\bracefrac\";\n break;\n case \"\\\\brack\":\n replaceWith = \"\\\\\\\\brackfrac\";\n break;\n default:\n throw new Error(\"Unrecognized infix genfrac command\");\n }\n return {\n type: \"infix\",\n mode: parser.mode,\n replaceWith,\n token\n };\n }\n});\nvar stylArray = [\"display\", \"text\", \"script\", \"scriptscript\"];\nvar delimFromValue = function delimFromValue(delimString) {\n var delim = null;\n if (delimString.length > 0) {\n delim = delimString;\n delim = delim === \".\" ? null : delim;\n }\n return delim;\n};\ndefineFunction({\n type: \"genfrac\",\n names: [\"\\\\genfrac\"],\n numArgs: 6,\n allowedInArgument: true,\n argTypes: [\"math\", \"math\", \"size\", \"text\", \"math\", \"math\"],\n handler(_ref3, args) {\n var parser = _ref3.parser;\n var numer = args[4];\n var denom = args[5];\n // Look into the parse nodes to get the desired delimiters.\n var leftNode = normalizeArgument(args[0]);\n var leftDelim = leftNode.type === \"atom\" && leftNode.family === \"open\" ? delimFromValue(leftNode.text) : null;\n var rightNode = normalizeArgument(args[1]);\n var rightDelim = rightNode.type === \"atom\" && rightNode.family === \"close\" ? delimFromValue(rightNode.text) : null;\n var barNode = assertNodeType(args[2], \"size\");\n var hasBarLine;\n var barSize = null;\n if (barNode.isBlank) {\n // \\genfrac acts differently than \\above.\n // \\genfrac treats an empty size group as a signal to use a\n // standard bar size. \\above would see size = 0 and omit the bar.\n hasBarLine = true;\n } else {\n barSize = barNode.value;\n hasBarLine = barSize.number > 0;\n }\n // Find out if we want displaystyle, textstyle, etc.\n var size = null;\n var styl = args[3];\n if (styl.type === \"ordgroup\") {\n if (styl.body.length > 0) {\n var textOrd = assertNodeType(styl.body[0], \"textord\");\n size = stylArray[Number(textOrd.text)];\n }\n } else {\n styl = assertNodeType(styl, \"textord\");\n size = stylArray[Number(styl.text)];\n }\n return wrapWithStyle({\n type: \"genfrac\",\n mode: parser.mode,\n numer,\n denom,\n continued: false,\n hasBarLine,\n barSize,\n leftDelim,\n rightDelim\n }, size);\n }\n});\n// \\above is an infix fraction that also defines a fraction bar size.\ndefineFunction({\n type: \"infix\",\n names: [\"\\\\above\"],\n numArgs: 1,\n argTypes: [\"size\"],\n infix: true,\n handler(_ref4, args) {\n var parser = _ref4.parser;\n _ref4.funcName;\n var token = _ref4.token;\n return {\n type: \"infix\",\n mode: parser.mode,\n replaceWith: \"\\\\\\\\abovefrac\",\n size: assertNodeType(args[0], \"size\").value,\n token\n };\n }\n});\ndefineFunction({\n type: \"genfrac\",\n names: [\"\\\\\\\\abovefrac\"],\n numArgs: 3,\n argTypes: [\"math\", \"size\", \"math\"],\n handler: (_ref5, args) => {\n var parser = _ref5.parser;\n _ref5.funcName;\n var numer = args[0];\n var barSize = assertNodeType(args[1], \"infix\").size;\n if (!barSize) {\n throw new Error(\"\\\\\\\\abovefrac expected size, but got \" + String(barSize));\n }\n var denom = args[2];\n var hasBarLine = barSize.number > 0;\n return {\n type: \"genfrac\",\n mode: parser.mode,\n numer,\n denom,\n continued: false,\n hasBarLine,\n barSize,\n leftDelim: null,\n rightDelim: null\n };\n }\n});\n\n// NOTE: Unlike most `htmlBuilder`s, this one handles not only \"horizBrace\", but\n// also \"supsub\" since an over/underbrace can affect super/subscripting.\nvar htmlBuilder$3 = (grp, options) => {\n var style = options.style;\n // Pull out the `ParseNode<\"horizBrace\">` if `grp` is a \"supsub\" node.\n var supSubGroup;\n var group;\n if (grp.type === \"supsub\") {\n // Ref: LaTeX source2e: }}}}\\limits}\n // i.e. LaTeX treats the brace similar to an op and passes it\n // with \\limits, so we need to assign supsub style.\n supSubGroup = grp.sup ? buildGroup$1(grp.sup, options.havingStyle(style.sup()), options) : buildGroup$1(grp.sub, options.havingStyle(style.sub()), options);\n group = assertNodeType(grp.base, \"horizBrace\");\n } else {\n group = assertNodeType(grp, \"horizBrace\");\n }\n // Build the base group\n var body = buildGroup$1(group.base, options.havingBaseStyle(Style$1.DISPLAY));\n // Create the stretchy element\n var braceBody = stretchySvg(group, options);\n // Generate the vlist, with the appropriate kerns ┏━━━━━━━━┓\n // This first vlist contains the content and the brace: equation\n var vlist;\n if (group.isOver) {\n vlist = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: body\n }, {\n type: \"kern\",\n size: 0.1\n }, {\n type: \"elem\",\n elem: braceBody,\n wrapperClasses: [\"svg-align\"]\n }]\n });\n } else {\n vlist = makeVList({\n positionType: \"bottom\",\n positionData: body.depth + 0.1 + braceBody.height,\n children: [{\n type: \"elem\",\n elem: braceBody,\n wrapperClasses: [\"svg-align\"]\n }, {\n type: \"kern\",\n size: 0.1\n }, {\n type: \"elem\",\n elem: body\n }]\n });\n }\n if (supSubGroup) {\n // To write the supsub, wrap the first vlist in another vlist:\n // They can't all go in the same vlist, because the note might be\n // wider than the equation. We want the equation to control the\n // brace width.\n // note long note long note\n // ┏━━━━━━━━┓ or ┏━━━┓ not ┏━━━━━━━━━┓\n // equation eqn eqn\n var vSpan = makeSpan([\"minner\", group.isOver ? \"mover\" : \"munder\"], [vlist], options);\n if (group.isOver) {\n vlist = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: vSpan\n }, {\n type: \"kern\",\n size: 0.2\n }, {\n type: \"elem\",\n elem: supSubGroup\n }]\n });\n } else {\n vlist = makeVList({\n positionType: \"bottom\",\n positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth,\n children: [{\n type: \"elem\",\n elem: supSubGroup\n }, {\n type: \"kern\",\n size: 0.2\n }, {\n type: \"elem\",\n elem: vSpan\n }]\n });\n }\n }\n return makeSpan([\"minner\", group.isOver ? \"mover\" : \"munder\"], [vlist], options);\n};\nvar mathmlBuilder$2 = (group, options) => {\n var accentNode = stretchyMathML(group.label);\n return new MathNode(group.isOver ? \"mover\" : \"munder\", [buildGroup(group.base, options), accentNode]);\n};\n// Horizontal stretchy braces\ndefineFunction({\n type: \"horizBrace\",\n names: [\"\\\\overbrace\", \"\\\\underbrace\", \"\\\\overbracket\", \"\\\\underbracket\"],\n numArgs: 1,\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n return {\n type: \"horizBrace\",\n mode: parser.mode,\n label: funcName,\n isOver: funcName.includes(\"\\\\over\"),\n base: args[0]\n };\n },\n htmlBuilder: htmlBuilder$3,\n mathmlBuilder: mathmlBuilder$2\n});\n\ndefineFunction({\n type: \"href\",\n names: [\"\\\\href\"],\n numArgs: 2,\n argTypes: [\"url\", \"original\"],\n allowedInText: true,\n handler: (_ref, args) => {\n var parser = _ref.parser;\n var body = args[1];\n var href = assertNodeType(args[0], \"url\").url;\n if (!parser.settings.isTrusted({\n command: \"\\\\href\",\n url: href\n })) {\n return parser.formatUnsupportedCmd(\"\\\\href\");\n }\n return {\n type: \"href\",\n mode: parser.mode,\n href,\n body: ordargument(body)\n };\n },\n htmlBuilder: (group, options) => {\n var elements = buildExpression$1(group.body, options, false);\n return makeAnchor(group.href, [], elements, options);\n },\n mathmlBuilder: (group, options) => {\n var math = buildExpressionRow(group.body, options);\n if (!(math instanceof MathNode)) {\n math = new MathNode(\"mrow\", [math]);\n }\n math.setAttribute(\"href\", group.href);\n return math;\n }\n});\ndefineFunction({\n type: \"href\",\n names: [\"\\\\url\"],\n numArgs: 1,\n argTypes: [\"url\"],\n allowedInText: true,\n handler: (_ref2, args) => {\n var parser = _ref2.parser;\n var href = assertNodeType(args[0], \"url\").url;\n if (!parser.settings.isTrusted({\n command: \"\\\\url\",\n url: href\n })) {\n return parser.formatUnsupportedCmd(\"\\\\url\");\n }\n var chars = [];\n for (var i = 0; i < href.length; i++) {\n var c = href[i];\n if (c === \"~\") {\n c = \"\\\\textasciitilde\";\n }\n chars.push({\n type: \"textord\",\n mode: \"text\",\n text: c\n });\n }\n var body = {\n type: \"text\",\n mode: parser.mode,\n font: \"\\\\texttt\",\n body: chars\n };\n return {\n type: \"href\",\n mode: parser.mode,\n href,\n body: ordargument(body)\n };\n }\n});\n\n// \\hbox is provided for compatibility with LaTeX \\vcenter.\n// In LaTeX, \\vcenter can act only on a box, as in\n// \\vcenter{\\hbox{$\\frac{a+b}{\\dfrac{c}{d}}$}}\n// This function by itself doesn't do anything but prevent a soft line break.\ndefineFunction({\n type: \"hbox\",\n names: [\"\\\\hbox\"],\n numArgs: 1,\n argTypes: [\"text\"],\n allowedInText: true,\n primitive: true,\n handler(_ref, args) {\n var parser = _ref.parser;\n return {\n type: \"hbox\",\n mode: parser.mode,\n body: ordargument(args[0])\n };\n },\n htmlBuilder(group, options) {\n var elements = buildExpression$1(group.body, options.withFont(''), false);\n return makeFragment(elements);\n },\n mathmlBuilder(group, options) {\n return new MathNode(\"mrow\", buildExpression(group.body, options.withFont('')));\n }\n});\n\ndefineFunction({\n type: \"html\",\n names: [\"\\\\htmlClass\", \"\\\\htmlId\", \"\\\\htmlStyle\", \"\\\\htmlData\"],\n numArgs: 2,\n argTypes: [\"raw\", \"original\"],\n allowedInText: true,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n _ref.token;\n var value = assertNodeType(args[0], \"raw\").string;\n var body = args[1];\n if (parser.settings.strict) {\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"htmlExtension\",\n errorMsg: \"HTML extension is disabled on strict mode\",\n report: true\n });\n }\n var trustContext;\n var attributes = {};\n switch (funcName) {\n case \"\\\\htmlClass\":\n attributes.class = value;\n trustContext = {\n command: \"\\\\htmlClass\",\n class: value\n };\n break;\n case \"\\\\htmlId\":\n attributes.id = value;\n trustContext = {\n command: \"\\\\htmlId\",\n id: value\n };\n break;\n case \"\\\\htmlStyle\":\n attributes.style = value;\n trustContext = {\n command: \"\\\\htmlStyle\",\n style: value\n };\n break;\n case \"\\\\htmlData\":\n {\n // `{,}` escapes a literal comma. Braces are used rather than a\n // backslash because `\\,` is a macro (a thin space) that expands\n // away before this raw argument is ever read.\n var ESCAPED_COMMA = \"{,}\";\n var data = [];\n var current = \"\";\n for (var i = 0; i < value.length; i++) {\n if (value.startsWith(ESCAPED_COMMA, i)) {\n current += \",\";\n i += ESCAPED_COMMA.length - 1;\n } else if (value[i] === \",\") {\n data.push(current);\n current = \"\";\n } else {\n current += value[i];\n }\n }\n data.push(current);\n for (var _i = 0; _i < data.length; _i++) {\n var item = data[_i];\n var firstEquals = item.indexOf(\"=\");\n if (firstEquals < 0) {\n throw new ParseError(\"\\\\htmlData key/value '\" + item + \"'\" + \" missing equals sign\");\n }\n var key = item.slice(0, firstEquals);\n var _value = item.slice(firstEquals + 1);\n attributes[\"data-\" + key.trim()] = _value;\n }\n trustContext = {\n command: \"\\\\htmlData\",\n attributes\n };\n break;\n }\n default:\n throw new Error(\"Unrecognized html command\");\n }\n if (!parser.settings.isTrusted(trustContext)) {\n return parser.formatUnsupportedCmd(funcName);\n }\n return {\n type: \"html\",\n mode: parser.mode,\n attributes,\n body: ordargument(body)\n };\n },\n htmlBuilder: (group, options) => {\n var elements = buildExpression$1(group.body, options, false);\n var classes = [\"enclosing\"];\n if (group.attributes.class) {\n classes.push(...group.attributes.class.trim().split(/\\s+/));\n }\n var span = makeSpan(classes, elements, options);\n for (var _ref3 of Object.entries(group.attributes)) {\n var attr = _ref3[0];\n var value = _ref3[1];\n if (attr !== \"class\") {\n span.setAttribute(attr, value);\n }\n }\n return span;\n },\n mathmlBuilder: (group, options) => {\n return buildExpressionRow(group.body, options);\n }\n});\n\ndefineFunction({\n type: \"htmlmathml\",\n names: [\"\\\\html@mathml\"],\n numArgs: 2,\n allowedInArgument: true,\n allowedInText: true,\n handler: (_ref, args) => {\n var parser = _ref.parser;\n return {\n type: \"htmlmathml\",\n mode: parser.mode,\n html: ordargument(args[0]),\n mathml: ordargument(args[1])\n };\n },\n htmlBuilder: (group, options) => {\n var elements = buildExpression$1(group.html, options, false);\n return makeFragment(elements);\n },\n mathmlBuilder: (group, options) => {\n return buildExpressionRow(group.mathml, options);\n }\n});\n\nvar sizeData = function sizeData(str) {\n if (/^[-+]? *(\\d+(\\.\\d*)?|\\.\\d+)$/.test(str)) {\n // str is a number with no unit specified.\n // default unit is bp, per graphix package.\n return {\n number: +str,\n unit: \"bp\"\n };\n } else {\n var match = /([-+]?) *(\\d+(?:\\.\\d*)?|\\.\\d+) *([a-z]{2})/.exec(str);\n if (!match) {\n throw new ParseError(\"Invalid size: '\" + str + \"' in \\\\includegraphics\");\n }\n var data = {\n number: +(match[1] + match[2]),\n // sign + magnitude, cast to number\n unit: match[3]\n };\n if (!validUnit(data)) {\n throw new ParseError(\"Invalid unit: '\" + data.unit + \"' in \\\\includegraphics.\");\n }\n return data;\n }\n};\ndefineFunction({\n type: \"includegraphics\",\n names: [\"\\\\includegraphics\"],\n numArgs: 1,\n numOptionalArgs: 1,\n argTypes: [\"raw\", \"url\"],\n allowedInText: false,\n handler: (_ref, args, optArgs) => {\n var parser = _ref.parser;\n var width = {\n number: 0,\n unit: \"em\"\n };\n var height = {\n number: 0.9,\n unit: \"em\"\n }; // sorta character sized.\n var totalheight = {\n number: 0,\n unit: \"em\"\n };\n var alt = \"\";\n if (optArgs[0]) {\n var attributeStr = assertNodeType(optArgs[0], \"raw\").string;\n // Parser.js does not parse key/value pairs. We get a string.\n var attributes = attributeStr.split(\",\");\n for (var i = 0; i < attributes.length; i++) {\n var keyVal = attributes[i].split(\"=\");\n if (keyVal.length === 2) {\n var str = keyVal[1].trim();\n switch (keyVal[0].trim()) {\n case \"alt\":\n alt = str;\n break;\n case \"width\":\n width = sizeData(str);\n break;\n case \"height\":\n height = sizeData(str);\n break;\n case \"totalheight\":\n totalheight = sizeData(str);\n break;\n default:\n throw new ParseError(\"Invalid key: '\" + keyVal[0] + \"' in \\\\includegraphics.\");\n }\n }\n }\n }\n var src = assertNodeType(args[0], \"url\").url;\n if (alt === \"\") {\n // No alt given. Use the file name. Strip away the path.\n alt = src;\n alt = alt.replace(/^.*[\\\\/]/, '');\n alt = alt.substring(0, alt.lastIndexOf('.'));\n }\n if (!parser.settings.isTrusted({\n command: \"\\\\includegraphics\",\n url: src\n })) {\n return parser.formatUnsupportedCmd(\"\\\\includegraphics\");\n }\n return {\n type: \"includegraphics\",\n mode: parser.mode,\n alt: alt,\n width: width,\n height: height,\n totalheight: totalheight,\n src: src\n };\n },\n htmlBuilder: (group, options) => {\n var height = calculateSize(group.height, options);\n var depth = 0;\n if (group.totalheight.number > 0) {\n depth = calculateSize(group.totalheight, options) - height;\n }\n var width = 0;\n if (group.width.number > 0) {\n width = calculateSize(group.width, options);\n }\n var style = {\n height: makeEm(height + depth)\n };\n if (width > 0) {\n style.width = makeEm(width);\n }\n if (depth > 0) {\n style.verticalAlign = makeEm(-depth);\n }\n var node = new Img(group.src, group.alt, style);\n node.height = height;\n node.depth = depth;\n return node;\n },\n mathmlBuilder: (group, options) => {\n var node = new MathNode(\"mglyph\", []);\n node.setAttribute(\"alt\", group.alt);\n var height = calculateSize(group.height, options);\n var depth = 0;\n if (group.totalheight.number > 0) {\n depth = calculateSize(group.totalheight, options) - height;\n node.setAttribute(\"valign\", makeEm(-depth));\n }\n node.setAttribute(\"height\", makeEm(height + depth));\n if (group.width.number > 0) {\n var width = calculateSize(group.width, options);\n node.setAttribute(\"width\", makeEm(width));\n }\n node.setAttribute(\"src\", group.src);\n return node;\n }\n});\n\n// Horizontal spacing commands\n// TODO: \\hskip and \\mskip should support plus and minus in lengths\ndefineFunction({\n type: \"kern\",\n names: [\"\\\\kern\", \"\\\\mkern\", \"\\\\hskip\", \"\\\\mskip\"],\n numArgs: 1,\n argTypes: [\"size\"],\n primitive: true,\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var size = assertNodeType(args[0], \"size\");\n if (parser.settings.strict) {\n var mathFunction = funcName[1] === 'm'; // \\mkern, \\mskip\n var muUnit = size.value.unit === 'mu';\n if (mathFunction) {\n if (!muUnit) {\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"mathVsTextUnits\",\n errorMsg: \"LaTeX's \" + funcName + \" supports only mu units, \" + (\"not \" + size.value.unit + \" units\"),\n report: true\n });\n }\n if (parser.mode !== \"math\") {\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"mathVsTextUnits\",\n errorMsg: \"LaTeX's \" + funcName + \" works only in math mode\",\n report: true\n });\n }\n } else {\n // !mathFunction\n if (muUnit) {\n handleStrict({\n strict: parser.settings.strict,\n errorCode: \"mathVsTextUnits\",\n errorMsg: \"LaTeX's \" + funcName + \" doesn't support mu units\",\n report: true\n });\n }\n }\n }\n return {\n type: \"kern\",\n mode: parser.mode,\n dimension: size.value\n };\n },\n htmlBuilder(group, options) {\n return makeGlue(group.dimension, options);\n },\n mathmlBuilder(group, options) {\n var dimension = calculateSize(group.dimension, options);\n return new SpaceNode(dimension);\n }\n});\n\n// Horizontal overlap functions\ndefineFunction({\n type: \"lap\",\n names: [\"\\\\mathllap\", \"\\\\mathrlap\", \"\\\\mathclap\"],\n numArgs: 1,\n allowedInText: true,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var body = args[0];\n return {\n type: \"lap\",\n mode: parser.mode,\n alignment: funcName.slice(5),\n body\n };\n },\n htmlBuilder: (group, options) => {\n // mathllap, mathrlap, mathclap\n var inner;\n if (group.alignment === \"clap\") {\n // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/\n inner = makeSpan([], [buildGroup$1(group.body, options)]);\n // wrap, since CSS will center a .clap > .katex-inner > span\n inner = makeSpan([\"katex-inner\"], [inner], options);\n } else {\n inner = makeSpan([\"katex-inner\"], [buildGroup$1(group.body, options)]);\n }\n var fix = makeSpan([\"katex-fix\"], []);\n var node = makeSpan([group.alignment], [inner, fix], options);\n // At this point, we have correctly set horizontal alignment of the\n // two items involved in the lap.\n // Next, use a strut to set the height of the HTML bounding box.\n // Otherwise, a tall argument may be misplaced.\n // This code resolved issue #1153\n var strut = makeSpan([\"katex-strut\"]);\n strut.style.height = makeEm(node.height + node.depth);\n if (node.depth) {\n strut.style.verticalAlign = makeEm(-node.depth);\n }\n node.children.unshift(strut);\n // Next, prevent vertical misplacement when next to something tall.\n // This code resolves issue #1234\n node = makeSpan([\"katex-thinbox\"], [node], options);\n return makeSpan([\"mord\", \"katex-vbox\"], [node], options);\n },\n mathmlBuilder: (group, options) => {\n // mathllap, mathrlap, mathclap\n var node = new MathNode(\"mpadded\", [buildGroup(group.body, options)]);\n if (group.alignment !== \"rlap\") {\n var offset = group.alignment === \"llap\" ? \"-1\" : \"-0.5\";\n node.setAttribute(\"lspace\", offset + \"width\");\n }\n node.setAttribute(\"width\", \"0px\");\n return node;\n }\n});\n\n// Switching from text mode back to math mode\ndefineFunction({\n type: \"styling\",\n names: [\"\\\\(\", \"$\"],\n numArgs: 0,\n allowedInText: true,\n allowedInMath: false,\n handler(_ref, args) {\n var funcName = _ref.funcName,\n parser = _ref.parser;\n var outerMode = parser.mode;\n parser.switchMode(\"math\");\n var close = funcName === \"\\\\(\" ? \"\\\\)\" : \"$\";\n var body = parser.parseExpression(false, close);\n parser.expect(close);\n parser.switchMode(outerMode);\n return {\n type: \"styling\",\n mode: parser.mode,\n style: \"text\",\n resetFont: true,\n body\n };\n }\n});\n// Check for extra closing math delimiters\ndefineFunction({\n type: \"text\",\n // Doesn't matter what this is.\n names: [\"\\\\)\", \"\\\\]\"],\n numArgs: 0,\n allowedInText: true,\n allowedInMath: false,\n handler(context, args) {\n throw new ParseError(\"Mismatched \" + context.funcName);\n }\n});\n\nvar chooseMathStyle = (group, options) => {\n switch (options.style.size) {\n case Style$1.DISPLAY.size:\n return group.display;\n case Style$1.TEXT.size:\n return group.text;\n case Style$1.SCRIPT.size:\n return group.script;\n case Style$1.SCRIPTSCRIPT.size:\n return group.scriptscript;\n default:\n return group.text;\n }\n};\ndefineFunction({\n type: \"mathchoice\",\n names: [\"\\\\mathchoice\"],\n numArgs: 4,\n primitive: true,\n handler: (_ref, args) => {\n var parser = _ref.parser;\n return {\n type: \"mathchoice\",\n mode: parser.mode,\n display: ordargument(args[0]),\n text: ordargument(args[1]),\n script: ordargument(args[2]),\n scriptscript: ordargument(args[3])\n };\n },\n htmlBuilder: (group, options) => {\n var body = chooseMathStyle(group, options);\n var elements = buildExpression$1(body, options, false);\n return makeFragment(elements);\n },\n mathmlBuilder: (group, options) => {\n var body = chooseMathStyle(group, options);\n return buildExpressionRow(body, options);\n }\n});\n\n// For an operator with limits, assemble the base, sup, and sub into a span.\nvar assembleSupSub = (base, supGroup, subGroup, options, style, slant, baseShift) => {\n base = makeSpan([], [base]);\n var subIsSingleCharacter = subGroup && isCharacterBox(subGroup);\n var sub;\n var sup;\n // We manually have to handle the superscripts and subscripts. This,\n // aside from the kern calculations, is copied from supsub.\n if (supGroup) {\n var elem = buildGroup$1(supGroup, options.havingStyle(style.sup()), options);\n sup = {\n elem,\n kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth)\n };\n }\n if (subGroup) {\n var _elem = buildGroup$1(subGroup, options.havingStyle(style.sub()), options);\n sub = {\n elem: _elem,\n kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - _elem.height)\n };\n }\n // Build the final group as a vlist of the possible subscript, base,\n // and possible superscript.\n var finalGroup;\n if (sup && sub) {\n var bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift;\n finalGroup = makeVList({\n positionType: \"bottom\",\n positionData: bottom,\n children: [{\n type: \"kern\",\n size: options.fontMetrics().bigOpSpacing5\n }, {\n type: \"elem\",\n elem: sub.elem,\n marginLeft: makeEm(-slant)\n }, {\n type: \"kern\",\n size: sub.kern\n }, {\n type: \"elem\",\n elem: base\n }, {\n type: \"kern\",\n size: sup.kern\n }, {\n type: \"elem\",\n elem: sup.elem,\n marginLeft: makeEm(slant)\n }, {\n type: \"kern\",\n size: options.fontMetrics().bigOpSpacing5\n }]\n });\n } else if (sub) {\n var top = base.height - baseShift;\n // Shift the limits by the slant of the symbol. Note\n // that we are supposed to shift the limits by 1/2 of the slant,\n // but since we are centering the limits adding a full slant of\n // margin will shift by 1/2 that.\n finalGroup = makeVList({\n positionType: \"top\",\n positionData: top,\n children: [{\n type: \"kern\",\n size: options.fontMetrics().bigOpSpacing5\n }, {\n type: \"elem\",\n elem: sub.elem,\n marginLeft: makeEm(-slant)\n }, {\n type: \"kern\",\n size: sub.kern\n }, {\n type: \"elem\",\n elem: base\n }]\n });\n } else if (sup) {\n var _bottom = base.depth + baseShift;\n finalGroup = makeVList({\n positionType: \"bottom\",\n positionData: _bottom,\n children: [{\n type: \"elem\",\n elem: base\n }, {\n type: \"kern\",\n size: sup.kern\n }, {\n type: \"elem\",\n elem: sup.elem,\n marginLeft: makeEm(slant)\n }, {\n type: \"kern\",\n size: options.fontMetrics().bigOpSpacing5\n }]\n });\n } else {\n // This case probably shouldn't occur (this would mean the\n // supsub was sending us a group with no superscript or\n // subscript) but be safe.\n return base;\n }\n var parts = [finalGroup];\n if (sub && slant !== 0 && !subIsSingleCharacter) {\n // A negative margin-left was applied to the lower limit.\n // Avoid an overlap by placing a spacer on the left on the group.\n var spacer = makeSpan([\"mspace\"], [], options);\n spacer.style.marginRight = makeEm(slant);\n parts.unshift(spacer);\n }\n return makeSpan([\"mop\", \"op-limits\"], parts, options);\n};\n\n// Limits, symbols\n// Most operators have a large successor symbol, but these don't.\nvar noSuccessor = new Set([\"\\\\smallint\"]);\n// NOTE: Unlike most `htmlBuilder`s, this one handles not only \"op\", but also\n// \"supsub\" since some of them (like \\int) can affect super/subscripting.\nvar htmlBuilder$2 = (grp, options) => {\n // Operators are handled in the TeXbook pg. 443-444, rule 13(a).\n var supGroup;\n var subGroup;\n var hasLimits = false;\n var group;\n if (grp.type === \"supsub\") {\n // If we have limits, supsub will pass us its group to handle. Pull\n // out the superscript and subscript and set the group to the op in\n // its base.\n supGroup = grp.sup;\n subGroup = grp.sub;\n group = assertNodeType(grp.base, \"op\");\n hasLimits = true;\n } else {\n group = assertNodeType(grp, \"op\");\n }\n var style = options.style;\n var large = false;\n if (style.size === Style$1.DISPLAY.size && group.symbol && !noSuccessor.has(group.name)) {\n // Most symbol operators get larger in displaystyle (rule 13)\n large = true;\n }\n var base;\n // Italic correction from the symbol glyph, captured before the symbol\n // may be wrapped in a vlist (for \\oiint/\\oiiint). Stays 0 for non-symbol ops.\n var symbolItalic;\n if (group.symbol) {\n // If this is a symbol, create the symbol.\n var fontName = large ? \"Size2-Regular\" : \"Size1-Regular\";\n var stash = \"\";\n if (group.name === \"\\\\oiint\" || group.name === \"\\\\oiiint\") {\n // No font glyphs yet, so use a glyph w/o the oval.\n // TODO: When font glyphs are available, delete this code.\n stash = group.name.slice(1);\n group.name = stash === \"oiint\" ? \"\\\\iint\" : \"\\\\iiint\";\n }\n base = makeSymbol(group.name, fontName, \"math\", options, [\"mop\", \"op-symbol\", large ? \"large-op\" : \"small-op\"]);\n symbolItalic = base.italic;\n if (stash.length > 0) {\n // We're in \\oiint or \\oiiint. Overlay the oval.\n // TODO: When font glyphs are available, delete this code.\n var oval = staticSvg(stash + \"Size\" + (large ? \"2\" : \"1\"), options);\n base = makeVList({\n positionType: \"individualShift\",\n children: [{\n type: \"elem\",\n elem: base,\n shift: 0\n }, {\n type: \"elem\",\n elem: oval,\n shift: large ? 0.08 : 0\n }]\n });\n group.name = \"\\\\\" + stash;\n base.classes.unshift(\"mop\");\n // Carry the italic correction from the original symbol to the\n // vlist wrapper so supsub can use it for subscript positioning.\n base.italic = symbolItalic;\n }\n } else if (group.body) {\n // If this is a list, compose that list.\n var inner = buildExpression$1(group.body, options, true);\n if (inner.length === 1 && inner[0] instanceof SymbolNode) {\n base = inner[0];\n base.classes[0] = \"mop\"; // replace old mclass\n } else {\n base = makeSpan([\"mop\"], inner, options);\n }\n } else {\n // Otherwise, this is a text operator. Build the text from the\n // operator's name.\n var output = [];\n for (var i = 1; i < group.name.length; i++) {\n output.push(mathsym(group.name[i], group.mode, options));\n }\n base = makeSpan([\"mop\"], output, options);\n }\n // If content of op is a single symbol, shift it vertically.\n var baseShift = 0;\n var slant = 0;\n if ((base instanceof SymbolNode || group.name === \"\\\\oiint\" || group.name === \"\\\\oiiint\") && !group.suppressBaseShift) {\n var _base$italic;\n // We suppress the shift of the base of \\overset and \\underset. Otherwise,\n // shift the symbol so its center lies on the axis (rule 13). It\n // appears that our fonts have the centers of the symbols already\n // almost on the axis, so these numbers are very small. Note we\n // don't actually apply this here, but instead it is used either in\n // the vlist creation or separately when there are no limits.\n baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight;\n // The slant of the symbol is just its italic correction.\n // SymbolNode carries .italic natively; Span (for \\oiint/\\oiiint)\n // only has it set when nonzero, so default to 0.\n slant = (_base$italic = base.italic) != null ? _base$italic : 0;\n }\n if (hasLimits) {\n return assembleSupSub(base, supGroup, subGroup, options, style, slant, baseShift);\n } else {\n if (baseShift) {\n base.style.position = \"relative\";\n base.style.top = makeEm(baseShift);\n }\n return base;\n }\n};\nvar mathmlBuilder$1 = (group, options) => {\n var node;\n if (group.symbol) {\n // This is a symbol. Just add the symbol.\n node = new MathNode(\"mo\", [makeText(group.name, group.mode)]);\n if (noSuccessor.has(group.name)) {\n node.setAttribute(\"largeop\", \"false\");\n }\n } else if (group.body) {\n // This is an operator with children. Add them.\n node = new MathNode(\"mo\", buildExpression(group.body, options));\n } else {\n // This is a text operator. Add all the characters from the\n // operator's name.\n node = new MathNode(\"mi\", [new TextNode(group.name.slice(1))]);\n // Append an <mo>⁡</mo>.\n // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4\n var operator = new MathNode(\"mo\", [makeText(\"\\u2061\", \"text\")]);\n if (group.parentIsSupSub) {\n node = new MathNode(\"mrow\", [node, operator]);\n } else {\n node = newDocumentFragment([node, operator]);\n }\n }\n return node;\n};\nvar singleCharBigOps = {\n \"\\u220F\": \"\\\\prod\",\n \"\\u2210\": \"\\\\coprod\",\n \"\\u2211\": \"\\\\sum\",\n \"\\u22c0\": \"\\\\bigwedge\",\n \"\\u22c1\": \"\\\\bigvee\",\n \"\\u22c2\": \"\\\\bigcap\",\n \"\\u22c3\": \"\\\\bigcup\",\n \"\\u2a00\": \"\\\\bigodot\",\n \"\\u2a01\": \"\\\\bigoplus\",\n \"\\u2a02\": \"\\\\bigotimes\",\n \"\\u2a04\": \"\\\\biguplus\",\n \"\\u2a06\": \"\\\\bigsqcup\"\n};\ndefineFunction({\n type: \"op\",\n names: [\"\\\\coprod\", \"\\\\bigvee\", \"\\\\bigwedge\", \"\\\\biguplus\", \"\\\\bigcap\", \"\\\\bigcup\", \"\\\\intop\", \"\\\\prod\", \"\\\\sum\", \"\\\\bigotimes\", \"\\\\bigoplus\", \"\\\\bigodot\", \"\\\\bigsqcup\", \"\\\\smallint\", \"\\u220F\", \"\\u2210\", \"\\u2211\", \"\\u22c0\", \"\\u22c1\", \"\\u22c2\", \"\\u22c3\", \"\\u2a00\", \"\\u2a01\", \"\\u2a02\", \"\\u2a04\", \"\\u2a06\"],\n numArgs: 0,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var fName = funcName;\n if (fName.length === 1) {\n fName = singleCharBigOps[fName];\n }\n return {\n type: \"op\",\n mode: parser.mode,\n limits: true,\n parentIsSupSub: false,\n symbol: true,\n name: fName\n };\n },\n htmlBuilder: htmlBuilder$2,\n mathmlBuilder: mathmlBuilder$1\n});\ndefineFunction({\n type: \"op\",\n names: [\"\\\\mathop\"],\n numArgs: 1,\n primitive: true,\n handler: (_ref2, args) => {\n var parser = _ref2.parser;\n var body = args[0];\n return {\n type: \"op\",\n mode: parser.mode,\n limits: false,\n parentIsSupSub: false,\n symbol: false,\n body: ordargument(body)\n };\n }\n});\n// There are 2 flags for operators; whether they produce limits in\n// displaystyle, and whether they are symbols and should grow in\n// displaystyle. These four groups cover the four possible choices.\nvar singleCharIntegrals = {\n \"\\u222b\": \"\\\\int\",\n \"\\u222c\": \"\\\\iint\",\n \"\\u222d\": \"\\\\iiint\",\n \"\\u222e\": \"\\\\oint\",\n \"\\u222f\": \"\\\\oiint\",\n \"\\u2230\": \"\\\\oiiint\"\n};\n// No limits, not symbols\ndefineFunction({\n type: \"op\",\n names: [\"\\\\arcsin\", \"\\\\arccos\", \"\\\\arctan\", \"\\\\arctg\", \"\\\\arcctg\", \"\\\\arg\", \"\\\\ch\", \"\\\\cos\", \"\\\\cosec\", \"\\\\cosh\", \"\\\\cot\", \"\\\\cotg\", \"\\\\coth\", \"\\\\csc\", \"\\\\ctg\", \"\\\\cth\", \"\\\\deg\", \"\\\\dim\", \"\\\\exp\", \"\\\\hom\", \"\\\\ker\", \"\\\\lg\", \"\\\\ln\", \"\\\\log\", \"\\\\sec\", \"\\\\sin\", \"\\\\sinh\", \"\\\\sh\", \"\\\\tan\", \"\\\\tanh\", \"\\\\tg\", \"\\\\th\"],\n numArgs: 0,\n handler(_ref3) {\n var parser = _ref3.parser,\n funcName = _ref3.funcName;\n return {\n type: \"op\",\n mode: parser.mode,\n limits: false,\n parentIsSupSub: false,\n symbol: false,\n name: funcName\n };\n }\n});\n// Limits, not symbols\ndefineFunction({\n type: \"op\",\n names: [\"\\\\det\", \"\\\\gcd\", \"\\\\inf\", \"\\\\lim\", \"\\\\max\", \"\\\\min\", \"\\\\Pr\", \"\\\\sup\"],\n numArgs: 0,\n handler(_ref4) {\n var parser = _ref4.parser,\n funcName = _ref4.funcName;\n return {\n type: \"op\",\n mode: parser.mode,\n limits: true,\n parentIsSupSub: false,\n symbol: false,\n name: funcName\n };\n }\n});\n// No limits, symbols\ndefineFunction({\n type: \"op\",\n names: [\"\\\\int\", \"\\\\iint\", \"\\\\iiint\", \"\\\\oint\", \"\\\\oiint\", \"\\\\oiiint\", \"\\u222b\", \"\\u222c\", \"\\u222d\", \"\\u222e\", \"\\u222f\", \"\\u2230\"],\n numArgs: 0,\n allowedInArgument: true,\n handler(_ref5) {\n var parser = _ref5.parser,\n funcName = _ref5.funcName;\n var fName = funcName;\n if (fName.length === 1) {\n fName = singleCharIntegrals[fName];\n }\n return {\n type: \"op\",\n mode: parser.mode,\n limits: false,\n parentIsSupSub: false,\n symbol: true,\n name: fName\n };\n }\n});\n\n// NOTE: Unlike most `htmlBuilder`s, this one handles not only\n// \"operatorname\", but also \"supsub\" since \\operatorname* can\n// affect super/subscripting.\nvar htmlBuilder$1 = (grp, options) => {\n // Operators are handled in the TeXbook pg. 443-444, rule 13(a).\n var supGroup;\n var subGroup;\n var hasLimits = false;\n var group;\n if (grp.type === \"supsub\") {\n // If we have limits, supsub will pass us its group to handle. Pull\n // out the superscript and subscript and set the group to the op in\n // its base.\n supGroup = grp.sup;\n subGroup = grp.sub;\n group = assertNodeType(grp.base, \"operatorname\");\n hasLimits = true;\n } else {\n group = assertNodeType(grp, \"operatorname\");\n }\n var base;\n if (group.body.length > 0) {\n var body = group.body.map(child => {\n var childText = \"text\" in child ? child.text : undefined;\n if (typeof childText === \"string\") {\n return {\n type: \"textord\",\n mode: child.mode,\n text: childText\n };\n } else {\n return child;\n }\n });\n // Consolidate function names into symbol characters.\n var expression = buildExpression$1(body, options.withFont(\"mathrm\"), true);\n for (var i = 0; i < expression.length; i++) {\n var child = expression[i];\n if (child instanceof SymbolNode) {\n // Per amsopn package,\n // change minus to hyphen and \\ast to asterisk\n child.text = child.text.replace(/\\u2212/, \"-\").replace(/\\u2217/, \"*\");\n }\n }\n base = makeSpan([\"mop\"], expression, options);\n } else {\n base = makeSpan([\"mop\"], [], options);\n }\n if (hasLimits) {\n return assembleSupSub(base, supGroup, subGroup, options, options.style, 0, 0);\n } else {\n return base;\n }\n};\nvar mathmlBuilder = (group, options) => {\n // The steps taken here are similar to the html version.\n var expression = buildExpression(group.body, options.withFont(\"mathrm\"));\n // Is expression a string or has it something like a fraction?\n var isAllString = true; // default\n for (var i = 0; i < expression.length; i++) {\n var node = expression[i];\n if (node instanceof SpaceNode) ; else if (node instanceof MathNode) {\n switch (node.type) {\n case \"mi\":\n case \"mn\":\n case \"mspace\":\n case \"mtext\":\n break;\n // Do nothing yet.\n case \"mo\":\n {\n var child = node.children[0];\n if (node.children.length === 1 && child instanceof TextNode) {\n child.text = child.text.replace(/\\u2212/, \"-\").replace(/\\u2217/, \"*\");\n } else {\n isAllString = false;\n }\n break;\n }\n default:\n isAllString = false;\n }\n } else {\n isAllString = false;\n }\n }\n if (isAllString) {\n // Write a single TextNode instead of multiple nested tags.\n var word = expression.map(node => node.toText()).join(\"\");\n expression = [new TextNode(word)];\n }\n var identifier = new MathNode(\"mi\", expression);\n identifier.setAttribute(\"mathvariant\", \"normal\");\n // \\u2061 is the same as ⁡\n // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp\n var operator = new MathNode(\"mo\", [makeText(\"\\u2061\", \"text\")]);\n if (group.parentIsSupSub) {\n return new MathNode(\"mrow\", [identifier, operator]);\n } else {\n return newDocumentFragment([identifier, operator]);\n }\n};\n// \\operatorname\n// amsopn.dtx: \\mathop{#1\\kern\\z@\\operator@font#3}\\newmcodes@\ndefineFunction({\n type: \"operatorname\",\n names: [\"\\\\operatorname@\", \"\\\\operatornamewithlimits\"],\n numArgs: 1,\n handler: (_ref, args) => {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var body = args[0];\n return {\n type: \"operatorname\",\n mode: parser.mode,\n body: ordargument(body),\n alwaysHandleSupSub: funcName === \"\\\\operatornamewithlimits\",\n limits: false,\n parentIsSupSub: false\n };\n },\n htmlBuilder: htmlBuilder$1,\n mathmlBuilder\n});\ndefineMacro(\"\\\\operatorname\", \"\\\\@ifstar\\\\operatornamewithlimits\\\\operatorname@\");\n\ndefineFunctionBuilders({\n type: \"ordgroup\",\n htmlBuilder(group, options) {\n if (group.semisimple) {\n return makeFragment(buildExpression$1(group.body, options, false));\n }\n return makeSpan([\"mord\"], buildExpression$1(group.body, options, true), options);\n },\n mathmlBuilder(group, options) {\n return buildExpressionRow(group.body, options, true);\n }\n});\n\ndefineFunction({\n type: \"overline\",\n names: [\"\\\\overline\"],\n numArgs: 1,\n handler(_ref, args) {\n var parser = _ref.parser;\n var body = args[0];\n return {\n type: \"overline\",\n mode: parser.mode,\n body\n };\n },\n htmlBuilder(group, options) {\n // Overlines are handled in the TeXbook pg 443, Rule 9.\n // Build the inner group in the cramped style.\n var innerGroup = buildGroup$1(group.body, options.havingCrampedStyle());\n // Create the line above the body\n var line = makeLineSpan(\"overline-line\", options);\n // Generate the vlist, with the appropriate kerns\n var defaultRuleThickness = options.fontMetrics().defaultRuleThickness;\n var vlist = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: innerGroup\n }, {\n type: \"kern\",\n size: 3 * defaultRuleThickness\n }, {\n type: \"elem\",\n elem: line\n }, {\n type: \"kern\",\n size: defaultRuleThickness\n }]\n });\n return makeSpan([\"mord\", \"katex-overline\"], [vlist], options);\n },\n mathmlBuilder(group, options) {\n var operator = new MathNode(\"mo\", [new TextNode(\"\\u203e\")]);\n operator.setAttribute(\"stretchy\", \"true\");\n var node = new MathNode(\"mover\", [buildGroup(group.body, options), operator]);\n node.setAttribute(\"accent\", \"true\");\n return node;\n }\n});\n\ndefineFunction({\n type: \"phantom\",\n names: [\"\\\\phantom\"],\n numArgs: 1,\n allowedInText: true,\n handler: (_ref, args) => {\n var parser = _ref.parser;\n var body = args[0];\n return {\n type: \"phantom\",\n mode: parser.mode,\n body: ordargument(body)\n };\n },\n htmlBuilder: (group, options) => {\n var elements = buildExpression$1(group.body, options.withPhantom(), false);\n // \\phantom isn't supposed to affect the elements it contains.\n // See \"color\" for more details.\n return makeFragment(elements);\n },\n mathmlBuilder: (group, options) => {\n var inner = buildExpression(group.body, options);\n return new MathNode(\"mphantom\", inner);\n }\n});\ndefineMacro(\"\\\\hphantom\", \"\\\\smash{\\\\phantom{#1}}\");\ndefineFunction({\n type: \"vphantom\",\n names: [\"\\\\vphantom\"],\n numArgs: 1,\n allowedInText: true,\n handler: (_ref2, args) => {\n var parser = _ref2.parser;\n var body = args[0];\n return {\n type: \"vphantom\",\n mode: parser.mode,\n body\n };\n },\n htmlBuilder: (group, options) => {\n var inner = makeSpan([\"katex-inner\"], [buildGroup$1(group.body, options.withPhantom())]);\n var fix = makeSpan([\"katex-fix\"], []);\n return makeSpan([\"mord\", \"rlap\"], [inner, fix], options);\n },\n mathmlBuilder: (group, options) => {\n var inner = buildExpression(ordargument(group.body), options);\n var phantom = new MathNode(\"mphantom\", inner);\n var node = new MathNode(\"mpadded\", [phantom]);\n node.setAttribute(\"width\", \"0px\");\n return node;\n }\n});\n\n// Box manipulation\ndefineFunction({\n type: \"raisebox\",\n names: [\"\\\\raisebox\"],\n numArgs: 2,\n argTypes: [\"size\", \"hbox\"],\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser;\n var amount = assertNodeType(args[0], \"size\").value;\n var body = args[1];\n return {\n type: \"raisebox\",\n mode: parser.mode,\n dy: amount,\n body\n };\n },\n htmlBuilder(group, options) {\n var body = buildGroup$1(group.body, options);\n var dy = calculateSize(group.dy, options);\n return makeVList({\n positionType: \"shift\",\n positionData: -dy,\n children: [{\n type: \"elem\",\n elem: body\n }]\n });\n },\n mathmlBuilder(group, options) {\n var node = new MathNode(\"mpadded\", [buildGroup(group.body, options)]);\n var dy = group.dy.number + group.dy.unit;\n node.setAttribute(\"voffset\", dy);\n return node;\n }\n});\n\nvar handler = (_ref, args) => {\n var parser = _ref.parser;\n return {\n type: \"reflectbox\",\n mode: parser.mode,\n body: args[0]\n };\n};\ndefineFunction({\n type: \"reflectbox\",\n names: [\"\\\\reflectbox\"],\n numArgs: 1,\n argTypes: [\"hbox\"],\n allowedInText: true,\n handler,\n htmlBuilder(group, options) {\n return makeSpan([\"mord\", \"reflectbox\"], [buildGroup$1(group.body, options)], options);\n },\n mathmlBuilder(group, options) {\n return buildGroup(group.body, options);\n }\n});\n// Parse math directly so the shared builders inherit the surrounding style.\n// \\reflectbox instead uses an hbox argument for LaTeX's text-box behavior.\ndefineFunction({\n type: \"reflectbox\",\n names: [\"\\\\mathreflectbox\"],\n numArgs: 1,\n argTypes: [\"math\"],\n handler\n});\n\ndefineFunction({\n type: \"internal\",\n names: [\"\\\\relax\"],\n numArgs: 0,\n allowedInText: true,\n allowedInArgument: true,\n handler(_ref) {\n var parser = _ref.parser;\n return {\n type: \"internal\",\n mode: parser.mode\n };\n }\n});\n\ndefineFunction({\n type: \"rule\",\n names: [\"\\\\rule\"],\n numArgs: 2,\n numOptionalArgs: 1,\n allowedInText: true,\n allowedInMath: true,\n argTypes: [\"size\", \"size\", \"size\"],\n handler(_ref, args, optArgs) {\n var parser = _ref.parser;\n var shift = optArgs[0];\n var width = assertNodeType(args[0], \"size\");\n var height = assertNodeType(args[1], \"size\");\n return {\n type: \"rule\",\n mode: parser.mode,\n shift: shift && assertNodeType(shift, \"size\").value,\n width: width.value,\n height: height.value\n };\n },\n htmlBuilder(group, options) {\n // Make an empty span for the rule\n var rule = makeSpan([\"mord\", \"katex-rule\"], [], options);\n // Calculate the shift, width, and height of the rule, and account for units\n var width = calculateSize(group.width, options);\n var height = calculateSize(group.height, options);\n var shift = group.shift ? calculateSize(group.shift, options) : 0;\n // Style the rule to the right size\n rule.style.borderRightWidth = makeEm(width);\n rule.style.borderTopWidth = makeEm(height);\n rule.style.bottom = makeEm(shift);\n // Record the height and width\n rule.width = width;\n rule.height = height + shift;\n rule.depth = -shift;\n // Font size is the number large enough that the browser will\n // reserve at least `absHeight` space above the baseline.\n // The 1.125 factor was empirically determined\n rule.maxFontSize = height * 1.125 * options.sizeMultiplier;\n return rule;\n },\n mathmlBuilder(group, options) {\n var width = calculateSize(group.width, options);\n var height = calculateSize(group.height, options);\n var shift = group.shift ? calculateSize(group.shift, options) : 0;\n var color = options.color && options.getColor() || \"black\";\n var rule = new MathNode(\"mspace\");\n rule.setAttribute(\"mathbackground\", color);\n rule.setAttribute(\"width\", makeEm(width));\n rule.setAttribute(\"height\", makeEm(height));\n var wrapper = new MathNode(\"mpadded\", [rule]);\n if (shift >= 0) {\n wrapper.setAttribute(\"height\", makeEm(shift));\n } else {\n wrapper.setAttribute(\"height\", makeEm(shift));\n wrapper.setAttribute(\"depth\", makeEm(-shift));\n }\n wrapper.setAttribute(\"voffset\", makeEm(shift));\n return wrapper;\n }\n});\n\nfunction sizingGroup(value, options, baseOptions) {\n var inner = buildExpression$1(value, options, false);\n var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;\n // Add size-resetting classes to the inner list and set maxFontSize\n // manually. Handle nested size changes.\n for (var i = 0; i < inner.length; i++) {\n var pos = inner[i].classes.indexOf(\"katex-sizing\");\n if (pos < 0) {\n Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions));\n } else if (inner[i].classes[pos + 1] === \"reset-size\" + options.size) {\n // This is a nested size change: e.g., inner[i] is the \"b\" in\n // `\\Huge a \\small b`. Override the old size (the `reset-` class)\n // but not the new size.\n inner[i].classes[pos + 1] = \"reset-size\" + baseOptions.size;\n }\n inner[i].height *= multiplier;\n inner[i].depth *= multiplier;\n }\n return makeFragment(inner);\n}\nvar sizeFuncs = [\"\\\\tiny\", \"\\\\sixptsize\", \"\\\\scriptsize\", \"\\\\footnotesize\", \"\\\\small\", \"\\\\normalsize\", \"\\\\large\", \"\\\\Large\", \"\\\\LARGE\", \"\\\\huge\", \"\\\\Huge\"];\nvar htmlBuilder = (group, options) => {\n // Handle sizing operators like \\Huge. Real TeX doesn't actually allow\n // these functions inside of math expressions, so we do some special\n // handling.\n var newOptions = options.havingSize(group.size);\n return sizingGroup(group.body, newOptions, options);\n};\ndefineFunction({\n type: \"sizing\",\n names: sizeFuncs,\n numArgs: 0,\n allowedInText: true,\n handler: (_ref, args) => {\n var breakOnTokenText = _ref.breakOnTokenText,\n funcName = _ref.funcName,\n parser = _ref.parser;\n var body = parser.parseExpression(false, breakOnTokenText);\n return {\n type: \"sizing\",\n mode: parser.mode,\n // Figure out what size to use based on the list of functions above\n size: sizeFuncs.indexOf(funcName) + 1,\n body\n };\n },\n htmlBuilder,\n mathmlBuilder: (group, options) => {\n var newOptions = options.havingSize(group.size);\n var inner = buildExpression(group.body, newOptions);\n var node = new MathNode(\"mstyle\", inner);\n // TODO(emily): This doesn't produce the correct size for nested size\n // changes, because we don't keep state of what style we're currently\n // in, so we can't reset the size to normal before changing it. Now\n // that we're passing an options parameter we should be able to fix\n // this.\n node.setAttribute(\"mathsize\", makeEm(newOptions.sizeMultiplier));\n return node;\n }\n});\n\n// smash, with optional [tb], as in AMS\ndefineFunction({\n type: \"smash\",\n names: [\"\\\\smash\"],\n numArgs: 1,\n numOptionalArgs: 1,\n allowedInText: true,\n handler: (_ref, args, optArgs) => {\n var parser = _ref.parser;\n var smashHeight = false;\n var smashDepth = false;\n var tbArg = optArgs[0] && assertNodeType(optArgs[0], \"ordgroup\");\n if (tbArg) {\n // Optional [tb] argument is engaged.\n // ref: amsmath: \\renewcommand{\\smash}[1][tb]{%\n // def\\mb@t{\\ht}\\def\\mb@b{\\dp}\\def\\mb@tb{\\ht\\z@\\z@\\dp}%\n var letter;\n for (var i = 0; i < tbArg.body.length; ++i) {\n var node = tbArg.body[i];\n letter = assertSymbolNodeType(node).text;\n if (letter === \"t\") {\n smashHeight = true;\n } else if (letter === \"b\") {\n smashDepth = true;\n } else {\n smashHeight = false;\n smashDepth = false;\n break;\n }\n }\n } else {\n smashHeight = true;\n smashDepth = true;\n }\n var body = args[0];\n return {\n type: \"smash\",\n mode: parser.mode,\n body,\n smashHeight,\n smashDepth\n };\n },\n htmlBuilder: (group, options) => {\n var node = makeSpan([], [buildGroup$1(group.body, options)]);\n if (!group.smashHeight && !group.smashDepth) {\n return node;\n }\n if (group.smashHeight) {\n node.height = 0;\n }\n if (group.smashDepth) {\n node.depth = 0;\n }\n if (group.smashHeight && group.smashDepth) {\n // Symmetric \\smash can stay in inline layout.\n return makeSpan([\"mord\", \"katex-smash\"], [node], options);\n }\n // In order to influence makeVList for asymmetric smashing, we have to\n // reset the children.\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n if (group.smashHeight) {\n node.children[i].height = 0;\n }\n if (group.smashDepth) {\n node.children[i].depth = 0;\n }\n }\n }\n // At this point, we've reset the TeX-like height and depth values.\n // But the span still has an HTML line height.\n // makeVList applies \"display: table-cell\", which prevents the browser\n // from acting on that line height. So we'll call makeVList now.\n var smashedNode = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: node\n }]\n });\n // For spacing, TeX treats \\smash as a math group (same spacing as ord).\n return makeSpan([\"mord\"], [smashedNode], options);\n },\n mathmlBuilder: (group, options) => {\n var node = new MathNode(\"mpadded\", [buildGroup(group.body, options)]);\n if (group.smashHeight) {\n node.setAttribute(\"height\", \"0px\");\n }\n if (group.smashDepth) {\n node.setAttribute(\"depth\", \"0px\");\n }\n return node;\n }\n});\n\ndefineFunction({\n type: \"sqrt\",\n names: [\"\\\\sqrt\"],\n numArgs: 1,\n numOptionalArgs: 1,\n handler(_ref, args, optArgs) {\n var parser = _ref.parser;\n var index = optArgs[0];\n var body = args[0];\n return {\n type: \"sqrt\",\n mode: parser.mode,\n body,\n index\n };\n },\n htmlBuilder(group, options) {\n // Square roots are handled in the TeXbook pg. 443, Rule 11.\n // First, we do the same steps as in overline to build the inner group\n // and line\n var inner = buildGroup$1(group.body, options.havingCrampedStyle());\n if (inner.height === 0) {\n // Render a small surd.\n inner.height = options.fontMetrics().xHeight;\n }\n // Some groups can return document fragments. Handle those by wrapping\n // them in a span.\n inner = wrapFragment(inner, options);\n // Calculate the minimum size for the \\surd delimiter\n var metrics = options.fontMetrics();\n var theta = metrics.defaultRuleThickness;\n var phi = theta;\n if (options.style.id < Style$1.TEXT.id) {\n phi = options.fontMetrics().xHeight;\n }\n // Calculate the clearance between the body and line\n var lineClearance = theta + phi / 4;\n var minDelimiterHeight = inner.height + inner.depth + lineClearance + theta;\n // Create a sqrt SVG of the required minimum size\n var _makeSqrtImage = makeSqrtImage(minDelimiterHeight, options),\n img = _makeSqrtImage.span,\n ruleWidth = _makeSqrtImage.ruleWidth,\n advanceWidth = _makeSqrtImage.advanceWidth;\n var delimDepth = img.height - ruleWidth;\n // Adjust the clearance based on the delimiter size\n if (delimDepth > inner.height + inner.depth + lineClearance) {\n lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2;\n }\n // Shift the sqrt image\n var imgShift = img.height - inner.height - lineClearance - ruleWidth;\n inner.style.paddingLeft = makeEm(advanceWidth);\n // Overlay the image and the argument.\n var body = makeVList({\n positionType: \"firstBaseline\",\n children: [{\n type: \"elem\",\n elem: inner,\n wrapperClasses: [\"svg-align\"]\n }, {\n type: \"kern\",\n size: -(inner.height + imgShift)\n }, {\n type: \"elem\",\n elem: img\n }, {\n type: \"kern\",\n size: ruleWidth\n }]\n });\n if (!group.index) {\n return makeSpan([\"mord\", \"sqrt\"], [body], options);\n } else {\n // Handle the optional root index\n // The index is always in scriptscript style\n var newOptions = options.havingStyle(Style$1.SCRIPTSCRIPT);\n var rootm = buildGroup$1(group.index, newOptions, options);\n // The amount the index is shifted by. This is taken from the TeX\n // source, in the definition of `\\r@@t`.\n var toShift = 0.6 * (body.height - body.depth);\n // Build a VList with the superscript shifted up correctly\n var rootVList = makeVList({\n positionType: \"shift\",\n positionData: -toShift,\n children: [{\n type: \"elem\",\n elem: rootm\n }]\n });\n // Add a class surrounding it so we can add on the appropriate\n // kerning\n var rootVListWrap = makeSpan([\"katex-root\"], [rootVList]);\n return makeSpan([\"mord\", \"sqrt\"], [rootVListWrap, body], options);\n }\n },\n mathmlBuilder(group, options) {\n var body = group.body,\n index = group.index;\n return index ? new MathNode(\"mroot\", [buildGroup(body, options), buildGroup(index, options)]) : new MathNode(\"msqrt\", [buildGroup(body, options)]);\n }\n});\n\nvar styleMap = {\n \"display\": Style$1.DISPLAY,\n \"text\": Style$1.TEXT,\n \"script\": Style$1.SCRIPT,\n \"scriptscript\": Style$1.SCRIPTSCRIPT\n};\nfunction isStyleStr(s) {\n return s in styleMap;\n}\ndefineFunction({\n type: \"styling\",\n names: [\"\\\\displaystyle\", \"\\\\textstyle\", \"\\\\scriptstyle\", \"\\\\scriptscriptstyle\"],\n numArgs: 0,\n allowedInText: true,\n primitive: true,\n handler(_ref, args) {\n var breakOnTokenText = _ref.breakOnTokenText,\n funcName = _ref.funcName,\n parser = _ref.parser;\n // parse out the implicit body\n var body = parser.parseExpression(true, breakOnTokenText);\n // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.\n // here and in buildHTML and de-dupe the enumeration of all the styles).\n var style = funcName.slice(1, funcName.length - 5);\n if (!isStyleStr(style)) {\n throw new Error(\"Unknown style: \" + style);\n }\n return {\n type: \"styling\",\n mode: parser.mode,\n // Figure out what style to use by pulling out the style from\n // the function name\n style,\n body\n };\n },\n htmlBuilder(group, options) {\n // Style changes are handled in the TeXbook on pg. 442, Rule 3.\n var newStyle = styleMap[group.style];\n var newOptions = options.havingStyle(newStyle);\n if (group.resetFont) {\n newOptions = newOptions.withFont('');\n }\n return sizingGroup(group.body, newOptions, options);\n },\n mathmlBuilder(group, options) {\n // Figure out what style we're changing to.\n var newStyle = styleMap[group.style];\n var newOptions = options.havingStyle(newStyle);\n if (group.resetFont) {\n newOptions = newOptions.withFont('');\n }\n var inner = buildExpression(group.body, newOptions);\n var node = new MathNode(\"mstyle\", inner);\n var styleAttributes = {\n \"display\": [\"0\", \"true\"],\n \"text\": [\"0\", \"false\"],\n \"script\": [\"1\", \"false\"],\n \"scriptscript\": [\"2\", \"false\"]\n };\n var attr = styleAttributes[group.style];\n node.setAttribute(\"scriptlevel\", attr[0]);\n node.setAttribute(\"displaystyle\", attr[1]);\n return node;\n }\n});\n\n/**\n * Sometimes, groups perform special rules when they have superscripts or\n * subscripts attached to them. This function lets the `supsub` group know that\n * Sometimes, groups perform special rules when they have superscripts or\n * its inner element should handle the superscripts and subscripts instead of\n * handling them itself.\n */\nvar htmlBuilderDelegate = function htmlBuilderDelegate(group, options) {\n var base = group.base;\n if (!base) {\n return null;\n } else if (base.type === \"op\") {\n // Operators handle supsubs differently when they have limits\n // (e.g. `\\displaystyle\\sum_2^3`)\n var delegate = base.limits && (options.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub);\n return delegate ? htmlBuilder$2 : null;\n } else if (base.type === \"operatorname\") {\n var _delegate = base.alwaysHandleSupSub && (options.style.size === Style$1.DISPLAY.size || base.limits);\n return _delegate ? htmlBuilder$1 : null;\n } else if (base.type === \"accent\") {\n return isCharacterBox(base.base) ? htmlBuilder$a : null;\n } else if (base.type === \"horizBrace\") {\n var isSup = !group.sub;\n return isSup === base.isOver ? htmlBuilder$3 : null;\n } else {\n return null;\n }\n};\n// Super scripts and subscripts, whose precise placement can depend on other\n// functions that precede them.\ndefineFunctionBuilders({\n type: \"supsub\",\n htmlBuilder(group, options) {\n // Superscript and subscripts are handled in the TeXbook on page\n // 445-446, rules 18(a-f).\n // Here is where we defer to the inner group if it should handle\n // superscripts and subscripts itself.\n var builderDelegate = htmlBuilderDelegate(group, options);\n if (builderDelegate) {\n return builderDelegate(group, options);\n }\n var valueBase = group.base,\n valueSup = group.sup,\n valueSub = group.sub;\n var base = buildGroup$1(valueBase, options);\n var supm;\n var subm;\n var metrics = options.fontMetrics();\n // Rule 18a\n var supShift = 0;\n var subShift = 0;\n var isCharBox = valueBase && isCharacterBox(valueBase);\n if (valueSup) {\n var newOptions = options.havingStyle(options.style.sup());\n supm = buildGroup$1(valueSup, newOptions, options);\n if (!isCharBox) {\n supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier;\n }\n }\n if (valueSub) {\n var _newOptions = options.havingStyle(options.style.sub());\n subm = buildGroup$1(valueSub, _newOptions, options);\n if (!isCharBox) {\n subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options.sizeMultiplier;\n }\n }\n // Rule 18c\n var minSupShift;\n if (options.style === Style$1.DISPLAY) {\n minSupShift = metrics.sup1;\n } else if (options.style.cramped) {\n minSupShift = metrics.sup3;\n } else {\n minSupShift = metrics.sup2;\n }\n // scriptspace is a font-size-independent size, so scale it\n // appropriately for use as the marginRight.\n var multiplier = options.sizeMultiplier;\n var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier);\n var marginLeft = null;\n if (subm) {\n // Subscripts shouldn't be shifted by the base's italic correction.\n // Account for that by shifting the subscript back the appropriate\n // amount. Note we only do this when the base is a single symbol.\n var isOiint = group.base && group.base.type === \"op\" && group.base.name && (group.base.name === \"\\\\oiint\" || group.base.name === \"\\\\oiiint\");\n if (base instanceof SymbolNode || isOiint) {\n var _base$italic;\n // SymbolNode has .italic natively; for \\oiint/\\oiiint the\n // op builder stores .italic on the wrapping Span.\n marginLeft = makeEm(-((_base$italic = base.italic) != null ? _base$italic : 0));\n }\n }\n var supsub;\n if (supm && subm) {\n supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);\n subShift = Math.max(subShift, metrics.sub2);\n var ruleWidth = metrics.defaultRuleThickness;\n // Rule 18e\n var maxWidth = 4 * ruleWidth;\n if (supShift - supm.depth - (subm.height - subShift) < maxWidth) {\n subShift = maxWidth - (supShift - supm.depth) + subm.height;\n var psi = 0.8 * metrics.xHeight - (supShift - supm.depth);\n if (psi > 0) {\n supShift += psi;\n subShift -= psi;\n }\n }\n var vlistElem = [{\n type: \"elem\",\n elem: subm,\n shift: subShift,\n marginRight,\n marginLeft\n }, {\n type: \"elem\",\n elem: supm,\n shift: -supShift,\n marginRight\n }];\n supsub = makeVList({\n positionType: \"individualShift\",\n children: vlistElem\n });\n } else if (subm) {\n // Rule 18b\n subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight);\n var _vlistElem = [{\n type: \"elem\",\n elem: subm,\n marginLeft,\n marginRight\n }];\n supsub = makeVList({\n positionType: \"shift\",\n positionData: subShift,\n children: _vlistElem\n });\n } else if (supm) {\n // Rule 18c, d\n supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);\n supsub = makeVList({\n positionType: \"shift\",\n positionData: -supShift,\n children: [{\n type: \"elem\",\n elem: supm,\n marginRight\n }]\n });\n } else {\n throw new Error(\"supsub must have either sup or sub.\");\n }\n // Wrap the supsub vlist in a span.msupsub to reset text-align.\n var mclass = getTypeOfDomTree(base, \"right\") || \"mord\";\n return makeSpan([mclass], [base, makeSpan([\"msupsub\"], [supsub])], options);\n },\n mathmlBuilder(group, options) {\n // Is the inner group a relevant horizontal brace?\n var isBrace = false;\n var isOver;\n var isSup;\n if (group.base && group.base.type === \"horizBrace\") {\n isSup = !!group.sup;\n if (isSup === group.base.isOver) {\n isBrace = true;\n isOver = group.base.isOver;\n }\n }\n if (group.base && (group.base.type === \"op\" || group.base.type === \"operatorname\")) {\n group.base.parentIsSupSub = true;\n }\n var children = [buildGroup(group.base, options)];\n if (group.sub) {\n children.push(buildGroup(group.sub, options));\n }\n if (group.sup) {\n children.push(buildGroup(group.sup, options));\n }\n var nodeType;\n if (isBrace) {\n nodeType = isOver ? \"mover\" : \"munder\";\n } else if (!group.sub) {\n var base = group.base;\n if (base && base.type === \"op\" && base.limits && (options.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) {\n nodeType = \"mover\";\n } else if (base && base.type === \"operatorname\" && base.alwaysHandleSupSub && (base.limits || options.style === Style$1.DISPLAY)) {\n nodeType = \"mover\";\n } else {\n nodeType = \"msup\";\n }\n } else if (!group.sup) {\n var _base = group.base;\n if (_base && _base.type === \"op\" && _base.limits && (options.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) {\n nodeType = \"munder\";\n } else if (_base && _base.type === \"operatorname\" && _base.alwaysHandleSupSub && (_base.limits || options.style === Style$1.DISPLAY)) {\n nodeType = \"munder\";\n } else {\n nodeType = \"msub\";\n }\n } else {\n var _base2 = group.base;\n if (_base2 && _base2.type === \"op\" && _base2.limits && options.style === Style$1.DISPLAY) {\n nodeType = \"munderover\";\n } else if (_base2 && _base2.type === \"operatorname\" && _base2.alwaysHandleSupSub && (options.style === Style$1.DISPLAY || _base2.limits)) {\n nodeType = \"munderover\";\n } else {\n nodeType = \"msubsup\";\n }\n }\n return new MathNode(nodeType, children);\n }\n});\n\n// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.\ndefineFunctionBuilders({\n type: \"atom\",\n htmlBuilder(group, options) {\n return mathsym(group.text, group.mode, options, [\"m\" + group.family]);\n },\n mathmlBuilder(group, options) {\n var node = new MathNode(\"mo\", [makeText(group.text, group.mode)]);\n if (group.family === \"bin\") {\n var variant = getVariant(group, options);\n if (variant === \"bold-italic\") {\n node.setAttribute(\"mathvariant\", variant);\n }\n } else if (group.family === \"punct\") {\n node.setAttribute(\"separator\", \"true\");\n } else if (group.family === \"open\" || group.family === \"close\") {\n // Delims built here should not stretch vertically.\n // See delimsizing.js for stretchy delims.\n node.setAttribute(\"stretchy\", \"false\");\n }\n return node;\n }\n});\n\n// \"mathord\" and \"textord\" ParseNodes created in Parser.js from symbol Groups in\n// src/symbols.js.\nvar defaultVariant = {\n \"mi\": \"italic\",\n \"mn\": \"normal\",\n \"mtext\": \"normal\"\n};\ndefineFunctionBuilders({\n type: \"mathord\",\n htmlBuilder(group, options) {\n return makeOrd(group, options);\n },\n mathmlBuilder(group, options) {\n var node = new MathNode(\"mi\", [makeText(group.text, group.mode, options)]);\n var variant = getVariant(group, options) || \"italic\";\n if (variant !== defaultVariant[node.type]) {\n node.setAttribute(\"mathvariant\", variant);\n }\n return node;\n }\n});\ndefineFunctionBuilders({\n type: \"textord\",\n htmlBuilder(group, options) {\n return makeOrd(group, options);\n },\n mathmlBuilder(group, options) {\n var text = makeText(group.text, group.mode, options);\n var variant = getVariant(group, options) || \"normal\";\n var node;\n if (group.mode === 'text') {\n node = new MathNode(\"mtext\", [text]);\n } else if (/[0-9]/.test(group.text)) {\n node = new MathNode(\"mn\", [text]);\n } else if (group.text === \"\\\\prime\") {\n node = new MathNode(\"mo\", [text]);\n } else {\n node = new MathNode(\"mi\", [text]);\n }\n if (variant !== defaultVariant[node.type]) {\n node.setAttribute(\"mathvariant\", variant);\n }\n return node;\n }\n});\n\n// A map of CSS-based spacing functions to their CSS class.\nvar cssSpace = new Map([[\"\\\\nobreak\", \"nobreak\"], [\"\\\\allowbreak\", \"allowbreak\"]]);\n// A lookup table to determine whether a spacing function/symbol should be\n// treated like a regular space character. If a symbol or command is a key\n// in this table, then it should be a regular space character. Furthermore,\n// the associated value may have a `className` specifying an extra CSS class\n// to add to the created `span`.\nvar regularSpace = new Map([[\" \", {}], [\"\\\\ \", {}], [\"~\", {\n className: \"nobreak\"\n}], [\"\\\\space\", {}], [\"\\\\nobreakspace\", {\n className: \"nobreak\"\n}]]);\n// ParseNode<\"spacing\"> created in Parser.js from the \"spacing\" symbol Groups in\n// src/symbols.js.\ndefineFunctionBuilders({\n type: \"spacing\",\n htmlBuilder(group, options) {\n var regularSpaceItem = regularSpace.get(group.text);\n var cssSpaceClass = cssSpace.get(group.text);\n if (regularSpaceItem) {\n var className = regularSpaceItem.className || \"\";\n // Spaces are generated by adding an actual space. Each of these\n // things has an entry in the symbols table, so these will be turned\n // into appropriate outputs.\n if (group.mode === \"text\") {\n var ord = makeOrd(group, options);\n ord.classes.push(className);\n return ord;\n } else {\n return makeSpan([\"mspace\", className], [mathsym(group.text, group.mode, options)], options);\n }\n } else if (cssSpaceClass) {\n // Spaces based on just a CSS class.\n return makeSpan([\"mspace\", cssSpaceClass], [], options);\n } else {\n throw new ParseError(\"Unknown type of space \\\"\" + group.text + \"\\\"\");\n }\n },\n mathmlBuilder(group, options) {\n var node;\n if (regularSpace.has(group.text)) {\n node = new MathNode(\"mtext\", [new TextNode(\"\\u00a0\")]);\n } else if (cssSpace.has(group.text)) {\n // CSS-based MathML spaces (\\nobreak, \\allowbreak) are ignored\n return new MathNode(\"mspace\");\n } else {\n throw new ParseError(\"Unknown type of space \\\"\" + group.text + \"\\\"\");\n }\n return node;\n }\n});\n\nvar pad = () => {\n var padNode = new MathNode(\"mtd\", []);\n padNode.setAttribute(\"width\", \"50%\");\n return padNode;\n};\ndefineFunctionBuilders({\n type: \"tag\",\n mathmlBuilder(group, options) {\n var table = new MathNode(\"mtable\", [new MathNode(\"mtr\", [pad(), new MathNode(\"mtd\", [buildExpressionRow(group.body, options)]), pad(), new MathNode(\"mtd\", [buildExpressionRow(group.tag, options)])])]);\n table.setAttribute(\"width\", \"100%\");\n return table;\n // TODO: Left-aligned tags.\n // Currently, the group and options passed here do not contain\n // enough info to set tag alignment. `leqno` is in Settings but it is\n // not passed to Options. On the HTML side, leqno is\n // set by a CSS class applied in buildTree.js. That would have worked\n // in MathML if browsers supported <mlabeledtr>. Since they don't, we\n // need to rewrite the way this function is called.\n }\n});\n\n// Non-mathy text, possibly in a font\nvar textFontFamilies = {\n \"\\\\text\": undefined,\n \"\\\\textrm\": \"textrm\",\n \"\\\\textsf\": \"textsf\",\n \"\\\\texttt\": \"texttt\",\n \"\\\\textnormal\": \"textrm\"\n};\nvar textFontWeights = {\n \"\\\\textbf\": \"textbf\",\n \"\\\\textmd\": \"textmd\"\n};\nvar textFontShapes = {\n \"\\\\textit\": \"textit\",\n \"\\\\textup\": \"textup\"\n};\nvar optionsWithFont = (group, options) => {\n var font = group.font;\n // Checks if the argument is a font family or a font style.\n if (!font) {\n return options;\n } else if (textFontFamilies[font]) {\n return options.withTextFontFamily(textFontFamilies[font]);\n } else if (textFontWeights[font]) {\n return options.withTextFontWeight(textFontWeights[font]);\n } else if (font === \"\\\\emph\") {\n return options.fontShape === \"textit\" ? options.withTextFontShape(\"textup\") : options.withTextFontShape(\"textit\");\n }\n return options.withTextFontShape(textFontShapes[font]);\n};\ndefineFunction({\n type: \"text\",\n names: [\n // Font families\n \"\\\\text\", \"\\\\textrm\", \"\\\\textsf\", \"\\\\texttt\", \"\\\\textnormal\",\n // Font weights\n \"\\\\textbf\", \"\\\\textmd\",\n // Font Shapes\n \"\\\\textit\", \"\\\\textup\", \"\\\\emph\"],\n numArgs: 1,\n argTypes: [\"text\"],\n allowedInArgument: true,\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser,\n funcName = _ref.funcName;\n var body = args[0];\n return {\n type: \"text\",\n mode: parser.mode,\n body: ordargument(body),\n font: funcName\n };\n },\n htmlBuilder(group, options) {\n var newOptions = optionsWithFont(group, options);\n var inner = buildExpression$1(group.body, newOptions, true);\n return makeSpan([\"mord\", \"text\"], inner, newOptions);\n },\n mathmlBuilder(group, options) {\n var newOptions = optionsWithFont(group, options);\n return buildExpressionRow(group.body, newOptions);\n }\n});\n\ndefineFunction({\n type: \"underline\",\n names: [\"\\\\underline\"],\n numArgs: 1,\n allowedInText: true,\n handler(_ref, args) {\n var parser = _ref.parser;\n return {\n type: \"underline\",\n mode: parser.mode,\n body: args[0]\n };\n },\n htmlBuilder(group, options) {\n // Underlines are handled in the TeXbook pg 443, Rule 10.\n // Build the inner group.\n var innerGroup = buildGroup$1(group.body, options);\n // Create the line to go below the body\n var line = makeLineSpan(\"underline-line\", options);\n // Generate the vlist, with the appropriate kerns\n var defaultRuleThickness = options.fontMetrics().defaultRuleThickness;\n var vlist = makeVList({\n positionType: \"top\",\n positionData: innerGroup.height,\n children: [{\n type: \"kern\",\n size: defaultRuleThickness\n }, {\n type: \"elem\",\n elem: line\n }, {\n type: \"kern\",\n size: 3 * defaultRuleThickness\n }, {\n type: \"elem\",\n elem: innerGroup\n }]\n });\n return makeSpan([\"mord\", \"katex-underline\"], [vlist], options);\n },\n mathmlBuilder(group, options) {\n var operator = new MathNode(\"mo\", [new TextNode(\"\\u203e\")]);\n operator.setAttribute(\"stretchy\", \"true\");\n var node = new MathNode(\"munder\", [buildGroup(group.body, options), operator]);\n node.setAttribute(\"accentunder\", \"true\");\n return node;\n }\n});\n\n// \\vcenter: Vertically center the argument group on the math axis.\ndefineFunction({\n type: \"vcenter\",\n names: [\"\\\\vcenter\"],\n numArgs: 1,\n argTypes: [\"original\"],\n // In LaTeX, \\vcenter can act only on a box.\n allowedInText: false,\n handler(_ref, args) {\n var parser = _ref.parser;\n return {\n type: \"vcenter\",\n mode: parser.mode,\n body: args[0]\n };\n },\n htmlBuilder(group, options) {\n var body = buildGroup$1(group.body, options);\n var axisHeight = options.fontMetrics().axisHeight;\n var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight));\n return makeVList({\n positionType: \"shift\",\n positionData: dy,\n children: [{\n type: \"elem\",\n elem: body\n }]\n });\n },\n mathmlBuilder(group, options) {\n // There is no way to do this in MathML.\n // Write a class as a breadcrumb in case some post-processor wants\n // to perform a vcenter adjustment.\n // Wrap in mrow to ensure valid MathML when placed inside mo (e.g., \\mathrel)\n var mpadded = new MathNode(\"mpadded\", [buildGroup(group.body, options)], [\"vcenter\"]);\n return new MathNode(\"mrow\", [mpadded]);\n }\n});\n\ndefineFunction({\n type: \"verb\",\n names: [\"\\\\verb\"],\n numArgs: 0,\n allowedInText: true,\n handler(context, args, optArgs) {\n // \\verb and \\verb* are dealt with directly in Parser.js.\n // If we end up here, it's because of a failure to match the two delimiters\n // in the regex in Lexer.js. LaTeX raises the following error when \\verb is\n // terminated by end of line (or file).\n throw new ParseError(\"\\\\verb ended by end of line instead of matching delimiter\");\n },\n htmlBuilder(group, options) {\n var text = makeVerb(group);\n var body = [];\n // \\verb enters text mode and therefore is sized like \\textstyle\n var newOptions = options.havingStyle(options.style.text());\n for (var i = 0; i < text.length; i++) {\n var c = text[i];\n if (c === '~') {\n c = '\\\\textasciitilde';\n }\n body.push(makeSymbol(c, \"Typewriter-Regular\", group.mode, newOptions, [\"mord\", \"texttt\"]));\n }\n return makeSpan([\"mord\", \"text\"].concat(newOptions.sizingClasses(options)), tryCombineChars(body), newOptions);\n },\n mathmlBuilder(group, options) {\n var text = new TextNode(makeVerb(group));\n var node = new MathNode(\"mtext\", [text]);\n node.setAttribute(\"mathvariant\", \"monospace\");\n return node;\n }\n});\n/**\n * Converts verb group into body string.\n *\n * \\verb* replaces each space with an open box \\u2423\n * \\verb replaces each space with a no-break space \\xA0\n */\nvar makeVerb = group => group.body.replace(/ /g, group.star ? '\\u2423' : '\\xA0');\n\n/** Include this to ensure that all functions are defined. */\nvar functions = _functions;\n\n/**\n * The Lexer class handles tokenizing the input in various ways. Since our\n * parser expects us to be able to backtrack, the lexer allows lexing from any\n * given starting point.\n *\n * Its main exposed function is the `lex` function, which takes a position to\n * lex from and a type of token to lex. It defers to the appropriate `_innerLex`\n * function.\n *\n * The various `_innerLex` functions perform the actual lexing of different\n * kinds.\n */\n/* The following tokenRegex\n * - matches typical whitespace (but not NBSP etc.) using its first group\n * - does not match any control character \\x00-\\x1f except whitespace\n * - does not match a bare backslash\n * - matches any ASCII character except those just mentioned\n * - does not match the BMP private use area \\uE000-\\uF8FF\n * - does not match bare surrogate code units\n * - matches any BMP character except for those just described\n * - matches any valid Unicode surrogate pair\n * - matches a backslash followed by one or more whitespace characters\n * - matches a backslash followed by one or more letters then whitespace\n * - matches a backslash followed by any BMP character\n * Capturing groups:\n * [1] regular whitespace\n * [2] backslash followed by whitespace\n * [3] anything else, which may include:\n * [4] left character of \\verb*\n * [5] left character of \\verb\n * [6] backslash followed by word, excluding any trailing whitespace\n * Just because the Lexer matches something doesn't mean it's valid input:\n * If there is no matching function or symbol definition, the Parser will\n * still reject the input.\n */\nvar spaceRegexString = \"[ \\r\\n\\t]\";\nvar controlWordRegexString = \"\\\\\\\\[a-zA-Z@]+\";\nvar controlSymbolRegexString = \"\\\\\\\\[^\\uD800-\\uDFFF]\";\nvar controlWordWhitespaceRegexString = \"(\" + controlWordRegexString + \")\" + spaceRegexString + \"*\";\nvar controlSpaceRegexString = \"\\\\\\\\(\\n|[ \\r\\t]+\\n?)[ \\r\\t]*\";\nvar combiningDiacriticalMarkString = \"[\\u0300-\\u036f]\";\nvar combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + \"+$\");\nvar tokenRegexString = \"(\" + spaceRegexString + \"+)|\" + (// whitespace\ncontrolSpaceRegexString + \"|\") +\n// \\whitespace\n\"([!-\\\\[\\\\]-\\u2027\\u202A-\\uD7FF\\uF900-\\uFFFF]\" + (// single codepoint\ncombiningDiacriticalMarkString + \"*\") +\n// ...plus accents\n\"|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]\" + (// surrogate pair\ncombiningDiacriticalMarkString + \"*\") +\n// ...plus accents\n\"|\\\\\\\\verb\\\\*([^]).*?\\\\4\" +\n// \\verb*\n\"|\\\\\\\\verb([^*a-zA-Z]).*?\\\\5\" + (// \\verb unstarred\n\"|\" + controlWordWhitespaceRegexString) + (// \\macroName + spaces\n\"|\" + controlSymbolRegexString + \")\"); // \\\\, \\', etc.\n/** Main Lexer class */\nclass Lexer {\n constructor(input, settings) {\n this.input = void 0;\n this.settings = void 0;\n this.tokenRegex = void 0;\n // Category codes. The lexer only supports comment characters (14) for now.\n // MacroExpander additionally distinguishes active (13).\n this.catcodes = void 0;\n // Separate accents from characters\n this.input = input;\n this.settings = settings;\n this.tokenRegex = new RegExp(tokenRegexString, 'g');\n this.catcodes = {\n \"%\": 14,\n // comment character\n \"~\": 13 // active character\n };\n }\n setCatcode(char, code) {\n this.catcodes[char] = code;\n }\n /**\n * This function lexes a single token.\n */\n lex() {\n var input = this.input;\n var pos = this.tokenRegex.lastIndex;\n if (pos === input.length) {\n return new Token(\"EOF\", new SourceLocation(this, pos, pos));\n }\n var match = this.tokenRegex.exec(input);\n if (match === null || match.index !== pos) {\n throw new ParseError(\"Unexpected character: '\" + input[pos] + \"'\", new Token(input[pos], new SourceLocation(this, pos, pos + 1)));\n }\n var text = match[6] || match[3] || (match[2] ? \"\\\\ \" : \" \");\n if (this.catcodes[text] === 14) {\n // comment character\n var nlIndex = input.indexOf('\\n', this.tokenRegex.lastIndex);\n if (nlIndex === -1) {\n this.tokenRegex.lastIndex = input.length; // EOF\n handleStrict({\n strict: this.settings.strict,\n errorCode: \"commentAtEnd\",\n errorMsg: \"% comment has no terminating newline; LaTeX would \" + \"fail because of commenting the end of math mode (e.g. $)\",\n report: true\n });\n } else {\n this.tokenRegex.lastIndex = nlIndex + 1;\n }\n return this.lex();\n }\n return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex));\n }\n}\n\n/**\n * A `Namespace` refers to a space of nameable things like macros or lengths,\n * which can be `set` either globally or local to a nested group, using an\n * undo stack similar to how TeX implements this functionality.\n * Performance-wise, `get` and local `set` take constant time, while global\n * `set` takes time proportional to the depth of group nesting.\n */\nclass Namespace {\n /**\n * Both arguments are optional. The first argument is an object of\n * built-in mappings which never change. The second argument is an object\n * of initial (global-level) mappings, which will constantly change\n * according to any global/top-level `set`s done.\n */\n constructor(builtins, globalMacros) {\n if (builtins === void 0) {\n builtins = {};\n }\n if (globalMacros === void 0) {\n globalMacros = {};\n }\n this.current = void 0;\n this.builtins = void 0;\n this.undefStack = void 0;\n this.current = globalMacros;\n this.builtins = builtins;\n this.undefStack = [];\n }\n /**\n * Start a new nested group, affecting future local `set`s.\n */\n beginGroup() {\n this.undefStack.push({});\n }\n /**\n * End current nested group, restoring values before the group began.\n */\n endGroup() {\n if (this.undefStack.length === 0) {\n throw new ParseError(\"Unbalanced namespace destruction: attempt \" + \"to pop global namespace; please report this as a bug\");\n }\n var undefs = this.undefStack.pop();\n for (var key of Object.keys(undefs)) {\n if (undefs[key] === undefined) {\n delete this.current[key];\n } else {\n this.current[key] = undefs[key];\n }\n }\n }\n /**\n * Ends all currently nested groups (if any), restoring values before the\n * groups began. Useful in case of an error in the middle of parsing.\n */\n endGroups() {\n while (this.undefStack.length > 0) {\n this.endGroup();\n }\n }\n /**\n * Detect whether `name` has a definition. Equivalent to\n * `get(name) != null`.\n */\n has(name) {\n return Object.prototype.hasOwnProperty.call(this.current, name) || Object.prototype.hasOwnProperty.call(this.builtins, name);\n }\n /**\n * Get the current value of a name, or `undefined` if there is no value.\n *\n * Note: Do not use `if (namespace.get(...))` to detect whether a macro\n * is defined, as the definition may be the empty string which evaluates\n * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or\n * `if (namespace.has(...))`.\n */\n get(name) {\n if (Object.prototype.hasOwnProperty.call(this.current, name)) {\n return this.current[name];\n } else if (Object.prototype.hasOwnProperty.call(this.builtins, name)) {\n return this.builtins[name];\n } else {\n return undefined;\n }\n }\n /**\n * Set the current value of a name, and optionally set it globally too.\n * Local set() sets the current value and (when appropriate) adds an undo\n * operation to the undo stack. Global set() may change the undo\n * operation at every level, so takes time linear in their number.\n * A value of undefined means to delete existing definitions.\n */\n set(name, value, global) {\n if (global === void 0) {\n global = false;\n }\n if (global) {\n // Global set is equivalent to setting in all groups. Simulate this\n // by destroying any undos currently scheduled for this name,\n // and adding an undo with the *new* value (in case it later gets\n // locally reset within this environment).\n for (var i = 0; i < this.undefStack.length; i++) {\n delete this.undefStack[i][name];\n }\n if (this.undefStack.length > 0) {\n this.undefStack[this.undefStack.length - 1][name] = value;\n }\n } else {\n // Undo this set at end of this group (possibly to `undefined`),\n // unless an undo is already in place, in which case that older\n // value is the correct one.\n var top = this.undefStack[this.undefStack.length - 1];\n if (top && !Object.prototype.hasOwnProperty.call(top, name)) {\n top[name] = Object.prototype.hasOwnProperty.call(this.current, name) ? this.current[name] : undefined;\n }\n }\n if (value == null) {\n delete this.current[name];\n } else {\n this.current[name] = value;\n }\n }\n}\n\n/**\n * Predefined macros for KaTeX.\n * This can be used to define some commands in terms of others.\n */\nvar macros = _macros;\n//////////////////////////////////////////////////////////////////////\n// macro tools\ndefineMacro(\"\\\\noexpand\", function (context) {\n // The expansion is the token itself; but that token is interpreted\n // as if its meaning were ‘\\relax’ if it is a control sequence that\n // would ordinarily be expanded by TeX’s expansion rules.\n var t = context.popToken();\n if (context.isExpandable(t.text)) {\n t.noexpand = true;\n t.treatAsRelax = true;\n }\n return {\n tokens: [t],\n numArgs: 0\n };\n});\ndefineMacro(\"\\\\expandafter\", function (context) {\n // TeX first reads the token that comes immediately after \\expandafter,\n // without expanding it; let’s call this token t. Then TeX reads the\n // token that comes after t (and possibly more tokens, if that token\n // has an argument), replacing it by its expansion. Finally TeX puts\n // t back in front of that expansion.\n var t = context.popToken();\n context.expandOnce(true); // expand only an expandable token\n return {\n tokens: [t],\n numArgs: 0\n };\n});\n// LaTeX's \\@firstoftwo{#1}{#2} expands to #1, skipping #2\n// TeX source: \\long\\def\\@firstoftwo#1#2{#1}\ndefineMacro(\"\\\\@firstoftwo\", function (context) {\n var args = context.consumeArgs(2);\n return {\n tokens: args[0],\n numArgs: 0\n };\n});\n// LaTeX's \\@secondoftwo{#1}{#2} expands to #2, skipping #1\n// TeX source: \\long\\def\\@secondoftwo#1#2{#2}\ndefineMacro(\"\\\\@secondoftwo\", function (context) {\n var args = context.consumeArgs(2);\n return {\n tokens: args[1],\n numArgs: 0\n };\n});\n// LaTeX's \\@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)\n// symbol that isn't a space, consuming any spaces but not consuming the\n// first nonspace character. If that nonspace character matches #1, then\n// the macro expands to #2; otherwise, it expands to #3.\ndefineMacro(\"\\\\@ifnextchar\", function (context) {\n var args = context.consumeArgs(3); // symbol, if, else\n context.consumeSpaces();\n var nextToken = context.future();\n if (args[0].length === 1 && args[0][0].text === nextToken.text) {\n return {\n tokens: args[1],\n numArgs: 0\n };\n } else {\n return {\n tokens: args[2],\n numArgs: 0\n };\n }\n});\n// LaTeX's \\@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.\n// If it is `*`, then it consumes the symbol, and the macro expands to #1;\n// otherwise, the macro expands to #2 (without consuming the symbol).\n// TeX source: \\def\\@ifstar#1{\\@ifnextchar *{\\@firstoftwo{#1}}}\ndefineMacro(\"\\\\@ifstar\", \"\\\\@ifnextchar *{\\\\@firstoftwo{#1}}\");\n// LaTeX's \\TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode\ndefineMacro(\"\\\\TextOrMath\", function (context) {\n var args = context.consumeArgs(2);\n if (context.mode === 'text') {\n return {\n tokens: args[0],\n numArgs: 0\n };\n } else {\n return {\n tokens: args[1],\n numArgs: 0\n };\n }\n});\n// Lookup table for parsing numbers in base 8 through 16\nvar digitToNumber = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"a\": 10,\n \"A\": 10,\n \"b\": 11,\n \"B\": 11,\n \"c\": 12,\n \"C\": 12,\n \"d\": 13,\n \"D\": 13,\n \"e\": 14,\n \"E\": 14,\n \"f\": 15,\n \"F\": 15\n};\n// TeX \\char makes a literal character (catcode 12) using the following forms:\n// (see The TeXBook, p. 43)\n// \\char123 -- decimal\n// \\char'123 -- octal\n// \\char\"123 -- hex\n// \\char`x -- character that can be written (i.e. isn't active)\n// \\char`\\x -- character that cannot be written (e.g. %)\n// These all refer to characters from the font, so we turn them into special\n// calls to a function \\@char dealt with in the Parser.\ndefineMacro(\"\\\\char\", function (context) {\n var token = context.popToken();\n var base;\n var number = 0;\n if (token.text === \"'\") {\n base = 8;\n token = context.popToken();\n } else if (token.text === '\"') {\n base = 16;\n token = context.popToken();\n } else if (token.text === \"`\") {\n token = context.popToken();\n if (token.text[0] === \"\\\\\") {\n number = token.text.charCodeAt(1);\n } else if (token.text === \"EOF\") {\n throw new ParseError(\"\\\\char` missing argument\");\n } else {\n number = token.text.charCodeAt(0);\n }\n } else {\n base = 10;\n }\n if (base) {\n // Parse a number in the given base, starting with first `token`.\n number = digitToNumber[token.text];\n if (number == null || number >= base) {\n throw new ParseError(\"Invalid base-\" + base + \" digit \" + token.text);\n }\n var digit;\n while ((digit = digitToNumber[context.future().text]) != null && digit < base) {\n number *= base;\n number += digit;\n context.popToken();\n }\n }\n return \"\\\\@char{\" + number + \"}\";\n});\n// \\newcommand{\\macro}[args]{definition}\n// \\renewcommand{\\macro}[args]{definition}\n// TODO: Optional arguments: \\newcommand{\\macro}[args][default]{definition}\nvar newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {\n var arg = context.consumeArg().tokens;\n if (arg.length !== 1) {\n throw new ParseError(\"\\\\newcommand's first argument must be a macro name\");\n }\n var name = arg[0].text;\n var exists = context.isDefined(name);\n if (exists && !existsOK) {\n throw new ParseError(\"\\\\newcommand{\" + name + \"} attempting to redefine \" + (name + \"; use \\\\renewcommand\"));\n }\n if (!exists && !nonexistsOK) {\n throw new ParseError(\"\\\\renewcommand{\" + name + \"} when command \" + name + \" \" + \"does not yet exist; use \\\\newcommand\");\n }\n var numArgs = 0;\n arg = context.consumeArg().tokens;\n if (arg.length === 1 && arg[0].text === \"[\") {\n var argText = '';\n var token = context.expandNextToken();\n while (token.text !== \"]\" && token.text !== \"EOF\") {\n // TODO: Should properly expand arg, e.g., ignore {}s\n argText += token.text;\n token = context.expandNextToken();\n }\n if (!argText.match(/^\\s*[0-9]+\\s*$/)) {\n throw new ParseError(\"Invalid number of arguments: \" + argText);\n }\n numArgs = parseInt(argText);\n arg = context.consumeArg().tokens;\n }\n if (!(exists && skipIfExists)) {\n // Final arg is the expansion of the macro\n context.macros.set(name, {\n tokens: arg,\n numArgs\n });\n }\n return '';\n};\ndefineMacro(\"\\\\newcommand\", context => newcommand(context, false, true, false));\ndefineMacro(\"\\\\renewcommand\", context => newcommand(context, true, false, false));\ndefineMacro(\"\\\\providecommand\", context => newcommand(context, true, true, true));\n// terminal (console) tools\ndefineMacro(\"\\\\message\", context => {\n var arg = context.consumeArgs(1)[0];\n // eslint-disable-next-line no-console\n console.log(arg.reverse().map(token => token.text).join(\"\"));\n return '';\n});\ndefineMacro(\"\\\\errmessage\", context => {\n var arg = context.consumeArgs(1)[0];\n // eslint-disable-next-line no-console\n console.error(arg.reverse().map(token => token.text).join(\"\"));\n return '';\n});\ndefineMacro(\"\\\\show\", context => {\n var tok = context.popToken();\n var name = tok.text;\n // eslint-disable-next-line no-console\n console.log(tok, context.macros.get(name), functions[name], symbols.math[name], symbols.text[name]);\n return '';\n});\n//////////////////////////////////////////////////////////////////////\n// Grouping\n// \\let\\bgroup={ \\let\\egroup=}\ndefineMacro(\"\\\\bgroup\", \"{\");\ndefineMacro(\"\\\\egroup\", \"}\");\n// Symbols from latex.ltx:\n// \\def~{\\nobreakspace{}}\n// \\def\\lq{`}\n// \\def\\rq{'}\n// \\def \\aa {\\r a}\n// \\def \\AA {\\r A}\ndefineMacro(\"~\", \"\\\\nobreakspace\");\ndefineMacro(\"\\\\lq\", \"`\");\ndefineMacro(\"\\\\rq\", \"'\");\ndefineMacro(\"\\\\aa\", \"\\\\r a\");\ndefineMacro(\"\\\\AA\", \"\\\\r A\");\n// Copyright (C) and registered (R) symbols. Use raw symbol in MathML.\n// \\DeclareTextCommandDefault{\\textcopyright}{\\textcircled{c}}\n// \\DeclareTextCommandDefault{\\textregistered}{\\textcircled{%\n// \\check@mathfonts\\fontsize\\sf@size\\z@\\math@fontsfalse\\selectfont R}}\n// \\DeclareRobustCommand{\\copyright}{%\n// \\ifmmode{\\nfss@text{\\textcopyright}}\\else\\textcopyright\\fi}\ndefineMacro(\"\\\\textcopyright\", \"\\\\html@mathml{\\\\textcircled{c}}{\\\\char`©}\");\ndefineMacro(\"\\\\copyright\", \"\\\\TextOrMath{\\\\textcopyright}{\\\\text{\\\\textcopyright}}\");\ndefineMacro(\"\\\\textregistered\", \"\\\\html@mathml{\\\\textcircled{\\\\scriptsize R}}{\\\\char`®}\");\n// Characters omitted from Unicode range 1D400–1D7FF\ndefineMacro(\"\\u212C\", \"\\\\mathscr{B}\"); // script\ndefineMacro(\"\\u2130\", \"\\\\mathscr{E}\");\ndefineMacro(\"\\u2131\", \"\\\\mathscr{F}\");\ndefineMacro(\"\\u210B\", \"\\\\mathscr{H}\");\ndefineMacro(\"\\u2110\", \"\\\\mathscr{I}\");\ndefineMacro(\"\\u2112\", \"\\\\mathscr{L}\");\ndefineMacro(\"\\u2133\", \"\\\\mathscr{M}\");\ndefineMacro(\"\\u211B\", \"\\\\mathscr{R}\");\ndefineMacro(\"\\u212D\", \"\\\\mathfrak{C}\"); // Fraktur\ndefineMacro(\"\\u210C\", \"\\\\mathfrak{H}\");\ndefineMacro(\"\\u2128\", \"\\\\mathfrak{Z}\");\n// Define \\Bbbk with a macro that works in both HTML and MathML.\ndefineMacro(\"\\\\Bbbk\", \"\\\\Bbb{k}\");\n// \\llap and \\rlap render their contents in text mode\ndefineMacro(\"\\\\llap\", \"\\\\mathllap{\\\\textrm{#1}}\");\ndefineMacro(\"\\\\rlap\", \"\\\\mathrlap{\\\\textrm{#1}}\");\ndefineMacro(\"\\\\clap\", \"\\\\mathclap{\\\\textrm{#1}}\");\n// \\mathstrut from the TeXbook, p 360\ndefineMacro(\"\\\\mathstrut\", \"\\\\vphantom{(}\");\n// \\underbar from TeXbook p 353\ndefineMacro(\"\\\\underbar\", \"\\\\underline{\\\\text{#1}}\");\n// \\not is defined by base/fontmath.ltx via\n// \\DeclareMathSymbol{\\not}{\\mathrel}{symbols}{\"36}\n// It's thus treated like a \\mathrel, but defined by a symbol that has zero\n// width but extends to the right. We use \\rlap to get that spacing.\n// For MathML we write U+0338 here. buildMathML.js will then do the overlay.\ndefineMacro(\"\\\\not\", \"\\\\html@mathml{\\\\mathrel{\\\\mathrlap\\\\@not}\\\\nobreak}\" + \"{\\\\char\\\"338}\");\n// Negated symbols from base/fontmath.ltx:\n// \\def\\neq{\\not=} \\let\\ne=\\neq\n// \\DeclareRobustCommand\n// \\notin{\\mathrel{\\m@th\\mathpalette\\c@ncel\\in}}\n// \\def\\c@ncel#1#2{\\m@th\\ooalign{$\\hfil#1\\mkern1mu/\\hfil$\\crcr$#1#2$}}\ndefineMacro(\"\\\\neq\", \"\\\\html@mathml{\\\\mathrel{\\\\not=}}{\\\\mathrel{\\\\char`≠}}\");\ndefineMacro(\"\\\\ne\", \"\\\\neq\");\ndefineMacro(\"\\u2260\", \"\\\\neq\");\ndefineMacro(\"\\\\notin\", \"\\\\html@mathml{\\\\mathrel{{\\\\in}\\\\mathllap{/\\\\mskip1mu}}}\" + \"{\\\\mathrel{\\\\char`∉}}\");\ndefineMacro(\"\\u2209\", \"\\\\notin\");\n// Unicode stacked relations\ndefineMacro(\"\\u2258\", \"\\\\html@mathml{\" + \"\\\\mathrel{=\\\\kern{-1em}\\\\raisebox{0.4em}{$\\\\scriptsize\\\\frown$}}\" + \"}{\\\\mathrel{\\\\char`\\u2258}}\");\ndefineMacro(\"\\u2259\", \"\\\\html@mathml{\\\\stackrel{\\\\tiny\\\\wedge}{=}}{\\\\mathrel{\\\\char`\\u2258}}\");\ndefineMacro(\"\\u225A\", \"\\\\html@mathml{\\\\stackrel{\\\\tiny\\\\vee}{=}}{\\\\mathrel{\\\\char`\\u225A}}\");\ndefineMacro(\"\\u225B\", \"\\\\html@mathml{\\\\stackrel{\\\\scriptsize\\\\star}{=}}\" + \"{\\\\mathrel{\\\\char`\\u225B}}\");\ndefineMacro(\"\\u225D\", \"\\\\html@mathml{\\\\stackrel{\\\\tiny\\\\mathrm{def}}{=}}\" + \"{\\\\mathrel{\\\\char`\\u225D}}\");\ndefineMacro(\"\\u225E\", \"\\\\html@mathml{\\\\stackrel{\\\\tiny\\\\mathrm{m}}{=}}\" + \"{\\\\mathrel{\\\\char`\\u225E}}\");\ndefineMacro(\"\\u225F\", \"\\\\html@mathml{\\\\stackrel{\\\\tiny?}{=}}{\\\\mathrel{\\\\char`\\u225F}}\");\n// Misc Unicode\ndefineMacro(\"\\u27C2\", \"\\\\perp\");\ndefineMacro(\"\\u203C\", \"\\\\mathclose{!\\\\mkern-0.8mu!}\");\ndefineMacro(\"\\u220C\", \"\\\\notni\");\ndefineMacro(\"\\u231C\", \"\\\\ulcorner\");\ndefineMacro(\"\\u231D\", \"\\\\urcorner\");\ndefineMacro(\"\\u231E\", \"\\\\llcorner\");\ndefineMacro(\"\\u231F\", \"\\\\lrcorner\");\ndefineMacro(\"\\u00A9\", \"\\\\copyright\");\ndefineMacro(\"\\u00AE\", \"\\\\textregistered\");\n// The KaTeX fonts have corners at codepoints that don't match Unicode.\n// For MathML purposes, use the Unicode code point.\ndefineMacro(\"\\\\ulcorner\", \"\\\\html@mathml{\\\\@ulcorner}{\\\\mathop{\\\\char\\\"231c}}\");\ndefineMacro(\"\\\\urcorner\", \"\\\\html@mathml{\\\\@urcorner}{\\\\mathop{\\\\char\\\"231d}}\");\ndefineMacro(\"\\\\llcorner\", \"\\\\html@mathml{\\\\@llcorner}{\\\\mathop{\\\\char\\\"231e}}\");\ndefineMacro(\"\\\\lrcorner\", \"\\\\html@mathml{\\\\@lrcorner}{\\\\mathop{\\\\char\\\"231f}}\");\n//////////////////////////////////////////////////////////////////////\n// LaTeX_2ε\n// \\vdots{\\vbox{\\baselineskip4\\p@ \\lineskiplimit\\z@\n// \\kern6\\p@\\hbox{.}\\hbox{.}\\hbox{.}}}\n// We'll call \\varvdots, which gets a glyph from symbols.js.\n// The zero-width rule gets us an equivalent to the vertical 6pt kern.\ndefineMacro(\"\\\\vdots\", \"{\\\\varvdots\\\\rule{0pt}{15pt}}\");\ndefineMacro(\"\\u22ee\", \"\\\\vdots\");\n//////////////////////////////////////////////////////////////////////\n// amsmath.sty\n// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf\n// Italic Greek capital letters. AMS defines these with \\DeclareMathSymbol,\n// but they are equivalent to \\mathit{\\Letter}.\ndefineMacro(\"\\\\varGamma\", \"\\\\mathit{\\\\Gamma}\");\ndefineMacro(\"\\\\varDelta\", \"\\\\mathit{\\\\Delta}\");\ndefineMacro(\"\\\\varTheta\", \"\\\\mathit{\\\\Theta}\");\ndefineMacro(\"\\\\varLambda\", \"\\\\mathit{\\\\Lambda}\");\ndefineMacro(\"\\\\varXi\", \"\\\\mathit{\\\\Xi}\");\ndefineMacro(\"\\\\varPi\", \"\\\\mathit{\\\\Pi}\");\ndefineMacro(\"\\\\varSigma\", \"\\\\mathit{\\\\Sigma}\");\ndefineMacro(\"\\\\varUpsilon\", \"\\\\mathit{\\\\Upsilon}\");\ndefineMacro(\"\\\\varPhi\", \"\\\\mathit{\\\\Phi}\");\ndefineMacro(\"\\\\varPsi\", \"\\\\mathit{\\\\Psi}\");\ndefineMacro(\"\\\\varOmega\", \"\\\\mathit{\\\\Omega}\");\n//\\newcommand{\\substack}[1]{\\subarray{c}#1\\endsubarray}\ndefineMacro(\"\\\\substack\", \"\\\\begin{subarray}{c}#1\\\\end{subarray}\");\n// \\renewcommand{\\colon}{\\nobreak\\mskip2mu\\mathpunct{}\\nonscript\n// \\mkern-\\thinmuskip{:}\\mskip6muplus1mu\\relax}\ndefineMacro(\"\\\\colon\", \"\\\\nobreak\\\\mskip2mu\\\\mathpunct{}\" + \"\\\\mathchoice{\\\\mkern-3mu}{\\\\mkern-3mu}{}{}{:}\\\\mskip6mu\\\\relax\");\n// \\newcommand{\\boxed}[1]{\\fbox{\\m@th$\\displaystyle#1$}}\ndefineMacro(\"\\\\boxed\", \"\\\\fbox{$\\\\displaystyle{#1}$}\");\n// \\def\\iff{\\DOTSB\\;\\Longleftrightarrow\\;}\n// \\def\\implies{\\DOTSB\\;\\Longrightarrow\\;}\n// \\def\\impliedby{\\DOTSB\\;\\Longleftarrow\\;}\ndefineMacro(\"\\\\iff\", \"\\\\DOTSB\\\\;\\\\Longleftrightarrow\\\\;\");\ndefineMacro(\"\\\\implies\", \"\\\\DOTSB\\\\;\\\\Longrightarrow\\\\;\");\ndefineMacro(\"\\\\impliedby\", \"\\\\DOTSB\\\\;\\\\Longleftarrow\\\\;\");\n// \\def\\dddot#1{{\\mathop{#1}\\limits^{\\vbox to-1.4\\ex@{\\kern-\\tw@\\ex@\n// \\hbox{\\normalfont ...}\\vss}}}}\n// We use \\overset which avoids the vertical shift of \\mathop.\ndefineMacro(\"\\\\dddot\", \"{\\\\overset{\\\\raisebox{-0.1ex}{\\\\normalsize ...}}{#1}}\");\ndefineMacro(\"\\\\ddddot\", \"{\\\\overset{\\\\raisebox{-0.1ex}{\\\\normalsize ....}}{#1}}\");\n// AMSMath's automatic \\dots, based on \\mdots@@ macro.\nvar dotsByToken = {\n ',': '\\\\dotsc',\n '\\\\not': '\\\\dotsb',\n // \\keybin@ checks for the following:\n '+': '\\\\dotsb',\n '=': '\\\\dotsb',\n '<': '\\\\dotsb',\n '>': '\\\\dotsb',\n '-': '\\\\dotsb',\n '*': '\\\\dotsb',\n ':': '\\\\dotsb',\n // Symbols whose definition starts with \\DOTSB:\n '\\\\DOTSB': '\\\\dotsb',\n '\\\\coprod': '\\\\dotsb',\n '\\\\bigvee': '\\\\dotsb',\n '\\\\bigwedge': '\\\\dotsb',\n '\\\\biguplus': '\\\\dotsb',\n '\\\\bigcap': '\\\\dotsb',\n '\\\\bigcup': '\\\\dotsb',\n '\\\\prod': '\\\\dotsb',\n '\\\\sum': '\\\\dotsb',\n '\\\\bigotimes': '\\\\dotsb',\n '\\\\bigoplus': '\\\\dotsb',\n '\\\\bigodot': '\\\\dotsb',\n '\\\\bigsqcup': '\\\\dotsb',\n '\\\\And': '\\\\dotsb',\n '\\\\longrightarrow': '\\\\dotsb',\n '\\\\Longrightarrow': '\\\\dotsb',\n '\\\\longleftarrow': '\\\\dotsb',\n '\\\\Longleftarrow': '\\\\dotsb',\n '\\\\longleftrightarrow': '\\\\dotsb',\n '\\\\Longleftrightarrow': '\\\\dotsb',\n '\\\\mapsto': '\\\\dotsb',\n '\\\\longmapsto': '\\\\dotsb',\n '\\\\hookrightarrow': '\\\\dotsb',\n '\\\\doteq': '\\\\dotsb',\n // Symbols whose definition starts with \\mathbin:\n '\\\\mathbin': '\\\\dotsb',\n // Symbols whose definition starts with \\mathrel:\n '\\\\mathrel': '\\\\dotsb',\n '\\\\relbar': '\\\\dotsb',\n '\\\\Relbar': '\\\\dotsb',\n '\\\\xrightarrow': '\\\\dotsb',\n '\\\\xleftarrow': '\\\\dotsb',\n // Symbols whose definition starts with \\DOTSI:\n '\\\\DOTSI': '\\\\dotsi',\n '\\\\int': '\\\\dotsi',\n '\\\\oint': '\\\\dotsi',\n '\\\\iint': '\\\\dotsi',\n '\\\\iiint': '\\\\dotsi',\n '\\\\iiiint': '\\\\dotsi',\n '\\\\idotsint': '\\\\dotsi',\n // Symbols whose definition starts with \\DOTSX:\n '\\\\DOTSX': '\\\\dotsx'\n};\nvar dotsbGroups = new Set(['bin', 'rel']);\ndefineMacro(\"\\\\dots\", function (context) {\n // TODO: If used in text mode, should expand to \\textellipsis.\n // However, in KaTeX, \\textellipsis and \\ldots behave the same\n // (in text mode), and it's unlikely we'd see any of the math commands\n // that affect the behavior of \\dots when in text mode. So fine for now\n // (until we support \\ifmmode ... \\else ... \\fi).\n var thedots = '\\\\dotso';\n var next = context.expandAfterFuture().text;\n if (next in dotsByToken) {\n thedots = dotsByToken[next];\n } else if (next.slice(0, 4) === '\\\\not') {\n thedots = '\\\\dotsb';\n } else if (next in symbols.math) {\n if (dotsbGroups.has(symbols.math[next].group)) {\n thedots = '\\\\dotsb';\n }\n }\n return thedots;\n});\nvar spaceAfterDots = {\n // \\rightdelim@ checks for the following:\n ')': true,\n ']': true,\n '\\\\rbrack': true,\n '\\\\}': true,\n '\\\\rbrace': true,\n '\\\\rangle': true,\n '\\\\rceil': true,\n '\\\\rfloor': true,\n '\\\\rgroup': true,\n '\\\\rmoustache': true,\n '\\\\right': true,\n '\\\\bigr': true,\n '\\\\biggr': true,\n '\\\\Bigr': true,\n '\\\\Biggr': true,\n // \\extra@ also tests for the following:\n '$': true,\n // \\extrap@ checks for the following:\n ';': true,\n '.': true,\n ',': true\n};\ndefineMacro(\"\\\\dotso\", function (context) {\n var next = context.future().text;\n if (next in spaceAfterDots) {\n return \"\\\\ldots\\\\,\";\n } else {\n return \"\\\\ldots\";\n }\n});\ndefineMacro(\"\\\\dotsc\", function (context) {\n var next = context.future().text;\n // \\dotsc uses \\extra@ but not \\extrap@, instead specially checking for\n // ';' and '.', but doesn't check for ','.\n if (next in spaceAfterDots && next !== ',') {\n return \"\\\\ldots\\\\,\";\n } else {\n return \"\\\\ldots\";\n }\n});\ndefineMacro(\"\\\\cdots\", function (context) {\n var next = context.future().text;\n if (next in spaceAfterDots) {\n return \"\\\\@cdots\\\\,\";\n } else {\n return \"\\\\@cdots\";\n }\n});\ndefineMacro(\"\\\\dotsb\", \"\\\\cdots\");\ndefineMacro(\"\\\\dotsm\", \"\\\\cdots\");\ndefineMacro(\"\\\\dotsi\", \"\\\\!\\\\cdots\");\n// amsmath doesn't actually define \\dotsx, but \\dots followed by a macro\n// starting with \\DOTSX implies \\dotso, and then \\extra@ detects this case\n// and forces the added `\\,`.\ndefineMacro(\"\\\\dotsx\", \"\\\\ldots\\\\,\");\n// \\let\\DOTSI\\relax\n// \\let\\DOTSB\\relax\n// \\let\\DOTSX\\relax\ndefineMacro(\"\\\\DOTSI\", \"\\\\relax\");\ndefineMacro(\"\\\\DOTSB\", \"\\\\relax\");\ndefineMacro(\"\\\\DOTSX\", \"\\\\relax\");\n// Spacing, based on amsmath.sty's override of LaTeX defaults\n// \\DeclareRobustCommand{\\tmspace}[3]{%\n// \\ifmmode\\mskip#1#2\\else\\kern#1#3\\fi\\relax}\ndefineMacro(\"\\\\tmspace\", \"\\\\TextOrMath{\\\\kern#1#3}{\\\\mskip#1#2}\\\\relax\");\n// \\renewcommand{\\,}{\\tmspace+\\thinmuskip{.1667em}}\n// TODO: math mode should use \\thinmuskip\ndefineMacro(\"\\\\,\", \"\\\\tmspace+{3mu}{.1667em}\");\n// \\let\\thinspace\\,\ndefineMacro(\"\\\\thinspace\", \"\\\\,\");\n// \\def\\>{\\mskip\\medmuskip}\n// \\renewcommand{\\:}{\\tmspace+\\medmuskip{.2222em}}\n// TODO: \\> and math mode of \\: should use \\medmuskip = 4mu plus 2mu minus 4mu\ndefineMacro(\"\\\\>\", \"\\\\mskip{4mu}\");\ndefineMacro(\"\\\\:\", \"\\\\tmspace+{4mu}{.2222em}\");\n// \\let\\medspace\\:\ndefineMacro(\"\\\\medspace\", \"\\\\:\");\n// \\renewcommand{\\;}{\\tmspace+\\thickmuskip{.2777em}}\n// TODO: math mode should use \\thickmuskip = 5mu plus 5mu\ndefineMacro(\"\\\\;\", \"\\\\tmspace+{5mu}{.2777em}\");\n// \\let\\thickspace\\;\ndefineMacro(\"\\\\thickspace\", \"\\\\;\");\n// \\renewcommand{\\!}{\\tmspace-\\thinmuskip{.1667em}}\n// TODO: math mode should use \\thinmuskip\ndefineMacro(\"\\\\!\", \"\\\\tmspace-{3mu}{.1667em}\");\n// \\let\\negthinspace\\!\ndefineMacro(\"\\\\negthinspace\", \"\\\\!\");\n// \\newcommand{\\negmedspace}{\\tmspace-\\medmuskip{.2222em}}\n// TODO: math mode should use \\medmuskip\ndefineMacro(\"\\\\negmedspace\", \"\\\\tmspace-{4mu}{.2222em}\");\n// \\newcommand{\\negthickspace}{\\tmspace-\\thickmuskip{.2777em}}\n// TODO: math mode should use \\thickmuskip\ndefineMacro(\"\\\\negthickspace\", \"\\\\tmspace-{5mu}{.277em}\");\n// \\def\\enspace{\\kern.5em }\ndefineMacro(\"\\\\enspace\", \"\\\\kern.5em \");\n// \\def\\enskip{\\hskip.5em\\relax}\ndefineMacro(\"\\\\enskip\", \"\\\\hskip.5em\\\\relax\");\n// \\def\\quad{\\hskip1em\\relax}\ndefineMacro(\"\\\\quad\", \"\\\\hskip1em\\\\relax\");\n// \\def\\qquad{\\hskip2em\\relax}\ndefineMacro(\"\\\\qquad\", \"\\\\hskip2em\\\\relax\");\n// \\tag@in@display form of \\tag\ndefineMacro(\"\\\\tag\", \"\\\\@ifstar\\\\tag@literal\\\\tag@paren\");\ndefineMacro(\"\\\\tag@paren\", \"\\\\tag@literal{({#1})}\");\ndefineMacro(\"\\\\tag@literal\", context => {\n if (context.macros.get(\"\\\\df@tag\")) {\n throw new ParseError(\"Multiple \\\\tag\");\n }\n return \"\\\\gdef\\\\df@tag{\\\\text{#1}}\";\n});\n// \\renewcommand{\\bmod}{\\nonscript\\mskip-\\medmuskip\\mkern5mu\\mathbin\n// {\\operator@font mod}\\penalty900\n// \\mkern5mu\\nonscript\\mskip-\\medmuskip}\n// \\newcommand{\\pod}[1]{\\allowbreak\n// \\if@display\\mkern18mu\\else\\mkern8mu\\fi(#1)}\n// \\renewcommand{\\pmod}[1]{\\pod{{\\operator@font mod}\\mkern6mu#1}}\n// \\newcommand{\\mod}[1]{\\allowbreak\\if@display\\mkern18mu\n// \\else\\mkern12mu\\fi{\\operator@font mod}\\,\\,#1}\n// TODO: math mode should use \\medmuskip = 4mu plus 2mu minus 4mu\ndefineMacro(\"\\\\bmod\", \"\\\\mathchoice{\\\\mskip1mu}{\\\\mskip1mu}{\\\\mskip5mu}{\\\\mskip5mu}\" + \"\\\\mathbin{\\\\rm mod}\" + \"\\\\mathchoice{\\\\mskip1mu}{\\\\mskip1mu}{\\\\mskip5mu}{\\\\mskip5mu}\");\ndefineMacro(\"\\\\pod\", \"\\\\allowbreak\" + \"\\\\mathchoice{\\\\mkern18mu}{\\\\mkern8mu}{\\\\mkern8mu}{\\\\mkern8mu}(#1)\");\ndefineMacro(\"\\\\pmod\", \"\\\\pod{{\\\\rm mod}\\\\mkern6mu#1}\");\ndefineMacro(\"\\\\mod\", \"\\\\allowbreak\" + \"\\\\mathchoice{\\\\mkern18mu}{\\\\mkern12mu}{\\\\mkern12mu}{\\\\mkern12mu}\" + \"{\\\\rm mod}\\\\,\\\\,#1\");\n//////////////////////////////////////////////////////////////////////\n// LaTeX source2e\n// \\expandafter\\let\\expandafter\\@normalcr\n// \\csname\\expandafter\\@gobble\\string\\\\ \\endcsname\n// \\DeclareRobustCommand\\newline{\\@normalcr\\relax}\ndefineMacro(\"\\\\newline\", \"\\\\\\\\\\\\relax\");\n// \\def\\TeX{T\\kern-.1667em\\lower.5ex\\hbox{E}\\kern-.125emX\\@}\n// TODO: Doesn't normally work in math mode because \\@ fails. KaTeX doesn't\n// support \\@ yet, so that's omitted, and we add \\text so that the result\n// doesn't look funny in math mode.\ndefineMacro(\"\\\\TeX\", \"\\\\textrm{\\\\html@mathml{\" + \"T\\\\kern-.1667em\\\\raisebox{-.5ex}{E}\\\\kern-.125emX\" + \"}{TeX}}\");\n// \\DeclareRobustCommand{\\LaTeX}{L\\kern-.36em%\n// {\\sbox\\z@ T%\n// \\vbox to\\ht\\z@{\\hbox{\\check@mathfonts\n// \\fontsize\\sf@size\\z@\n// \\math@fontsfalse\\selectfont\n// A}%\n// \\vss}%\n// }%\n// \\kern-.15em%\n// \\TeX}\n// This code aligns the top of the A with the T (from the perspective of TeX's\n// boxes, though visually the A appears to extend above slightly).\n// We compute the corresponding \\raisebox when A is rendered in \\normalsize\n// \\scriptstyle, which has a scale factor of 0.7 (see Options.js).\nvar latexRaiseA = makeEm(fontMetricsData['Main-Regular'][\"T\".charCodeAt(0)][1] - 0.7 * fontMetricsData['Main-Regular'][\"A\".charCodeAt(0)][1]);\ndefineMacro(\"\\\\LaTeX\", \"\\\\textrm{\\\\html@mathml{\" + (\"L\\\\kern-.36em\\\\raisebox{\" + latexRaiseA + \"}{\\\\scriptstyle A}\") + \"\\\\kern-.15em\\\\TeX}{LaTeX}}\");\n// New KaTeX logo based on tweaking LaTeX logo\ndefineMacro(\"\\\\KaTeX\", \"\\\\textrm{\\\\html@mathml{\" + (\"K\\\\kern-.17em\\\\raisebox{\" + latexRaiseA + \"}{\\\\scriptstyle A}\") + \"\\\\kern-.15em\\\\TeX}{KaTeX}}\");\n// \\DeclareRobustCommand\\hspace{\\@ifstar\\@hspacer\\@hspace}\n// \\def\\@hspace#1{\\hskip #1\\relax}\n// \\def\\@hspacer#1{\\vrule \\@width\\z@\\nobreak\n// \\hskip #1\\hskip \\z@skip}\ndefineMacro(\"\\\\hspace\", \"\\\\@ifstar\\\\@hspacer\\\\@hspace\");\ndefineMacro(\"\\\\@hspace\", \"\\\\hskip #1\\\\relax\");\ndefineMacro(\"\\\\@hspacer\", \"\\\\rule{0pt}{0pt}\\\\hskip #1\\\\relax\");\n//////////////////////////////////////////////////////////////////////\n// mathtools.sty\n//\\providecommand\\ordinarycolon{:}\ndefineMacro(\"\\\\ordinarycolon\", \":\");\n//\\def\\vcentcolon{\\mathrel{\\mathop\\ordinarycolon}}\n//TODO(edemaine): Not yet centered. Fix via \\raisebox or #726\ndefineMacro(\"\\\\vcentcolon\", \"\\\\mathrel{\\\\mathop\\\\ordinarycolon}\");\n// \\providecommand*\\dblcolon{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}\ndefineMacro(\"\\\\dblcolon\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\vcentcolon\\\\mathrel{\\\\mkern-.9mu}\\\\vcentcolon}}\" + \"{\\\\mathop{\\\\char\\\"2237}}\");\n// \\providecommand*\\coloneqq{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}\ndefineMacro(\"\\\\coloneqq\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\vcentcolon\\\\mathrel{\\\\mkern-1.2mu}=}}\" + \"{\\\\mathop{\\\\char\\\"2254}}\"); // ≔\n// \\providecommand*\\Coloneqq{\\dblcolon\\mathrel{\\mkern-1.2mu}=}\ndefineMacro(\"\\\\Coloneqq\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\dblcolon\\\\mathrel{\\\\mkern-1.2mu}=}}\" + \"{\\\\mathop{\\\\char\\\"2237\\\\char\\\"3d}}\");\n// \\providecommand*\\coloneq{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}\ndefineMacro(\"\\\\coloneq\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\vcentcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\mathrel{-}}}\" + \"{\\\\mathop{\\\\char\\\"3a\\\\char\\\"2212}}\");\n// \\providecommand*\\Coloneq{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}\ndefineMacro(\"\\\\Coloneq\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\dblcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\mathrel{-}}}\" + \"{\\\\mathop{\\\\char\\\"2237\\\\char\\\"2212}}\");\n// \\providecommand*\\eqqcolon{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}\ndefineMacro(\"\\\\eqqcolon\", \"\\\\html@mathml{\" + \"\\\\mathrel{=\\\\mathrel{\\\\mkern-1.2mu}\\\\vcentcolon}}\" + \"{\\\\mathop{\\\\char\\\"2255}}\"); // ≕\n// \\providecommand*\\Eqqcolon{=\\mathrel{\\mkern-1.2mu}\\dblcolon}\ndefineMacro(\"\\\\Eqqcolon\", \"\\\\html@mathml{\" + \"\\\\mathrel{=\\\\mathrel{\\\\mkern-1.2mu}\\\\dblcolon}}\" + \"{\\\\mathop{\\\\char\\\"3d\\\\char\\\"2237}}\");\n// \\providecommand*\\eqcolon{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}\ndefineMacro(\"\\\\eqcolon\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\mathrel{-}\\\\mathrel{\\\\mkern-1.2mu}\\\\vcentcolon}}\" + \"{\\\\mathop{\\\\char\\\"2239}}\");\n// \\providecommand*\\Eqcolon{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}\ndefineMacro(\"\\\\Eqcolon\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\mathrel{-}\\\\mathrel{\\\\mkern-1.2mu}\\\\dblcolon}}\" + \"{\\\\mathop{\\\\char\\\"2212\\\\char\\\"2237}}\");\n// \\providecommand*\\colonapprox{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}\ndefineMacro(\"\\\\colonapprox\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\vcentcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\approx}}\" + \"{\\\\mathop{\\\\char\\\"3a\\\\char\\\"2248}}\");\n// \\providecommand*\\Colonapprox{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}\ndefineMacro(\"\\\\Colonapprox\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\dblcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\approx}}\" + \"{\\\\mathop{\\\\char\\\"2237\\\\char\\\"2248}}\");\n// \\providecommand*\\colonsim{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}\ndefineMacro(\"\\\\colonsim\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\vcentcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\sim}}\" + \"{\\\\mathop{\\\\char\\\"3a\\\\char\\\"223c}}\");\n// \\providecommand*\\Colonsim{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}\ndefineMacro(\"\\\\Colonsim\", \"\\\\html@mathml{\" + \"\\\\mathrel{\\\\dblcolon\\\\mathrel{\\\\mkern-1.2mu}\\\\sim}}\" + \"{\\\\mathop{\\\\char\\\"2237\\\\char\\\"223c}}\");\n// Some Unicode characters are implemented with macros to mathtools functions.\ndefineMacro(\"\\u2237\", \"\\\\dblcolon\"); // ::\ndefineMacro(\"\\u2239\", \"\\\\eqcolon\"); // -:\ndefineMacro(\"\\u2254\", \"\\\\coloneqq\"); // :=\ndefineMacro(\"\\u2255\", \"\\\\eqqcolon\"); // =:\ndefineMacro(\"\\u2A74\", \"\\\\Coloneqq\"); // ::=\n//////////////////////////////////////////////////////////////////////\n// colonequals.sty\n// Alternate names for mathtools's macros:\ndefineMacro(\"\\\\ratio\", \"\\\\vcentcolon\");\ndefineMacro(\"\\\\coloncolon\", \"\\\\dblcolon\");\ndefineMacro(\"\\\\colonequals\", \"\\\\coloneqq\");\ndefineMacro(\"\\\\coloncolonequals\", \"\\\\Coloneqq\");\ndefineMacro(\"\\\\equalscolon\", \"\\\\eqqcolon\");\ndefineMacro(\"\\\\equalscoloncolon\", \"\\\\Eqqcolon\");\ndefineMacro(\"\\\\colonminus\", \"\\\\coloneq\");\ndefineMacro(\"\\\\coloncolonminus\", \"\\\\Coloneq\");\ndefineMacro(\"\\\\minuscolon\", \"\\\\eqcolon\");\ndefineMacro(\"\\\\minuscoloncolon\", \"\\\\Eqcolon\");\n// \\colonapprox name is same in mathtools and colonequals.\ndefineMacro(\"\\\\coloncolonapprox\", \"\\\\Colonapprox\");\n// \\colonsim name is same in mathtools and colonequals.\ndefineMacro(\"\\\\coloncolonsim\", \"\\\\Colonsim\");\n// Additional macros, implemented by analogy with mathtools definitions:\ndefineMacro(\"\\\\simcolon\", \"\\\\mathrel{\\\\sim\\\\mathrel{\\\\mkern-1.2mu}\\\\vcentcolon}\");\ndefineMacro(\"\\\\simcoloncolon\", \"\\\\mathrel{\\\\sim\\\\mathrel{\\\\mkern-1.2mu}\\\\dblcolon}\");\ndefineMacro(\"\\\\approxcolon\", \"\\\\mathrel{\\\\approx\\\\mathrel{\\\\mkern-1.2mu}\\\\vcentcolon}\");\ndefineMacro(\"\\\\approxcoloncolon\", \"\\\\mathrel{\\\\approx\\\\mathrel{\\\\mkern-1.2mu}\\\\dblcolon}\");\n// Present in newtxmath, pxfonts and txfonts\ndefineMacro(\"\\\\notni\", \"\\\\html@mathml{\\\\not\\\\ni}{\\\\mathrel{\\\\char`\\u220C}}\");\ndefineMacro(\"\\\\limsup\", \"\\\\DOTSB\\\\operatorname*{lim\\\\,sup}\");\ndefineMacro(\"\\\\liminf\", \"\\\\DOTSB\\\\operatorname*{lim\\\\,inf}\");\n//////////////////////////////////////////////////////////////////////\n// From amsopn.sty\ndefineMacro(\"\\\\injlim\", \"\\\\DOTSB\\\\operatorname*{inj\\\\,lim}\");\ndefineMacro(\"\\\\projlim\", \"\\\\DOTSB\\\\operatorname*{proj\\\\,lim}\");\ndefineMacro(\"\\\\varlimsup\", \"\\\\DOTSB\\\\operatorname*{\\\\overline{lim}}\");\ndefineMacro(\"\\\\varliminf\", \"\\\\DOTSB\\\\operatorname*{\\\\underline{lim}}\");\ndefineMacro(\"\\\\varinjlim\", \"\\\\DOTSB\\\\operatorname*{\\\\underrightarrow{lim}}\");\ndefineMacro(\"\\\\varprojlim\", \"\\\\DOTSB\\\\operatorname*{\\\\underleftarrow{lim}}\");\n//////////////////////////////////////////////////////////////////////\n// MathML alternates for KaTeX glyphs in the Unicode private area\ndefineMacro(\"\\\\gvertneqq\", \"\\\\html@mathml{\\\\@gvertneqq}{\\u2269}\");\ndefineMacro(\"\\\\lvertneqq\", \"\\\\html@mathml{\\\\@lvertneqq}{\\u2268}\");\ndefineMacro(\"\\\\ngeqq\", \"\\\\html@mathml{\\\\@ngeqq}{\\u2271}\");\ndefineMacro(\"\\\\ngeqslant\", \"\\\\html@mathml{\\\\@ngeqslant}{\\u2271}\");\ndefineMacro(\"\\\\nleqq\", \"\\\\html@mathml{\\\\@nleqq}{\\u2270}\");\ndefineMacro(\"\\\\nleqslant\", \"\\\\html@mathml{\\\\@nleqslant}{\\u2270}\");\ndefineMacro(\"\\\\nshortmid\", \"\\\\html@mathml{\\\\@nshortmid}{∤}\");\ndefineMacro(\"\\\\nshortparallel\", \"\\\\html@mathml{\\\\@nshortparallel}{∦}\");\ndefineMacro(\"\\\\nsubseteqq\", \"\\\\html@mathml{\\\\@nsubseteqq}{\\u2288}\");\ndefineMacro(\"\\\\nsupseteqq\", \"\\\\html@mathml{\\\\@nsupseteqq}{\\u2289}\");\ndefineMacro(\"\\\\varsubsetneq\", \"\\\\html@mathml{\\\\@varsubsetneq}{⊊}\");\ndefineMacro(\"\\\\varsubsetneqq\", \"\\\\html@mathml{\\\\@varsubsetneqq}{⫋}\");\ndefineMacro(\"\\\\varsupsetneq\", \"\\\\html@mathml{\\\\@varsupsetneq}{⊋}\");\ndefineMacro(\"\\\\varsupsetneqq\", \"\\\\html@mathml{\\\\@varsupsetneqq}{⫌}\");\ndefineMacro(\"\\\\imath\", \"\\\\html@mathml{\\\\@imath}{\\u0131}\");\ndefineMacro(\"\\\\jmath\", \"\\\\html@mathml{\\\\@jmath}{\\u0237}\");\n//////////////////////////////////////////////////////////////////////\n// stmaryrd and semantic\n// The stmaryrd and semantic packages render the next four items by calling a\n// glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros.\ndefineMacro(\"\\\\llbracket\", \"\\\\html@mathml{\" + \"\\\\mathopen{[\\\\mkern-3.2mu[}}\" + \"{\\\\mathopen{\\\\char`\\u27e6}}\");\ndefineMacro(\"\\\\rrbracket\", \"\\\\html@mathml{\" + \"\\\\mathclose{]\\\\mkern-3.2mu]}}\" + \"{\\\\mathclose{\\\\char`\\u27e7}}\");\ndefineMacro(\"\\u27e6\", \"\\\\llbracket\"); // blackboard bold [\ndefineMacro(\"\\u27e7\", \"\\\\rrbracket\"); // blackboard bold ]\ndefineMacro(\"\\\\lBrace\", \"\\\\html@mathml{\" + \"\\\\mathopen{\\\\{\\\\mkern-3.2mu[}}\" + \"{\\\\mathopen{\\\\char`\\u2983}}\");\ndefineMacro(\"\\\\rBrace\", \"\\\\html@mathml{\" + \"\\\\mathclose{]\\\\mkern-3.2mu\\\\}}}\" + \"{\\\\mathclose{\\\\char`\\u2984}}\");\ndefineMacro(\"↤\", \"\\\\mapsfrom\");\ndefineMacro(\"\\\\mapsfrom\", \"\\\\html@mathml{\\\\mathrel{\\\\mathreflectbox{\\\\mapsto}}}{\\\\mathrel{\\\\char`↤}}\");\ndefineMacro(\"\\u2983\", \"\\\\lBrace\"); // blackboard bold {\ndefineMacro(\"\\u2984\", \"\\\\rBrace\"); // blackboard bold }\n// TODO: Create variable sized versions of the last two items. I believe that\n// will require new font glyphs.\n// The stmaryrd function `\\minuso` provides a \"Plimsoll\" symbol that\n// superimposes the characters \\circ and \\mathminus. Used in chemistry.\ndefineMacro(\"\\\\minuso\", \"\\\\mathbin{\\\\html@mathml{\" + \"{\\\\mathrlap{\\\\mathchoice{\\\\kern{0.145em}}{\\\\kern{0.145em}}\" + \"{\\\\kern{0.1015em}}{\\\\kern{0.0725em}}\\\\circ}{-}}}\" + \"{\\\\char`⦵}}\");\ndefineMacro(\"⦵\", \"\\\\minuso\");\n//////////////////////////////////////////////////////////////////////\n// texvc.sty\n// The texvc package contains macros available in mediawiki pages.\n// We omit the functions deprecated at\n// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax\n// We also omit texvc's \\O, which conflicts with \\text{\\O}\ndefineMacro(\"\\\\darr\", \"\\\\downarrow\");\ndefineMacro(\"\\\\dArr\", \"\\\\Downarrow\");\ndefineMacro(\"\\\\Darr\", \"\\\\Downarrow\");\ndefineMacro(\"\\\\lang\", \"\\\\langle\");\ndefineMacro(\"\\\\rang\", \"\\\\rangle\");\ndefineMacro(\"\\\\uarr\", \"\\\\uparrow\");\ndefineMacro(\"\\\\uArr\", \"\\\\Uparrow\");\ndefineMacro(\"\\\\Uarr\", \"\\\\Uparrow\");\ndefineMacro(\"\\\\N\", \"\\\\mathbb{N}\");\ndefineMacro(\"\\\\R\", \"\\\\mathbb{R}\");\ndefineMacro(\"\\\\Z\", \"\\\\mathbb{Z}\");\ndefineMacro(\"\\\\alef\", \"\\\\aleph\");\ndefineMacro(\"\\\\alefsym\", \"\\\\aleph\");\ndefineMacro(\"\\\\Alpha\", \"\\\\mathrm{A}\");\ndefineMacro(\"\\\\Beta\", \"\\\\mathrm{B}\");\ndefineMacro(\"\\\\bull\", \"\\\\bullet\");\ndefineMacro(\"\\\\Chi\", \"\\\\mathrm{X}\");\ndefineMacro(\"\\\\clubs\", \"\\\\clubsuit\");\ndefineMacro(\"\\\\cnums\", \"\\\\mathbb{C}\");\ndefineMacro(\"\\\\Complex\", \"\\\\mathbb{C}\");\ndefineMacro(\"\\\\Dagger\", \"\\\\ddagger\");\ndefineMacro(\"\\\\diamonds\", \"\\\\diamondsuit\");\ndefineMacro(\"\\\\empty\", \"\\\\emptyset\");\ndefineMacro(\"\\\\Epsilon\", \"\\\\mathrm{E}\");\ndefineMacro(\"\\\\Eta\", \"\\\\mathrm{H}\");\ndefineMacro(\"\\\\exist\", \"\\\\exists\");\ndefineMacro(\"\\\\harr\", \"\\\\leftrightarrow\");\ndefineMacro(\"\\\\hArr\", \"\\\\Leftrightarrow\");\ndefineMacro(\"\\\\Harr\", \"\\\\Leftrightarrow\");\ndefineMacro(\"\\\\hearts\", \"\\\\heartsuit\");\ndefineMacro(\"\\\\image\", \"\\\\Im\");\ndefineMacro(\"\\\\infin\", \"\\\\infty\");\ndefineMacro(\"\\\\Iota\", \"\\\\mathrm{I}\");\ndefineMacro(\"\\\\isin\", \"\\\\in\");\ndefineMacro(\"\\\\Kappa\", \"\\\\mathrm{K}\");\ndefineMacro(\"\\\\larr\", \"\\\\leftarrow\");\ndefineMacro(\"\\\\lArr\", \"\\\\Leftarrow\");\ndefineMacro(\"\\\\Larr\", \"\\\\Leftarrow\");\ndefineMacro(\"\\\\lrarr\", \"\\\\leftrightarrow\");\ndefineMacro(\"\\\\lrArr\", \"\\\\Leftrightarrow\");\ndefineMacro(\"\\\\Lrarr\", \"\\\\Leftrightarrow\");\ndefineMacro(\"\\\\Mu\", \"\\\\mathrm{M}\");\ndefineMacro(\"\\\\natnums\", \"\\\\mathbb{N}\");\ndefineMacro(\"\\\\Nu\", \"\\\\mathrm{N}\");\ndefineMacro(\"\\\\Omicron\", \"\\\\mathrm{O}\");\ndefineMacro(\"\\\\plusmn\", \"\\\\pm\");\ndefineMacro(\"\\\\rarr\", \"\\\\rightarrow\");\ndefineMacro(\"\\\\rArr\", \"\\\\Rightarrow\");\ndefineMacro(\"\\\\Rarr\", \"\\\\Rightarrow\");\ndefineMacro(\"\\\\real\", \"\\\\Re\");\ndefineMacro(\"\\\\reals\", \"\\\\mathbb{R}\");\ndefineMacro(\"\\\\Reals\", \"\\\\mathbb{R}\");\ndefineMacro(\"\\\\Rho\", \"\\\\mathrm{P}\");\ndefineMacro(\"\\\\sdot\", \"\\\\cdot\");\ndefineMacro(\"\\\\sect\", \"\\\\S\");\ndefineMacro(\"\\\\spades\", \"\\\\spadesuit\");\ndefineMacro(\"\\\\sub\", \"\\\\subset\");\ndefineMacro(\"\\\\sube\", \"\\\\subseteq\");\ndefineMacro(\"\\\\supe\", \"\\\\supseteq\");\ndefineMacro(\"\\\\Tau\", \"\\\\mathrm{T}\");\ndefineMacro(\"\\\\thetasym\", \"\\\\vartheta\");\n// TODO: defineMacro(\"\\\\varcoppa\", \"\\\\\\mbox{\\\\coppa}\");\ndefineMacro(\"\\\\weierp\", \"\\\\wp\");\ndefineMacro(\"\\\\Zeta\", \"\\\\mathrm{Z}\");\n//////////////////////////////////////////////////////////////////////\n// statmath.sty\n// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf\ndefineMacro(\"\\\\argmin\", \"\\\\DOTSB\\\\operatorname*{arg\\\\,min}\");\ndefineMacro(\"\\\\argmax\", \"\\\\DOTSB\\\\operatorname*{arg\\\\,max}\");\ndefineMacro(\"\\\\plim\", \"\\\\DOTSB\\\\mathop{\\\\operatorname{plim}}\\\\limits\");\n//////////////////////////////////////////////////////////////////////\n// braket.sty\n// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf\ndefineMacro(\"\\\\bra\", \"\\\\mathinner{\\\\langle{#1}|}\");\ndefineMacro(\"\\\\ket\", \"\\\\mathinner{|{#1}\\\\rangle}\");\ndefineMacro(\"\\\\braket\", \"\\\\mathinner{\\\\langle{#1}\\\\rangle}\");\ndefineMacro(\"\\\\Bra\", \"\\\\left\\\\langle#1\\\\right|\");\ndefineMacro(\"\\\\Ket\", \"\\\\left|#1\\\\right\\\\rangle\");\nvar braketHelper = one => context => {\n var left = context.consumeArg().tokens;\n var middle = context.consumeArg().tokens;\n var middleDouble = context.consumeArg().tokens;\n var right = context.consumeArg().tokens;\n var oldMiddle = context.macros.get(\"|\");\n var oldMiddleDouble = context.macros.get(\"\\\\|\");\n context.macros.beginGroup();\n var midMacro = double => context => {\n if (one) {\n // Only modify the first instance of | or \\|\n context.macros.set(\"|\", oldMiddle);\n if (middleDouble.length) {\n context.macros.set(\"\\\\|\", oldMiddleDouble);\n }\n }\n var doubled = double;\n if (!double && middleDouble.length) {\n // Mimic \\@ifnextchar\n var nextToken = context.future();\n if (nextToken.text === \"|\") {\n context.popToken();\n doubled = true;\n }\n }\n return {\n tokens: doubled ? middleDouble : middle,\n numArgs: 0\n };\n };\n context.macros.set(\"|\", midMacro(false));\n if (middleDouble.length) {\n context.macros.set(\"\\\\|\", midMacro(true));\n }\n var arg = context.consumeArg().tokens;\n var expanded = context.expandTokens([...right, ...arg, ...left // reversed\n ]);\n context.macros.endGroup();\n return {\n tokens: expanded.reverse(),\n numArgs: 0\n };\n};\ndefineMacro(\"\\\\bra@ket\", braketHelper(false));\ndefineMacro(\"\\\\bra@set\", braketHelper(true));\ndefineMacro(\"\\\\Braket\", \"\\\\bra@ket{\\\\left\\\\langle}\" + \"{\\\\,\\\\middle\\\\vert\\\\,}{\\\\,\\\\middle\\\\vert\\\\,}{\\\\right\\\\rangle}\");\ndefineMacro(\"\\\\Set\", \"\\\\bra@set{\\\\left\\\\{\\\\:}\" + \"{\\\\;\\\\middle\\\\vert\\\\;}{\\\\;\\\\middle\\\\Vert\\\\;}{\\\\:\\\\right\\\\}}\");\ndefineMacro(\"\\\\set\", \"\\\\bra@set{\\\\{\\\\,}{\\\\mid}{}{\\\\,\\\\}}\");\n// has no support for special || or \\|\n//////////////////////////////////////////////////////////////////////\n// actuarialangle.dtx\ndefineMacro(\"\\\\angln\", \"{\\\\angl n}\");\n// Custom Khan Academy colors, should be moved to an optional package\ndefineMacro(\"\\\\blue\", \"\\\\textcolor{##6495ed}{#1}\");\ndefineMacro(\"\\\\orange\", \"\\\\textcolor{##ffa500}{#1}\");\ndefineMacro(\"\\\\pink\", \"\\\\textcolor{##ff00af}{#1}\");\ndefineMacro(\"\\\\red\", \"\\\\textcolor{##df0030}{#1}\");\ndefineMacro(\"\\\\green\", \"\\\\textcolor{##28ae7b}{#1}\");\ndefineMacro(\"\\\\gray\", \"\\\\textcolor{gray}{#1}\");\ndefineMacro(\"\\\\purple\", \"\\\\textcolor{##9d38bd}{#1}\");\ndefineMacro(\"\\\\blueA\", \"\\\\textcolor{##ccfaff}{#1}\");\ndefineMacro(\"\\\\blueB\", \"\\\\textcolor{##80f6ff}{#1}\");\ndefineMacro(\"\\\\blueC\", \"\\\\textcolor{##63d9ea}{#1}\");\ndefineMacro(\"\\\\blueD\", \"\\\\textcolor{##11accd}{#1}\");\ndefineMacro(\"\\\\blueE\", \"\\\\textcolor{##0c7f99}{#1}\");\ndefineMacro(\"\\\\tealA\", \"\\\\textcolor{##94fff5}{#1}\");\ndefineMacro(\"\\\\tealB\", \"\\\\textcolor{##26edd5}{#1}\");\ndefineMacro(\"\\\\tealC\", \"\\\\textcolor{##01d1c1}{#1}\");\ndefineMacro(\"\\\\tealD\", \"\\\\textcolor{##01a995}{#1}\");\ndefineMacro(\"\\\\tealE\", \"\\\\textcolor{##208170}{#1}\");\ndefineMacro(\"\\\\greenA\", \"\\\\textcolor{##b6ffb0}{#1}\");\ndefineMacro(\"\\\\greenB\", \"\\\\textcolor{##8af281}{#1}\");\ndefineMacro(\"\\\\greenC\", \"\\\\textcolor{##74cf70}{#1}\");\ndefineMacro(\"\\\\greenD\", \"\\\\textcolor{##1fab54}{#1}\");\ndefineMacro(\"\\\\greenE\", \"\\\\textcolor{##0d923f}{#1}\");\ndefineMacro(\"\\\\goldA\", \"\\\\textcolor{##ffd0a9}{#1}\");\ndefineMacro(\"\\\\goldB\", \"\\\\textcolor{##ffbb71}{#1}\");\ndefineMacro(\"\\\\goldC\", \"\\\\textcolor{##ff9c39}{#1}\");\ndefineMacro(\"\\\\goldD\", \"\\\\textcolor{##e07d10}{#1}\");\ndefineMacro(\"\\\\goldE\", \"\\\\textcolor{##a75a05}{#1}\");\ndefineMacro(\"\\\\redA\", \"\\\\textcolor{##fca9a9}{#1}\");\ndefineMacro(\"\\\\redB\", \"\\\\textcolor{##ff8482}{#1}\");\ndefineMacro(\"\\\\redC\", \"\\\\textcolor{##f9685d}{#1}\");\ndefineMacro(\"\\\\redD\", \"\\\\textcolor{##e84d39}{#1}\");\ndefineMacro(\"\\\\redE\", \"\\\\textcolor{##bc2612}{#1}\");\ndefineMacro(\"\\\\maroonA\", \"\\\\textcolor{##ffbde0}{#1}\");\ndefineMacro(\"\\\\maroonB\", \"\\\\textcolor{##ff92c6}{#1}\");\ndefineMacro(\"\\\\maroonC\", \"\\\\textcolor{##ed5fa6}{#1}\");\ndefineMacro(\"\\\\maroonD\", \"\\\\textcolor{##ca337c}{#1}\");\ndefineMacro(\"\\\\maroonE\", \"\\\\textcolor{##9e034e}{#1}\");\ndefineMacro(\"\\\\purpleA\", \"\\\\textcolor{##ddd7ff}{#1}\");\ndefineMacro(\"\\\\purpleB\", \"\\\\textcolor{##c6b9fc}{#1}\");\ndefineMacro(\"\\\\purpleC\", \"\\\\textcolor{##aa87ff}{#1}\");\ndefineMacro(\"\\\\purpleD\", \"\\\\textcolor{##7854ab}{#1}\");\ndefineMacro(\"\\\\purpleE\", \"\\\\textcolor{##543b78}{#1}\");\ndefineMacro(\"\\\\mintA\", \"\\\\textcolor{##f5f9e8}{#1}\");\ndefineMacro(\"\\\\mintB\", \"\\\\textcolor{##edf2df}{#1}\");\ndefineMacro(\"\\\\mintC\", \"\\\\textcolor{##e0e5cc}{#1}\");\ndefineMacro(\"\\\\grayA\", \"\\\\textcolor{##f6f7f7}{#1}\");\ndefineMacro(\"\\\\grayB\", \"\\\\textcolor{##f0f1f2}{#1}\");\ndefineMacro(\"\\\\grayC\", \"\\\\textcolor{##e3e5e6}{#1}\");\ndefineMacro(\"\\\\grayD\", \"\\\\textcolor{##d6d8da}{#1}\");\ndefineMacro(\"\\\\grayE\", \"\\\\textcolor{##babec2}{#1}\");\ndefineMacro(\"\\\\grayF\", \"\\\\textcolor{##888d93}{#1}\");\ndefineMacro(\"\\\\grayG\", \"\\\\textcolor{##626569}{#1}\");\ndefineMacro(\"\\\\grayH\", \"\\\\textcolor{##3b3e40}{#1}\");\ndefineMacro(\"\\\\grayI\", \"\\\\textcolor{##21242c}{#1}\");\ndefineMacro(\"\\\\kaBlue\", \"\\\\textcolor{##314453}{#1}\");\ndefineMacro(\"\\\\kaGreen\", \"\\\\textcolor{##71B307}{#1}\");\n\n/**\n * This file contains the “gullet” where macros are expanded\n * until only non-macro tokens remain.\n */\n// List of commands that act like macros but aren't defined as a macro,\n// function, or symbol. Used in `isDefined`.\nvar implicitCommands = {\n \"^\": true,\n // Parser.js\n \"_\": true,\n // Parser.js\n \"\\\\limits\": true,\n // Parser.js\n \"\\\\nolimits\": true // Parser.js\n};\nclass MacroExpander {\n constructor(input, settings, mode) {\n this.settings = void 0;\n this.expansionCount = void 0;\n this.lexer = void 0;\n this.macros = void 0;\n this.stack = void 0;\n this.mode = void 0;\n this.settings = settings;\n this.expansionCount = 0;\n this.feed(input);\n // Make new global namespace\n this.macros = new Namespace(macros, settings.macros);\n this.mode = mode;\n this.stack = []; // contains tokens in REVERSE order\n }\n /**\n * Feed a new input string to the same MacroExpander\n * (with existing macros etc.).\n */\n feed(input) {\n this.lexer = new Lexer(input, this.settings);\n }\n /**\n * Switches between \"text\" and \"math\" modes.\n */\n switchMode(newMode) {\n this.mode = newMode;\n }\n /**\n * Start a new group nesting within all namespaces.\n */\n beginGroup() {\n this.macros.beginGroup();\n }\n /**\n * End current group nesting within all namespaces.\n */\n endGroup() {\n this.macros.endGroup();\n }\n /**\n * Ends all currently nested groups (if any), restoring values before the\n * groups began. Useful in case of an error in the middle of parsing.\n */\n endGroups() {\n this.macros.endGroups();\n }\n /**\n * Returns the topmost token on the stack, without expanding it.\n * Similar in behavior to TeX's `\\futurelet`.\n */\n future() {\n if (this.stack.length === 0) {\n this.pushToken(this.lexer.lex());\n }\n return this.stack[this.stack.length - 1];\n }\n /**\n * Remove and return the next unexpanded token.\n */\n popToken() {\n this.future(); // ensure non-empty stack\n return this.stack.pop();\n }\n /**\n * Add a given token to the token stack. In particular, this get be used\n * to put back a token returned from one of the other methods.\n */\n pushToken(token) {\n this.stack.push(token);\n }\n /**\n * Append an array of tokens to the token stack.\n */\n pushTokens(tokens) {\n this.stack.push(...tokens);\n }\n /**\n * Find an macro argument without expanding tokens and append the array of\n * tokens to the token stack. Uses Token as a container for the result.\n */\n scanArgument(isOptional) {\n var start;\n var end;\n var tokens;\n if (isOptional) {\n this.consumeSpaces(); // \\@ifnextchar gobbles any space following it\n if (this.future().text !== \"[\") {\n return null;\n }\n start = this.popToken(); // don't include [ in tokens\n var _this$consumeArg = this.consumeArg([\"]\"]);\n tokens = _this$consumeArg.tokens;\n end = _this$consumeArg.end;\n } else {\n var _this$consumeArg2 = this.consumeArg();\n tokens = _this$consumeArg2.tokens;\n start = _this$consumeArg2.start;\n end = _this$consumeArg2.end;\n }\n // indicate the end of an argument\n this.pushToken(new Token(\"EOF\", end.loc));\n this.pushTokens(tokens);\n return new Token(\"\", SourceLocation.range(start, end));\n }\n /**\n * Consume all following space tokens, without expansion.\n */\n consumeSpaces() {\n for (;;) {\n var token = this.future();\n if (token.text === \" \") {\n this.stack.pop();\n } else {\n break;\n }\n }\n }\n /**\n * Consume an argument from the token stream, and return the resulting array\n * of tokens and start/end token.\n */\n consumeArg(delims) {\n // The argument for a delimited parameter is the shortest (possibly\n // empty) sequence of tokens with properly nested {...} groups that is\n // followed ... by this particular list of non-parameter tokens.\n // The argument for an undelimited parameter is the next nonblank\n // token, unless that token is ‘{’, when the argument will be the\n // entire {...} group that follows.\n var tokens = [];\n var isDelimited = delims && delims.length > 0;\n if (!isDelimited) {\n // Ignore spaces between arguments. As the TeXbook says:\n // \"After you have said ‘\\def\\row#1#2{...}’, you are allowed to\n // put spaces between the arguments (e.g., ‘\\row x n’), because\n // TeX doesn’t use single spaces as undelimited arguments.\"\n this.consumeSpaces();\n }\n var start = this.future();\n var tok;\n var depth = 0;\n var match = 0;\n do {\n tok = this.popToken();\n tokens.push(tok);\n if (tok.text === \"{\") {\n ++depth;\n } else if (tok.text === \"}\") {\n --depth;\n if (depth === -1) {\n throw new ParseError(\"Extra }\", tok);\n }\n } else if (tok.text === \"EOF\") {\n throw new ParseError(\"Unexpected end of input in a macro argument\" + \", expected '\" + (delims && isDelimited ? delims[match] : \"}\") + \"'\", tok);\n }\n if (delims && isDelimited) {\n if ((depth === 0 || depth === 1 && delims[match] === \"{\") && tok.text === delims[match]) {\n ++match;\n if (match === delims.length) {\n // don't include delims in tokens\n tokens.splice(-match, match);\n break;\n }\n } else {\n match = 0;\n }\n }\n } while (depth !== 0 || isDelimited);\n // If the argument found ... has the form ‘{<nested tokens>}’,\n // ... the outermost braces enclosing the argument are removed\n if (start.text === \"{\" && tokens[tokens.length - 1].text === \"}\") {\n tokens.pop();\n tokens.shift();\n }\n tokens.reverse(); // to fit in with stack order\n return {\n tokens,\n start,\n end: tok\n };\n }\n /**\n * Consume the specified number of (delimited) arguments from the token\n * stream and return the resulting array of arguments.\n */\n consumeArgs(numArgs, delimiters) {\n if (delimiters) {\n if (delimiters.length !== numArgs + 1) {\n throw new ParseError(\"The length of delimiters doesn't match the number of args!\");\n }\n var delims = delimiters[0];\n for (var i = 0; i < delims.length; i++) {\n var tok = this.popToken();\n if (delims[i] !== tok.text) {\n throw new ParseError(\"Use of the macro doesn't match its definition\", tok);\n }\n }\n }\n var args = [];\n for (var _i = 0; _i < numArgs; _i++) {\n args.push(this.consumeArg(delimiters && delimiters[_i + 1]).tokens);\n }\n return args;\n }\n /**\n * Increment `expansionCount` by the specified amount.\n * Throw an error if it exceeds `maxExpand`.\n */\n countExpansion(amount) {\n this.expansionCount += amount;\n if (this.expansionCount > this.settings.maxExpand) {\n throw new ParseError(\"Too many expansions: infinite loop or \" + \"need to increase maxExpand setting\");\n }\n }\n /**\n * Expand the next token only once if possible.\n *\n * If the token is expanded, the resulting tokens will be pushed onto\n * the stack in reverse order, and the number of such tokens will be\n * returned. This number might be zero or positive.\n *\n * If not, the return value is `false`, and the next token remains at the\n * top of the stack.\n *\n * In either case, the next token will be on the top of the stack,\n * or the stack will be empty (in case of empty expansion\n * and no other tokens).\n *\n * Used to implement `expandAfterFuture` and `expandNextToken`.\n *\n * If expandableOnly, only expandable tokens are expanded and\n * an undefined control sequence results in an error.\n */\n expandOnce(expandableOnly) {\n var topToken = this.popToken();\n var name = topToken.text;\n var expansion = !topToken.noexpand ? this._getExpansion(name) : null;\n if (expansion == null || expandableOnly && expansion.unexpandable) {\n if (expandableOnly && expansion == null && name[0] === \"\\\\\" && !this.isDefined(name)) {\n throw new ParseError(\"Undefined control sequence: \" + name);\n }\n this.pushToken(topToken);\n return false;\n }\n this.countExpansion(1);\n var tokens = expansion.tokens;\n var args = this.consumeArgs(expansion.numArgs, expansion.delimiters);\n if (expansion.numArgs) {\n // paste arguments in place of the placeholders\n tokens = tokens.slice(); // make a shallow copy\n for (var i = tokens.length - 1; i >= 0; --i) {\n var tok = tokens[i];\n if (tok.text === \"#\") {\n if (i === 0) {\n throw new ParseError(\"Incomplete placeholder at end of macro body\", tok);\n }\n tok = tokens[--i]; // next token on stack\n if (tok.text === \"#\") {\n // ## → #\n tokens.splice(i + 1, 1); // drop first #\n } else if (/^[1-9]$/.test(tok.text)) {\n // replace the placeholder with the indicated argument\n tokens.splice(i, 2, ...args[+tok.text - 1]);\n } else {\n throw new ParseError(\"Not a valid argument number\", tok);\n }\n }\n }\n }\n // Concatenate expansion onto top of stack.\n this.pushTokens(tokens);\n return tokens.length;\n }\n /**\n * Expand the next token only once (if possible), and return the resulting\n * top token on the stack (without removing anything from the stack).\n * Similar in behavior to TeX's `\\expandafter\\futurelet`.\n * Equivalent to expandOnce() followed by future().\n */\n expandAfterFuture() {\n this.expandOnce();\n return this.future();\n }\n /**\n * Recursively expand first token, then return first non-expandable token.\n */\n expandNextToken() {\n for (;;) {\n if (this.expandOnce() === false) {\n // fully expanded\n var token = this.stack.pop();\n // the token after \\noexpand is interpreted as if its meaning\n // were ‘\\relax’\n if (token.treatAsRelax) {\n token.text = \"\\\\relax\";\n }\n return token;\n }\n }\n }\n /**\n * Fully expand the given macro name and return the resulting list of\n * tokens, or return `undefined` if no such macro is defined.\n */\n expandMacro(name) {\n return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined;\n }\n /**\n * Fully expand the given token stream and return the resulting list of\n * tokens. Note that the input tokens are in reverse order, but the\n * output tokens are in forward order.\n */\n expandTokens(tokens) {\n var output = [];\n var oldStackLength = this.stack.length;\n this.pushTokens(tokens);\n while (this.stack.length > oldStackLength) {\n // Expand only expandable tokens\n if (this.expandOnce(true) === false) {\n // fully expanded\n var token = this.stack.pop();\n if (token.treatAsRelax) {\n // the expansion of \\noexpand is the token itself\n token.noexpand = false;\n token.treatAsRelax = false;\n }\n output.push(token);\n }\n }\n // Count all of these tokens as additional expansions, to prevent\n // exponential blowup from linearly many \\edef's.\n this.countExpansion(output.length);\n return output;\n }\n /**\n * Fully expand the given macro name and return the result as a string,\n * or return `undefined` if no such macro is defined.\n */\n expandMacroAsText(name) {\n var tokens = this.expandMacro(name);\n if (tokens) {\n return tokens.map(token => token.text).join(\"\");\n } else {\n return tokens;\n }\n }\n /**\n * Returns the expanded macro as a reversed array of tokens and a macro\n * argument count. Or returns `null` if no such macro.\n */\n _getExpansion(name) {\n var definition = this.macros.get(name);\n if (definition == null) {\n // mainly checking for undefined here\n return definition;\n }\n // If a single character has an associated catcode other than 13\n // (active character), then don't expand it.\n if (name.length === 1) {\n var catcode = this.lexer.catcodes[name];\n if (catcode != null && catcode !== 13) {\n return;\n }\n }\n var expansion = typeof definition === \"function\" ? definition(this) : definition;\n if (typeof expansion === \"string\") {\n var numArgs = 0;\n if (expansion.includes(\"#\")) {\n var stripped = expansion.replace(/##/g, \"\");\n while (stripped.includes(\"#\" + (numArgs + 1))) {\n ++numArgs;\n }\n }\n var bodyLexer = new Lexer(expansion, this.settings);\n var tokens = [];\n var tok = bodyLexer.lex();\n while (tok.text !== \"EOF\") {\n tokens.push(tok);\n tok = bodyLexer.lex();\n }\n tokens.reverse(); // to fit in with stack using push and pop\n var expanded = {\n tokens,\n numArgs\n };\n return expanded;\n }\n return expansion;\n }\n /**\n * Determine whether a command is currently \"defined\" (has some\n * functionality), meaning that it's a macro (in the current group),\n * a function, a symbol, or one of the special commands listed in\n * `implicitCommands`.\n */\n isDefined(name) {\n return this.macros.has(name) || Object.prototype.hasOwnProperty.call(functions, name) || Object.prototype.hasOwnProperty.call(symbols.math, name) || Object.prototype.hasOwnProperty.call(symbols.text, name) || Object.prototype.hasOwnProperty.call(implicitCommands, name);\n }\n /**\n * Determine whether a command is expandable.\n */\n isExpandable(name) {\n var macro = this.macros.get(name);\n if (macro != null) {\n return typeof macro === \"string\" || typeof macro === \"function\" || !macro.unexpandable;\n }\n return Object.prototype.hasOwnProperty.call(functions, name) && !functions[name].primitive;\n }\n}\n\n// Helpers for Parser.js handling of Unicode (sub|super)script characters.\nvar unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;\nvar uSubsAndSups = Object.freeze({\n '₊': '+',\n '₋': '-',\n '₌': '=',\n '₍': '(',\n '₎': ')',\n '₀': '0',\n '₁': '1',\n '₂': '2',\n '₃': '3',\n '₄': '4',\n '₅': '5',\n '₆': '6',\n '₇': '7',\n '₈': '8',\n '₉': '9',\n '\\u2090': 'a',\n '\\u2091': 'e',\n '\\u2095': 'h',\n '\\u1D62': 'i',\n '\\u2C7C': 'j',\n '\\u2096': 'k',\n '\\u2097': 'l',\n '\\u2098': 'm',\n '\\u2099': 'n',\n '\\u2092': 'o',\n '\\u209A': 'p',\n '\\u1D63': 'r',\n '\\u209B': 's',\n '\\u209C': 't',\n '\\u1D64': 'u',\n '\\u1D65': 'v',\n '\\u2093': 'x',\n '\\u1D66': 'β',\n '\\u1D67': 'γ',\n '\\u1D68': 'ρ',\n '\\u1D69': '\\u03d5',\n '\\u1D6A': 'χ',\n '⁺': '+',\n '⁻': '-',\n '⁼': '=',\n '⁽': '(',\n '⁾': ')',\n '⁰': '0',\n '¹': '1',\n '²': '2',\n '³': '3',\n '⁴': '4',\n '⁵': '5',\n '⁶': '6',\n '⁷': '7',\n '⁸': '8',\n '⁹': '9',\n '\\u1D2C': 'A',\n '\\u1D2E': 'B',\n '\\u1D30': 'D',\n '\\u1D31': 'E',\n '\\u1D33': 'G',\n '\\u1D34': 'H',\n '\\u1D35': 'I',\n '\\u1D36': 'J',\n '\\u1D37': 'K',\n '\\u1D38': 'L',\n '\\u1D39': 'M',\n '\\u1D3A': 'N',\n '\\u1D3C': 'O',\n '\\u1D3E': 'P',\n '\\u1D3F': 'R',\n '\\u1D40': 'T',\n '\\u1D41': 'U',\n '\\u2C7D': 'V',\n '\\u1D42': 'W',\n '\\u1D43': 'a',\n '\\u1D47': 'b',\n '\\u1D9C': 'c',\n '\\u1D48': 'd',\n '\\u1D49': 'e',\n '\\u1DA0': 'f',\n '\\u1D4D': 'g',\n '\\u02B0': 'h',\n '\\u2071': 'i',\n '\\u02B2': 'j',\n '\\u1D4F': 'k',\n '\\u02E1': 'l',\n '\\u1D50': 'm',\n '\\u207F': 'n',\n '\\u1D52': 'o',\n '\\u1D56': 'p',\n '\\u02B3': 'r',\n '\\u02E2': 's',\n '\\u1D57': 't',\n '\\u1D58': 'u',\n '\\u1D5B': 'v',\n '\\u02B7': 'w',\n '\\u02E3': 'x',\n '\\u02B8': 'y',\n '\\u1DBB': 'z',\n '\\u1D5D': 'β',\n '\\u1D5E': 'γ',\n '\\u1D5F': 'δ',\n '\\u1D60': '\\u03d5',\n '\\u1D61': 'χ',\n '\\u1DBF': 'θ'\n});\n\n/* eslint no-constant-condition:0 */\n// Pre-evaluate both modules as unicodeSymbols require String.normalize()\nvar unicodeAccents = {\n \"́\": {\n \"text\": \"\\\\'\",\n \"math\": \"\\\\acute\"\n },\n \"̀\": {\n \"text\": \"\\\\`\",\n \"math\": \"\\\\grave\"\n },\n \"̈\": {\n \"text\": \"\\\\\\\"\",\n \"math\": \"\\\\ddot\"\n },\n \"̃\": {\n \"text\": \"\\\\~\",\n \"math\": \"\\\\tilde\"\n },\n \"̄\": {\n \"text\": \"\\\\=\",\n \"math\": \"\\\\bar\"\n },\n \"̆\": {\n \"text\": \"\\\\u\",\n \"math\": \"\\\\breve\"\n },\n \"̌\": {\n \"text\": \"\\\\v\",\n \"math\": \"\\\\check\"\n },\n \"̂\": {\n \"text\": \"\\\\^\",\n \"math\": \"\\\\hat\"\n },\n \"̇\": {\n \"text\": \"\\\\.\",\n \"math\": \"\\\\dot\"\n },\n \"̊\": {\n \"text\": \"\\\\r\",\n \"math\": \"\\\\mathring\"\n },\n \"̋\": {\n \"text\": \"\\\\H\"\n },\n \"̧\": {\n \"text\": \"\\\\c\"\n }\n};\nvar unicodeSymbols = {\n \"á\": \"á\",\n \"à\": \"à\",\n \"ä\": \"ä\",\n \"ǟ\": \"ǟ\",\n \"ã\": \"ã\",\n \"ā\": \"ā\",\n \"ă\": \"ă\",\n \"ắ\": \"ắ\",\n \"ằ\": \"ằ\",\n \"ẵ\": \"ẵ\",\n \"ǎ\": \"ǎ\",\n \"â\": \"â\",\n \"ấ\": \"ấ\",\n \"ầ\": \"ầ\",\n \"ẫ\": \"ẫ\",\n \"ȧ\": \"ȧ\",\n \"ǡ\": \"ǡ\",\n \"å\": \"å\",\n \"ǻ\": \"ǻ\",\n \"ḃ\": \"ḃ\",\n \"ć\": \"ć\",\n \"ḉ\": \"ḉ\",\n \"č\": \"č\",\n \"ĉ\": \"ĉ\",\n \"ċ\": \"ċ\",\n \"ç\": \"ç\",\n \"ď\": \"ď\",\n \"ḋ\": \"ḋ\",\n \"ḑ\": \"ḑ\",\n \"é\": \"é\",\n \"è\": \"è\",\n \"ë\": \"ë\",\n \"ẽ\": \"ẽ\",\n \"ē\": \"ē\",\n \"ḗ\": \"ḗ\",\n \"ḕ\": \"ḕ\",\n \"ĕ\": \"ĕ\",\n \"ḝ\": \"ḝ\",\n \"ě\": \"ě\",\n \"ê\": \"ê\",\n \"ế\": \"ế\",\n \"ề\": \"ề\",\n \"ễ\": \"ễ\",\n \"ė\": \"ė\",\n \"ȩ\": \"ȩ\",\n \"ḟ\": \"ḟ\",\n \"ǵ\": \"ǵ\",\n \"ḡ\": \"ḡ\",\n \"ğ\": \"ğ\",\n \"ǧ\": \"ǧ\",\n \"ĝ\": \"ĝ\",\n \"ġ\": \"ġ\",\n \"ģ\": \"ģ\",\n \"ḧ\": \"ḧ\",\n \"ȟ\": \"ȟ\",\n \"ĥ\": \"ĥ\",\n \"ḣ\": \"ḣ\",\n \"ḩ\": \"ḩ\",\n \"í\": \"í\",\n \"ì\": \"ì\",\n \"ï\": \"ï\",\n \"ḯ\": \"ḯ\",\n \"ĩ\": \"ĩ\",\n \"ī\": \"ī\",\n \"ĭ\": \"ĭ\",\n \"ǐ\": \"ǐ\",\n \"î\": \"î\",\n \"ǰ\": \"ǰ\",\n \"ĵ\": \"ĵ\",\n \"ḱ\": \"ḱ\",\n \"ǩ\": \"ǩ\",\n \"ķ\": \"ķ\",\n \"ĺ\": \"ĺ\",\n \"ľ\": \"ľ\",\n \"ļ\": \"ļ\",\n \"ḿ\": \"ḿ\",\n \"ṁ\": \"ṁ\",\n \"ń\": \"ń\",\n \"ǹ\": \"ǹ\",\n \"ñ\": \"ñ\",\n \"ň\": \"ň\",\n \"ṅ\": \"ṅ\",\n \"ņ\": \"ņ\",\n \"ó\": \"ó\",\n \"ò\": \"ò\",\n \"ö\": \"ö\",\n \"ȫ\": \"ȫ\",\n \"õ\": \"õ\",\n \"ṍ\": \"ṍ\",\n \"ṏ\": \"ṏ\",\n \"ȭ\": \"ȭ\",\n \"ō\": \"ō\",\n \"ṓ\": \"ṓ\",\n \"ṑ\": \"ṑ\",\n \"ŏ\": \"ŏ\",\n \"ǒ\": \"ǒ\",\n \"ô\": \"ô\",\n \"ố\": \"ố\",\n \"ồ\": \"ồ\",\n \"ỗ\": \"ỗ\",\n \"ȯ\": \"ȯ\",\n \"ȱ\": \"ȱ\",\n \"ő\": \"ő\",\n \"ṕ\": \"ṕ\",\n \"ṗ\": \"ṗ\",\n \"ŕ\": \"ŕ\",\n \"ř\": \"ř\",\n \"ṙ\": \"ṙ\",\n \"ŗ\": \"ŗ\",\n \"ś\": \"ś\",\n \"ṥ\": \"ṥ\",\n \"š\": \"š\",\n \"ṧ\": \"ṧ\",\n \"ŝ\": \"ŝ\",\n \"ṡ\": \"ṡ\",\n \"ş\": \"ş\",\n \"ẗ\": \"ẗ\",\n \"ť\": \"ť\",\n \"ṫ\": \"ṫ\",\n \"ţ\": \"ţ\",\n \"ú\": \"ú\",\n \"ù\": \"ù\",\n \"ü\": \"ü\",\n \"ǘ\": \"ǘ\",\n \"ǜ\": \"ǜ\",\n \"ǖ\": \"ǖ\",\n \"ǚ\": \"ǚ\",\n \"ũ\": \"ũ\",\n \"ṹ\": \"ṹ\",\n \"ū\": \"ū\",\n \"ṻ\": \"ṻ\",\n \"ŭ\": \"ŭ\",\n \"ǔ\": \"ǔ\",\n \"û\": \"û\",\n \"ů\": \"ů\",\n \"ű\": \"ű\",\n \"ṽ\": \"ṽ\",\n \"ẃ\": \"ẃ\",\n \"ẁ\": \"ẁ\",\n \"ẅ\": \"ẅ\",\n \"ŵ\": \"ŵ\",\n \"ẇ\": \"ẇ\",\n \"ẘ\": \"ẘ\",\n \"ẍ\": \"ẍ\",\n \"ẋ\": \"ẋ\",\n \"ý\": \"ý\",\n \"ỳ\": \"ỳ\",\n \"ÿ\": \"ÿ\",\n \"ỹ\": \"ỹ\",\n \"ȳ\": \"ȳ\",\n \"ŷ\": \"ŷ\",\n \"ẏ\": \"ẏ\",\n \"ẙ\": \"ẙ\",\n \"ź\": \"ź\",\n \"ž\": \"ž\",\n \"ẑ\": \"ẑ\",\n \"ż\": \"ż\",\n \"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\n \"ὸ\": \"ὸ\",\n \"ύ\": \"ύ\",\n \"ὺ\": \"ὺ\",\n \"ϋ\": \"ϋ\",\n \"ΰ\": \"ΰ\",\n \"ῢ\": \"ῢ\",\n \"ῡ\": \"ῡ\",\n \"ῠ\": \"ῠ\",\n \"ώ\": \"ώ\",\n \"ὼ\": \"ὼ\",\n \"Ύ\": \"Ύ\",\n \"Ὺ\": \"Ὺ\",\n \"Ϋ\": \"Ϋ\",\n \"Ῡ\": \"Ῡ\",\n \"Ῠ\": \"Ῠ\",\n \"Ώ\": \"Ώ\",\n \"Ὼ\": \"Ὼ\"\n};\n/**\n * This file contains the parser used to parse out a TeX expression from the\n * input. Since TeX isn't context-free, standard parsers don't work particularly\n * well.\n *\n * The strategy of this parser is as such:\n *\n * The main functions (the `.parse...` ones) take a position in the current\n * parse string to parse tokens from. The lexer (found in Lexer.js, stored at\n * this.gullet.lexer) also supports pulling out tokens at arbitrary places. When\n * individual tokens are needed at a position, the lexer is called to pull out a\n * token, which is then used.\n *\n * The parser has a property called \"mode\" indicating the mode that\n * the parser is currently in. Currently it has to be one of \"math\" or\n * \"text\", which denotes whether the current environment is a math-y\n * one or a text-y one (e.g. inside \\text). Currently, this serves to\n * limit the functions which can be used in text mode.\n *\n * The main functions then return an object which contains the useful data that\n * was parsed at its given point, and a new position at the end of the parsed\n * data. The main functions can call each other and continue the parsing by\n * using the returned position as a new starting point.\n *\n * There are also extra `.handle...` functions, which pull out some reused\n * functionality into self-contained functions.\n *\n * The functions return ParseNodes.\n */\nclass Parser {\n constructor(input, settings) {\n this.mode = void 0;\n this.gullet = void 0;\n this.settings = void 0;\n this.leftrightDepth = void 0;\n this.nextToken = void 0;\n // Start in math mode\n this.mode = \"math\";\n // Create a new macro expander (gullet) and (indirectly via that) also a\n // new lexer (mouth) for this parser (stomach, in the language of TeX)\n this.gullet = new MacroExpander(input, settings, this.mode);\n // Store the settings for use in parsing\n this.settings = settings;\n // Count leftright depth (for \\middle errors)\n this.leftrightDepth = 0;\n this.nextToken = null;\n }\n /**\n * Checks a result to make sure it has the right type, and throws an\n * appropriate error otherwise.\n */\n expect(text, consume) {\n if (consume === void 0) {\n consume = true;\n }\n if (this.fetch().text !== text) {\n throw new ParseError(\"Expected '\" + text + \"', got '\" + this.fetch().text + \"'\", this.fetch());\n }\n if (consume) {\n this.consume();\n }\n }\n /**\n * Discards the current lookahead token, considering it consumed.\n */\n consume() {\n this.nextToken = null;\n }\n /**\n * Return the current lookahead token, or if there isn't one (at the\n * beginning, or if the previous lookahead token was consume()d),\n * fetch the next token as the new lookahead token and return it.\n */\n fetch() {\n if (this.nextToken == null) {\n this.nextToken = this.gullet.expandNextToken();\n }\n return this.nextToken;\n }\n /**\n * Switches between \"text\" and \"math\" modes.\n */\n switchMode(newMode) {\n this.mode = newMode;\n this.gullet.switchMode(newMode);\n }\n /**\n * Main parsing function, which parses an entire input.\n */\n parse() {\n if (!this.settings.globalGroup) {\n // Create a group namespace for the math expression.\n // (LaTeX creates a new group for every $...$, $$...$$, \\[...\\].)\n this.gullet.beginGroup();\n }\n // Use old \\color behavior (same as LaTeX's \\textcolor) if requested.\n // We do this within the group for the math expression, so it doesn't\n // pollute settings.macros.\n if (this.settings.colorIsTextColor) {\n this.gullet.macros.set(\"\\\\color\", \"\\\\textcolor\");\n }\n try {\n // Try to parse the input\n var parse = this.parseExpression(false);\n // If we succeeded, make sure there's an EOF at the end\n this.expect(\"EOF\");\n // End the group namespace for the expression\n if (!this.settings.globalGroup) {\n this.gullet.endGroup();\n }\n return parse;\n // Close any leftover groups in case of a parse error.\n } finally {\n this.gullet.endGroups();\n }\n }\n /**\n * Fully parse a separate sequence of tokens as a separate job.\n * Tokens should be specified in reverse order, as in a MacroDefinition.\n */\n subparse(tokens) {\n // Save the next token from the current job.\n var oldToken = this.nextToken;\n this.consume();\n // Run the new job, terminating it with an excess '}'\n this.gullet.pushToken(new Token(\"}\"));\n this.gullet.pushTokens(tokens);\n var parse = this.parseExpression(false);\n this.expect(\"}\");\n // Restore the next token from the current job.\n this.nextToken = oldToken;\n return parse;\n }\n /**\n * Parses an \"expression\", which is a list of atoms.\n *\n * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This\n * happens when functions have higher precedence than infix\n * nodes in implicit parses.\n *\n * `breakOnTokenText`: The text of the token that the expression should end\n * with, or `null` if something else should end the\n * expression.\n */\n parseExpression(breakOnInfix, breakOnTokenText) {\n var body = [];\n // Keep adding atoms to the body until we can't parse any more atoms (either\n // we reached the end, a }, or a \\right)\n while (true) {\n // Ignore spaces in math mode\n if (this.mode === \"math\") {\n this.consumeSpaces();\n }\n var lex = this.fetch();\n if (Parser.endOfExpression.has(lex.text)) {\n break;\n }\n if (breakOnTokenText && lex.text === breakOnTokenText) {\n break;\n }\n if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {\n break;\n }\n var atom = this.parseAtom(breakOnTokenText);\n if (!atom) {\n break;\n } else if (atom.type === \"internal\") {\n // Internal nodes do not appear in parse tree\n continue;\n }\n body.push(atom);\n }\n if (this.mode === \"text\") {\n this.formLigatures(body);\n }\n return this.handleInfixNodes(body);\n }\n /**\n * Rewrites infix operators such as \\over with corresponding commands such\n * as \\frac.\n *\n * There can only be one infix operator per group. If there's more than one\n * then the expression is ambiguous. This can be resolved by adding {}.\n */\n handleInfixNodes(body) {\n var overIndex = -1;\n var funcName;\n for (var i = 0; i < body.length; i++) {\n var node = body[i];\n if (node.type === \"infix\") {\n if (overIndex !== -1) {\n throw new ParseError(\"only one infix operator per group\", node.token);\n }\n overIndex = i;\n funcName = node.replaceWith;\n }\n }\n if (overIndex !== -1 && funcName) {\n var numerNode;\n var denomNode;\n var numerBody = body.slice(0, overIndex);\n var denomBody = body.slice(overIndex + 1);\n if (numerBody.length === 1 && numerBody[0].type === \"ordgroup\") {\n numerNode = numerBody[0];\n } else {\n numerNode = {\n type: \"ordgroup\",\n mode: this.mode,\n body: numerBody\n };\n }\n if (denomBody.length === 1 && denomBody[0].type === \"ordgroup\") {\n denomNode = denomBody[0];\n } else {\n denomNode = {\n type: \"ordgroup\",\n mode: this.mode,\n body: denomBody\n };\n }\n var _node;\n if (funcName === \"\\\\\\\\abovefrac\") {\n _node = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []);\n } else {\n _node = this.callFunction(funcName, [numerNode, denomNode], []);\n }\n return [_node];\n } else {\n return body;\n }\n }\n /**\n * Handle a subscript or superscript with nice errors.\n */\n handleSupSubscript(name) {\n var symbolToken = this.fetch();\n var symbol = symbolToken.text;\n this.consume();\n this.consumeSpaces(); // ignore spaces before sup/subscript argument\n // Skip over allowed internal nodes such as \\relax\n var group;\n do {\n var _group;\n group = this.parseGroup(name);\n } while (((_group = group) == null ? void 0 : _group.type) === \"internal\");\n if (!group) {\n throw new ParseError(\"Expected group after '\" + symbol + \"'\", symbolToken);\n }\n return group;\n }\n /**\n * Converts the textual input of an unsupported command into a text node\n * contained within a color node whose color is determined by errorColor\n */\n formatUnsupportedCmd(text) {\n var textordArray = [];\n for (var i = 0; i < text.length; i++) {\n textordArray.push({\n type: \"textord\",\n mode: \"text\",\n text: text[i]\n });\n }\n var textNode = {\n type: \"text\",\n mode: this.mode,\n body: textordArray\n };\n var colorNode = {\n type: \"color\",\n mode: this.mode,\n color: this.settings.errorColor,\n body: [textNode]\n };\n return colorNode;\n }\n /**\n * Parses a group with optional super/subscripts.\n */\n parseAtom(breakOnTokenText) {\n // The body of an atom is an implicit group, so that things like\n // \\left(x\\right)^2 work correctly.\n var base = this.parseGroup(\"atom\", breakOnTokenText);\n // Internal nodes (e.g. \\relax) cannot support super/subscripts.\n // Instead, we will pick up super/subscripts with blank base next round.\n if ((base == null ? void 0 : base.type) === \"internal\") {\n return base;\n }\n // In text mode, we don't have superscripts or subscripts\n if (this.mode === \"text\") {\n return base;\n }\n var superscript;\n var subscript;\n while (true) {\n // Guaranteed in math mode, so eat any spaces first.\n this.consumeSpaces();\n // Lex the first token\n var lex = this.fetch();\n if (lex.text === \"\\\\limits\" || lex.text === \"\\\\nolimits\") {\n // We got a limit control\n if (base && base.type === \"op\") {\n base.limits = lex.text === \"\\\\limits\";\n base.alwaysHandleSupSub = true;\n } else if (base && base.type === \"operatorname\") {\n if (base.alwaysHandleSupSub) {\n base.limits = lex.text === \"\\\\limits\";\n }\n } else {\n throw new ParseError(\"Limit controls must follow a math operator\", lex);\n }\n this.consume();\n } else if (lex.text === \"^\") {\n // We got a superscript start\n if (superscript) {\n throw new ParseError(\"Double superscript\", lex);\n }\n superscript = this.handleSupSubscript(\"superscript\");\n } else if (lex.text === \"_\") {\n // We got a subscript start\n if (subscript) {\n throw new ParseError(\"Double subscript\", lex);\n }\n subscript = this.handleSupSubscript(\"subscript\");\n } else if (lex.text === \"'\") {\n // We got a prime\n if (superscript) {\n throw new ParseError(\"Double superscript\", lex);\n }\n var prime = {\n type: \"textord\",\n mode: this.mode,\n text: \"\\\\prime\"\n };\n // Many primes can be grouped together, so we handle this here\n var primes = [prime];\n this.consume();\n // Keep lexing tokens until we get something that's not a prime\n while (this.fetch().text === \"'\") {\n // For each one, add another prime to the list\n primes.push(prime);\n this.consume();\n }\n // If there's a superscript following the primes, combine that\n // superscript in with the primes.\n if (this.fetch().text === \"^\") {\n primes.push(this.handleSupSubscript(\"superscript\"));\n }\n // Put everything into an ordgroup as the superscript\n superscript = {\n type: \"ordgroup\",\n mode: this.mode,\n body: primes\n };\n } else if (uSubsAndSups[lex.text]) {\n // A Unicode subscript or superscript character.\n // We treat these similarly to the unicode-math package.\n // So we render a string of Unicode (sub|super)scripts the\n // same as a (sub|super)script of regular characters.\n var isSub = unicodeSubRegEx.test(lex.text);\n var subsupTokens = [];\n subsupTokens.push(new Token(uSubsAndSups[lex.text]));\n this.consume();\n // Continue fetching tokens to fill out the string.\n while (true) {\n var token = this.fetch().text;\n if (!uSubsAndSups[token]) {\n break;\n }\n if (unicodeSubRegEx.test(token) !== isSub) {\n break;\n }\n subsupTokens.unshift(new Token(uSubsAndSups[token]));\n this.consume();\n }\n // Now create a (sub|super)script.\n var body = this.subparse(subsupTokens);\n if (isSub) {\n subscript = {\n type: \"ordgroup\",\n mode: \"math\",\n body\n };\n } else {\n superscript = {\n type: \"ordgroup\",\n mode: \"math\",\n body\n };\n }\n } else {\n // If it wasn't ^, _, or ', stop parsing super/subscripts\n break;\n }\n }\n // Base must be set if superscript or subscript are set per logic above,\n // but need to check here for type check to pass.\n if (superscript && subscript) {\n return {\n type: \"supsub\",\n mode: this.mode,\n base,\n sup: superscript,\n sub: subscript\n };\n } else if (superscript) {\n return {\n type: \"supsub\",\n mode: this.mode,\n base,\n sup: superscript\n };\n } else if (subscript) {\n return {\n type: \"supsub\",\n mode: this.mode,\n base,\n sub: subscript\n };\n } else {\n // Otherwise return the original body\n return base;\n }\n }\n /**\n * Parses an entire function, including its base and all of its arguments.\n */\n parseFunction(breakOnTokenText, name) {\n var token = this.fetch();\n var func = token.text;\n var funcData = functions[func];\n if (!funcData) {\n return null;\n }\n this.consume(); // consume command token\n if (name && name !== \"atom\" && !funcData.allowedInArgument) {\n throw new ParseError(\"Got function '\" + func + \"' with no arguments\" + (name ? \" as \" + name : \"\"), token);\n // Treat undefined allowedInText as false.\n } else if (this.mode === \"text\" && !funcData.allowedInText) {\n throw new ParseError(\"Can't use function '\" + func + \"' in text mode\", token);\n // Treat undefined allowedInMath as true.\n } else if (this.mode === \"math\" && funcData.allowedInMath === false) {\n throw new ParseError(\"Can't use function '\" + func + \"' in math mode\", token);\n }\n var _this$parseArguments = this.parseArguments(func, funcData),\n args = _this$parseArguments.args,\n optArgs = _this$parseArguments.optArgs;\n return this.callFunction(func, args, optArgs, token, breakOnTokenText);\n }\n /**\n * Call a function handler with a suitable context and arguments.\n */\n callFunction(name, args, optArgs, token, breakOnTokenText) {\n var context = {\n funcName: name,\n parser: this,\n token,\n breakOnTokenText\n };\n var func = functions[name];\n if (func && func.handler) {\n return func.handler(context, args, optArgs);\n } else {\n throw new ParseError(\"No function handler for \" + name);\n }\n }\n /**\n * Parses the arguments of a function or environment\n */\n parseArguments(func,\n // Should look like \"\\name\" or \"\\begin{name}\".\n funcData) {\n var _funcData$numOptional;\n var numOptionalArgs = (_funcData$numOptional = funcData.numOptionalArgs) != null ? _funcData$numOptional : 0;\n var totalArgs = funcData.numArgs + numOptionalArgs;\n if (totalArgs === 0) {\n return {\n args: [],\n optArgs: []\n };\n }\n var args = [];\n var optArgs = [];\n for (var i = 0; i < totalArgs; i++) {\n var _funcData$argTypes;\n var argType = (_funcData$argTypes = funcData.argTypes) == null ? void 0 : _funcData$argTypes[i];\n var isOptional = i < numOptionalArgs;\n if (\"primitive\" in funcData && funcData.primitive && argType == null ||\n // \\sqrt expands into primitive if optional argument doesn't exist\n funcData.type === \"sqrt\" && i === 1 && optArgs[0] == null) {\n argType = \"primitive\";\n }\n var arg = this.parseGroupOfType(\"argument to '\" + func + \"'\", argType, isOptional);\n if (isOptional) {\n optArgs.push(arg);\n } else if (arg != null) {\n args.push(arg);\n } else {\n // should be unreachable\n throw new ParseError(\"Null argument, please report this as a bug\");\n }\n }\n return {\n args,\n optArgs\n };\n }\n /**\n * Parses a group when the mode is changing.\n */\n parseGroupOfType(name, type, optional) {\n switch (type) {\n case \"color\":\n return this.parseColorGroup(optional);\n case \"size\":\n return this.parseSizeGroup(optional);\n case \"url\":\n return this.parseUrlGroup(optional);\n case \"math\":\n case \"text\":\n return this.parseArgumentGroup(optional, type);\n case \"hbox\":\n {\n // hbox argument type wraps the argument in the equivalent of\n // \\hbox, which is like \\text but switching to \\textstyle size\n // and resetting math font.\n var group = this.parseArgumentGroup(optional, \"text\");\n return group != null ? {\n type: \"styling\",\n mode: group.mode,\n body: [group],\n style: \"text\",\n // simulate \\textstyle\n resetFont: true\n } : null;\n }\n case \"raw\":\n {\n // Skip spaces and comments up to the opening brace while % is still a comment\n this.gullet.consumeSpaces();\n var percentCatcode = this.gullet.lexer.catcodes[\"%\"];\n this.gullet.lexer.setCatcode(\"%\", 12); // other character\n var token = this.parseStringGroup(optional);\n this.gullet.lexer.setCatcode(\"%\", percentCatcode);\n return token != null ? {\n type: \"raw\",\n mode: \"text\",\n string: token.text\n } : null;\n }\n case \"primitive\":\n {\n if (optional) {\n throw new ParseError(\"A primitive argument cannot be optional\");\n }\n var _group2 = this.parseGroup(name);\n if (_group2 == null) {\n throw new ParseError(\"Expected group as \" + name, this.fetch());\n }\n return _group2;\n }\n case \"original\":\n case undefined:\n return this.parseArgumentGroup(optional);\n default:\n throw new ParseError(\"Unknown group type as \" + name, this.fetch());\n }\n }\n /**\n * Discard any space tokens, fetching the next non-space token.\n */\n consumeSpaces() {\n while (this.fetch().text === \" \") {\n this.consume();\n }\n }\n /**\n * Parses a group, essentially returning the string formed by the\n * brace-enclosed tokens plus some position information.\n */\n parseStringGroup(optional) {\n var argToken = this.gullet.scanArgument(optional);\n if (argToken == null) {\n return null;\n }\n var str = \"\";\n var nextToken;\n while ((nextToken = this.fetch()).text !== \"EOF\") {\n str += nextToken.text;\n this.consume();\n }\n this.consume(); // consume the end of the argument\n argToken.text = str;\n return argToken;\n }\n /**\n * Parses a regex-delimited group: the largest sequence of tokens\n * whose concatenated strings match `regex`. Returns the string\n * formed by the tokens plus some position information.\n */\n parseRegexGroup(regex, modeName) {\n var firstToken = this.fetch();\n var lastToken = firstToken;\n var str = \"\";\n var nextToken;\n while ((nextToken = this.fetch()).text !== \"EOF\" && regex.test(str + nextToken.text)) {\n lastToken = nextToken;\n str += lastToken.text;\n this.consume();\n }\n if (str === \"\") {\n throw new ParseError(\"Invalid \" + modeName + \": '\" + firstToken.text + \"'\", firstToken);\n }\n return firstToken.range(lastToken, str);\n }\n /**\n * Parses a color description.\n */\n parseColorGroup(optional) {\n var res = this.parseStringGroup(optional);\n if (res == null) {\n return null;\n }\n var match = /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);\n if (!match) {\n throw new ParseError(\"Invalid color: '\" + res.text + \"'\", res);\n }\n var color = match[0];\n if (/^[0-9a-f]{6}$/i.test(color)) {\n // We allow a 6-digit HTML color spec without a leading \"#\".\n // This follows the xcolor package's HTML color model.\n // Predefined color names are all missed by this RegEx pattern.\n color = \"#\" + color;\n }\n return {\n type: \"color-token\",\n mode: this.mode,\n color\n };\n }\n /**\n * Parses a size specification, consisting of magnitude and unit.\n */\n parseSizeGroup(optional) {\n var res;\n var isBlank = false;\n // don't expand before parseStringGroup\n this.gullet.consumeSpaces();\n if (!optional && this.gullet.future().text !== \"{\") {\n res = this.parseRegexGroup(/^[-+]? *(?:$|\\d+|\\d+\\.\\d*|\\.\\d*) *[a-z]{0,2} *$/, \"size\");\n } else {\n res = this.parseStringGroup(optional);\n }\n if (!res) {\n return null;\n }\n if (!optional && res.text.length === 0) {\n // Because we've tested for what is !optional, this block won't\n // affect \\kern, \\hspace, etc. It will capture the mandatory arguments\n // to \\genfrac and \\above.\n res.text = \"0pt\"; // Enable \\above{}\n isBlank = true; // This is here specifically for \\genfrac\n }\n var match = /([-+]?) *(\\d+(?:\\.\\d*)?|\\.\\d+) *([a-z]{2})/.exec(res.text);\n if (!match) {\n throw new ParseError(\"Invalid size: '\" + res.text + \"'\", res);\n }\n var data = {\n number: +(match[1] + match[2]),\n // sign + magnitude, cast to number\n unit: match[3]\n };\n if (!validUnit(data)) {\n throw new ParseError(\"Invalid unit: '\" + data.unit + \"'\", res);\n }\n return {\n type: \"size\",\n mode: this.mode,\n value: data,\n isBlank\n };\n }\n /**\n * Parses an URL, checking escaped letters and allowed protocols,\n * and setting the catcode of % as an active character (as in \\hyperref).\n */\n parseUrlGroup(optional) {\n var percentCatcode = this.gullet.lexer.catcodes[\"%\"];\n var tildeCatcode = this.gullet.lexer.catcodes[\"~\"];\n this.gullet.lexer.setCatcode(\"%\", 13); // active character\n this.gullet.lexer.setCatcode(\"~\", 12); // other character\n var res = this.parseStringGroup(optional);\n this.gullet.lexer.setCatcode(\"%\", percentCatcode);\n this.gullet.lexer.setCatcode(\"~\", tildeCatcode);\n if (res == null) {\n return null;\n }\n // hyperref package allows backslashes alone in href, but doesn't\n // generate valid links in such cases; we interpret this as\n // \"undefined\" behaviour, and keep them as-is. Some browser will\n // replace backslashes with forward slashes.\n var url = res.text.replace(/\\\\([#$%&~_^{}])/g, '$1');\n return {\n type: \"url\",\n mode: this.mode,\n url\n };\n }\n /**\n * Parses an argument with the mode specified.\n */\n parseArgumentGroup(optional, mode) {\n var argToken = this.gullet.scanArgument(optional);\n if (argToken == null) {\n return null;\n }\n var outerMode = this.mode;\n if (mode) {\n // Switch to specified mode\n this.switchMode(mode);\n }\n this.gullet.beginGroup();\n var expression = this.parseExpression(false, \"EOF\");\n // TODO: find an alternative way to denote the end\n this.expect(\"EOF\"); // expect the end of the argument\n this.gullet.endGroup();\n var result = {\n type: \"ordgroup\",\n mode: this.mode,\n loc: argToken.loc,\n body: expression\n };\n if (mode) {\n // Switch mode back\n this.switchMode(outerMode);\n }\n return result;\n }\n /**\n * Parses an ordinary group, which is either a single nucleus (like \"x\")\n * or an expression in braces (like \"{x+y}\") or an implicit group, a group\n * that starts at the current position, and ends right before a higher explicit\n * group ends, or at EOF.\n */\n parseGroup(name,\n // For error reporting.\n breakOnTokenText) {\n var firstToken = this.fetch();\n var text = firstToken.text;\n var result;\n // Try to parse an open brace or \\begingroup\n if (text === \"{\" || text === \"\\\\begingroup\") {\n this.consume();\n var groupEnd = text === \"{\" ? \"}\" : \"\\\\endgroup\";\n this.gullet.beginGroup();\n // If we get a brace, parse an expression\n var expression = this.parseExpression(false, groupEnd);\n var lastToken = this.fetch();\n this.expect(groupEnd); // Check that we got a matching closing brace\n this.gullet.endGroup();\n result = {\n type: \"ordgroup\",\n mode: this.mode,\n loc: SourceLocation.range(firstToken, lastToken),\n body: expression,\n // A group formed by \\begingroup...\\endgroup is a semi-simple group\n // which doesn't affect spacing in math mode, i.e., is transparent.\n // https://tex.stackexchange.com/questions/1930/when-should-one-\n // use-begingroup-instead-of-bgroup\n semisimple: text === \"\\\\begingroup\" || undefined\n };\n } else {\n // If there exists a function with this name, parse the function.\n // Otherwise, just return a nucleus\n result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();\n if (result == null && text[0] === \"\\\\\" && !Object.prototype.hasOwnProperty.call(implicitCommands, text)) {\n if (this.settings.throwOnError) {\n throw new ParseError(\"Undefined control sequence: \" + text, firstToken);\n }\n result = this.formatUnsupportedCmd(text);\n this.consume();\n }\n }\n return result;\n }\n /**\n * Form ligature-like combinations of characters for text mode.\n * This includes inputs like \"--\", \"---\", \"``\" and \"''\".\n * The result will simply replace multiple textord nodes with a single\n * character in each value by a single textord node having multiple\n * characters in its value. The representation is still ASCII source.\n * The group will be modified in place.\n */\n formLigatures(group) {\n var n = group.length - 1;\n for (var i = 0; i < n; ++i) {\n var a = group[i];\n if (a.type !== \"textord\") {\n continue;\n }\n var v = a.text;\n var next = group[i + 1];\n if (!next || next.type !== \"textord\") {\n continue;\n }\n if (v === \"-\" && next.text === \"-\") {\n var afterNext = group[i + 2];\n if (i + 1 < n && afterNext && afterNext.type === \"textord\" && afterNext.text === \"-\") {\n group.splice(i, 3, {\n type: \"textord\",\n mode: \"text\",\n loc: SourceLocation.range(a, afterNext),\n text: \"---\"\n });\n n -= 2;\n } else {\n group.splice(i, 2, {\n type: \"textord\",\n mode: \"text\",\n loc: SourceLocation.range(a, next),\n text: \"--\"\n });\n n -= 1;\n }\n }\n if ((v === \"'\" || v === \"`\") && next.text === v) {\n group.splice(i, 2, {\n type: \"textord\",\n mode: \"text\",\n loc: SourceLocation.range(a, next),\n text: v + v\n });\n n -= 1;\n }\n }\n }\n /**\n * Parse a single symbol out of the string. Here, we handle single character\n * symbols and special functions like \\verb.\n */\n parseSymbol() {\n var nucleus = this.fetch();\n var text = nucleus.text;\n if (/^\\\\verb[^a-zA-Z]/.test(text)) {\n this.consume();\n var arg = text.slice(5);\n var star = arg.charAt(0) === \"*\";\n if (star) {\n arg = arg.slice(1);\n }\n // Lexer's tokenRegex is constructed to always have matching\n // first/last characters.\n if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {\n throw new ParseError(\"\\\\verb assertion failed --\\n please report what input caused this bug\");\n }\n arg = arg.slice(1, -1); // remove first and last char\n return {\n type: \"verb\",\n mode: \"text\",\n body: arg,\n star\n };\n }\n // At this point, we should have a symbol, possibly with accents.\n // First expand any accented base symbol according to unicodeSymbols.\n if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text[0]) && !symbols[this.mode][text[0]]) {\n // This behavior is not strict (XeTeX-compatible) in math mode.\n if (this.settings.strict && this.mode === \"math\") {\n handleStrict({\n strict: this.settings.strict,\n errorCode: \"unicodeTextInMathMode\",\n errorMsg: \"Accented Unicode text character \\\"\" + text[0] + \"\\\" used in math mode\",\n report: true,\n token: nucleus\n });\n }\n text = unicodeSymbols[text[0]] + text.slice(1);\n }\n // Strip off any combining characters\n var match = combiningDiacriticalMarksEndRegex.exec(text);\n if (match) {\n text = text.substring(0, match.index);\n if (text === 'i') {\n text = '\\u0131'; // dotless i, in math and text mode\n } else if (text === 'j') {\n text = '\\u0237'; // dotless j, in math and text mode\n }\n }\n // Recognize base symbol\n var symbol;\n if (symbols[this.mode][text]) {\n if (this.settings.strict && this.mode === 'math' && extraLatin.includes(text)) {\n handleStrict({\n strict: this.settings.strict,\n errorCode: \"unicodeTextInMathMode\",\n errorMsg: \"Latin-1/Unicode text character \\\"\" + text[0] + \"\\\" used in math mode\",\n report: true,\n token: nucleus\n });\n }\n var group = symbols[this.mode][text].group;\n var loc = SourceLocation.range(nucleus);\n var s;\n if (isAtom(group)) {\n s = {\n type: \"atom\",\n mode: this.mode,\n family: group,\n loc,\n text\n };\n } else {\n s = {\n type: group,\n mode: this.mode,\n loc,\n text\n };\n }\n symbol = s;\n } else if (text.charCodeAt(0) >= 0x80) {\n // no symbol for e.g. ^\n if (this.settings.strict) {\n if (!supportedCodepoint(text.charCodeAt(0))) {\n handleStrict({\n strict: this.settings.strict,\n errorCode: \"unknownSymbol\",\n errorMsg: \"Unrecognized Unicode character \\\"\" + text[0] + \"\\\"\" + (\" (\" + text.charCodeAt(0) + \")\"),\n report: true,\n token: nucleus\n });\n } else if (this.mode === \"math\") {\n handleStrict({\n strict: this.settings.strict,\n errorCode: \"unicodeTextInMathMode\",\n errorMsg: \"Unicode text character \\\"\" + text[0] + \"\\\" used in math mode\",\n report: true,\n token: nucleus\n });\n }\n }\n // All nonmathematical Unicode characters are rendered as if they\n // are in text mode (wrapped in \\text) because that's what it\n // takes to render them in LaTeX. Setting `mode: this.mode` is\n // another natural choice (the user requested math mode), but\n // this makes it more difficult for getCharacterMetrics() to\n // distinguish Unicode characters without metrics and those for\n // which we want to simulate the letter M.\n symbol = {\n type: \"textord\",\n mode: \"text\",\n loc: SourceLocation.range(nucleus),\n text\n };\n } else {\n return null; // EOF, ^, _, {, }, etc.\n }\n this.consume();\n // Transform combining characters into accents\n if (match) {\n for (var i = 0; i < match[0].length; i++) {\n var accent = match[0][i];\n if (!unicodeAccents[accent]) {\n throw new ParseError(\"Unknown accent ' \" + accent + \"'\", nucleus);\n }\n var command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text;\n if (!command) {\n throw new ParseError(\"Accent \" + accent + \" unsupported in \" + this.mode + \" mode\", nucleus);\n }\n symbol = {\n type: \"accent\",\n mode: this.mode,\n loc: SourceLocation.range(nucleus),\n label: command,\n isStretchy: false,\n isShifty: true,\n base: symbol\n };\n }\n }\n return symbol;\n }\n}\nParser.endOfExpression = new Set([\"}\", \"\\\\endgroup\", \"\\\\end\", \"\\\\right\", \"&\"]);\n\n/**\n * Parses an expression using a Parser, then returns the parsed result.\n */\nvar parseTree = function parseTree(toParse, settings) {\n if (!(typeof toParse === 'string' || toParse instanceof String)) {\n throw new TypeError('KaTeX can only parse string typed expression');\n }\n var parser = new Parser(toParse, settings);\n // Blank out any \\df@tag to avoid spurious \"Duplicate \\tag\" errors\n delete parser.gullet.macros.current[\"\\\\df@tag\"];\n var tree = parser.parse();\n // Prevent a color definition from persisting between calls to katex.render().\n delete parser.gullet.macros.current[\"\\\\current@color\"];\n delete parser.gullet.macros.current[\"\\\\color\"];\n // If the input used \\tag, it will set the \\df@tag macro to the tag.\n // In this case, we separately parse the tag and wrap the tree.\n if (parser.gullet.macros.get(\"\\\\df@tag\")) {\n if (!settings.displayMode) {\n throw new ParseError(\"\\\\tag works only in display equations\");\n }\n tree = [{\n type: \"tag\",\n mode: \"text\",\n body: tree,\n tag: parser.subparse([new Token(\"\\\\df@tag\")])\n }];\n }\n return tree;\n};\n\n/* eslint no-console:0 */\n/**\n * Parse and build an expression, and place that expression in the DOM node\n * given.\n */\nvar render = function render(expression, baseNode, options) {\n baseNode.textContent = \"\";\n var node = renderToDomTree(expression, options).toNode();\n baseNode.appendChild(node);\n};\n// KaTeX's styles don't work properly in quirks mode. Print out an error, and\n// disable rendering.\nif (typeof document !== \"undefined\") {\n if (document.compatMode !== \"CSS1Compat\") {\n typeof console !== \"undefined\" && console.warn(\"Warning: KaTeX doesn't work in quirks mode. Make sure your \" + \"website has a suitable doctype.\");\n render = function render() {\n throw new ParseError(\"KaTeX doesn't work in quirks mode.\");\n };\n }\n}\n/**\n * Parse and build an expression, and return the markup for that.\n */\nvar renderToString = function renderToString(expression, options) {\n var markup = renderToDomTree(expression, options).toMarkup();\n return markup;\n};\n/**\n * Parse an expression and return the parse tree.\n */\nvar generateParseTree = function generateParseTree(expression, options) {\n var settings = new Settings(options);\n return parseTree(expression, settings);\n};\n/**\n * If the given error is a KaTeX ParseError and options.throwOnError is false,\n * renders the invalid LaTeX as a span with hover title giving the KaTeX\n * error message. Otherwise, simply throws the error.\n */\nvar renderError = function renderError(error, expression, options) {\n if (options.throwOnError || !(error instanceof ParseError)) {\n throw error;\n }\n var node = makeSpan([\"katex-error\"], [new SymbolNode(expression)]);\n node.setAttribute(\"title\", error.toString());\n node.setAttribute(\"style\", \"color:\" + options.errorColor);\n return node;\n};\n/**\n * Generates and returns the katex build tree. This is used for advanced\n * use cases (like rendering to custom output).\n */\nvar renderToDomTree = function renderToDomTree(expression, options) {\n var settings = new Settings(options);\n try {\n var tree = parseTree(expression, settings);\n return buildTree(tree, expression, settings);\n } catch (error) {\n return renderError(error, expression, settings);\n }\n};\n/**\n * Generates and returns the katex build tree, with just HTML (no MathML).\n * This is used for advanced use cases (like rendering to custom output).\n */\nvar renderToHTMLTree = function renderToHTMLTree(expression, options) {\n var settings = new Settings(options);\n try {\n var tree = parseTree(expression, settings);\n return buildHTMLTree(tree, settings);\n } catch (error) {\n return renderError(error, expression, settings);\n }\n};\nvar version = \"0.19.1\";\nvar __domTree = {\n Span,\n Anchor,\n SymbolNode,\n SvgNode,\n PathNode,\n LineNode\n};\n// CJS exports and ESM default export\nvar katex = {\n /**\n * Current KaTeX version\n */\n version,\n /**\n * Renders the given LaTeX into an HTML+MathML combination, and adds\n * it as a child to the specified DOM node.\n */\n render,\n /**\n * Renders the given LaTeX into an HTML+MathML combination string,\n * for sending to the client.\n */\n renderToString,\n /**\n * KaTeX error, usually during parsing.\n */\n ParseError,\n /**\n * The schema of Settings\n */\n SETTINGS_SCHEMA,\n /**\n * Parses the given LaTeX into KaTeX's internal parse tree structure,\n * without rendering to HTML or MathML.\n *\n * NOTE: This method is not currently recommended for public use.\n * The internal tree representation is unstable and is very likely\n * to change. Use at your own risk.\n */\n __parse: generateParseTree,\n /**\n * Renders the given LaTeX into an HTML+MathML internal DOM tree\n * representation, without flattening that representation to a string.\n *\n * NOTE: This method is not currently recommended for public use.\n * The internal tree representation is unstable and is very likely\n * to change. Use at your own risk.\n */\n __renderToDomTree: renderToDomTree,\n /**\n * Renders the given LaTeX into an HTML internal DOM tree representation,\n * without MathML and without flattening that representation to a string.\n *\n * NOTE: This method is not currently recommended for public use.\n * The internal tree representation is unstable and is very likely\n * to change. Use at your own risk.\n */\n __renderToHTMLTree: renderToHTMLTree,\n /**\n * extends internal font metrics object with a new object\n * each key in the new object represents a font name\n */\n __setFontMetrics: setFontMetrics,\n /**\n * adds a new symbol to builtin symbols table\n */\n __defineSymbol: defineSymbol,\n /**\n * adds a new function to builtin function list,\n * which directly produce parse tree elements\n * and have their own html/mathml builders\n */\n __defineFunction: defineFunction,\n /**\n * adds a new macro to builtin macro list\n */\n __defineMacro: defineMacro,\n /**\n * Expose the dom tree node types, which can be useful for type checking nodes.\n *\n * NOTE: These methods are not currently recommended for public use.\n * The internal tree representation is unstable and is very likely\n * to change. Use at your own risk.\n */\n __domTree\n};\n\nexport { ParseError, SETTINGS_SCHEMA, defineFunction as __defineFunction, defineMacro as __defineMacro, defineSymbol as __defineSymbol, __domTree, generateParseTree as __parse, renderToDomTree as __renderToDomTree, renderToHTMLTree as __renderToHTMLTree, setFontMetrics as __setFontMetrics, katex as default, render, renderToString, version };\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/**\n * TeX-to-React via KaTeX, replicating the rehype-katex pipeline this renderer\n * replaced: the same three-arm error chain (strict render, `strict: 'ignore'`\n * retry, error span) and a DOM-identical element tree, so settled math keeps\n * its exact markup. KaTeX emits an HTML string; the browser's own HTML parser\n * (`DOMParser`, applying the spec's SVG/MathML foreign-content attribute\n * adjustments KaTeX output relies on) turns it into a tree this module maps\n * onto React elements — KaTeX output is a static span/MathML/SVG vocabulary\n * with no raw user HTML, the same trust shiki's tree gets in CodeBlock.\n *\n * React 18 has no MathML support, so the `.katex-mathml` subtree's elements\n * land in the HTML namespace — exactly as they did under the replaced\n * hast-util-to-jsx-runtime pipeline. The visual arm is the `.katex-html`\n * span tree; the MathML arm serves assistive technology, which reads it by\n * tag name regardless of namespace.\n */\n\nimport { createElement } from 'react'\nimport type { CSSProperties, ReactNode } from 'react'\nimport katex from 'katex'\n\n/**\n * Convert one inline `style` attribute string into React's style object.\n * KaTeX emits only plain kebab-case declarations (no custom properties and no\n * nameless declarations), so camel-casing the property is the whole mapping.\n */\nfunction styleObject(css: string): CSSProperties {\n const style: Record<string, string> = {}\n for (const declaration of css.split(';')) {\n const colon = declaration.indexOf(':')\n if (colon === -1) continue\n const name = declaration.slice(0, colon).trim()\n const key = name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase())\n style[key] = declaration.slice(colon + 1).trim()\n }\n return style\n}\n\n/** Map one parsed DOM node onto a React element (text nodes pass through). */\nfunction domToReact(node: ChildNode, key: number): ReactNode {\n if (node.nodeType === Node.TEXT_NODE) return node.textContent\n /* v8 ignore next 2 -- KaTeX output holds only elements and text; other\n node kinds cannot appear in its serialized vocabulary. */\n if (node.nodeType !== Node.ELEMENT_NODE) return null\n const element = node as Element\n const props: Record<string, unknown> = { key }\n for (const attribute of element.attributes) {\n if (attribute.name === 'class') props['className'] = attribute.value\n else if (attribute.name === 'style') props['style'] = styleObject(attribute.value)\n else props[attribute.name] = attribute.value\n }\n const children = [...element.childNodes].map(domToReact)\n return children.length === 0\n ? createElement(element.localName, props)\n : createElement(element.localName, props, ...children)\n}\n\n/**\n * Render TeX source to React elements through KaTeX.\n * @param value - The TeX source (math node value; fenced `math` blocks append\n * their trailing newline to match the replaced pipeline's text extraction).\n * @param displayMode - Display (block) versus inline rendering.\n * @returns KaTeX's element tree, or the error span when the source does not\n * parse (colored with KaTeX's stock `errorColor`, matching rehype-katex).\n */\nexport function renderTexToReact(value: string, displayMode: boolean): ReactNode {\n let html: string\n try {\n html = katex.renderToString(value, { displayMode, throwOnError: true })\n } catch (error) {\n try {\n html = katex.renderToString(value, { displayMode, strict: 'ignore', throwOnError: false })\n } catch {\n // KaTeX renders ParseErrors itself under throwOnError: false; only its\n // internal errors reach here, so mirror rehype-katex's manual span.\n /* v8 ignore next 8 */\n return (\n <span\n className=\"katex-error\"\n style={{ color: '#cc0000' }}\n title={String(error)}\n >\n {value}\n </span>\n )\n }\n }\n const parsed = new DOMParser().parseFromString(html, 'text/html')\n return [...parsed.body.childNodes].map(domToReact)\n}\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/**\n * Direct mdast→React markdown renderer. Replaces the react-markdown /\n * remark-rehype pipeline with one switch over parsed nodes so streaming can\n * cache frozen blocks as React elements; the rendered DOM is pinned\n * byte-for-byte by `tests/fixtures/markdown-dom` and must not drift.\n *\n * Untrusted-output policy (unchanged from the replaced pipeline): link and\n * image destinations pass a protocol allowlist, images additionally require\n * absolute HTTP(S), raw HTML renders as literal text (no HTML enters the\n * DOM), and KaTeX runs without trusted commands. Fragment-anchor URLs fail\n * the allowlist, so footnote references and back-references render as plain\n * text rather than in-page links.\n *\n * Merge-extensible node unions fall through the documented default (render\n * nothing) rather than ending in assertNever: grammars registered elsewhere\n * may add node types this renderer has no mapping for.\n */\n\nimport { Fragment, createElement, useState } from 'react'\nimport type { Key, ReactNode } from 'react'\nimport clsx from 'clsx'\nimport type * as Md from 'mdast'\nimport type {} from 'mdast-util-math'\nimport { normalizeUri } from 'micromark-util-sanitize-uri'\nimport { CodeBlock } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { renderTexToReact } from './katex.js'\nimport { McpAppCodeBlock, StreamingMcpAppPlaceholder } from '../McpAppFrame.js'\nimport { isMcpAppCodeBlock, extractMcpAppTitle, extractMcpAppHeight } from '../mcp-app.js'\nimport type { MarkdownPathImages } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PositionedBlock } from './incremental.js'\nimport css from './MarkdownText.module.css'\n\n/** Copy-button labels forwarded to fence CodeBlocks (this package is cordis-free, so copy arrives via props). */\nexport interface MarkdownCodeLabels {\n /** Copy-button idle label. */\n copyLabel?: string | undefined\n /** Copy-button label during the post-copy confirmation window. */\n copiedLabel?: string | undefined\n}\n\nfunction sanitizeUrl(url: string): string {\n try {\n switch (new URL(url).protocol) {\n case 'http:':\n case 'https:':\n case 'mailto:':\n return url\n default:\n return ''\n }\n } catch {\n // Relative and otherwise unparsable destinations are disallowed alongside\n // disallowed protocols; new URL() has no other failure mode for strings.\n return ''\n }\n}\n\nfunction remoteImageUrl(url: string): string | undefined {\n try {\n const protocol = new URL(url).protocol\n return protocol === 'http:' || protocol === 'https:' ? url : undefined\n } catch {\n // Same single failure mode as above: not an absolute URL.\n return undefined\n }\n}\n\n/** Link/image reference targets collected from a document (first definition per identifier wins, as in CommonMark). */\nexport interface ReferenceTargets {\n /** Link/image definitions keyed by upper-cased identifier. */\n definitions: Map<string, Md.Definition>\n /** Footnote definitions keyed by upper-cased identifier. */\n footnotes: Map<string, Md.FootnoteDefinition>\n}\n\n/**\n * Create an empty {@link ReferenceTargets}.\n * @returns Fresh empty maps.\n */\nexport function createReferenceTargets(): ReferenceTargets {\n return { definitions: new Map(), footnotes: new Map() }\n}\n\n/**\n * Record every definition and footnote definition under `nodes` into\n * `targets`, depth-first, keeping the first definition per identifier.\n * @param nodes - Subtrees to walk (top-level blocks or any nested children).\n * @param targets - Accumulator, typically shared across incremental segments.\n */\nexport function collectReferenceTargets(\n nodes: readonly Md.RootContent[],\n targets: ReferenceTargets,\n): void {\n for (const node of nodes) {\n if (node.type === 'definition') {\n const id = node.identifier.toUpperCase()\n if (!targets.definitions.has(id)) targets.definitions.set(id, node)\n } else if (node.type === 'footnoteDefinition') {\n const id = node.identifier.toUpperCase()\n if (!targets.footnotes.has(id)) targets.footnotes.set(id, node)\n }\n if ('children' in node) collectReferenceTargets(node.children, targets)\n }\n}\n\n/**\n * File-mention affordance for inline code: the owner resolves an authored\n * token to the file it names, using its own vocabulary of real files — the\n * renderer never guesses at what looks like a path.\n */\nexport interface MarkdownFileMentions {\n /**\n * Resolve one inline-code token.\n * @param value - The authored token, exactly as written.\n * @returns The opener with its accessible label and full-path title, or\n * undefined when the token names no known file — it then stays inert code.\n */\n resolve(value: string): { open: () => void; label: string; title: string } | undefined\n}\n\n/**\n * One render pass's state: immutable options and targets plus the footnote\n * numbering accumulated in document order while references render.\n */\nexport interface MarkdownRenderContext {\n /** Reader addition: optional semantic text-leaf renderer with an absolute source offset. */\n readonly renderText?: (value: string, offset: number, inline?: boolean) => ReactNode\n /** Reader addition: keep atomic code content behind the source-order gate. */\n readonly renderAtom?: (children: ReactNode, offset: number) => ReactNode\n readonly sourceOffset?: number\n /** Streaming arm: fences render plain and TeX stays literal. */\n readonly streaming: boolean\n /** Localized fence copy-button labels. */\n readonly codeLabels: MarkdownCodeLabels | undefined\n /** Inside a blockquote's children: tables there always fill the quote's width. */\n readonly inBlockquote?: boolean\n /** Inline-code file mentions; absent wherever no opener vocabulary exists. */\n readonly fileMentions: MarkdownFileMentions | undefined\n readonly pathImages?: MarkdownPathImages\n /** Inside an anchor's children: interactive mentions must not nest there. */\n readonly inLink?: boolean\n /** Reference targets visible to this pass. */\n readonly targets: ReferenceTargets\n /** Footnote identifiers in first-reference order; a footnote's number is its 1-based index here. */\n readonly footnoteOrder: string[]\n /** References rendered per identifier; drives the section's back-reference count. */\n readonly footnoteCounts: Map<string, number>\n}\n\n/**\n * Render top-level blocks. Nodes that render nothing (definitions, unmapped\n * types) are dropped rather than kept as null placeholders, matching the\n * replaced pipeline's child lists so separator newlines land identically.\n * @param blocks - Blocks with their stream-stable render keys.\n * @param context - The pass state; footnote numbering mutates in document order.\n * @returns One React node per rendered block.\n */\nexport function renderBlocks(\n blocks: readonly PositionedBlock[],\n context: MarkdownRenderContext,\n): ReactNode[] {\n return blocks\n .map(block => renderNode(block.node, block.key, {\n ...context,\n sourceOffset: block.key - (block.node.position?.start.offset ?? block.key),\n }))\n .filter(element => element !== null)\n}\n\n/**\n * Interleave the newline text nodes the replaced pipeline emitted between\n * block-level children. They are invisible between elements but coalesce\n * into adjacent literal raw-HTML text, where the DOM parity fixtures pin\n * them.\n * @param elements - Rendered block children with empty renders already dropped.\n * @param edges - Also emit the leading and trailing newline (hast's loose wrap).\n * @returns The interleaved children.\n */\nexport function wrapBlockChildren(elements: readonly ReactNode[], edges: boolean): ReactNode[] {\n const wrapped: ReactNode[] = []\n for (const element of elements) {\n if (edges || wrapped.length > 0) wrapped.push('\\n')\n wrapped.push(element)\n }\n if (edges && elements.length > 0) wrapped.push('\\n')\n return wrapped\n}\n\n/**\n * A block child rendered for a parent that must tell paragraphs apart from\n * other blocks (list items unwrap them when tight; footnote bodies receive\n * their back-references inside the trailing paragraph).\n */\ntype BlockEntry = { paragraph: ReactNode[] } | { element: ReactNode }\n\n/** Render container children into {@link BlockEntry} values, dropping empty renders. */\nfunction renderBlockEntries(\n blocks: readonly Md.RootContent[],\n context: MarkdownRenderContext,\n): BlockEntry[] {\n const entries: BlockEntry[] = []\n for (const [index, block] of blocks.entries()) {\n if (block.type === 'paragraph') {\n entries.push({ paragraph: renderChildren(block.children, context) })\n } else {\n const element = renderNode(block, index, context)\n if (element !== null) entries.push({ element })\n }\n }\n return entries\n}\n\nfunction renderChildren(\n nodes: readonly Md.RootContent[],\n context: MarkdownRenderContext,\n): ReactNode[] {\n return nodes.map((node, index) => renderNode(node, index, context))\n}\n\nfunction renderNode(node: Md.RootContent, key: Key, context: MarkdownRenderContext): ReactNode {\n switch (node.type) {\n case 'text':\n return context.renderText ? context.renderText(node.value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0)) : node.value\n case 'paragraph':\n return <p key={key}>{renderChildren(node.children, context)}</p>\n case 'heading':\n return createElement(`h${node.depth}`, { key }, ...renderChildren(node.children, context))\n case 'blockquote':\n return (\n <blockquote key={key}>\n {wrapBlockChildren(\n renderChildren(node.children, { ...context, inBlockquote: true }).filter(child => child !== null),\n true,\n )}\n </blockquote>\n )\n case 'thematicBreak':\n return <hr key={key} />\n case 'break':\n // The replaced pipeline emitted a newline text node after each <br>.\n return <Fragment key={key}><br />{'\\n'}</Fragment>\n case 'strong':\n return <strong key={key}>{renderChildren(node.children, context)}</strong>\n case 'emphasis':\n return <em key={key}>{renderChildren(node.children, context)}</em>\n case 'delete':\n return <del key={key}>{renderChildren(node.children, context)}</del>\n case 'inlineCode': {\n // Parity with mdast-util-to-hast: inline code renders line endings as spaces.\n const value = node.value.replace(/\\r?\\n|\\r/g, ' ')\n // Native code chips are inline-flex. Keep a single inline formatting\n // context so motion spans do not become flex items or drop code spaces.\n const content = context.renderText ? <span>{context.renderText(value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0), true)}</span> : value\n // An inline-code token that is entirely an absolute HTTP(S) URL keeps\n // its code chrome and gains the same safe external anchor as a link;\n // commands, partial URLs, and other schemes stay inert. The value is\n // authored text, not a parsed destination, so no normalizeUri: port,\n // path, and query render unchanged.\n const href = inlineCodeHttpUrl(value)\n if (href !== undefined) return <code key={key}>{renderSafeLink(href, [content], 'link')}</code>\n // A token the owner's file-mention vocabulary recognizes opens that\n // file; the resolver, not this renderer, decides what names a file.\n // Inside an anchor the token stays inert — a button cannot nest there.\n const mention = context.inLink === true ? undefined : context.fileMentions?.resolve(value)\n if (mention !== undefined) {\n return (\n <code key={key}>\n <button\n type=\"button\"\n className={css.fileMention}\n title={mention.title}\n aria-label={mention.label}\n onClick={mention.open}\n >\n {content}\n </button>\n </code>\n )\n }\n return <code key={key}>{content}</code>\n }\n case 'html':\n // No HTML parser enters the pipeline: raw HTML stays literal text.\n return context.renderText ? context.renderText(node.value, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0)) : node.value\n case 'code': {\n const code = renderCode(node, key, context)\n return context.renderAtom ? <Fragment key={key}>{context.renderAtom(code, (context.sourceOffset ?? 0) + (node.position?.start.offset ?? 0))}</Fragment> : code\n }\n case 'math':\n return <Fragment key={key}>{renderTexToReact(node.value, true)}</Fragment>\n case 'inlineMath':\n return <Fragment key={key}>{renderTexToReact(node.value, false)}</Fragment>\n case 'list':\n return renderList(node, key, context)\n case 'listItem':\n // Reachable only in hand-built trees: the grammar emits items inside lists.\n return renderListItem(node, listItemLoose(node), key, context)\n case 'table':\n return renderTable(node, key, context)\n case 'link':\n return renderAnchor(node.url, renderChildren(node.children, { ...context, inLink: true }), key)\n case 'linkReference':\n return renderLinkReference(node, key, context)\n case 'image':\n return renderImage(node.url, node.alt ?? '', key, context)\n case 'imageReference':\n return renderImageReference(node, key, context)\n case 'footnoteReference':\n return renderFootnoteReference(node, key, context)\n case 'definition':\n case 'footnoteDefinition':\n // Targets render elsewhere: definitions resolve references in place;\n // footnote bodies render in the trailing section.\n return null\n default:\n // Documented default for the merge-extensible union: node types without\n // a mapping (tableRow/tableCell outside a table, frontmatter, future\n // grammar contributions) render nothing.\n return null\n }\n}\n\nfunction renderCode(node: Md.Code, key: Key, context: MarkdownRenderContext): ReactNode {\n const language = node.lang ?? undefined\n if (node.value === '') {\n // Parity: the replaced pipeline kept the stock <pre> for an empty fence.\n return (\n <pre key={key}>\n <code className={language === undefined ? undefined : `language-${language}`} />\n </pre>\n )\n }\n // The replaced pipeline recovered the grammar id from the hast class with\n // /language-([\\w-]+)/, which truncates at the first non-word character.\n const lang = language === undefined ? undefined : /^[\\w-]+/.exec(language)?.[0]\n\n if (isMcpAppCodeBlock(node.lang, node.meta, node.value)) {\n const title = extractMcpAppTitle(node.meta, node.value)\n const initialHeight = extractMcpAppHeight(node.meta)\n if (context.streaming) {\n return <StreamingMcpAppPlaceholder key={key} title={title} />\n }\n return <McpAppCodeBlock key={key} html={node.value} title={title} initialHeight={initialHeight} />\n }\n\n if (!context.streaming && lang === 'math') {\n // ```math fences render as display TeX once settled (rehype-katex parity);\n // its text extraction saw the code block's trailing newline.\n return <Fragment key={key}>{renderTexToReact(`${node.value}\\n`, true)}</Fragment>\n }\n return (\n <CodeBlock\n key={key}\n // The replaced hast pipeline appended one synthetic newline that\n // CodeBlock's display trim removes; feeding the bare value would make\n // that trim eat a REAL trailing blank line inside the fence instead.\n code={`${node.value}\\n`}\n lang={context.streaming ? undefined : lang}\n copyLabel={context.codeLabels?.copyLabel ?? '复制代码'}\n copiedLabel={context.codeLabels?.copiedLabel ?? '已复制'}\n />\n )\n}\n\n/** A list is loose when it or any of its items is spread; every item then keeps its paragraphs. */\nfunction listLoose(list: Md.List): boolean {\n return (list.spread ?? false) || list.children.some(listItemLoose)\n}\n\nfunction listItemLoose(item: Md.ListItem): boolean {\n return item.spread ?? item.children.length > 1\n}\n\nfunction renderList(node: Md.List, key: Key, context: MarkdownRenderContext): ReactNode {\n const loose = listLoose(node)\n const properties: { start?: number; className?: string } = {}\n if (typeof node.start === 'number' && node.start !== 1) properties.start = node.start\n if (node.children.some(item => typeof item.checked === 'boolean')) {\n properties.className = 'contains-task-list'\n }\n return createElement(\n node.ordered === true ? 'ol' : 'ul',\n { key, ...properties },\n ...node.children.map((item, index) => renderListItem(item, loose, index, context)),\n )\n}\n\nfunction renderListItem(\n item: Md.ListItem,\n loose: boolean,\n key: Key,\n context: MarkdownRenderContext,\n): ReactNode {\n const entries = renderBlockEntries(item.children, context)\n const task = typeof item.checked === 'boolean'\n if (task) {\n const checkbox = <input key=\"task-checkbox\" type=\"checkbox\" checked={item.checked === true} disabled />\n const head = entries[0]\n if (head !== undefined && 'paragraph' in head) {\n head.paragraph = head.paragraph.length > 0 ? [checkbox, ' ', ...head.paragraph] : [checkbox]\n } else {\n entries.unshift({ paragraph: [checkbox] })\n }\n }\n // Newline placement and tight-paragraph unwrapping mirror\n // mdast-util-to-hast's list-item handler: a newline before every child\n // except a tight leading paragraph, and after a trailing non-paragraph\n // (or any trailing child when loose).\n const parts: ReactNode[] = []\n for (const [index, entry] of entries.entries()) {\n const isParagraph = 'paragraph' in entry\n if (loose || index !== 0 || !isParagraph) parts.push('\\n')\n if (!isParagraph) parts.push(entry.element)\n else if (loose) parts.push(<p key={`p-${index}`}>{entry.paragraph}</p>)\n else parts.push(<Fragment key={`p-${index}`}>{entry.paragraph}</Fragment>)\n }\n const tail = entries[entries.length - 1]\n if (tail !== undefined && (loose || !('paragraph' in tail))) parts.push('\\n')\n return (\n <li key={key} className={task ? 'task-list-item' : undefined}>\n {parts}\n </li>\n )\n}\n\nfunction renderTable(node: Md.Table, key: Key, context: MarkdownRenderContext): ReactNode {\n const align = node.align ?? null\n const [headRow, ...bodyRows] = node.children\n const columns = align === null ? headRow?.children.length ?? 0 : align.length\n // Four or more columns read as a comparison matrix: the block keeps the\n // table at natural width and exposes the stable `md-table-wide` hook so a\n // hosting layout (the chat transcript) can widen it past the message\n // column. Narrower tables — and any table inside a blockquote — fill the\n // column and wrap instead (deepsuite chat TableWrapper parity).\n const wide = columns >= 4 && context.inBlockquote !== true\n return (\n // Wide tables rest with overflow-x hidden (the hover-revealed bar in\n // MarkdownText.module.css), which drops Chromium's implicit scroller\n // focusability — the explicit tabindex keeps them keyboard-reachable,\n // and :focus-visible restores scrolling.\n <div\n key={key}\n className={clsx(css.tableScroll, wide ? 'md-table-wide' : css.tableFill)}\n tabIndex={wide ? 0 : undefined}\n >\n <table>\n {headRow !== undefined && <thead>{renderTableRow(headRow, 'th', align, 0, context)}</thead>}\n {bodyRows.length > 0 && (\n <tbody>\n {bodyRows.map((row, index) => renderTableRow(row, 'td', align, index + 1, context))}\n </tbody>\n )}\n </table>\n </div>\n )\n}\n\nfunction renderTableRow(\n row: Md.TableRow,\n cellTag: 'th' | 'td',\n align: readonly Md.AlignType[] | null,\n key: Key,\n context: MarkdownRenderContext,\n): ReactNode {\n // With column alignment present, every row renders exactly one cell per\n // column, padding or truncating the row (mdast-util-to-hast parity).\n const length = align === null ? row.children.length : align.length\n const cells: ReactNode[] = []\n for (let index = 0; index < length; index++) {\n const cell = row.children[index]\n const alignValue = align?.[index]\n cells.push(createElement(\n cellTag,\n // hast-util-to-jsx-runtime's default tableCellAlignToStyle turned the\n // deprecated align attribute into an inline style; keep that DOM.\n { key: index, style: alignValue == null ? undefined : { textAlign: alignValue } },\n ...(cell === undefined ? [] : renderChildren(cell.children, context)),\n ))\n }\n return <tr key={key}>{cells}</tr>\n}\n\n/** Anchor over an already-authored href: allowlisted or unwrapped, external links get the safe attributes. */\nfunction renderSafeLink(href: string, children: ReactNode[], key: Key): ReactNode {\n const safeHref = sanitizeUrl(href)\n if (safeHref === '') return <Fragment key={key}>{children}</Fragment>\n const external = ['http:', 'https:'].includes(new URL(safeHref).protocol)\n return (\n <a\n key={key}\n href={safeHref}\n {...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n >\n {children}\n </a>\n )\n}\n\n/** Anchor over a parsed markdown destination, which hast normalized before the allowlist saw it. */\nfunction renderAnchor(url: string, children: ReactNode[], key: Key): ReactNode {\n return renderSafeLink(normalizeUri(url), children, key)\n}\n\n/**\n * The complete inline-code value when it is exactly an absolute HTTP(S) URL\n * (no surrounding whitespace); anything else stays inert code.\n */\nfunction inlineCodeHttpUrl(value: string): string | undefined {\n if (value.trim() !== value) return undefined\n try {\n const protocol = new URL(value).protocol\n return protocol === 'http:' || protocol === 'https:' ? value : undefined\n } catch {\n // Not an absolute URL at all — the only way new URL() rejects a string.\n return undefined\n }\n}\n\nfunction renderImage(url: string, alt: string, key: Key, context: MarkdownRenderContext): ReactNode {\n // RC2 semantics, including the revalidation of a trusted vocabulary result.\n const remote = remoteImageUrl(sanitizeUrl(normalizeUri(url)))\n const rewritten = remote === undefined ? context.pathImages?.resolve(url) : undefined\n let imageSrc = remote\n if (rewritten !== undefined) {\n try {\n const parsed = new URL(rewritten)\n if (['http:', 'https:', 'blob:', 'data:'].includes(parsed.protocol) || rewritten.startsWith('dsh-app://app/api/file?')) imageSrc = rewritten\n } catch { /* A vocabulary result must be an absolute URL. */ }\n }\n if (imageSrc === undefined) {\n return <span key={key} className={css.imageAlt}>{alt}</span>\n }\n return <MarkdownImage key={`${key}:${imageSrc}`} src={imageSrc} alt={alt} destination={url} />\n}\n\nfunction MarkdownImage({ src, alt, destination }: { src: string; alt: string; destination: string }): ReactNode {\n const [failed, setFailed] = useState(false)\n if (failed) return <span className={css.imageAlt}>{alt || destination}</span>\n return (\n <img\n className={css.image}\n src={src}\n alt={alt}\n onError={() => { setFailed(true) }}\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n />\n )\n}\n\n/** The bracketed source text a reference reverts to when its definition is missing. */\nfunction referenceSuffix(node: Md.LinkReference | Md.ImageReference): string {\n if (node.referenceType === 'collapsed') return '][]'\n if (node.referenceType === 'full') return `][${node.label ?? node.identifier}]`\n return ']'\n}\n\nfunction renderLinkReference(\n node: Md.LinkReference,\n key: Key,\n context: MarkdownRenderContext,\n): ReactNode {\n const definition = context.targets.definitions.get(node.identifier.toUpperCase())\n if (definition === undefined) {\n // The grammar only emits references whose definitions exist somewhere in\n // the same parse, but incremental segments and hand-built trees may still\n // present unresolved ones: revert to the bracketed source text — which is\n // not an anchor, so mentions inside it stay live.\n return <Fragment key={key}>{'['}{renderChildren(node.children, context)}{referenceSuffix(node)}</Fragment>\n }\n return renderAnchor(definition.url, renderChildren(node.children, { ...context, inLink: true }), key)\n}\n\nfunction renderImageReference(\n node: Md.ImageReference,\n key: Key,\n context: MarkdownRenderContext,\n): ReactNode {\n const definition = context.targets.definitions.get(node.identifier.toUpperCase())\n if (definition === undefined) return `![${node.alt ?? ''}${referenceSuffix(node)}`\n return renderImage(definition.url, node.alt ?? '', key, context)\n}\n\nfunction renderFootnoteReference(\n node: Md.FootnoteReference,\n key: Key,\n context: MarkdownRenderContext,\n): ReactNode {\n const id = node.identifier.toUpperCase()\n const seen = context.footnoteCounts.get(id)\n if (seen === undefined) context.footnoteOrder.push(id)\n context.footnoteCounts.set(id, (seen ?? 0) + 1)\n // The in-page anchor fails the protocol allowlist, so only the numbered\n // superscript renders (matching the replaced pipeline's unwrapped link).\n return <sup key={key}>{String(context.footnoteOrder.indexOf(id) + 1)}</sup>\n}\n\n/**\n * Render the trailing footnote section for every footnote referenced during\n * the pass, in first-reference order, with one plain-text back-reference\n * marker per rendered reference.\n * @param context - The pass state after all blocks rendered.\n * @returns The section, or null when no referenced footnote has a definition.\n */\nexport function renderFootnoteSection(context: MarkdownRenderContext): ReactNode | null {\n const items: ReactNode[] = []\n for (const id of context.footnoteOrder) {\n const definition = context.targets.footnotes.get(id)\n if (definition === undefined) continue\n const count = context.footnoteCounts.get(id) ?? 0\n const backrefs: ReactNode[] = []\n for (let reference = 1; reference <= count; reference++) {\n if (backrefs.length > 0) backrefs.push(' ')\n backrefs.push('↩')\n if (reference > 1) backrefs.push(<sup key={`re-${reference}`}>{String(reference)}</sup>)\n }\n const entries = renderBlockEntries(definition.children, context)\n const tail = entries[entries.length - 1]\n const body: ReactNode[] = entries.map((entry, index) => (\n 'paragraph' in entry\n ? (\n <p key={`p-${index}`}>\n {entry.paragraph}\n {entry === tail && <>{' '}{backrefs}</>}\n </p>\n )\n : entry.element\n ))\n // Without a trailing paragraph the back-references join the block list\n // itself (and pick up the wrap newlines), as in the replaced pipeline.\n if (tail === undefined || !('paragraph' in tail)) body.push(...backrefs)\n items.push(\n <li key={id} id={`user-content-fn-${normalizeUri(id.toLowerCase())}`}>\n {wrapBlockChildren(body, true)}\n </li>,\n )\n }\n if (items.length === 0) return null\n return (\n <section key=\"footnotes\" data-footnotes className=\"footnotes\">\n <h2 id=\"footnote-label\" className=\"sr-only\">Footnotes</h2>\n <ol>{items}</ol>\n </section>\n )\n}\n","// Adapted from DeepSeek Harness b150a551b8d465e31e418e1b2eaf5e79bbb7d28e (MIT). See THIRD_PARTY_NOTICES.md.\n/**\n * Untrusted assistant-Markdown renderer over the direct mdast pipeline:\n * `parse.ts` grammars, the incremental streaming parser, and `render.tsx`.\n * While a message streams, all but the trailing two blocks freeze as cached\n * React elements and only the source tail behind them re-parses per chunk,\n * so per-chunk work tracks the tail size instead of the whole reply. Frozen\n * blocks keep their source-offset keys when they cross the freeze boundary,\n * so React reconciles instead of remounting. Known deviation while\n * streaming: a reference-style link or footnote whose definition sits on the\n * other side of the freeze boundary renders literally until the settled\n * full parse self-heals it.\n */\n\nimport { memo, useMemo, useRef } from 'react'\nimport type { ReactNode } from 'react'\nimport type { MarkdownPathImages } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { IncrementalMarkdownParser } from './incremental.js'\nimport { parseGfm, parseGfmWithMath } from './parse.js'\nimport {\n collectReferenceTargets, createReferenceTargets, renderBlocks, renderFootnoteSection,\n wrapBlockChildren,\n} from './render.js'\nimport type { MarkdownCodeLabels, MarkdownFileMentions, MarkdownRenderContext, ReferenceTargets } from './render.js'\n// KaTeX CSS is supplied once by the shared DSH UI-primitives client bundle.\nimport css from './MarkdownText.module.css'\n\nexport type { MarkdownCodeLabels, MarkdownFileMentions } from './render.js'\n\n/** One settled full render: parse with math, resolve references, append the footnote section. */\nfunction renderSettled(\n text: string,\n codeLabels: MarkdownCodeLabels | undefined,\n fileMentions: MarkdownFileMentions | undefined,\n pathImages: MarkdownPathImages | undefined,\n renderText: MarkdownRenderContext['renderText'],\n renderAtom: MarkdownRenderContext['renderAtom'],\n): ReactNode[] {\n const root = parseGfmWithMath(text)\n const targets = createReferenceTargets()\n collectReferenceTargets(root.children, targets)\n const context: MarkdownRenderContext = {\n renderText,\n renderAtom,\n streaming: false,\n codeLabels,\n fileMentions,\n pathImages,\n targets,\n footnoteOrder: [],\n footnoteCounts: new Map(),\n }\n const blocks = wrapBlockChildren(\n renderBlocks(root.children.map((node, index) => ({ node, key: node.position?.start.offset ?? -(index + 1) })), context),\n false,\n )\n const section = renderFootnoteSection(context)\n return section === null ? blocks : [...blocks, '\\n', section]\n}\n\n/**\n * Streaming render state for one growing message: the incremental parser,\n * the frozen blocks' cached elements, and the reference/footnote state their\n * rendering consumed (footnote numbering assigned to frozen references is\n * final, so the tail continues from a copy of it each frame).\n */\nclass StreamingRenderer {\n private readonly parser = new IncrementalMarkdownParser(parseGfm)\n private generation = -1\n private frozenCount = 0\n private frozenElements: ReactNode[] = []\n private frozenTargets: ReferenceTargets = createReferenceTargets()\n private frozenFootnoteOrder: string[] = []\n private frozenFootnoteCounts = new Map<string, number>()\n private lastText: string | null = null\n private lastRendered: ReactNode[] = []\n\n /** @param codeLabels - Fence copy labels baked into cached elements; the owner replaces the renderer when they change. */\n constructor(private readonly codeLabels: MarkdownCodeLabels | undefined, private readonly renderText: MarkdownRenderContext['renderText'], private readonly renderAtom: MarkdownRenderContext['renderAtom'], private readonly pathImages: MarkdownPathImages | undefined) {}\n\n /**\n * Render the current accumulated text. Idempotent per text value, so React\n * may re-execute the calling render freely.\n * @param text - The full accumulated markdown source.\n * @returns Frozen elements, re-rendered tail, and the footnote section.\n */\n render(text: string): ReactNode[] {\n if (text === this.lastText) return this.lastRendered\n const { frozen, tail, generation } = this.parser.update(text)\n if (generation !== this.generation) {\n this.generation = generation\n this.frozenCount = 0\n this.frozenElements = []\n this.frozenTargets = createReferenceTargets()\n this.frozenFootnoteOrder = []\n this.frozenFootnoteCounts = new Map()\n }\n const newlyFrozen = frozen.slice(this.frozenCount)\n collectReferenceTargets(newlyFrozen.map(block => block.node), this.frozenTargets)\n // Targets visible this frame: everything frozen so far plus the current\n // tail parse — a newly frozen block's references resolved against the\n // same parse tree its definitions came from.\n const frameTargets: ReferenceTargets = {\n definitions: new Map(this.frozenTargets.definitions),\n footnotes: new Map(this.frozenTargets.footnotes),\n }\n collectReferenceTargets(tail.map(block => block.node), frameTargets)\n if (newlyFrozen.length > 0) {\n const frozenContext: MarkdownRenderContext = {\n renderText: this.renderText,\n renderAtom: this.renderAtom,\n streaming: true,\n codeLabels: this.codeLabels,\n fileMentions: undefined,\n pathImages: this.pathImages,\n targets: frameTargets,\n footnoteOrder: this.frozenFootnoteOrder,\n footnoteCounts: this.frozenFootnoteCounts,\n }\n // Separator newlines are cached alongside the elements so the\n // assembled children match the settled pipeline's block wrapping.\n const batch = [...this.frozenElements]\n for (const element of renderBlocks(newlyFrozen, frozenContext)) {\n if (batch.length > 0) batch.push('\\n')\n batch.push(element)\n }\n this.frozenElements = batch\n this.frozenCount = frozen.length\n }\n const tailContext: MarkdownRenderContext = {\n renderText: this.renderText,\n renderAtom: this.renderAtom,\n streaming: true,\n codeLabels: this.codeLabels,\n fileMentions: undefined,\n pathImages: this.pathImages,\n targets: frameTargets,\n footnoteOrder: [...this.frozenFootnoteOrder],\n footnoteCounts: new Map(this.frozenFootnoteCounts),\n }\n const children = [...this.frozenElements]\n for (const element of renderBlocks(tail, tailContext)) {\n if (children.length > 0) children.push('\\n')\n children.push(element)\n }\n const section = renderFootnoteSection(tailContext)\n if (section !== null) children.push('\\n', section)\n this.lastText = text\n this.lastRendered = children\n return this.lastRendered\n }\n}\n\n/**\n * Render untrusted assistant-authored Markdown as semantic React elements.\n * @param props - Markdown source text preserved by the session projection;\n * `streaming` renders fences and TeX plain (highlighting and KaTeX land on\n * the finalize swap) and parses incrementally across chunks; `codeLabels`\n * forwards localized copy-button labels to fence CodeBlocks — pass a\n * reference-stable object (memoized per locale revision), because a new\n * identity discards the streaming render cache mid-message. `fileMentions`\n * links inline-code tokens its resolver recognizes as real files; this is\n * the single streaming gate — it applies to settled renders only, because a\n * streaming message's vocabulary is not final and frozen cached elements\n * must not bake in handlers that could go stale.\n * @returns A GFM document with TeX math rendered through KaTeX; raw HTML,\n * relative links, and unsafe protocols are disabled, while absolute HTTP(S)\n * images render directly.\n */\nexport const MarkdownText = memo(function MarkdownText({ text, streaming = false, codeLabels, fileMentions, pathImages, renderText, renderAtom }: {\n text: string\n streaming?: boolean\n codeLabels?: MarkdownCodeLabels | undefined\n fileMentions?: MarkdownFileMentions | undefined\n pathImages?: MarkdownPathImages | undefined\n renderText?: MarkdownRenderContext['renderText']\n renderAtom?: MarkdownRenderContext['renderAtom']\n}) {\n const streamRef = useRef<StreamingRenderer | null>(null)\n const streamImagesRef = useRef(pathImages)\n const streamLabelsRef = useRef<MarkdownCodeLabels | undefined>(codeLabels)\n const children = useMemo(() => {\n if (!streaming) {\n streamRef.current = null\n return renderSettled(text, codeLabels, fileMentions, pathImages, renderText, renderAtom)\n }\n if (streamRef.current === null || streamLabelsRef.current !== codeLabels || streamImagesRef.current !== pathImages) {\n streamRef.current = new StreamingRenderer(codeLabels, renderText, renderAtom, pathImages)\n streamLabelsRef.current = codeLabels\n streamImagesRef.current = pathImages\n }\n return streamRef.current.render(text)\n }, [text, streaming, codeLabels, fileMentions, pathImages, renderText, renderAtom])\n return <div className={css.markdown}>{children}</div>\n})\n","/** Web or Desktop file route. Authorization stays Host-side. */\nexport function localPathMediaUrl(protocol: string, origin: string, value: string): string | undefined {\n if (!value.startsWith('/') || value.startsWith('//')) return undefined;\n if (protocol === 'http:' || protocol === 'https:') {\n return `${origin}/api/file?path=${encodeURIComponent(value)}`;\n }\n // Official fileMediaUrl accepts the Desktop application base dsh-app://app/.\n if (protocol === 'dsh-app:' && origin === 'dsh-app://app') {\n return `dsh-app://app/api/file?path=${encodeURIComponent(value)}`;\n }\n return undefined;\n}\n\nexport const readerPathImages = {\n resolve: (value: string) => typeof window === 'undefined' ? undefined\n : localPathMediaUrl(window.location.protocol, window.location.origin, value),\n};\n","import { createContext, useContext, useLayoutEffect, useMemo, useRef } from 'react';\nimport type { ReactNode, RefObject } from 'react';\nimport type { MarkdownFileMentions } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { MarkdownText } from './markdown/MarkdownText.js';\nimport { readerPathImages } from './platform-media.js';\nimport { WORD_MOTION, WordTimeline } from './word-timeline.js';\nimport css from './Reader.module.css';\n\nconst WordScope = createContext({ enabled: false, generation: 0 });\nconst CODE_LABELS = { copyLabel: '复制代码', copiedLabel: '已复制' };\n\nfunction useSourceReveal(element: RefObject<HTMLElement>, born: number | null, generation: number) {\n const scope = useContext(WordScope);\n const cancelled = useRef(false);\n useLayoutEffect(() => {\n const target = element.current;\n if (!target) return;\n target.dataset.wordState = 'settled';\n if (!scope.enabled || scope.generation !== generation) { cancelled.current = true; return; }\n if (cancelled.current || born === null || document.hidden) return;\n const age = Number(document.timeline.currentTime ?? performance.now()) - born;\n if (age >= WORD_MOTION.duration || typeof target.animate !== 'function') return;\n // The reference opacity + blur frames, applied only to this new word.\n // No color interpolation, stylesheet mutation, or whole-paragraph wipe.\n const animation = target.animate([\n { opacity: 0, filter: `blur(${WORD_MOTION.blur}px)` },\n { opacity: 1, filter: 'blur(0px)' },\n ], { duration: WORD_MOTION.duration, easing: WORD_MOTION.easing, fill: 'backwards' });\n // One absolute clock prevents newly mounted/resegmented leaves from getting\n // a fresh delay or running ahead because their layout effects ran later.\n animation.startTime = born;\n target.dataset.wordState = 'resolving';\n const finish = () => { animation.cancel(); target.dataset.wordState = 'settled'; document.removeEventListener('visibilitychange', hidden); };\n animation.onfinish = finish;\n const hidden = () => { if (document.hidden) { cancelled.current = true; finish(); } };\n document.addEventListener('visibilitychange', hidden);\n return () => { animation.cancel(); document.removeEventListener('visibilitychange', hidden); target.dataset.wordState = 'settled'; };\n }, [element, born, generation, scope.enabled, scope.generation]);\n}\n\nfunction Word({ children, born, generation, offset, inline }: { children: string; born: number | null; generation: number; offset: number; inline: boolean }) {\n const element = useRef<HTMLSpanElement>(null);\n useSourceReveal(element, born, generation);\n return <span ref={element} className={inline ? css.streamInlineWord : css.streamWord} data-reader-word data-source-start={offset} data-source-birth={born ?? undefined}>{children}</span>;\n}\n\n/** A native code block enters on the same clock, without rebuilding its text. */\nfunction MotionAtom({ children, born, generation, offset }: { children: ReactNode; born: number | null; generation: number; offset: number }) {\n const element = useRef<HTMLDivElement>(null);\n useSourceReveal(element, born, generation);\n return <div ref={element} className={css.streamAtom} data-reader-atom data-source-start={offset} data-source-birth={born ?? undefined}>{children}</div>;\n}\n\n/** Native Think is literal text, not Markdown. Spans never alter its bytes. */\nexport function MotionPlainText({ text, enabled, revision }: { text: string; enabled: boolean; revision: number }) {\n const timeline = useRef<WordTimeline>();\n timeline.current ??= new WordTimeline();\n timeline.current.begin(text, enabled, revision, Number(document.timeline.currentTime ?? performance.now()));\n const current = timeline.current;\n const generation = current.generation;\n const scope = useMemo(() => ({ enabled, generation }), [enabled, generation]);\n return <WordScope.Provider value={scope}><div className={css.reasonPlain}>\n {current.hasLiveText ? current.words(text, 0).map(word => word.text.trim()\n ? <Word key={word.key} born={word.born} generation={generation} offset={word.key} inline>{word.text}</Word>\n : word.text) : text}\n </div></WordScope.Provider>;\n}\n\n/** Native DSH Markdown semantics with a stable text-leaf animation hook. */\nexport function MotionMarkdown({ text, streaming, enabled, revision, fileMentions }: {\n text: string; streaming: boolean; enabled: boolean; revision: number; fileMentions?: MarkdownFileMentions;\n}) {\n const timeline = useRef<WordTimeline>();\n timeline.current ??= new WordTimeline();\n timeline.current.begin(text, enabled, revision, Number(document.timeline.currentTime ?? performance.now()));\n const generation = timeline.current.generation;\n const scope = useMemo(() => ({ enabled, generation }), [enabled, generation]);\n const renderText = useMemo(() => (value: string, offset: number, inline = false): ReactNode => {\n const current = timeline.current!;\n if (!current.hasLiveText) return value;\n return current.words(value, offset).map(word => word.text.trim()\n ? <Word key={word.key} born={word.born} generation={current.generation} offset={word.key} inline={inline || /^\\p{P}+$/u.test(word.text)}>{word.text}</Word>\n : word.text);\n }, []);\n const renderAtom = useMemo(() => (children: ReactNode, offset: number): ReactNode => {\n const current = timeline.current!;\n return current.hasLiveText ? <MotionAtom born={current.bornAt(offset)} generation={current.generation} offset={offset}>{children}</MotionAtom> : children;\n }, []);\n return <WordScope.Provider value={scope}>\n <MarkdownText text={text} streaming={streaming} codeLabels={CODE_LABELS} fileMentions={fileMentions} pathImages={readerPathImages} renderText={renderText} renderAtom={renderAtom} />\n </WordScope.Provider>;\n}\n","import { useEffect, useMemo, useState } from 'react';\nimport type { ReaderBlockOwner, ReaderBlockPresentation } from './types.js';\n\n/**\n * Cordis service name. Another client plugin lists this in `inject` and\n * registers a transformer. The reading view paints the result. The session\n * block, transcript, and fold inputs stay on the original text.\n */\nexport const TEXT_TRANSFORM_SERVICE = 'dsh-better-display.text-transform';\n\nexport type DisplayTextKind = 'reasoning' | 'body';\n\nexport interface DisplayTextRequest {\n /** Original block text. Registrants must not write it back onto the block. */\n text: string;\n streaming: boolean;\n /** Opaque id of this mounted block. Stable until the block unmounts. */\n blockKey: string;\n kind: DisplayTextKind;\n /** Assistant body and reasoning are the usual targets. Tool prose uses `tool`. */\n source?: ReaderBlockOwner['source'];\n}\n\nexport interface DisplayText {\n text: string;\n /**\n * True when this string is the settled display for the current source.\n * False keeps the live reveal open, including after the model has stopped\n * but a translation batch is still outstanding.\n */\n final: boolean;\n}\n\n/**\n * Sync `read` on every paint, plus `subscribe` when a later batch changes\n * what `read` returns. `subscribe` may be called once per kind and must\n * accept more than one listener.\n */\nexport interface DisplayTextTransformer {\n read(request: DisplayTextRequest): DisplayText | string | undefined;\n subscribe?(listener: () => void): () => void;\n}\n\nexport interface DisplayCursor extends DisplayText {\n /**\n * Increments when the displayed string or its `final` bit changes.\n * This is not the reveal clock. Passing it to the word timeline as the\n * motion revision replays or snaps the paragraph.\n */\n transformRevision: number;\n /**\n * Reveal identity. Stays put when the new string extends the previous\n * display string, so an appended translation batch continues the fade.\n * Increments only when the string is replaced, which settles the new\n * text instead of typing it again from the first grapheme.\n */\n motionRevision: number;\n}\n\nexport interface TextTransformRegistry {\n register(kind: DisplayTextKind | readonly DisplayTextKind[], transformer: DisplayTextTransformer): () => void;\n has(kind: DisplayTextKind): boolean;\n read(request: DisplayTextRequest): DisplayCursor;\n subscribe(kind: DisplayTextKind, listener: () => void): () => void;\n release(kind: DisplayTextKind, blockKey: string): void;\n}\n\nconst KINDS = new Set<DisplayTextKind>(['reasoning', 'body']);\n\nfunction isKind(value: string): value is DisplayTextKind {\n return KINDS.has(value as DisplayTextKind);\n}\n\nfunction reportTransformError(error: unknown): void {\n console.warn('[dsh-better-display] text transform failed; showing original text', error);\n}\n\nfunction passthrough(request: DisplayTextRequest): DisplayCursor {\n return { text: request.text, final: !request.streaming, transformRevision: 0, motionRevision: 0 };\n}\n\nfunction normalize(value: DisplayText | string | undefined, request: DisplayTextRequest): DisplayText {\n if (typeof value === 'string') return { text: value, final: !request.streaming };\n if (!value || typeof value.text !== 'string') return { text: request.text, final: !request.streaming };\n return { text: value.text, final: typeof value.final === 'boolean' ? value.final : !request.streaming };\n}\n\n/**\n * Appends keep the motion revision. A replacement gets a new one so the\n * timeline treats the swapped string as already settled.\n */\nexport function nextDisplayCursor(previous: DisplayCursor | undefined, display: DisplayText): DisplayCursor {\n if (!previous) return { ...display, transformRevision: 0, motionRevision: 0 };\n if (previous.text === display.text && previous.final === display.final) return previous;\n const appended = display.text.startsWith(previous.text);\n return {\n text: display.text,\n final: display.final,\n transformRevision: previous.transformRevision + 1,\n motionRevision: appended ? previous.motionRevision : previous.motionRevision + 1,\n };\n}\n\n/**\n * Streaming flag fed to the reveal. With no transformer this is the model's\n * flag. A transformer that reports `final: !streaming` produces the same flag.\n */\nexport function displayStreaming(sourceStreaming: boolean, shown: Pick<DisplayCursor, 'final'>, active: boolean): boolean {\n return active ? !shown.final : sourceStreaming;\n}\n\n/** No registry, or none for this kind: the source string, and no cursor write. */\nexport function readDisplayText(registry: TextTransformRegistry | undefined, request: DisplayTextRequest): DisplayCursor {\n if (!registry?.has(request.kind)) return passthrough(request);\n return registry.read(request);\n}\n\ninterface StackEntry {\n transformer: DisplayTextTransformer;\n unsubscribe?: () => void;\n}\n\nclass TextTransformRegistryImpl implements TextTransformRegistry {\n private readonly stacks = new Map<DisplayTextKind, StackEntry[]>();\n private readonly listeners = new Map<DisplayTextKind, Set<() => void>>();\n private readonly cursors = new Map<string, DisplayCursor>();\n\n register(kind: DisplayTextKind | readonly DisplayTextKind[], transformer: DisplayTextTransformer): () => void {\n const requested = [...new Set(Array.isArray(kind) ? kind : [kind])];\n for (const item of requested) {\n if (!isKind(item)) throw new Error(`Unknown display text kind: ${String(item)}`);\n }\n const bound: { kind: DisplayTextKind; entry: StackEntry }[] = [];\n for (const item of requested) {\n const entry: StackEntry = { transformer };\n try {\n entry.unsubscribe = transformer.subscribe?.(() => { this.emit(item); });\n } catch (error) {\n reportTransformError(error);\n }\n const stack = this.stacks.get(item) ?? [];\n stack.push(entry);\n this.stacks.set(item, stack);\n bound.push({ kind: item, entry });\n this.emit(item);\n }\n return () => {\n for (const { kind: item, entry } of bound) {\n try { entry.unsubscribe?.(); } catch (error) { reportTransformError(error); }\n const stack = this.stacks.get(item);\n if (!stack) continue;\n const next = stack.filter(candidate => candidate !== entry);\n if (next.length > 0) this.stacks.set(item, next);\n else this.stacks.delete(item);\n this.emit(item);\n }\n };\n }\n\n has(kind: DisplayTextKind): boolean {\n return (this.stacks.get(kind)?.length ?? 0) > 0;\n }\n\n read(request: DisplayTextRequest): DisplayCursor {\n const transformer = this.stacks.get(request.kind)?.at(-1)?.transformer;\n if (!transformer) return passthrough(request);\n let display: DisplayText;\n try {\n display = normalize(transformer.read(request), request);\n } catch (error) {\n // A broken transformer must never hide the original text. Show it and\n // ask again on the next text change or notify, so a recovered\n // transformer takes over without a remount.\n reportTransformError(error);\n display = { text: request.text, final: !request.streaming };\n }\n const key = `${request.kind}\\u0000${request.blockKey}`;\n const next = nextDisplayCursor(this.cursors.get(key), display);\n this.cursors.set(key, next);\n return next;\n }\n\n subscribe(kind: DisplayTextKind, listener: () => void): () => void {\n const set = this.listeners.get(kind) ?? new Set();\n set.add(listener);\n this.listeners.set(kind, set);\n return () => { set.delete(listener); };\n }\n\n release(kind: DisplayTextKind, blockKey: string): void {\n this.cursors.delete(`${kind}\\u0000${blockKey}`);\n }\n\n private emit(kind: DisplayTextKind): void {\n const set = this.listeners.get(kind);\n if (!set) return;\n for (const listener of [...set]) listener();\n }\n}\n\nexport function createTextTransformRegistry(): TextTransformRegistry {\n return new TextTransformRegistryImpl();\n}\n\nlet active: TextTransformRegistry | undefined;\n\n/** Points the reading view at the registry this client plugin provides. */\nexport function installTextTransformRegistry(registry: TextTransformRegistry | undefined): () => void {\n const previous = active;\n active = registry;\n return () => { active = previous; };\n}\n\nexport function activeTextTransform(): TextTransformRegistry | undefined {\n return active;\n}\n\n/**\n * Subscribe while mounted. The reveal components call this only after\n * `has(kind)`, so an empty registry adds no hook and no listener.\n */\nexport function useDisplayText(registry: TextTransformRegistry, request: DisplayTextRequest): DisplayCursor {\n const [epoch, setEpoch] = useState(0);\n const { text, streaming, blockKey, kind, source } = request;\n useEffect(() => registry.subscribe(kind, () => { setEpoch(value => value + 1); }), [registry, kind]);\n useEffect(() => () => { registry.release(kind, blockKey); }, [registry, kind, blockKey]);\n return useMemo(\n () => registry.read({ text, streaming, blockKey, kind, source }),\n [registry, text, streaming, blockKey, kind, source, epoch],\n );\n}\n\n/** Chain-slot owner. Extra fields are optional so older callers still type-check. */\nexport function readerBlockOwner(\n block: ReaderBlockOwner['block'],\n streaming: boolean,\n source: ReaderBlockOwner['source'],\n presentation: ReaderBlockPresentation,\n holdFormatting: boolean,\n): ReaderBlockOwner {\n return {\n block,\n streaming,\n source,\n presentation: {\n startedAt: presentation.startedAt,\n interrupted: presentation.interrupted,\n liveText: presentation.liveText,\n },\n holdFormatting,\n liveText: presentation.liveText,\n };\n}\n\n/** Copy actions read this. Display text never replaces it. */\nexport function originalAnswerText(blocks: readonly { readonly kind: string; readonly text?: string }[]): string {\n return blocks.flatMap(block => block.kind === 'text' && typeof block.text === 'string' ? [block.text] : []).join('\\n\\n');\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /** Display-only reader text transforms. Present after this client plugin applies. */\n 'dsh-better-display.text-transform'?: TextTransformRegistry;\n }\n}\n","import { memo, useEffect, useRef, useState } from 'react';\nimport type { TurnTailChatData } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport { formatRanFor, formatRunDuration } from './message-chrome.js';\nimport css from './TurnMetrics.module.css';\n\ntype TurnTokenUsage = NonNullable<TurnTailChatData['tokenUsage']>;\n\nexport interface TurnMetricsProps {\n usage?: TurnTokenUsage;\n runMs?: number;\n tokensPerSecond?: number;\n ttftMs?: number;\n}\n\nfunction formatTokens(count: number): string {\n if (count >= 1_000_000) return `${(count / 1_000_000).toFixed(2)}M tok`;\n if (count >= 1000) return `${(count / 1000).toFixed(1)}k tok`;\n return `${count} tok`;\n}\n\nexport const TurnMetrics = memo(function TurnMetrics({\n usage,\n runMs,\n tokensPerSecond,\n ttftMs,\n}: TurnMetricsProps) {\n const [open, setOpen] = useState(false);\n const containerRef = useRef<HTMLSpanElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onClickOutside = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n };\n document.addEventListener('pointerdown', onClickOutside);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('pointerdown', onClickOutside);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [open]);\n\n const totalTokens = usage?.totalTokens;\n const hasTiming = typeof runMs === 'number' && runMs > 0;\n const hasTokens = typeof totalTokens === 'number' && totalTokens > 0;\n if (!hasTiming && !hasTokens) return null;\n\n const cacheHitPercent = usage && usage.cacheReadTokens && usage.totalTokens > usage.outputTokens\n ? Math.round((usage.cacheReadTokens / (usage.totalTokens - usage.outputTokens)) * 100)\n : null;\n\n return (\n <span ref={containerRef} className={css.container}>\n {hasTokens && typeof totalTokens === 'number' && (\n <button\n type=\"button\"\n className={css.pillButton}\n data-active={open}\n onClick={() => setOpen(v => !v)}\n aria-expanded={open}\n title=\"查看本轮 Token 消耗\"\n >\n <svg className={css.pillIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <ellipse cx=\"8\" cy=\"4.2\" rx=\"5\" ry=\"2.2\" strokeWidth=\"1.2\" />\n <path d=\"M3 4.2v7.6c0 1.2 2.2 2.2 5 2.2s5-1 5-2.2V4.2\" strokeWidth=\"1.2\" />\n <path d=\"M3 8c0 1.2 2.2 2.2 5 2.2s5-1 5-2.2\" strokeWidth=\"1.2\" />\n </svg>\n <span>用量 {formatTokens(totalTokens)}</span>\n </button>\n )}\n {hasTiming && typeof runMs === 'number' && (\n <button\n type=\"button\"\n className={css.timeButton}\n data-active={open}\n onClick={() => setOpen(v => !v)}\n aria-expanded={open}\n aria-label={formatRanFor(runMs)}\n title=\"查看本轮用时和速度\"\n >\n <svg className={css.pillIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" strokeWidth=\"1.2\" />\n <path d=\"M8 4.5v3.8l2.5 1.5\" strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n <span>{formatRanFor(runMs)}</span>\n </button>\n )}\n\n {open && (\n <div className={css.metricsPop} role=\"dialog\" aria-label=\"本轮概况\">\n <div className={css.popHeader}>\n <span>本轮性能与用量概况</span>\n </div>\n\n {hasTiming && typeof runMs === 'number' && (\n <div className={css.popSection}>\n <div className={css.popSectionTitle}>耗时与生成速度</div>\n <div className={css.popGrid}>\n <span className={css.popLabel}>总用时</span>\n <span className={css.popValue}>{formatRunDuration(runMs)}</span>\n\n {typeof tokensPerSecond === 'number' && tokensPerSecond > 0 && (\n <>\n <span className={css.popLabel}>生成吞吐 (TPS)</span>\n <span className={css.popValue}>{tokensPerSecond.toFixed(1)} tok/s</span>\n </>\n )}\n\n {typeof ttftMs === 'number' && ttftMs > 0 && (\n <>\n <span className={css.popLabel}>首字延迟 (TTFT)</span>\n <span className={css.popValue}>{(ttftMs / 1000).toFixed(2)}s</span>\n </>\n )}\n </div>\n </div>\n )}\n\n {hasTokens && usage && (\n <div className={css.popSection}>\n <div className={css.popSectionTitle}>Token 消耗分解</div>\n <div className={css.popGrid}>\n <span className={css.popLabel}>总消耗</span>\n <span className={css.popValue}>{usage.totalTokens.toLocaleString()} tok</span>\n\n <span className={css.popLabel}>\n 输入\n {cacheHitPercent !== null && (\n <span className={css.popBadge}>命中 {cacheHitPercent}%</span>\n )}\n </span>\n <span className={css.popValue}>{(usage.totalTokens - usage.outputTokens).toLocaleString()} tok</span>\n\n {typeof usage.cacheReadTokens === 'number' && usage.cacheReadTokens > 0 && (\n <>\n <span className={css.popLabel}>缓存读取</span>\n <span className={css.popValue}>{usage.cacheReadTokens.toLocaleString()} tok</span>\n </>\n )}\n\n <span className={css.popLabel}>\n 输出\n {typeof usage.reasoningTokens === 'number' && usage.reasoningTokens > 0 && (\n <span className={css.popBadge}>思考 {usage.reasoningTokens.toLocaleString()}</span>\n )}\n </span>\n <span className={css.popValue}>{usage.outputTokens?.toLocaleString() ?? 0} tok</span>\n </div>\n </div>\n )}\n </div>\n )}\n </span>\n );\n});\n","import { Component, Fragment, memo, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';\nimport type { AssistantBlock, UserMessageNode } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport { JsonBlock, MarkdownText, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { ComposerFillContext, McpAppFrame } from './McpAppFrame.js';\nimport { formatMessageClock } from './message-chrome.js';\nimport { markdownLabels, truncatedJsonLabel } from './primitive-labels.js';\nimport type { BlockRenderProps, ReaderBlockOwner } from './types.js';\nimport { useStreamingText } from './streaming.js';\nimport { MotionMarkdown, MotionPlainText } from './word-motion.js';\nimport { activeTextTransform, displayStreaming, originalAnswerText, readerBlockOwner, useDisplayText } from './text-transform.js';\nimport type { TextTransformRegistry } from './text-transform.js';\nimport css from './Reader.module.css';\n\nconst IMAGE_TYPES = new Set(['image/png', 'image/jpeg', 'image/webp', 'image/gif']);\n\nexport class BlockBoundary extends Component<{ children: ReactNode }, { failed: boolean; detail: string }> {\n state = { failed: false, detail: '' };\n // Temporary diagnostic: surface the reason inline so a recurrence is reportable\n // without a console. Remove once the reported block crash is identified.\n static getDerivedStateFromError(error: unknown) {\n const err = error as { message?: unknown } | undefined;\n return { failed: true, detail: String(err?.message ?? error).slice(0, 160) };\n }\n render() {\n return this.state.failed\n ? <div className={css.notice}>此内容暂时无法在阅读页显示;原对话中的记录未受影响。<span data-reader-block-error style={{ opacity: .65 }}>({this.state.detail})</span></div>\n : this.props.children;\n }\n}\n\nexport const ImageBlock = memo(function ImageBlock({ attachment, loadImage }: {\n attachment: ImageAttachmentRef; loadImage: BlockRenderProps['loadImage'];\n}) {\n const [attempt, setAttempt] = useState(0);\n const [url, setUrl] = useState<string | null>(null);\n const [error, setError] = useState(false);\n const [decoded, setDecoded] = useState(false);\n const dialog = useRef<HTMLDialogElement>(null);\n const opener = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n let active = true;\n let owned: string | null = null;\n const timeout = setTimeout(() => { if (active) { setError(true); active = false; } }, 20000);\n setError(false); setDecoded(false); setUrl(null);\n void loadImage(attachment).then(result => {\n if (!active) return;\n clearTimeout(timeout);\n if (!IMAGE_TYPES.has(result.mediaType)) throw new Error('Unsupported image media type');\n const bytes = Uint8Array.from(result.data);\n owned = URL.createObjectURL(new Blob([bytes.buffer], { type: result.mediaType }));\n setUrl(owned);\n }).catch(() => { clearTimeout(timeout); if (active) setError(true); });\n return () => { active = false; clearTimeout(timeout); if (owned) URL.revokeObjectURL(owned); };\n }, [attachment.attachmentId, attempt, loadImage]);\n const width = Number.isFinite(attachment.width) && attachment.width > 0 ? attachment.width : 4;\n const height = Number.isFinite(attachment.height) && attachment.height > 0 ? attachment.height : 3;\n return <figure className={css.imageFigure} data-reader-image data-image-state={error ? 'error' : decoded ? 'ready' : 'loading'}>\n <div className={css.imageFrame} style={{ aspectRatio: `${width} / ${height}` }}>\n {!error && url && <button ref={opener} type=\"button\" className={css.imageOpen} aria-label={`放大图片${attachment.name ? `:${attachment.name}` : ''}`} onClick={() => dialog.current?.showModal()}>\n <img src={url} alt={attachment.name ?? '会话图片'} width={width} height={height} onLoad={() => setDecoded(true)} onError={() => setError(true)} data-ready={decoded} />\n </button>}\n {(!decoded || error) && <div className={css.imagePlaceholder}>\n <span>{error ? '图片未能加载' : '正在加载图片'}</span>\n {error && <button type=\"button\" className={css.textButton} onClick={() => setAttempt(value => value + 1)}>重试</button>}\n </div>}\n </div>\n {attachment.name && <figcaption>{attachment.name}</figcaption>}\n <dialog ref={dialog} className={css.imageDialog} aria-label=\"图片预览\" onClose={() => opener.current?.focus()} onClick={event => { if (event.target === dialog.current) dialog.current?.close(); }}>\n <button type=\"button\" autoFocus className={css.dialogClose} aria-label=\"关闭图片预览\" onClick={() => dialog.current?.close()}>×</button>\n {url && <img src={url} alt={attachment.name ?? '会话图片'} />}\n </dialog>\n </figure>;\n});\n\nexport function contentBlocks(content: UserMessageNode['content']): AssistantBlock[] {\n return content.map(block => {\n if (block.type === 'text') return { kind: 'text', text: block.text };\n if (block.type === 'image') return { kind: 'image', attachment: block.attachment };\n return { kind: 'other', block };\n });\n}\n\ntype TextPresentation = { startedAt?: number; interrupted?: boolean; liveText?: boolean };\n\ntype MarkdownStreamProps = {\n text: string;\n streaming: boolean;\n holdFormatting: boolean;\n kind?: 'body' | 'reasoning';\n fileMentions?: BlockRenderProps['fileMentions'];\n transformed?: boolean;\n} & TextPresentation;\n\nfunction MarkdownStream({ text, streaming, holdFormatting, startedAt, interrupted = false, liveText = false, kind = 'body', fileMentions, transformed = false }: MarkdownStreamProps) {\n const root = useRef<HTMLDivElement>(null);\n const presentation = useStreamingText(text, streaming, { startedAt, interrupted: interrupted || !liveText, selected: holdFormatting });\n // Native Markdown changes block keys for its full final parse. Keep the last\n // committed mode while this answer is selected, then finish formatting on\n // deselection. Business status and the source text still update normally.\n const committedMode = useRef(streaming);\n const effectiveMode = holdFormatting ? committedMode.current : presentation.formatStreaming;\n useLayoutEffect(() => { committedMode.current = effectiveMode; }, [effectiveMode]);\n return <div ref={root} className={css.readingText} data-reader-text data-reader-text-kind={kind} data-received-length={text.length} data-shown-length={presentation.text.length}\n data-presentation-pending={presentation.pending || undefined} data-motion-style=\"opacity-blur\" data-ud-motion=\"reader-text-arrival\" data-ud-motion-type=\"reveal\" data-ud-motion-no-flash=\"true\"\n data-text-transform={transformed ? (streaming ? 'live' : 'final') : undefined}>\n <MotionMarkdown text={presentation.text} streaming={effectiveMode} enabled={liveText && presentation.reveal && effectiveMode} revision={presentation.revision} fileMentions={fileMentions} />\n </div>;\n}\n\nfunction TransformedMarkdown({ registry, blockKey, source, text, streaming, ...props }: MarkdownStreamProps & { registry: TextTransformRegistry; blockKey: string; source: ReaderBlockOwner['source'] }) {\n const shown = useDisplayText(registry, { text, streaming, blockKey, kind: 'body', source });\n return <MarkdownStream {...props} text={shown.text} streaming={displayStreaming(streaming, shown, true)} transformed />;\n}\n\nfunction ReadingMarkdown({ blockKey, source, ...props }: MarkdownStreamProps & { blockKey: string; source: ReaderBlockOwner['source'] }) {\n const registry = activeTextTransform();\n if (registry?.has('body')) return <TransformedMarkdown registry={registry} blockKey={blockKey} source={source} {...props} />;\n return <MarkdownStream {...props} />;\n}\n\ntype ReasoningStreamProps = { blockKey: string; text: string; streaming: boolean; holdFormatting: boolean; transformed?: boolean } & TextPresentation;\n\nfunction ReasoningStream({ blockKey, text, streaming, holdFormatting, startedAt, interrupted = false, liveText = false, transformed = false }: ReasoningStreamProps) {\n const presentation = useStreamingText(text, streaming, { startedAt, interrupted: interrupted || !liveText, selected: holdFormatting });\n return <div className={css.readingText} data-reader-text data-reader-text-kind=\"reasoning\" data-reader-reasoning-block-key={blockKey} data-received-length={text.length} data-shown-length={presentation.text.length}\n data-presentation-pending={presentation.pending || undefined} data-motion-style=\"opacity-blur\" data-ud-motion=\"reader-text-arrival\" data-ud-motion-type=\"reveal\" data-ud-motion-no-flash=\"true\"\n data-text-transform={transformed ? (streaming ? 'live' : 'final') : undefined}>\n <MotionPlainText text={presentation.text} enabled={liveText && presentation.reveal} revision={presentation.revision} />\n </div>;\n}\n\nfunction TransformedReasoning({ registry, blockKey, source, text, streaming, ...props }: ReasoningStreamProps & { registry: TextTransformRegistry; blockKey: string; source: ReaderBlockOwner['source'] }) {\n const shown = useDisplayText(registry, { text, streaming, blockKey, kind: 'reasoning', source });\n return <ReasoningStream {...props} blockKey={blockKey} text={shown.text} streaming={displayStreaming(streaming, shown, true)} transformed />;\n}\n\nfunction ReadingReasoning({ blockKey, source, ...props }: ReasoningStreamProps & { blockKey: string; source: ReaderBlockOwner['source'] }) {\n const registry = activeTextTransform();\n if (registry?.has('reasoning')) return <TransformedReasoning registry={registry} blockKey={blockKey} source={source} {...props} />;\n return <ReasoningStream {...props} blockKey={blockKey} />;\n}\n\nfunction fallback(block: AssistantBlock, streaming: boolean, source: ReaderBlockOwner['source'], loadImage: BlockRenderProps['loadImage'], fillComposer: BlockRenderProps['fillComposer'], holdFormatting: boolean, presentation: TextPresentation, blockKey: string, fileMentions?: BlockRenderProps['fileMentions']): ReactNode {\n switch (block.kind) {\n case 'text': return source === 'user' ? <MarkdownText text={block.text} labels={markdownLabels} /> : <ReadingMarkdown text={block.text} streaming={streaming} holdFormatting={holdFormatting} {...presentation} fileMentions={fileMentions} blockKey={blockKey} source={source} />;\n case 'image': return <ImageBlock attachment={block.attachment} loadImage={loadImage} />;\n case 'reasoning': return <ReadingReasoning text={block.text} streaming={streaming} holdFormatting={holdFormatting} {...presentation} blockKey={blockKey} source={source} />;\n case 'tool-call': return <JsonBlock label={`工具参数 · ${block.name}`} payload={block.argsRaw} truncatedLabel={truncatedJsonLabel} />;\n case 'other': {\n const raw = block.block;\n if (raw && typeof raw === 'object') {\n const item = raw as Record<string, unknown>;\n if ((item.type === 'mcp-app' || item.type === 'mcpapp' || item.type === 'ui') && typeof item.html === 'string') {\n return <McpAppFrame html={item.html} title={typeof item.title === 'string' ? item.title : undefined} fillComposer={fillComposer} />;\n }\n }\n return <div className={css.unknown}>\n <p>此内容类型尚未接入阅读页,原始内容已保留。</p>\n <JsonBlock label=\"查看原始内容\" payload={block.block} truncatedLabel={truncatedJsonLabel} />\n </div>;\n }\n }\n}\n\nexport const Blocks = memo(function Blocks({ blocks, streaming = false, source = 'assistant', holdFormatting = false, startedAt, interrupted, liveText, renderSlotChain, loadImage, fillComposer, fileMentions }: BlockRenderProps & TextPresentation & {\n blocks: readonly AssistantBlock[]; streaming?: boolean; source?: ReaderBlockOwner['source']; holdFormatting?: boolean;\n}) {\n const reactId = useId();\n return <ComposerFillContext.Provider value={fillComposer}>\n <div className={css.blocks} data-streaming={streaming || undefined}>\n {blocks.map((block, index) => <BlockBoundary key={block.kind === 'image' ? `image:${block.attachment.attachmentId}:${index}` : `${index}:${block.kind}`}>\n <Fragment>{renderSlotChain('dsh-better-display.block', readerBlockOwner(block, streaming, source, { startedAt, interrupted, liveText }, holdFormatting), { fallback: fallback(block, streaming, source, loadImage, fillComposer, holdFormatting, { startedAt, interrupted, liveText }, `${reactId}:${index}:${block.kind}`, fileMentions) })}</Fragment>\n </BlockBoundary>)}\n </div>\n </ComposerFillContext.Provider>;\n});\n\nimport { TurnMetrics } from './TurnMetrics.js';\n\nfunction CopyGlyph() {\n return <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\"><rect x=\"5\" y=\"5\" width=\"8\" height=\"8\" rx=\"1.5\" /><path d=\"M3 10H2.8A.8.8 0 0 1 2 9.2V2.8a.8.8 0 0 1 .8-.8h6.4a.8.8 0 0 1 .8.8V3\" /></svg>;\n}\n\nfunction useCopyReceipt() {\n const [receipt, setReceipt] = useState('');\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => { if (timer.current) clearTimeout(timer.current); }, []);\n const copy = async (text: string) => {\n const accepted = await writeClipboard(text);\n setReceipt(accepted ? '已复制' : '未能复制,请手动选择文字');\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setReceipt(''), 2000);\n };\n return { receipt, copy };\n}\n\nfunction MessageClock({ time }: { time: number }) {\n return <time className={css.messageClock} dateTime={new Date(time).toISOString()}>{formatMessageClock(time)}</time>;\n}\n\nexport function CopyAnswer({ blocks, onFork, metrics, extraActions }: { blocks: readonly AssistantBlock[]; onFork?: () => void; metrics?: BlockRenderProps['metrics']; extraActions?: ReactNode }) {\n const { receipt, copy } = useCopyReceipt();\n // Session text. A display transformer does not write these blocks.\n const text = originalAnswerText(blocks);\n const endedAt = metrics?.endedAt;\n const hasMetrics = metrics !== undefined && (metrics.usage !== undefined || metrics.runMs !== undefined || endedAt !== undefined);\n if (!text.trim() && !onFork && !hasMetrics) return null;\n return <div className={css.answerActions}>\n {text.trim() !== '' && (\n <button type=\"button\" className={css.iconButton} aria-label=\"复制回答\" title=\"复制回答\" onClick={() => { void copy(text); }}>\n <CopyGlyph />\n </button>\n )}\n {extraActions}\n {onFork && (\n <button\n type=\"button\"\n className={css.iconButton}\n aria-label=\"以此处为基础创建分叉会话\"\n title=\"以此处为基础创建分叉会话 (Fork)\"\n onClick={onFork}\n >\n <svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\">\n <circle cx=\"4.5\" cy=\"3.5\" r=\"1.8\" />\n <circle cx=\"4.5\" cy=\"12.5\" r=\"1.8\" />\n <circle cx=\"11.5\" cy=\"5.5\" r=\"1.8\" />\n <path d=\"M4.5 5.5v5M4.5 8c2.5 0 4.5-1 7-2.5\" strokeLinecap=\"round\" />\n </svg>\n </button>\n )}\n {metrics && <TurnMetrics usage={metrics.usage} runMs={metrics.runMs} tokensPerSecond={metrics.tokensPerSecond} ttftMs={metrics.ttftMs} />}\n {endedAt !== undefined && <MessageClock time={endedAt} />}\n <span role=\"status\" className={css.meta}>{receipt}</span>\n </div>;\n}\n\nexport function UserMessageActions({ text, time }: { text: string; time?: number }) {\n const { receipt, copy } = useCopyReceipt();\n const hasText = text.trim() !== '';\n if (!hasText && time === undefined) return null;\n return <div className={css.userActions}>\n {time !== undefined && <MessageClock time={time} />}\n {hasText && (\n <button type=\"button\" className={css.iconButton} aria-label=\"复制消息\" title=\"复制消息\" onClick={() => { void copy(text); }}>\n <CopyGlyph />\n </button>\n )}\n <span role=\"status\" className={css.meta}>{receipt}</span>\n </div>;\n}\n","/** Transitions.dev Reasoning stream, adapted to appended content, never a loop. */\nexport const REASON_HOLD = 840;\nexport const REASON_STEP = 500;\nexport const REASON_LINES = 2;\n/** Ceiling on how much text one catch-up step may cover. */\nexport const REASON_MAX_LINES = 40;\n/** Beat between catch-up steps, while the transcript is still well behind. */\nexport const REASON_CHASE_HOLD = 40;\n\nexport function reasoningTarget(\n top: number,\n contentHeight: number,\n viewportHeight: number,\n lineHeight: number,\n backlogLines = 0,\n): number {\n const end = Math.max(0, contentHeight - viewportHeight);\n const current = Math.min(end, Math.max(0, top));\n // `backlogLines` is how far the newest text sits below what is painted. The\n // reference step size is a reading pace: two lines, then a hold. That pace is\n // far slower than a fast model writes, so the viewport used to crawl behind in\n // fixed hops no matter how quickly the text arrived. Covering the backlog in\n // one step keeps the newest line with the text instead; a model that writes at\n // or below the reading pace still leaves the backlog at two lines, unchanged.\n const lines = Math.max(REASON_LINES, Math.min(REASON_MAX_LINES, Math.ceil(backlogLines)));\n return Math.min(end, current + Math.max(1, lineHeight) * lines);\n}\n\n","import { useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\nimport { StreamMotionContext } from './streaming.js';\nimport type { ReactNode } from 'react';\nimport { REASON_CHASE_HOLD, REASON_HOLD, REASON_LINES, REASON_STEP, reasoningTarget } from './reasoning-follow.js';\nimport css from './Reader.module.css';\n\nconst EASING = 'cubic-bezier(.22,1,.36,1)';\n\n/** One real transcript: reference transform while following, native scroll while reading. */\nexport function ReasoningCard({ children, step, active, motion, selected, onRead }: {\n children: ReactNode; step: number; active: boolean; motion: boolean; selected: boolean; onRead: () => void;\n}) {\n const viewport = useRef<HTMLDivElement>(null);\n const track = useRef<HTMLDivElement>(null);\n const content = useRef<HTMLDivElement>(null);\n const controls = useId();\n const [expanded, setExpanded] = useState(false);\n const [following, setFollowing] = useState(true);\n const [overflow, setOverflow] = useState(false);\n const [edges, setEdges] = useState('none');\n const lastHeight = useRef(0);\n const resize = useRef<Animation | null>(null);\n const previousExpanded = useRef(expanded);\n const stopFollow = useRef<() => void>(() => {});\n const { paused = false } = useContext(StreamMotionContext);\n const allowed = following && active && motion && !selected && !paused;\n\n const pause = useCallback(() => {\n stopFollow.current();\n setFollowing(false);\n onRead();\n }, [onRead]);\n\n useLayoutEffect(() => {\n // The parent's selection observer can suspend this card before its own\n // listener runs. Clearing a selection must not silently resume following.\n if (!selected) return;\n stopFollow.current();\n setFollowing(false);\n }, [selected]);\n\n useLayoutEffect(() => {\n if (!expanded) return;\n const port = viewport.current;\n const host = port?.closest<HTMLElement>('[data-conversation-scroll]');\n if (!port || !host) return;\n const fit = () => {\n // Public DSH layout variable, updated by the native composer's observer.\n // Leave room for the permanent identity, footer and reading margin.\n const composer = parseFloat(getComputedStyle(host).getPropertyValue('--dsh-composer-height')) || 152;\n const heading = port.parentElement?.querySelector<HTMLElement>('[data-reader-reasoning-heading]')?.offsetHeight || 30;\n const footer = port.parentElement?.querySelector<HTMLElement>('[data-ud-check=reasoning-controls]')?.offsetHeight || 38;\n const available = Math.max(120, host.clientHeight - composer - heading - footer - 32);\n port.style.setProperty('--reason-reading-height', `${available}px`);\n };\n fit();\n const observer = new ResizeObserver(fit); observer.observe(host);\n return () => { observer.disconnect(); };\n }, [expanded]);\n\n useLayoutEffect(() => {\n const port = viewport.current;\n const text = content.current;\n const scrollTrack = track.current;\n if (!port || !text || !scrollTrack) return;\n let frame = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let nextAt = performance.now() + REASON_HOLD;\n let alive = true;\n let automatic = false;\n let lastPainted = port.scrollTop;\n let targetOffset = lastPainted;\n const tail = () => Math.max(0, text.offsetHeight - port.clientHeight);\n const clamp = (value: number) => Math.max(0, Math.min(tail(), value));\n const paintedOffset = () => {\n if (!automatic) return port.scrollTop;\n const transform = getComputedStyle(scrollTrack).transform;\n // Reduced-motion CSS may win before React receives the media change.\n // Retain the last painted position rather than snapping back to the top.\n return clamp(transform === 'none' ? lastPainted : port.scrollTop - new DOMMatrixReadOnly(transform).m42);\n };\n const hasSelection = () => {\n const selection = document.getSelection();\n return !!selection && !selection.isCollapsed && !!selection.anchorNode && text.contains(selection.anchorNode);\n };\n const cancel = () => {\n cancelAnimationFrame(frame); frame = 0;\n clearTimeout(timer); timer = undefined;\n delete port.dataset.reasoningMoving;\n };\n const manual = () => {\n if (!automatic) return;\n const top = paintedOffset();\n automatic = false;\n scrollTrack.style.transition = 'none';\n scrollTrack.style.transform = 'none';\n // Set both in the same layout effect/event, before a frame can paint.\n // The first wheel gesture must already have a native scrollable viewport.\n port.style.overflow = 'auto';\n port.scrollTop = top;\n lastPainted = port.scrollTop;\n port.dataset.reasoningMode = 'manual';\n };\n const follow = () => {\n if (automatic) return;\n targetOffset = lastPainted = clamp(port.scrollTop);\n scrollTrack.style.transition = 'none';\n scrollTrack.style.transform = `translateY(-${lastPainted}px)`;\n port.scrollTop = 0;\n port.style.overflow = 'hidden';\n automatic = true;\n port.dataset.reasoningMode = 'transform';\n };\n const measure = (recordHeight = true) => {\n const previewHeight = parseFloat(getComputedStyle(port).getPropertyValue('--reason-preview-height'));\n setOverflow(text.offsetHeight > previewHeight + 1);\n lastPainted = paintedOffset();\n const top = lastPainted > 1;\n const bottom = tail() - lastPainted > 1;\n const next = top ? bottom ? 'both' : 'top' : bottom ? 'bottom' : 'none';\n setEdges(value => value === next ? value : next);\n if (recordHeight && !resize.current) lastHeight.current = port.clientHeight;\n };\n stopFollow.current = () => { cancel(); manual(); measure(false); };\n const canFollow = () => allowed && alive && !document.hidden && !hasSelection();\n const schedule = () => {\n if (!canFollow() || frame || timer !== undefined) return;\n follow();\n if (tail() - paintedOffset() < 1) return;\n timer = setTimeout(start, Math.max(0, nextAt - performance.now()));\n };\n const start = () => {\n timer = undefined;\n if (!canFollow()) return;\n const from = paintedOffset();\n const lineHeight = parseFloat(getComputedStyle(text).lineHeight) || 24;\n // How much unpainted text is waiting. A fast model pushes this far past the\n // reference step, and chasing it is what keeps the scroll continuous.\n const backlogLines = Math.max(0, (tail() - from) / lineHeight);\n const target = reasoningTarget(from, text.offsetHeight, port.clientHeight, lineHeight, backlogLines);\n if (target - from < 1) return;\n const began = performance.now();\n // Still behind after this step: take the next one almost immediately instead\n // of holding the reading beat, so motion tracks the text rather than stalling.\n nextAt = began + (backlogLines > REASON_LINES ? REASON_CHASE_HOLD : REASON_HOLD);\n targetOffset = target;\n // The supplied recipe: commit the start pose, then transition the track.\n // No per-frame scrollTop writes and no catch-up across unread lines.\n scrollTrack.style.transition = 'none';\n scrollTrack.style.transform = `translateY(-${from}px)`;\n void scrollTrack.offsetHeight;\n scrollTrack.style.transition = 'transform var(--reason-step) var(--reason-ease)';\n scrollTrack.style.transform = `translateY(-${target}px)`;\n port.dataset.reasoningMoving = 'true';\n port.dataset.reasoningFrom = String(from);\n port.dataset.reasoningTarget = String(target);\n port.dataset.reasoningBegan = String(began);\n const tick = (now: number) => {\n frame = 0;\n if (!canFollow()) { cancel(); manual(); return; }\n // Observe the browser's actual CSS interpolation for masks and handoff.\n measure();\n if (now - began < REASON_STEP || Math.abs(lastPainted - target) > .05) frame = requestAnimationFrame(tick);\n else { delete port.dataset.reasoningMoving; schedule(); }\n };\n frame = requestAnimationFrame(tick);\n };\n const onScroll = () => {\n measure();\n // Focus/keyboard-induced native scroll wins even while the track moves.\n if (automatic && port.scrollTop > 1) pause();\n };\n const onWheel = (event: WheelEvent) => {\n if (!event.deltaY) return;\n // The compositor picks a wheel scroller before handlers run. A clipped\n // transform viewport would otherwise lose this first gesture or scroll\n // the conversation. Consume only this handoff; later wheels stay native.\n const handoff = automatic && event.cancelable;\n if (handoff) event.preventDefault();\n const unit = event.deltaMode === WheelEvent.DOM_DELTA_LINE ? parseFloat(getComputedStyle(text).lineHeight) || 24\n : event.deltaMode === WheelEvent.DOM_DELTA_PAGE ? port.clientHeight : 1;\n pause();\n if (handoff) { port.scrollTop = clamp(port.scrollTop + event.deltaY * unit); measure(); }\n };\n const onSelection = () => { if (hasSelection()) pause(); };\n const onVisibility = () => {\n cancel(); manual();\n nextAt = performance.now() + REASON_HOLD;\n if (!document.hidden) schedule();\n };\n const observer = new ResizeObserver(() => {\n if (automatic && targetOffset > tail() + 1) {\n cancel(); manual();\n nextAt = performance.now() + REASON_HOLD;\n }\n measure(); schedule();\n });\n observer.observe(text); observer.observe(port);\n port.addEventListener('scroll', onScroll, { passive: true });\n port.addEventListener('wheel', onWheel, { passive: false });\n document.addEventListener('selectionchange', onSelection);\n document.addEventListener('visibilitychange', onVisibility);\n // Keep the previous layout height until the resize effect can sample it.\n measure(false); schedule();\n return () => {\n alive = false; cancel(); manual(); observer.disconnect();\n port.removeEventListener('scroll', onScroll); port.removeEventListener('wheel', onWheel);\n document.removeEventListener('selectionchange', onSelection);\n document.removeEventListener('visibilitychange', onVisibility);\n stopFollow.current = () => {};\n };\n }, [allowed, pause]);\n\n useLayoutEffect(() => {\n const port = viewport.current;\n if (!port) return;\n const changed = expanded !== previousExpanded.current;\n previousExpanded.current = expanded;\n const from = resize.current ? port.clientHeight : lastHeight.current;\n resize.current?.cancel(); resize.current = null;\n port.style.maxHeight = ''; port.style.height = '';\n const target = port.clientHeight;\n // Explicit reading adjusts only the conversation, never the outer app.\n // The card is also a reader anchor so resizing cannot pin a later answer\n // in place at the expense of this card's visible heading.\n if (changed && !selected) {\n const card = port.parentElement;\n const host = port.closest<HTMLElement>('[data-conversation-scroll]');\n if (card && host) {\n const composer = parseFloat(getComputedStyle(host).getPropertyValue('--dsh-composer-height')) || 152;\n const region = host.getBoundingClientRect();\n const box = card.getBoundingClientRect();\n const top = region.top + 16;\n const bottom = region.bottom - composer - 16;\n const delta = box.top < top ? box.top - top : box.bottom > bottom ? Math.min(box.bottom - bottom, box.top - top) : 0;\n if (Math.abs(delta) > 1) host.scrollTo({ top: Math.max(0, host.scrollTop + delta), behavior: motion ? 'smooth' : 'instant' });\n }\n }\n if (!changed || !motion || from < 1 || Math.abs(target - from) < 1) {\n lastHeight.current = target;\n return;\n }\n // max-height otherwise clamps the very first collapse frame to the new cap.\n port.style.maxHeight = 'none';\n const animation = port.animate([{ height: `${from}px` }, { height: `${target}px` }], { duration: 300, easing: EASING, fill: 'both' });\n resize.current = animation;\n const restore = () => {\n // `max-height` was cleared so the first frame could exceed the old cap; it has\n // to come back even if the animation never reports finishing, or the card keeps\n // the inline styles the animation was driving.\n port.style.maxHeight = ''; port.style.height = '';\n lastHeight.current = port.clientHeight;\n };\n let settled = false;\n const settle = () => {\n if (settled) return;\n settled = true;\n if (resize.current === animation) resize.current = null;\n animation.cancel();\n restore();\n };\n animation.onfinish = settle;\n // `fill: 'both'` holds whichever keyframe the animation stopped on, so a run that\n // never finishes — cancelled by a re-run, unmounted, or skipped by the compositor —\n // would leave the card at the previous height with its inline styles still\n // overridden. Restore on a deadline too.\n const deadline = window.setTimeout(settle, 300 + 240);\n return () => { window.clearTimeout(deadline); };\n }, [expanded, motion, selected]);\n useEffect(() => () => resize.current?.cancel(), []);\n\n const toggleReading = () => {\n // Resize the same transcript without changing follow intent or position.\n // Wheel, selection and viewport focus still explicitly pause following.\n onRead();\n setExpanded(value => !value);\n };\n\n return <div className={css.reasonCard} data-reader-reasoning-card data-reader-anchor data-expanded={expanded} data-following={allowed} data-overflow={overflow} data-ud-motion=\"reader-reasoning-size\">\n <div className={css.reasonHeading} data-reader-reasoning-heading data-ud-check=\"reasoning-identity\">\n <span className={css.reasonLabel} data-reader-reasoning-label>思考</span>\n <span>步骤 {step}</span>\n </div>\n <div ref={viewport} id={controls} className={css.reasonViewport} data-reader-reasoning-scroll data-edges={edges}\n data-ud-motion=\"reader-reasoning-scroll\" role=\"region\" aria-label={`步骤 ${step} 的思考${overflow ? ',可滚动阅读' : ''}`}\n tabIndex={overflow ? 0 : undefined} onPointerDown={pause} onFocus={pause}>\n <div ref={track} className={css.reasonTrack} data-reader-reasoning-track>\n <div ref={content} className={css.reasonText} data-reader-reasoning-text>{children}</div>\n </div>\n </div>\n {(overflow || expanded) && <div className={css.reasonFooter} data-ud-check=\"reasoning-controls\">\n {active && motion ? <button type=\"button\" className={css.reasonAction} disabled={selected} aria-controls={controls}\n aria-label={following ? '暂停自动跟随思考' : '继续跟随最新思考'}\n title={selected ? '取消文字选择后可继续跟随' : undefined}\n onClick={() => { if (following) pause(); else { onRead(); setFollowing(true); } }}>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">{following ? <path d=\"M5.5 4v8m5-8v8\" /> : <path d=\"M8 3v10m-4-4 4 4 4-4\" />}</svg>\n {following ? '暂停跟随' : '跟随最新'}\n </button> : <span className={css.reasonCaption}>{expanded ? '手动阅读' : '可滚动阅读'}</span>}\n <button type=\"button\" className={css.reasonAction} aria-expanded={expanded} aria-controls={controls}\n aria-label={expanded ? '收起完整思考' : '展开阅读完整思考'} onClick={toggleReading}>\n {expanded ? '收起' : '展开阅读'}\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">{expanded ? <path d=\"m4 10 4-4 4 4\" /> : <path d=\"m4 6 4 4 4-4\" />}</svg>\n </button>\n </div>}\n </div>;\n}\n","import { createElement, memo, useEffect, useLayoutEffect, useMemo, useRef, type ComponentType, type ReactNode, type RefObject } from 'react';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { UseGroupAction } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport type { SlotEntryDef, SlotMap, SlotSpec, StoredEntry } from '@deepseek-ai/dsh-client-ui-slots';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\n\n/**\n * RC2 composition adapter. Only public registry operations are used. We lend\n * registrations a Reader-owned seat, not a second implementation of their UI.\n * The platform still binds injection, hooks, locale, stores and boundaries.\n * Original entries, declarations and components are never changed.\n *\n * Child seats have unique names because RC2 declarations have one owner. The\n * sole component wrapper translates those names before delegating to the\n * framework-provided renderSlot. It does not implement a slot renderer.\n */\nexport const OFFICIAL_SLOTS = {\n actions: 'conversation.chat.assistant-actions',\n tools: 'tool.call.toolview',\n tail: 'conversation.chat.turnTail',\n nodes: 'conversation.chat.node',\n messageImages: 'conversation.chat.message.images',\n userImages: 'conversation.chat.user.images',\n} as const;\nexport type OfficialFamily = keyof typeof OFFICIAL_SLOTS;\nexport const OFFICIAL_SEATS = {\n actions: 'dsh-better-display.official.actions/conversation.chat.assistant-actions',\n tools: 'dsh-better-display.official.tools/tool.call.toolview',\n tail: 'dsh-better-display.official.tail/conversation.chat.turnTail',\n nodes: 'dsh-better-display.official.nodes/conversation.chat.node',\n messageImages: 'dsh-better-display.official.messageImages/conversation.chat.message.images',\n userImages: 'dsh-better-display.official.userImages/conversation.chat.user.images',\n} as const;\nexport type OfficialSeat = typeof OFFICIAL_SEATS[OfficialFamily];\nexport const officialSeat = (family: OfficialFamily, source: string = OFFICIAL_SLOTS[family]) =>\n `dsh-better-display.official.${family}/${source}`;\n\ntype Spec = SlotSpec<SlotEntryDef>;\ntype Render = (key: string, owner: object, options?: object) => ReactNode;\ntype RenderProps = { renderSlot: Render; renderSlotChain?: Render } & Record<string, unknown>;\ntype Registration = StoredEntry['options'] & Omit<StoredEntry, 'options' | 'component'> & { name: string };\n\n/** The documented, type-erased registry inspection/registration boundary. */\nexport interface CompositionRegistry {\n spec(key: string): Spec | undefined;\n entriesOfSlot(key: string): readonly StoredEntry[];\n subscribe(key: string, listener: () => void): () => void;\n inject(key: string, effect: () => () => void): () => void;\n register(options: Registration, component: unknown): () => void;\n}\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface SlotMap {\n 'dsh-better-display.official.actions/conversation.chat.assistant-actions': SlotMap['conversation.chat.assistant-actions'];\n 'dsh-better-display.official.tools/tool.call.toolview': SlotMap['tool.call.toolview'];\n 'dsh-better-display.official.tail/conversation.chat.turnTail': SlotMap['conversation.chat.turnTail'];\n 'dsh-better-display.official.nodes/conversation.chat.node': SlotMap['conversation.chat.node'];\n 'dsh-better-display.official.messageImages/conversation.chat.message.images': SlotMap['conversation.chat.message.images'];\n 'dsh-better-display.official.userImages/conversation.chat.user.images': SlotMap['conversation.chat.user.images'];\n }\n}\n\n/**\n * Searchable hide for official nodes drawn outside the Chat flow viewport.\n * The flow's own `useGroupAction` is not in scope here; this keeps the same\n * `hidden=\"until-found\"` contract so browser find can still reveal the row.\n */\nexport function useReaderGroupAction(hidden: boolean, reveal: () => void): RefObject<HTMLDivElement> {\n const ref = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n const element = ref.current;\n if (element === null) return;\n if (hidden && element.contains(element.ownerDocument.activeElement)) {\n reveal();\n return;\n }\n if (hidden) element.setAttribute('hidden', 'until-found');\n else element.removeAttribute('hidden');\n }, [hidden, reveal]);\n useEffect(() => {\n const element = ref.current;\n if (element === null) return;\n element.addEventListener('beforematch', reveal);\n return () => { element.removeEventListener('beforematch', reveal); };\n }, [reveal]);\n return ref;\n}\n\nexport const readerGroupAction: UseGroupAction = useReaderGroupAction;\n\n// Reader draws these rows itself. Everything else, including future kinds, is\n// mirrored so the official renderer still runs inside the reading view.\n// 'user' and 'steering' stay mirrored (message-recall buttons and the like).\n// 'assistant-step' is special: the official renderer is priority 0 and Reader\n// keeps that presentation. A strictly lower priority is a keyed-slot\n// replacement (lowest priority renders) and is mirrored for body content.\nconst READER_OWNED_NODES = new Set(['tool-call', 'turn-tail', 'turn-process']);\n\n/** Official `AssistantNodeView` registers at priority 0. Lower wins. */\nexport const OFFICIAL_ASSISTANT_PRIORITY = 0;\n\n/**\n * Mirror a chat-node registration into the Reader seat.\n * Assistant replacements are the entries that would actually replace the\n * official renderer on the host. The official priority itself stays out, so\n * Reader keeps its own answer markdown until a plugin opts in.\n */\nexport function acceptMirroredChatNode(entry: StoredEntry): boolean {\n const key = entry.options.key ?? '';\n if (key === 'assistant-step') return (entry.options.priority ?? OFFICIAL_ASSISTANT_PRIORITY) < OFFICIAL_ASSISTANT_PRIORITY;\n return !READER_OWNED_NODES.has(key);\n}\nconst EXPECTED: Record<OfficialFamily, Spec> = {\n actions: { kind: 'list', scope: 'session' },\n tools: { kind: 'keyed', scope: 'session' },\n tail: { kind: 'list', scope: 'session' },\n nodes: { kind: 'keyed', scope: 'session' },\n messageImages: { kind: 'single', scope: 'session' },\n userImages: { kind: 'single', scope: 'session' },\n};\n\n/**\n * Reader already presents produced paths with its copy/reveal actions. RC2's\n * official tail additionally owns explicit `present` artifacts. Leave those\n * cards, actions and state intact, and omit only the duplicate produced chips.\n * This changes a presentation prop, never the source match or session data.\n * Unrecognized shapes pass through intact for safe forward degradation.\n */\nexport function readerTailMatch(value: unknown, displayedPaths?: readonly string[]): unknown {\n if (!value || typeof value !== 'object') return value;\n const match = value as Record<string, unknown>;\n const displayed = new Set(displayedPaths ?? []);\n return displayed.size > 0 && Array.isArray(match.produced) && Array.isArray(match.presented)\n ? { ...match, produced: match.produced.filter(path => !displayed.has(path)) }\n : value;\n}\n\nfunction tailPresentation(component: unknown) {\n const Original = component as ComponentType<Record<string, unknown>>;\n return memo(function ReaderTailPresentation(props: Record<string, unknown>) {\n const matched = useMemo(() => readerTailMatch(props.matched, props.readerProducedPaths as readonly string[] | undefined), [props.matched, props.readerProducedPaths]);\n return createElement(Original, { ...props, matched });\n });\n}\n\nexport function officialChildren(slots: Pick<CompositionRegistry, 'spec'>): { [K in OfficialSeat]: SlotSpec<SlotMap[K]> } {\n return Object.fromEntries(Object.entries(OFFICIAL_SLOTS).map(([name, source]) => {\n const family = name as OfficialFamily;\n const spec = slots.spec(source);\n if (spec && (spec.kind !== EXPECTED[family].kind || spec.scope !== EXPECTED[family].scope)) {\n throw new Error(`Official slot contract changed: ${source} (${spec.kind}/${spec.scope})`);\n }\n // In particular, retain conversation.chat.node's contextual turn-data hook.\n return [officialSeat(family), spec ?? EXPECTED[family]];\n })) as { [K in OfficialSeat]: SlotSpec<SlotMap[K]> };\n}\n\nfunction translatedComponent(entry: StoredEntry, names: ReadonlyMap<string, string>) {\n if (names.size === 0) return entry.component;\n const Original = entry.component as ComponentType<Record<string, unknown>>;\n return memo(function OfficialSlotChildren(props: RenderProps) {\n const renders = useMemo(() => {\n const translate = (render: Render | undefined): Render => (key, owner, options) => {\n const seat = names.get(key);\n if (!seat || !render) throw new Error(`Undeclared official child slot: ${key}`);\n return render(seat, owner, options);\n };\n return {\n renderSlot: translate(props.renderSlot),\n ...(props.renderSlotChain ? { renderSlotChain: translate(props.renderSlotChain) } : {}),\n };\n }, [props.renderSlot, props.renderSlotChain]);\n return createElement(Original, { ...props, ...renders });\n });\n}\n\n/**\n * Mirror one elected contribution set incrementally. Unrelated additions do not\n * remount existing cards or recreate their subscriptions. A source unload/HMR\n * disposes the corresponding subtree and closures before its replacement.\n */\nexport function mirrorOfficialSlot(\n slots: CompositionRegistry,\n source: string,\n target: string,\n namespace: string,\n accept: (entry: StoredEntry) => boolean = () => true,\n): () => void {\n const mounted = new Map<StoredEntry, () => void>();\n let stopped = false;\n const reconcile = () => {\n if (stopped) return;\n const entries = slots.entriesOfSlot(source).filter(accept);\n const wanted = new Set(entries);\n for (const [entry, dispose] of mounted) {\n if (wanted.has(entry)) continue;\n dispose();\n mounted.delete(entry);\n }\n for (const entry of entries) {\n if (mounted.has(entry)) continue;\n const names = new Map(Object.keys(entry.children ?? {}).map(key => [key, `${namespace}/${key}`]));\n const children = Object.fromEntries([...names].map(([key, seat]) => [seat, entry.children![key]]));\n const disposers: (() => void)[] = [];\n const dispose = () => { for (const stop of disposers.splice(0).reverse()) stop(); };\n try {\n const { component: _component, options, children: _children, ...metadata } = entry;\n const presentation = source === OFFICIAL_SLOTS.tail && entry.locale === 'deliverables'\n ? { ...entry, component: tailPresentation(entry.component) }\n : entry;\n disposers.push(slots.register({\n ...options, ...metadata, name: target,\n ...(names.size ? { children } : {}),\n registrant: `dsh-better-display → ${entry.registrant ?? source}`,\n }, translatedComponent(presentation, names)));\n for (const [key, seat] of names) {\n disposers.push(mirrorOfficialSlot(slots, key, seat, namespace));\n }\n mounted.set(entry, dispose);\n } catch (error) {\n dispose();\n throw error;\n }\n }\n };\n const unsubscribe = slots.subscribe(source, reconcile);\n const dispose = () => {\n stopped = true;\n unsubscribe();\n for (const stop of [...mounted.values()].reverse()) stop();\n mounted.clear();\n };\n try { reconcile(); } catch (error) { dispose(); throw error; }\n return dispose;\n}\n\nexport function installOfficialSlots(ctx: Context): () => void {\n // The SlotMap overloads are for statically declared keys. Aliases are a\n // runtime composition, using exactly the public erased metadata contract.\n const slots = ctx.slots as unknown as CompositionRegistry;\n const disposers: (() => void)[] = [];\n try {\n for (const [name, source] of Object.entries(OFFICIAL_SLOTS)) {\n const family = name as OfficialFamily;\n disposers.push(slots.inject(source, () => {\n const spec = slots.spec(source)!;\n const target = officialSeat(family);\n const declared = slots.spec(target);\n if (spec.kind !== declared?.kind || spec.scope !== declared.scope) {\n throw new Error(`Official slot contract changed: ${source}`);\n }\n return mirrorOfficialSlot(slots, source, target, `dsh-better-display.official.${family}`,\n family === 'nodes' ? acceptMirroredChatNode : undefined);\n }));\n }\n } catch (error) {\n for (const stop of disposers.reverse()) stop();\n throw error;\n }\n return () => { for (const stop of disposers.splice(0).reverse()) stop(); };\n}\n\nexport type OfficialSlotKey = typeof OFFICIAL_SLOTS[OfficialFamily] & keyof SlotMap;\n","export type ChatSeatKind = 'user' | 'steering';\n\nexport function chatSeatProps(kind: ChatSeatKind, key: string): Record<string, string> {\n return {\n 'data-chat-anchor-key': key,\n 'data-chat-flow-key': key,\n 'data-chat-node-key': key,\n 'data-chat-flow-kind': kind,\n };\n}\n","import { useCallback, useState, useSyncExternalStore, type ReactNode } from 'react';\nimport type { AssistantActionOwnerProps, ChatConversationViewNode, ChatNode, ChatNodeOwnerProps, TurnTailOwnerProps, UseDisclosure } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store';\nimport type { AssistantBlock, ToolCallBlock } from '@deepseek-ai/dsh-client-ui-conversation/client';\ntype MessageId = AssistantActionOwnerProps['messageId'];\nimport { OFFICIAL_SEATS, readerGroupAction } from './official-slots.js';\nimport type { BlockRenderProps } from './types.js';\nimport { chatSeatProps } from './chat-seat.js';\nimport { Blocks } from './Blocks.js';\n\nexport function OfficialActions({ official, messageId }: Pick<BlockRenderProps, 'official'> & { messageId?: MessageId }) {\n if (!official || !messageId) return null;\n return <span data-reader-official-actions style={{ display: 'contents' }}>\n {official.renderSlot(OFFICIAL_SEATS.actions, { messageId })}\n </span>;\n}\n\n/** Each atomic Tool view owns its disclosure state through this stable Hook prop. */\nconst useToolDisclosure: UseDisclosure = () => {\n const [expanded, setExpanded] = useState(false);\n const toggle = useCallback(() => setExpanded(previous => !previous), []);\n return { expanded, setExpanded, toggle };\n};\n\nexport function OfficialTool({ official, block, toolName, cwd, openFile, fallback }: BlockRenderProps & {\n official: NonNullable<BlockRenderProps['official']>; block: ToolCallBlock; toolName: string; fallback: ReactNode;\n}) {\n const home = useSyncExternalStore(official.officialHost.subscribe, official.officialHost.getSnapshot).home;\n return <div data-reader-tool-official>\n {(official.renderSlot as (key: string, owner: object, options: object) => ReactNode)(OFFICIAL_SEATS.tools, {\n callId: block.callId, toolName,\n phase: 'kind' in block ? 'result' : block.phase, block, cwd, home,\n openFile: openFile ?? (() => {}),\n loadImage: official.officialImageLoader,\n useDisclosure: useToolDisclosure,\n inspect: () => official.openView('trajectory', block.callId),\n }, { entryKey: toolName, hookContext: { callId: block.callId, assistant: undefined }, fallback })}\n </div>;\n}\n\nfunction chatNodeOwner(render: BlockRenderProps, official: NonNullable<BlockRenderProps['official']>): ChatNodeOwnerProps {\n return {\n cwd: render.cwd,\n openFile: render.openFile ?? (() => {}),\n forkAt: render.forkAt ?? (() => {}),\n inspectCall: callId => official.openView('trajectory', callId),\n loadImage: official.officialImageLoader,\n fileMentions: official.officialFileMentions,\n };\n}\n\nfunction nodeHookContext(turnData: unknown, disclosureReset: ReturnType<typeof createSnapshotStore<number>>) {\n return { turnData, disclosureReset, useGroupAction: readerGroupAction };\n}\n\nexport function OfficialNode({ node, fallback, ...render }: BlockRenderProps & { node: ChatConversationViewNode; fallback: ReactNode }) {\n const official = render.official;\n const [disclosureReset] = useState(() => createSnapshotStore(0));\n if (!official) return fallback;\n const turn = node.location.kind === 'turn' || node.location.kind === 'step' ? node.location.turn : undefined;\n // The runtime node domain is open; the public SlotMap enumerates the known kinds.\n const renderNode = official.renderSlot as unknown as (key: string, owner: object, options: object) => ReactNode;\n return <div data-reader-official-node={node.kind} {...(node.kind === 'user' || node.kind === 'steering' ? chatSeatProps(node.kind, node.key) : {})}>\n {renderNode(OFFICIAL_SEATS.nodes, { ...chatNodeOwner(render, official), node }, { entryKey: node.kind, hookContext: nodeHookContext(turn?.data, disclosureReset), fallback })}\n </div>;\n}\n\ntype AssistantBodyProps = BlockRenderProps & {\n node: ChatNode<'assistant-step'>;\n blocks: readonly AssistantBlock[];\n streaming?: boolean;\n holdFormatting?: boolean;\n startedAt?: number;\n interrupted?: boolean;\n liveText?: boolean;\n};\n\n/**\n * Body of one assistant segment. A mirrored assistant-step replacement draws\n * it; Reader markdown is the fallback when no replacement is registered.\n * The caller keeps reasoning blocks on the reading card.\n */\nexport function OfficialAssistantBody({\n node, blocks, streaming = false, holdFormatting = false, startedAt, interrupted = false, liveText = false, ...render\n}: AssistantBodyProps) {\n const official = render.official;\n const [disclosureReset] = useState(() => createSnapshotStore(0));\n const fallback = <Blocks {...render} blocks={blocks} streaming={streaming} holdFormatting={holdFormatting} startedAt={startedAt} interrupted={interrupted} liveText={liveText} />;\n if (!official) return fallback;\n const turn = node.location.kind === 'turn' || node.location.kind === 'step' ? node.location.turn : undefined;\n const sameBlocks = blocks.length === node.data.blocks.length && blocks.every((block, index) => block === node.data.blocks[index]);\n const view = sameBlocks ? node : { ...node, data: { ...node.data, blocks } };\n const renderNode = official.renderSlot as unknown as (key: string, owner: object, options: object) => ReactNode;\n // groupPart matches the host split: response skips reasoning. The block\n // slice is what a replacement that ignores groupPart actually receives.\n return renderNode(OFFICIAL_SEATS.nodes, { ...chatNodeOwner(render, official), node: view, groupPart: 'response' }, {\n entryKey: 'assistant-step',\n hookContext: nodeHookContext(turn?.data, disclosureReset),\n fallback,\n });\n}\n\nexport function OfficialTail({ official, owner, produced }: Pick<BlockRenderProps, 'official'> & { owner?: TurnTailOwnerProps; produced: readonly string[] }) {\n const tailOwner = owner && official ? { ...owner, openFile: official.officialPreviewFile, readerProducedPaths: produced } : undefined;\n return official && tailOwner ? <div data-reader-official-tail style={{ display: 'contents' }}>\n {official.renderSlot(OFFICIAL_SEATS.tail, tailOwner)}\n </div> : null;\n}\n","/** One turn lane: `live` while it is still in the visible order. */\nexport interface TurnSlot<T extends { readonly key: string }> {\n readonly group: T;\n readonly live: boolean;\n}\n\n/**\n * Keep live turns in the incoming `groups` order, and keep a departing turn\n * next to the live neighbour that preceded it.\n *\n * A rewind removes turn keys from the visible order. Unmounting them in that\n * same commit snaps the transcript, so the lane retains the last group object\n * until the collapse finishes. A re-render, a stream tick, or a reconnect that\n * still contains the same keys only replaces the group object and leaves\n * `live` true — those updates must not start a collapse. A key that returns\n * is live again where `groups` places it. Loading older history therefore\n * stays in transcript order instead of appending the older turns after the\n * ones already on screen. A departing slot is inserted immediately after the\n * nearest preceding slot that is still live, or at the front when it had none,\n * so several departing neighbours keep their relative order.\n *\n * Returns `current` itself when nothing changed, so a React state update can\n * bail out on `Object.is`.\n */\nexport function reconcileTurnSlots<T extends { readonly key: string }>(\n current: readonly TurnSlot<T>[],\n groups: readonly T[],\n): readonly TurnSlot<T>[] {\n const incoming = new Map(groups.map(group => [group.key, group]));\n const next: TurnSlot<T>[] = groups.map(group => ({ group, live: true }));\n for (const slot of current) {\n if (incoming.has(slot.group.key)) continue;\n insertDeparting(next, { group: slot.group, live: false }, precedingLiveKey(current, incoming, slot.group.key));\n }\n const same =\n next.length === current.length &&\n next.every(\n (slot, index) => slot.live === current[index]!.live && slot.group === current[index]!.group,\n );\n return same ? current : next;\n}\n\n/** Nearest preceding slot that is still in the incoming order, if any. */\nfunction precedingLiveKey<T extends { readonly key: string }>(\n current: readonly TurnSlot<T>[],\n incoming: ReadonlyMap<string, T>,\n key: string,\n): string | undefined {\n const index = current.findIndex(slot => slot.group.key === key);\n for (let cursor = index - 1; cursor >= 0; cursor--) {\n const candidate = current[cursor]!.group.key;\n if (incoming.has(candidate)) return candidate;\n }\n return undefined;\n}\n\n/**\n * Place a departing slot after `anchorKey`, or at the front when the slot had\n * no preceding live neighbour. Slots that share an anchor keep `current` order\n * because each one is inserted at the end of the departing run after that anchor.\n */\nfunction insertDeparting<T extends { readonly key: string }>(\n next: TurnSlot<T>[],\n slot: TurnSlot<T>,\n anchorKey: string | undefined,\n): void {\n if (anchorKey === undefined) {\n const firstLive = next.findIndex(item => item.live);\n next.splice(firstLive < 0 ? next.length : firstLive, 0, slot);\n return;\n }\n const anchorIndex = next.findIndex(item => item.group.key === anchorKey);\n if (anchorIndex < 0) {\n next.unshift(slot);\n return;\n }\n let insertAt = anchorIndex + 1;\n while (insertAt < next.length && next[insertAt]?.live === false) insertAt++;\n next.splice(insertAt, 0, slot);\n}\n","import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { ReactNode, RefObject } from 'react';\nimport css from './Reader.module.css';\nimport { StreamMotionContext } from './streaming.js';\nimport { reconcileTurnSlots, type TurnSlot } from './turn-slots.js';\n\nconst EASING = 'cubic-bezier(.22,1,.36,1)';\n\nexport function useMotionAllowed(enabled: boolean): boolean {\n const [reduced, setReduced] = useState(() => window.matchMedia('(prefers-reduced-motion: reduce)').matches);\n useEffect(() => {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n const change = () => setReduced(query.matches);\n query.addEventListener('change', change);\n return () => query.removeEventListener('change', change);\n }, []);\n return enabled && !reduced;\n}\n\nexport function usePinnedSelection(root: RefObject<HTMLElement>, selector = '[data-reader-answer], [data-reader-body], [data-reader-process]'): readonly string[] {\n const [keys, setKeys] = useState<readonly string[]>([]);\n useEffect(() => {\n const update = () => {\n const selection = document.getSelection();\n const range = selection && !selection.isCollapsed && selection.rangeCount ? selection.getRangeAt(0) : null;\n const next = range && root.current\n ? [...new Set(Array.from(root.current.querySelectorAll<HTMLElement>(selector))\n .filter(element => range.intersectsNode(element))\n .map(element => element.dataset.readerKey ?? element.dataset.readerProcessKey!).filter(Boolean))]\n : [];\n setKeys(previous => previous.length === next.length && previous.every((key, index) => key === next[index]) ? previous : next);\n };\n document.addEventListener('selectionchange', update);\n return () => document.removeEventListener('selectionchange', update);\n }, [root, selector]);\n return keys;\n}\n\nexport function StatusText({ text, motion, shimmer = false }: { text: string; motion: boolean; shimmer?: boolean }) {\n const ref = useRef<HTMLSpanElement>(null);\n const [visible, setVisible] = useState(() => !document.hidden);\n const [forcedColors, setForcedColors] = useState(() => window.matchMedia('(forced-colors: active)').matches);\n const allowed = motion && visible && !forcedColors;\n const [frame, setFrame] = useState<{\n text: string; id: number; phase: 'idle' | 'start' | 'running';\n outgoing: { text: string; id: number } | null;\n }>({ text, id: 0, phase: 'idle', outgoing: null });\n // Adjust before commit, so a new label cannot paint once before its entry state.\n // Reuse the previous incoming key: a rapid change exits from its current pose.\n if (frame.text !== text) setFrame({\n text, id: frame.id + 1, phase: allowed ? 'start' : 'idle',\n outgoing: allowed ? { text: frame.text, id: frame.id } : null,\n });\n useEffect(() => {\n const update = () => setVisible(!document.hidden);\n const query = window.matchMedia('(forced-colors: active)');\n const colors = () => setForcedColors(query.matches);\n document.addEventListener('visibilitychange', update);\n query.addEventListener('change', colors);\n return () => { document.removeEventListener('visibilitychange', update); query.removeEventListener('change', colors); };\n }, []);\n useLayoutEffect(() => {\n const id = frame.id;\n const settle = () => setFrame(current => current.id === id && current.outgoing\n ? { ...current, phase: 'idle', outgoing: null } : current);\n if (!allowed) { settle(); return; }\n if (!frame.outgoing || !ref.current) return;\n // Commit the supplied .is-enter-start pose before releasing CSS transitions.\n ref.current.getBoundingClientRect();\n let timer = 0;\n const tick = requestAnimationFrame(() => {\n setFrame(current => current.id === id ? { ...current, phase: 'running' } : current);\n timer = window.setTimeout(settle, 200); // 150ms swap + 50ms incoming gap.\n });\n return () => { cancelAnimationFrame(tick); window.clearTimeout(timer); };\n }, [frame.id, allowed]);\n const active = shimmer && allowed;\n const swapping = allowed && frame.outgoing !== null;\n return <span className={css.statusText} data-reader-status data-reader-busy={shimmer} data-ud-check=\"reader-status\">\n <span className={css.think} aria-hidden=\"true\" data-active={active} data-reader-status-phase={swapping ? frame.phase : 'idle'} data-ud-motion=\"reader-thinking-state\">\n <span className={css.thinkSizer}>{text}</span>\n {swapping && <span key={frame.outgoing!.id} className={`${css.thinkText} ${frame.phase === 'running' ? css.isExit : ''}`}\n data-reader-status-copy=\"outgoing\" data-text={frame.outgoing!.text}>{frame.outgoing!.text}</span>}\n <span key={frame.id} ref={ref} className={`${css.thinkText} ${swapping && frame.phase === 'start' ? css.isEnterStart : ''}`}\n data-reader-status-copy=\"current\" data-reader-shimmer={active || undefined} data-text={text}>{text}</span>\n </span>\n <span className={css.srOnly} role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{text}</span>\n </span>;\n}\n\nexport function Disclosure({ open, onChange, label, controls, buttonRef, ariaLabel }: {\n open: boolean; onChange: (value: boolean) => void; label: ReactNode;\n controls?: string; buttonRef?: RefObject<HTMLButtonElement>;\n ariaLabel?: string;\n}) {\n const name = ariaLabel ?? '思考与过程';\n return <div className={css.disclosure} data-reader-disclosure data-expanded={open}>\n <button ref={buttonRef} type=\"button\" className={css.disclosureButton} aria-label={`${open ? '收起' : '展开'}${name}`} aria-expanded={open} {...(controls ? { 'aria-controls': controls } : {})} onClick={() => onChange(!open)}>\n {label}\n <svg className={css.chevron} data-open={open} viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\"><path d=\"m6 4 4 4-4 4\" /></svg>\n </button>\n </div>;\n}\n\n/** Supplemental details stay in source order beside their own narration. */\nexport function ProcessFragment({ open, motion, onRead, returnFocusTo, nodeKey, children, framed = false }: {\n open: boolean; motion: boolean; onRead: () => void; nodeKey: string;\n returnFocusTo: RefObject<HTMLElement>; children: ReactNode; framed?: boolean;\n}) {\n const body = useRef<HTMLDivElement>(null);\n const running = useRef<Animation | null>(null);\n const previous = useRef(open);\n const [present, setPresent] = useState(open);\n useLayoutEffect(() => {\n const element = body.current;\n if (!element) return;\n const from = running.current ? element.getBoundingClientRect().height : previous.current ? element.scrollHeight : 0;\n running.current?.cancel();\n running.current = null;\n const changed = previous.current !== open;\n previous.current = open;\n if (open) setPresent(true);\n if (!open && element.contains(document.activeElement)) returnFocusTo.current?.focus();\n element.style.height = open ? 'auto' : '0px';\n const target = open ? element.scrollHeight : 0;\n if (!motion || !changed || Math.abs(from - target) < 1) {\n setPresent(open);\n return;\n }\n const animation = element.animate(\n from > target\n ? [\n { offset: 0, height: `${from}px`, opacity: 1, transform: 'scaleY(1) translateY(0)' },\n { offset: 0.32, height: `${Math.round(from * 0.92)}px`, opacity: 0.35, transform: 'scaleY(0.96) translateY(-2px)' },\n { offset: 1, height: `${target}px`, opacity: 0, transform: 'scaleY(0.68) translateY(-8px)' },\n ]\n : [\n { offset: 0, height: `${from}px`, opacity: 0, transform: 'scaleY(0.8) translateY(6px)' },\n { offset: 0.3, height: `${Math.round(target * 0.4)}px`, opacity: 0.4, transform: 'scaleY(0.92) translateY(3px)' },\n { offset: 1, height: `${target}px`, opacity: 1, transform: 'scaleY(1) translateY(0)' },\n ],\n { duration: 380, easing: 'cubic-bezier(0.16, 1, 0.3, 1)', fill: 'both' },\n );\n running.current = animation;\n let settled = false;\n const settle = () => {\n if (settled) return;\n settled = true;\n if (running.current === animation) running.current = null;\n animation.cancel();\n setPresent(open);\n };\n animation.onfinish = settle;\n // `fill: 'both'\\` pins the opening keyframe (height 0, opacity 0), so while this\n // animation runs the body is *invisible* no matter what the element's style says.\n // An animation that never finishes — cancelled by a re-run, an unmount, or a\n // compositor that drops it — would then leave the row looking like it refused to\n // open, which is exactly the reported symptom. Cancel is only safe once the\n // state change has been committed, so the deadline does both.\n const deadline = window.setTimeout(settle, 380 + 240);\n return () => {\n window.clearTimeout(deadline);\n running.current?.cancel();\n };\n }, [open, motion, returnFocusTo]);\n if (!open && !present) return null;\n return <div ref={body} className={css.disclosureBody} data-reader-process data-reader-process-key={nodeKey} data-ud-motion=\"reader-process-size\"\n aria-hidden={!open} onPointerDown={() => { if (open) onRead(); }} onFocusCapture={() => { if (open) onRead(); }} {...(!open ? { inert: '' } : {})}>\n <div className={framed ? css.processFrame : css.processContents}>{children}</div>\n </div>;\n}\n\n/** Retire only narration that was actually visible; historical rows stay folded. */\nexport function RetiringContent({ visible, children, onRetired }: { visible: boolean; children: ReactNode; onRetired?: () => void }) {\n const { enabled } = useContext(StreamMotionContext);\n const root = useRef<HTMLDivElement>(null);\n const animation = useRef<Animation | null>(null);\n const [present, setPresent] = useState(visible);\n const [focusHeld, setFocusHeld] = useState(false);\n // Held in a ref so a caller passing an inline closure does not restart the\n // collapse every render, and so the settle path always sees the latest one.\n const retired = useRef(onRetired);\n retired.current = onRetired;\n useLayoutEffect(() => {\n const element = root.current;\n if (visible) {\n animation.current?.cancel(); animation.current = null;\n setPresent(true);\n return;\n }\n if (!element) return;\n // Reduced motion and a hidden page settle immediately. Focus may defer a\n // collapse that will actually play; it must not pin a reduced-motion rewind.\n // Move it to a surviving turn or the reading column first, or the browser\n // drops it on the document when this subtree unmounts.\n let retiredNow = false;\n const retireNow = () => {\n if (retiredNow) return;\n retiredNow = true;\n animation.current?.cancel(); animation.current = null;\n focusSurvivesRetire(element);\n setPresent(false); retired.current?.();\n };\n if (!enabled || document.hidden) { retireNow(); return; }\n // The retiring-content harness stubs document without addEventListener.\n const canListen = typeof document.addEventListener === 'function';\n const holdsFocus = element.contains(document.activeElement);\n if (holdsFocus || focusHeld) {\n if (holdsFocus) setFocusHeld(true);\n // Focus defers only a collapse that will play. `document.hidden` is not\n // state, so a page hidden while focus waits must retire from here.\n const onHiddenWhileHeld = () => { if (document.hidden) retireNow(); };\n if (canListen) document.addEventListener('visibilitychange', onHiddenWhileHeld);\n return () => { if (canListen) document.removeEventListener('visibilitychange', onHiddenWhileHeld); };\n }\n const from = element.getBoundingClientRect().height;\n animation.current?.cancel(); animation.current = null;\n if (from < 1) { setPresent(false); retired.current?.(); return; }\n const next = element.animate([{ height: `${from}px`, opacity: 1 }, { height: '0px', opacity: 0 }], { duration: 220, easing: EASING, fill: 'both' });\n animation.current = next;\n let settled = false;\n const settle = () => {\n if (settled || animation.current !== next) return;\n settled = true;\n animation.current = null; next.cancel(); setPresent(false); retired.current?.();\n };\n next.onfinish = settle;\n // #60: a stalled WAAPI finish must not leave the row mounted.\n const deadline = window.setTimeout(settle, 220 + 240);\n const onHide = () => { if (document.hidden) settle(); };\n if (canListen) document.addEventListener('visibilitychange', onHide);\n return () => {\n window.clearTimeout(deadline);\n if (canListen) document.removeEventListener('visibilitychange', onHide);\n if (animation.current === next) animation.current = null;\n next.cancel();\n };\n }, [visible, enabled, focusHeld]);\n useEffect(() => () => animation.current?.cancel(), []);\n if (!visible && !present) return null;\n return <div ref={root} className={css.retiringContent} data-reader-retiring={visible ? 'visible' : 'retiring'} data-ud-motion=\"reader-progress-retire\"\n onBlur={event => { if (!event.currentTarget.contains(event.relatedTarget)) setFocusHeld(false); }}>\n {children}\n </div>;\n}\n\n/**\n * Keeps a departing turn mounted for the length of its own collapse.\n *\n * A rewind removes turns from the visible order, and unmounting them outright\n * snapped the transcript: every withdrawn row disappeared in one frame with\n * nothing to scroll. Instead each departing turn is retained, rendered with\n * `visible={false}` so it animates to zero height, and released only once the\n * collapse has settled — so the reader watches the rows fold away and the rows\n * below glide up into their place.\n *\n * Live slots follow the incoming group order, so older history stays above the\n * tail. A collapsing turn stays next to the live neighbour that preceded it;\n * appending it would jump it to the bottom for the length of the animation.\n * Retention is bounded by the animation itself: `onRetired`\n * drops the slot, so a departing turn lives for one collapse and no longer —\n * and a key that comes back later is re-added as a live slot.\n */\nexport function RetiringTurns<T extends { readonly key: string }>({ groups, render }: {\n groups: readonly T[];\n render: (group: T) => ReactNode;\n}) {\n const [slots, setSlots] = useState<readonly TurnSlot<T>[]>(() =>\n groups.map((group) => ({ group, live: true })),\n );\n // Reconcile after every commit rather than during render: a key that left the\n // order becomes `live: false` and keeps its index, which is what lets the\n // collapse play in place instead of jumping the turn to the bottom.\n useLayoutEffect(() => {\n setSlots(current => reconcileTurnSlots(current, groups));\n }, [groups]);\n return (\n <>\n {slots.map((slot) => (\n <RetiringContent\n key={slot.group.key}\n visible={slot.live}\n onRetired={() => setSlots((current) => current.filter((candidate) =>\n candidate.live || candidate.group.key !== slot.group.key))}\n >\n {render(slot.group)}\n </RetiringContent>\n ))}\n </>\n );\n}\n\n/** A turn that is still on screen, not one this commit is about to unmount. */\nfunction survivingTurn(node: Element): HTMLElement | null {\n if (!(node instanceof HTMLElement) || node.dataset.readerRetiring === 'retiring') return null;\n const turn = node.hasAttribute('data-reader-turn') ? node : node.querySelector<HTMLElement>('[data-reader-turn]');\n if (turn === null) return null;\n const retiring = turn.closest('[data-reader-retiring]');\n if (retiring instanceof HTMLElement && retiring.dataset.readerRetiring === 'retiring') return null;\n return turn;\n}\n\n/**\n * Where focus goes when cut content is removed without an animation.\n * Prefer the nearest turn that is still live. Otherwise the reading column\n * (or the host scrollport) so focus does not fall through to the document.\n */\nfunction retireFocusTarget(element: HTMLElement): HTMLElement | null {\n const parent = element.parentElement;\n if (parent) {\n const siblings = [...parent.children];\n const index = siblings.indexOf(element);\n for (let cursor = index - 1; cursor >= 0; cursor--) {\n const turn = survivingTurn(siblings[cursor]!);\n if (turn) return turn;\n }\n for (let cursor = index + 1; cursor < siblings.length; cursor++) {\n const turn = survivingTurn(siblings[cursor]!);\n if (turn) return turn;\n }\n }\n const column = element.closest<HTMLElement>('[data-chat-flow]');\n if (column && !element.contains(column)) return column;\n const scroll = element.closest<HTMLElement>('[data-conversation-scroll]');\n if (scroll && !element.contains(scroll)) return scroll;\n return null;\n}\n\n/** Move focus out of `element` before it unmounts. A no-op when focus is elsewhere. */\nfunction focusSurvivesRetire(element: HTMLElement): void {\n const active = document.activeElement;\n if (active === null || !element.contains(active)) return;\n const target = retireFocusTarget(element);\n if (target === null || element.contains(target)) return;\n if (target.tabIndex < 0) target.tabIndex = -1;\n target.focus({ preventScroll: true });\n}\n\n// DOM-only behavior: the native Session remains the sole source of business data.\nexport function useReadingScroll(root: RefObject<HTMLElement>, motion: boolean): {\n detached: boolean;\n jump: () => void;\n /** Stop tail-follow so a rail landing is not pulled back to the live bottom. */\n release: () => void;\n} {\n const port = useRef<HTMLElement | null>(null);\n const following = useRef(true);\n // Tracked separately from `following`: only an explicit reader action clears\n // this, so a fold-induced scroll clamp cannot permanently drop the tail.\n const pinned = useRef(true);\n const anchor = useRef<{ element: HTMLElement; docTop: number } | null>(null);\n const cancelFollow = useRef<() => void>(() => {});\n const [detached, setDetached] = useState(false);\n useLayoutEffect(() => {\n const content = root.current;\n if (!content) return;\n const scroll = content.closest<HTMLElement>('[data-conversation-scroll]') ?? content;\n port.current = scroll;\n // Browser scroll anchoring moves the viewport on its own as the transcript\n // grows, which reads as the page freezing mid-follow.\n const previousOverflowAnchor = scroll.style.overflowAnchor;\n scroll.style.overflowAnchor = 'none';\n let followFrame = 0;\n let lastFrameAt = 0;\n let layoutDepth = 0;\n let lastWrittenTop: number | null = null;\n const layoutStart = () => {\n layoutDepth++;\n cancelAnimationFrame(followFrame); followFrame = 0;\n capture();\n };\n const layoutEnd = () => {\n layoutDepth = Math.max(0, layoutDepth - 1);\n if (!layoutDepth && following.current && !followFrame) {\n lastFrameAt = performance.now(); followFrame = requestAnimationFrame(follow);\n }\n };\n cancelFollow.current = () => {\n cancelAnimationFrame(followFrame);\n followFrame = 0;\n lastWrittenTop = null;\n };\n const selected = () => {\n const selection = document.getSelection();\n return selection && !selection.isCollapsed && selection.anchorNode && content.contains(selection.anchorNode);\n };\n // Only a focused text field suspends tail-follow. Clicking a fold control\n // inside the reader also moves document.activeElement into `content`, and\n // treating that as \"user is busy\" froze following for the rest of the turn.\n const editingText = () => {\n const active = document.activeElement;\n if (!(active instanceof HTMLElement)) return false;\n // The composer lives outside this subtree: focusing it must never stop\n // the transcript from following.\n if (!content.contains(active)) return false;\n return active.isContentEditable || active.tagName === 'TEXTAREA' || active.tagName === 'INPUT';\n };\n const capture = () => {\n const top = scroll.getBoundingClientRect().top;\n const candidates = content.querySelectorAll<HTMLElement>('[data-reader-anchor]');\n let candidate: HTMLElement | null = null;\n for (let index = 0; index < candidates.length; index++) {\n const element = candidates[index];\n if (element.getBoundingClientRect().bottom > top + 8) { candidate = element; break; }\n }\n // Record the anchor in DOCUMENT space, never viewport space. The viewport\n // offset also changes whenever the reader scrolls, so comparing it back\n // turned a plain scroll into an \"anchor correction\" that yanked the\n // viewport back to wherever the anchor had last been captured.\n anchor.current = candidate\n ? { element: candidate, docTop: candidate.getBoundingClientRect().top + scroll.scrollTop }\n : null;\n };\n // Anchor capture is only consumed while detached; coalesce DOM scans to one per frame.\n let captureFrame = 0;\n const scheduleCapture = () => {\n if (captureFrame) return;\n captureFrame = requestAnimationFrame(() => { captureFrame = 0; capture(); });\n };\n const atBottom = () => scroll.scrollHeight - scroll.scrollTop - scroll.clientHeight < 25;\n // Intent to stay pinned to the bottom, tracked independently of the scroll\n // position. A fold collapse shrinks the transcript and the browser clamps\n // scrollTop, producing a scroll event indistinguishable from the reader\n // scrolling up; without this the reader silently detached exactly when the\n // turn's last content arrived, and the page stopped following.\n pinned.current = true;\n const onScroll = () => {\n // While a follow animation is actively driving scroll, do not cancel following midway.\n if (followFrame !== 0 || layoutDepth > 0) return;\n // Our easing frames must not be mistaken for a user leaving the bottom.\n if (lastWrittenTop !== null && Math.abs(scroll.scrollTop - lastWrittenTop) < 1) return;\n // Bind the follow intent to the position observed HERE. Every scroll that\n // reaches this point is the viewport moving under someone else's hand: a\n // wheel, a drag, a key, or the browser clamping the offset after a shrink.\n //\n // The previous form inferred detaching from a strictly upward delta against\n // lastWrittenTop, which left two holes. That baseline is nulled by\n // cancelFollow/onWheel/onTouch/onKey, and the guard above already returned\n // for any scroll whose delta is under 1px — so a reader parked mid-transcript\n // by a scrollbar drag stayed following === true AND pinned === true. The next\n // content growth then took the re-attach branch and yanked the viewport to\n // the bottom, discarding what they were reading. Reading the position\n // directly needs no baseline: a fold's clamp lands at the very bottom and\n // still keeps following, while any other offset detaches.\n const bottom = atBottom();\n pinned.current = bottom;\n if (!bottom) { cancelAnimationFrame(followFrame); followFrame = 0; scheduleCapture(); }\n if (!following.current) {\n // Only an explicit return to the bottom resumes following.\n if (bottom) { following.current = true; setDetached(false); }\n return;\n }\n if (!bottom) { following.current = false; setDetached(true); }\n };\n const onWheel = (event: WheelEvent) => {\n cancelAnimationFrame(followFrame); followFrame = 0; lastWrittenTop = null;\n if (event.deltaY < 0) { following.current = false; setDetached(true); pinned.current = false; scheduleCapture(); }\n };\n const onTouch = () => {\n cancelAnimationFrame(followFrame); followFrame = 0; lastWrittenTop = null;\n };\n const onKey = (event: KeyboardEvent) => {\n if (event.target instanceof HTMLElement && event.target.closest('textarea,input,[contenteditable=true]')) return;\n if (['PageUp', 'Home', 'ArrowUp'].includes(event.key)) {\n cancelAnimationFrame(followFrame); followFrame = 0; lastWrittenTop = null;\n following.current = false; setDetached(true); pinned.current = false; scheduleCapture();\n }\n };\n const writeTop = (top: number) => { scroll.scrollTop = top; lastWrittenTop = scroll.scrollTop; };\n const follow = (now: number) => {\n followFrame = 0;\n if (!following.current || selected() || editingText()) return;\n if (layoutDepth > 0) return;\n const gap = scroll.scrollHeight - scroll.clientHeight - scroll.scrollTop;\n const delta = Math.min(48, Math.max(1, now - lastFrameAt));\n lastFrameAt = now;\n if (!motion || Math.abs(gap) < 1.5) { writeTop(scroll.scrollHeight); capture(); return; }\n writeTop(scroll.scrollTop + gap * (1 - Math.exp(-delta / 52)));\n followFrame = requestAnimationFrame(follow);\n };\n const firstFrame = requestAnimationFrame(() => {\n if (following.current && !selected()) writeTop(scroll.scrollHeight);\n capture();\n });\n let lastHeight = content.scrollHeight;\n const observer = new ResizeObserver(() => {\n if (selected()) return;\n const height = scroll.scrollHeight;\n const grew = height > lastHeight + 1;\n lastHeight = height;\n // Growth while the reader intends to be at the bottom re-attaches the\n // tail. This is the self-healing path for the clamp case above and is\n // also what keeps the viewport moving when a turn ends.\n if (grew && pinned.current && !editingText()) { following.current = true; setDetached(false); }\n if (following.current && !editingText()) {\n // Height is already animated: no second, lagging scroll easing.\n if (!motion || layoutDepth > 0) writeTop(scroll.scrollHeight);\n else if (!followFrame) { lastFrameAt = performance.now(); followFrame = requestAnimationFrame(follow); }\n } else if (!following.current && anchor.current?.element.isConnected) {\n // Only a real layout change above the anchor needs compensation. A reader\n // scroll moves the viewport offset but not the document offset, so this\n // stays silent while the reader is scrolling and cannot snap back.\n const delta = anchor.current.element.getBoundingClientRect().top + scroll.scrollTop - anchor.current.docTop;\n if (Math.abs(delta) > .5) writeTop(scroll.scrollTop + delta);\n }\n capture();\n });\n observer.observe(content);\n if (scroll !== content) observer.observe(scroll);\n content.addEventListener('reader-layout-start', layoutStart);\n content.addEventListener('reader-layout-end', layoutEnd);\n scroll.addEventListener('scroll', onScroll, { passive: true });\n scroll.addEventListener('wheel', onWheel, { passive: true });\n scroll.addEventListener('touchstart', onTouch, { passive: true });\n scroll.addEventListener('touchmove', onTouch, { passive: true });\n scroll.addEventListener('keydown', onKey);\n return () => {\n cancelAnimationFrame(firstFrame); cancelAnimationFrame(followFrame); cancelAnimationFrame(captureFrame); observer.disconnect();\n content.removeEventListener('reader-layout-start', layoutStart);\n content.removeEventListener('reader-layout-end', layoutEnd);\n scroll.style.overflowAnchor = previousOverflowAnchor;\n scroll.removeEventListener('scroll', onScroll); scroll.removeEventListener('wheel', onWheel);\n scroll.removeEventListener('touchstart', onTouch); scroll.removeEventListener('touchmove', onTouch);\n scroll.removeEventListener('keydown', onKey);\n };\n }, [root, motion]);\n const jump = useCallback(() => {\n cancelFollow.current();\n anchor.current = null;\n following.current = true;\n pinned.current = true;\n setDetached(false);\n if (port.current) {\n port.current.scrollTop = port.current.scrollHeight;\n }\n }, []);\n const release = useCallback(() => {\n cancelFollow.current();\n following.current = false;\n pinned.current = false;\n anchor.current = null;\n setDetached(true);\n }, []);\n return { detached, jump, release };\n}\n","import type { LiveStep, LiveTurnItem } from './live-turn.js';\n\n/** Presentation clock, not model/network time. */\nexport const FOLD_TIMING = {\n collapse: 320,\n count: 160,\n settle: 80,\n reveal: 180,\n /**\n * Slack added to every phase deadline before the watchdog forces the next phase.\n *\n * The choreography advances on animation promises and rendered frames. Both are\n * best-effort: a cancelled animation *rejects* and a compositor that never\n * finishes one leaves its promise pending, while a backgrounded tab stops\n * delivering frames. Without a deadline the machine would sit in a non-idle\n * phase forever, and a non-idle phase freezes both the frame source and the text\n * reveal, so the turn would look stuck until a remount. This is the liveness\n * guarantee that does not depend on any of them.\n */\n watchdogSlack: 240,\n} as const;\nexport type FoldPhase = 'idle' | 'collapse' | 'count' | 'settle' | 'reveal';\nexport type FlowRow =\n | { kind: 'summary'; key: string; item: Extract<LiveTurnItem, { kind: 'fold' }> }\n | { kind: 'step'; key: string; step: LiveStep; foldKey?: string };\n\n/** A step always has the same parent and React key, even when its membership changes. */\nexport function flowRows(items: readonly LiveTurnItem[]): FlowRow[] {\n return items.flatMap((item): FlowRow[] => item.kind === 'fold'\n ? [{ kind: 'summary', key: item.key, item }, ...item.steps.map(step => ({ kind: 'step' as const, key: step.key, step, foldKey: item.key }))]\n : [{ kind: 'step', key: item.key, step: item.step }]);\n}\n\nexport function retiringKeys(before: readonly LiveTurnItem[], after: readonly LiveTurnItem[], open: Readonly<Record<string, boolean>>): string[] {\n const folded = new Set(flowRows(after).filter(row => row.kind === 'step' && row.foldKey && !open[row.foldKey]).map(row => row.key));\n return flowRows(before).filter(row => row.kind === 'step' && !row.foldKey && folded.has(row.key)).map(row => row.key);\n}\n\n/** Insert only new summary slots. Never admit incoming content during shrink. */\nexport function collapseRows(before: readonly LiveTurnItem[], target: readonly LiveTurnItem[]): FlowRow[] {\n const rows = flowRows(before);\n const headers = new Set(rows.filter(row => row.kind === 'summary').map(row => row.key));\n for (const item of target) {\n if (item.kind !== 'fold' || headers.has(item.key)) continue;\n const members = new Set(item.steps.map(step => step.key));\n const at = rows.findIndex(row => members.has(row.key));\n if (at >= 0) rows.splice(at, 0, { kind: 'summary', key: item.key, item: { ...item, summary: item.summary.replace(/\\d+/g, '0') } });\n }\n return rows;\n}\n\nexport function containsNewUser(before: readonly LiveTurnItem[], after: readonly LiveTurnItem[]): boolean {\n const users = new Set(before.filter(item => item.kind === 'user').map(item => item.key));\n return after.some(item => item.kind === 'user' && !users.has(item.key));\n}\n","import { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { FOLD_TIMING } from './fold-choreography.js';\nimport css from './Reader.module.css';\n\n/** Values are presentation commits, never live network counters. */\nexport function SubtleNumberRoll({ value, motion }: { value: number; motion: boolean }) {\n const [outgoing, setOutgoing] = useState<number | null>(null);\n const previous = useRef(value);\n useLayoutEffect(() => {\n if (value === previous.current) return;\n const old = previous.current;\n previous.current = value;\n if (!motion) { setOutgoing(null); return; }\n setOutgoing(old);\n const timer = window.setTimeout(() => setOutgoing(null), FOLD_TIMING.count);\n return () => window.clearTimeout(timer);\n }, [value, motion]);\n return <span className={css.numberRollRoot} aria-hidden=\"true\">\n <span className={css.numberRollSizer}>{value}</span>\n {outgoing !== null && <span key={`out-${outgoing}`} className={`${css.numberRollDigit} ${css.numberRollExit}`}>{outgoing}</span>}\n <span key={`cur-${value}`} className={`${css.numberRollDigit} ${outgoing !== null ? css.numberRollEnter : ''}`}>{value}</span>\n </span>;\n}\n\nexport function FoldSummaryText({ summary, motion }: { summary: string; motion: boolean }) {\n const parts = useMemo(() => {\n const regex = /([^\\d]+)(\\d+)/g;\n const result: { text: string; number?: number }[] = [];\n let end = 0;\n for (const match of summary.matchAll(regex)) {\n result.push({ text: match[1]!, number: Number(match[2]) });\n end = match.index! + match[0].length;\n }\n if (end < summary.length) result.push({ text: summary.slice(end) });\n return result;\n }, [summary]);\n return <span className={css.foldSummary} data-reader-fold-summary={summary} aria-label={summary}>\n {parts.map(part => <span key={part.text} className={css.foldSummaryPart}>\n <span>{part.text}</span>\n {part.number !== undefined && <SubtleNumberRoll value={part.number} motion={motion} />}\n </span>)}\n </span>;\n}\n","import type { AssistantBlock, ToolCallBlock, TurnLocation } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { AssistantChatData, ChatConversationViewNode } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport { activityPhase } from './tool-activity.js';\n\nexport interface ReaderGroup { key: string; turn: number | null; keys: readonly string[] }\nexport interface TurnBoundary { status: 'open' | 'closed' | 'unknown'; reason: string | null; latestStep: number; closingStep: number | null }\n\n// Run on structural publication, not on each text delta. Node seats subscribe by key.\nexport function groupNodes(order: readonly string[], get: (key: string) => ChatConversationViewNode | undefined): ReaderGroup[] {\n const groups: ReaderGroup[] = [];\n const seenTurns = new Set<number>();\n for (const key of order) {\n const node = get(key);\n if (!node || node.visibility === 'hidden') continue;\n const turn = node.location.kind === 'step' || node.location.kind === 'turn' ? node.location.turn.turn : null;\n const previous = groups.at(-1);\n if (turn !== null && previous?.turn === turn) {\n (previous.keys as string[]).push(key);\n } else {\n groups.push({ key: turn === null ? `node:${key}` : seenTurns.has(turn) ? `turn:${turn}:${key}` : `turn:${turn}`, turn, keys: [key] });\n if (turn !== null) seenTurns.add(turn);\n }\n }\n return groups;\n}\n\nexport function boundaryOf(turn: TurnLocation | undefined): TurnBoundary {\n return {\n status: turn?.status ?? 'unknown',\n reason: turn?.end?.data.reason.kind ?? null,\n latestStep: turn?.steps.at(-1)?.step ?? -1,\n closingStep: turn?.data.get('turn-tail')?.closing?.step ?? null,\n };\n}\n\n/**\n * A settled body step before the closing step of a successful turn.\n *\n * This is presentation classification only. Narration is never process content\n * and never folds. The flag only marks body text that is no longer the turn's\n * final answer, so copy and fork stay on that final answer.\n */\nexport function isEarlierNarration(data: AssistantChatData, boundary: TurnBoundary): boolean {\n // New body text, a tool call, or a settled step is not a completed turn.\n if (data.status !== 'settled' || boundary.status !== 'closed' || boundary.reason !== 'completed') return false;\n if (data.blocks.some(block => block.kind === 'image' || block.kind === 'other')) return false;\n return boundary.closingStep !== null && data.step < boundary.closingStep;\n}\n\nexport function processExpanded(choice: boolean | undefined, boundary: TurnBoundary): boolean {\n return choice ?? !(boundary.status === 'closed' && boundary.reason === 'completed');\n}\n\n/** Reading while running must not pin the process open after completion. */\nexport function processChoiceKey(groupKey: string, boundary: TurnBoundary): string {\n return `${groupKey}:${boundary.status}:${boundary.reason ?? 'pending'}`;\n}\n\n/**\n * A body-only assistant step is not a thinking/process disclosure.\n *\n * Narration (text/image/other blocks) is always visible, so it never counts as\n * foldable process content; only literal reasoning does. Tool calls arrive as\n * their own flow entries and are checked separately by the reader.\n */\nexport function hasProcessContent(node: ChatConversationViewNode | undefined, _boundary: TurnBoundary): boolean {\n if (!node || node.visibility === 'hidden') return false;\n if (node.kind === 'assistant-step') {\n const data = node.data as AssistantChatData;\n return data.blocks.some(block => block.kind === 'reasoning' && block.text.trim() !== '');\n }\n return node.kind === 'context' || node.kind === 'model-retry' || node.kind === 'system-prompt' || node.kind === 'turn-process'\n || node.kind === 'command' || node.kind === 'manual-compaction' || node.kind === 'compaction';\n}\n\nexport function hasVisibleBody(blocks: readonly AssistantBlock[]): boolean {\n return blocks.some(block => block.kind === 'image' || block.kind === 'other' || (block.kind === 'text' && block.text.trim() !== ''));\n}\n\n/** Keep native block order. In particular, never lift a later Think above text. */\nexport function assistantSegments(blocks: readonly AssistantBlock[]): { kind: 'reasoning' | 'body'; start: number; blocks: AssistantBlock[] }[] {\n const segments: ReturnType<typeof assistantSegments> = [];\n let previous: ReturnType<typeof assistantSegments>[number] | undefined;\n blocks.forEach((block, index) => {\n if (block.kind === 'tool-call') { previous = undefined; return; }\n const kind = block.kind === 'reasoning' ? 'reasoning' : 'body';\n if (previous?.kind === kind) previous.blocks.push(block);\n else {\n previous = { kind, start: index, blocks: [block] };\n segments.push(previous);\n }\n });\n return segments;\n}\n\nexport function toolFailed(block: ToolCallBlock): boolean {\n return activityPhase({ block }) === 'failed';\n}\n\nexport function toolName(block: ToolCallBlock): string {\n return 'kind' in block ? block.call?.name ?? '工具调用' : block.name;\n}\n\nexport function terminalLabel(reason: string | null): string | null {\n switch (reason) {\n case 'completed': return null;\n case 'aborted': case 'interrupted': return '本轮已停止,已生成的内容仍保留。';\n case 'blocked': return '本轮需要处理阻塞事项;请查看原对话与下方操作区。';\n case 'max-tokens': return '输出达到本轮长度限制,内容可能尚未完整。';\n case 'error': return '本轮未完成;错误信息保留在下方。';\n case null: return null;\n default: return `本轮结束状态:${reason}。请在原对话中核对完整记录。`;\n }\n}\n\n/**\n * Extract the first usable fork anchor seq from candidate message nodes.\n * Only the durable closing message seq cuts the intended turn prefix: an\n * absent anchor must surface as undefined (never as 0 or NaN), because the\n * host treats a missing atSeq as a whole-session fork.\n */\nexport function forkAnchorSeq(\n candidates: ReadonlyArray<{ seq?: unknown } | null | undefined>,\n): number | undefined {\n for (const candidate of candidates) {\n const seq = candidate?.seq;\n if (typeof seq === 'number' && Number.isFinite(seq)) return seq;\n }\n return undefined;\n}\n","import { Fragment, memo } from 'react';\nimport type { RefObject } from 'react';\nimport type { ChatConversationViewNode, ChatNode, ChatNodeKind } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport { Blocks, CopyAnswer } from './Blocks.js';\nimport { ReasoningCard } from './ReasoningCard.js';\nimport { OfficialActions, OfficialAssistantBody } from './OfficialContent.js';\nimport { Disclosure, ProcessFragment } from './motion.js';\nimport { FoldSummaryText } from './LiveFold.js';\nimport { assistantSegments, forkAnchorSeq, hasVisibleBody, isEarlierNarration } from './projection.js';\nimport type { TurnBoundary } from './projection.js';\nimport type { BlockRenderProps, ReaderProps } from './types.js';\nimport css from './Reader.module.css';\n\nfunction isNode<K extends ChatNodeKind>(node: ChatConversationViewNode, kind: K): node is ChatNode<K> {\n return node.kind === kind;\n}\n\ntype SeatProps = BlockRenderProps & Pick<ReaderProps, 'useChat' | 'sessionId'> & {\n nodeKey: string; boundary: TurnBoundary; pinned?: boolean; processOpen?: boolean;\n};\n\nexport const AssistantNode = memo(function AssistantNode({ useChat, nodeKey, boundary, processOpen = false, pinned = false, folded = false, partStart, seamSummary, seamAfter = false, motion, onRead, returnFocusTo, ...render }: SeatProps & {\n motion: boolean; onRead: () => void; returnFocusTo: RefObject<HTMLButtonElement>; partStart?: number; folded?: boolean;\n seamSummary?: string; seamAfter?: boolean;\n}) {\n const node = useChat(snapshot => snapshot.nodes.get(nodeKey));\n if (!node || node.visibility === 'hidden' || !isNode(node, 'assistant-step')) return null;\n const data = node.data;\n const parts = assistantSegments(data.blocks);\n const earlier = isEarlierNarration(data, boundary);\n const hasToolCalls = data.blocks.some(block => block.kind === 'tool-call');\n const isProcessStep = earlier || folded || hasToolCalls || (boundary.latestStep > 0 && data.step < boundary.latestStep);\n const body = data.blocks.filter(block => block.kind !== 'reasoning' && block.kind !== 'tool-call');\n const visible = partStart === undefined ? parts : parts.filter(part => part.start === partStart);\n const bodyProps = { streaming: data.status === 'running', holdFormatting: pinned, startedAt: data.time, interrupted: data.status === 'interrupted', liveText: true as const };\n return <>{visible.map(part => {\n const index = parts.findIndex(item => item.start === part.start);\n const last = index === parts.length - 1;\n if (part.kind === 'reasoning') return <ProcessFragment key={part.start} open={processOpen} motion={motion} onRead={onRead} returnFocusTo={returnFocusTo} nodeKey={nodeKey} framed>\n <ReasoningCard step={data.step} active={processOpen && boundary.status === 'open' && data.step === boundary.latestStep} motion={motion} selected={pinned} onRead={onRead}>\n <Blocks {...render} blocks={part.blocks} streaming={data.status === 'running' && last && data.blocks.at(-1)?.kind === 'reasoning'}\n holdFormatting={pinned} startedAt={data.time} interrupted={data.status === 'interrupted'} liveText />\n </ReasoningCard>\n </ProcessFragment>;\n if (!hasVisibleBody(part.blocks)) return null;\n // Narration stays body prose and never enters a disclosure. The seam in\n // the gap summarises folded process between two body blocks. A foreign\n // assistant-step renderer receives these original blocks; Reader markdown,\n // including the text transform, is only the fallback.\n const isFinalAnswer = !isProcessStep;\n return <Fragment key={part.start}>\n {seamSummary && <div className={css.processSeamRow} data-reader-process-seam data-reader-process-seam-summary={seamSummary}>\n <Disclosure open={false} onChange={() => onRead()} ariaLabel=\"被折叠的过程\"\n label={<FoldSummaryText summary={seamSummary} motion={false} />} />\n </div>}\n <article className={css.answer} data-reader-body data-reader-anchor data-reader-key={nodeKey} data-reader-source-start={part.start}\n data-reader-seam-after={seamAfter || undefined} data-answer-status={data.status} data-answer-phase={isFinalAnswer ? 'body' : 'process'}>\n <OfficialAssistantBody {...render} node={node} blocks={part.blocks} {...bodyProps} />\n {isFinalAnswer && last && data.status === 'interrupted' && <span className={css.stopped}>已停止</span>}\n {isFinalAnswer && last && data.status !== 'running' && boundary.status === 'closed' && (\n <CopyAnswer blocks={body} onFork={(() => {\n // The fork anchor must be the durable closing message seq (same as\n // the official turn-tail branch). AssistantChatData carries no seq\n // of its own; passing it would fork the whole session instead.\n const anchor = forkAnchorSeq([data.finalNode, { seq: render.forkSeq }]);\n return render.forkAt && anchor !== undefined ? () => render.forkAt!(anchor) : undefined;\n })()} metrics={render.metrics} extraActions={<OfficialActions official={render.official} messageId={data.finalNode?.messageId} />} />\n )}\n </article>\n </Fragment>;\n })}</>;\n});\n","/**\n * Pure row-model derivation for tool summary rows: variant classification,\n * one-line summary, expanded-body text, and flattened result output from the\n * frozen call slice. Input material comes from the call ARGUMENTS; output and\n * error material from the settled result node. A call whose render intent is\n * a terminal card gets its expanded body from the views instead, through\n * `terminalCardModel` in terminal-card-model.ts.\n */\n// The block union's defining home is runtime (fold-product types); this\n// contract only forwards it (type-definition authority stays with the layer\n// that produces the values).\nimport { abbreviateHomePath } from '@deepseek-ai/dsh-util-workspace-path'\nimport type { ToolCallBlock, ToolResultNode } from '@deepseek-ai/dsh-client-ui-conversation/client'\n\nexport type { ToolCallBlock } from '@deepseek-ai/dsh-client-ui-conversation/client'\n\n/** Tool-call row variants selected by the generic atomic renderer. */\nexport type ToolRowVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others'\n\n/** Row state semantic; colors self-supplied via StateDot (design gives none). */\nexport type ToolRowState = 'running' | 'ok' | 'error' | 'stopped'\n\n/** Figma row titles per variant (design literals, not translatable copy). */\nexport const VARIANT_TITLES: Record<ToolRowVariant, string> = {\n search: 'Search', read: 'Read', bash: 'Bash',\n write: 'Write', edit: 'Edit', code: 'Code', others: 'Tool call',\n}\n\n/**\n * Known tool name -> variant.\n *\n * `cordis_define` is deliberately absent: ui-cordis registers a keyed\n * `tool.call.toolview` entry for it, and a keyed hit REPLACES the generic row\n * (this table is only reached through GenericToolCard, the dispatch fallback in\n * ToolCallTree). An entry here would be unreachable, and a second title for the\n * same call would be a second answer to a question the card already owns.\n */\nconst TOOL_VARIANTS: Record<string, ToolRowVariant> = {\n bash: 'bash',\n // The PowerShell twin is a shell tool: the bash row family (icon, colors)\n // with its own title from TOOL_TITLES, not the generic `others` row.\n pwsh: 'bash',\n read: 'read',\n web_fetch: 'read',\n web_search: 'search',\n grep: 'search',\n glob: 'search',\n write: 'write',\n edit: 'edit',\n run_code: 'code',\n cordis_package_inspect: 'read',\n cordis_runtime_inspect: 'read',\n // The three run-control verbs take one package id and produce a receipt, so\n // the generic row is the decided intent, not an unclassified default: there is\n // no program to show (that is `cordis_define`'s card) and no file to open. The\n // id lands in the summary slot, and the titles below name the act.\n cordis_run: 'others',\n cordis_stop: 'others',\n cordis_undefine: 'others',\n}\n\n/** Tool-owned titles that refine a generic row variant without replacing it. */\nconst TOOL_TITLES: Record<string, string> = {\n cordis_package_inspect: 'Inspect',\n cordis_runtime_inspect: 'Inspect',\n cordis_run: 'Run Cordis Plugin',\n cordis_stop: 'Stop Cordis Plugin',\n cordis_undefine: 'Remove Cordis Plugin',\n pwsh: 'Pwsh',\n}\n\n/**\n * Classify a tool name into its row variant.\n * @param toolName - wire tool name.\n * @returns matching variant, others when unknown.\n */\nexport function classifyTool(toolName: string): ToolRowVariant {\n return TOOL_VARIANTS[toolName] ?? 'others'\n}\n\n/** Everything ToolRow needs, derived once from the frozen slice. */\nexport interface ToolRowModel {\n variant: ToolRowVariant\n title: string\n summary: string\n /**\n * Filesystem path from args (`path` / `file_path`) when the row is a file\n * tool; absent for URL reads and non-file tools. The chat view resolves\n * relative values against the session cwd before opening.\n */\n filePath: string | undefined\n /** Expanded-body input text (pretty args); null = no input section. */\n body: string | null\n /** Flattened result text ({@link resultText}); null while running or when the result carries no text. */\n output: string | null\n /** First line of the result text on an error row; null for every other state. */\n errorSummary: string | null\n state: ToolRowState\n}\n\n/**\n * Flatten a settled result's content blocks to display text: text blocks\n * verbatim, other block shapes as pretty JSON. Empty content on a failed call\n * falls back to the structured error's `name: code` line.\n * @param node - the settled result node.\n * @returns the flattened result text (may be empty).\n */\nexport function resultText(node: ToolResultNode): string {\n const parts: string[] = []\n for (const block of node.content) {\n if (block.type === 'text') parts.push(block.text)\n else parts.push(JSON.stringify(block, null, 2))\n }\n if (parts.length === 0 && node.error !== undefined) {\n parts.push(`${node.error.name}: ${node.error.code}`)\n }\n return parts.join('\\n')\n}\n\nfunction parseArgs(argsRaw: string): unknown {\n try {\n return JSON.parse(argsRaw)\n } catch {\n // Non-JSON args (mid-stream truncation): summary/body fall back to the raw string.\n return undefined\n }\n}\n\nfunction firstLine(text: string): string {\n const nl = text.indexOf('\\n')\n return nl === -1 ? text : text.slice(0, nl)\n}\n\nfunction pickString(args: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const v = args[key]\n if (typeof v === 'string' && v !== '') return v\n }\n return undefined\n}\n\n/** Summary key preference per variant (args-derived; result-derived summaries are a ledger item). */\nconst SUMMARY_KEYS: Record<ToolRowVariant, readonly string[]> = {\n bash: ['description', 'command'],\n read: ['path', 'file_path', 'url'],\n search: ['query', 'pattern', 'url'],\n write: ['path', 'file_path'],\n edit: ['path', 'file_path'],\n code: ['description'],\n others: [],\n}\n\n/**\n * Strip the workspace root from a workspace-rooted absolute path (display only).\n * @param text - the path to shorten.\n * @param cwd - session workspace root; absent or empty leaves the path unchanged.\n * @returns the path relative to the workspace root, or unchanged when it is not rooted there.\n */\nexport function relativizeToCwd(text: string, cwd: string | undefined): string {\n if (cwd === undefined || cwd === '') return text\n const root = cwd.replace(/[/\\\\]+$/, '')\n if (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1)\n return text\n}\n\nfunction deriveSummary(variant: ToolRowVariant, argsRaw: string): string {\n const parsed = parseArgs(argsRaw)\n if (typeof parsed !== 'object' || parsed === null) return firstLine(argsRaw)\n const args = parsed as Record<string, unknown>\n if (variant === 'search' && Array.isArray(args.queries)) {\n const queries = args.queries.filter((query): query is string => typeof query === 'string' && query !== '')\n if (queries.length > 0) return queries.map(firstLine).join(', ')\n }\n const picked = pickString(args, SUMMARY_KEYS[variant])\n if (picked !== undefined) return firstLine(picked)\n for (const v of Object.values(args)) {\n if (typeof v === 'string' && v !== '') return firstLine(v)\n }\n return firstLine(argsRaw)\n}\n\n/** Path keys only — never `url` (web_fetch lands on the read variant). */\nconst FILE_PATH_KEYS = ['path', 'file_path'] as const\n\n/** File-tool variants whose summary may be an openable workspace path. */\nconst FILE_PATH_VARIANTS: ReadonlySet<ToolRowVariant> = new Set(['read', 'write', 'edit'])\n\nfunction deriveFilePath(variant: ToolRowVariant, argsRaw: string): string | undefined {\n if (!FILE_PATH_VARIANTS.has(variant)) return undefined\n const parsed = parseArgs(argsRaw)\n if (typeof parsed !== 'object' || parsed === null) return undefined\n const picked = pickString(parsed as Record<string, unknown>, FILE_PATH_KEYS)\n return picked === undefined ? undefined : firstLine(picked)\n}\n\nfunction deriveBody(variant: ToolRowVariant, argsRaw: string): string | null {\n if (argsRaw === '') return null\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return argsRaw\n // The code row's expanded body IS the program (monospace via the row's\n // variant styling), not the args JSON envelope around it.\n if (variant === 'code' && typeof parsed === 'object' && parsed !== null) {\n const code = (parsed as Record<string, unknown>).code\n if (typeof code === 'string' && code !== '') return code\n }\n return JSON.stringify(parsed, null, 2)\n}\n\n/**\n * Derive the full row model from a frozen call slice.\n * @param toolName - wire tool name (dispatch-supplied; survives windowless results).\n * @param block - RunningToolCall or ToolResultNode off the snapshot caches.\n * @param cwd - session workspace root; workspace-rooted path summaries display relative to it.\n * @param home - host account home; a leftover POSIX home path displays as `~`.\n * @returns the row model.\n */\nexport function toolRowModel(toolName: string, block: ToolCallBlock, cwd?: string, home?: string): ToolRowModel {\n const variant = classifyTool(toolName)\n const done = 'kind' in block\n const argsRaw = (done ? block.call?.argsRaw : ('argsRaw' in block ? block.argsRaw : '')) ?? ''\n const state: ToolRowState = !done ? 'running'\n : block.error?.code === 'interrupted' ? 'stopped'\n : block.isError ? 'error' : 'ok'\n const base = argsRaw === ''\n ? block.callId\n : abbreviateHomePath(relativizeToCwd(deriveSummary(variant, argsRaw), cwd), home)\n const toolTitle = TOOL_TITLES[toolName]\n // Others keeps the static \"Tool call\" title (figma literal); the real tool\n // name rides the mutable summary slot unless the tool owns a specific title.\n const summary = variant === 'others' && toolName !== '' && toolTitle === undefined\n ? `${toolName} · ${base}`\n : base\n // The empty string is \"no text\" for both derived result fields: a settled\n // call with blank content has nothing to expand, and a blank first line\n // would erase the collapsed error row's summary slot.\n const output = done ? (resultText(block) || null) : null\n const errorSummary = state === 'error' && output !== null ? firstLine(output) : null\n return {\n variant,\n title: toolTitle ?? VARIANT_TITLES[variant],\n summary,\n filePath: deriveFilePath(variant, argsRaw),\n body: deriveBody(variant, argsRaw),\n output,\n errorSummary,\n state,\n }\n}\n","import { memo, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport type { ToolCallBlock, ToolResultNode } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { DiffHunk, ReadBlockLine, SearchFileGroup } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { DiffBlock, DisclosureRow, JsonTree, ReadBlock, SearchBlock, TerminalBlock, WebBlock,\n IconApiOutlineRegular, IconBrowseOutlineRegular, IconEditOutlineRegular, IconSearchOutlineRegular, IconSkillOutlineRegular, IconSparkleRegular } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { Blocks, contentBlocks } from './Blocks.js';\nimport { OfficialTool } from './OfficialContent.js';\nimport { ProcessFragment } from './motion.js';\nimport { activityPhase, activitySummary, callDiffHunks, diffTotals, executionFacts, forgetCallClock, objectValue, runningClockBase } from './tool-activity.js';\nimport type { ToolActivityEntry, ToolCategory, ToolPhase } from './tool-activity.js';\nimport type { BlockRenderProps } from './types.js';\nimport { classifyTool, toolRowModel, VARIANT_TITLES } from './native/tool-call-model.js';\nimport { McpAppFrame, StreamingMcpAppPlaceholder } from './McpAppFrame.js';\nimport { diffBlockLabels, jsonTreeLabels, readBlockLabels, searchBlockLabels, terminalBlockLabels, webBlockLabels } from './primitive-labels.js';\nimport css from './Reader.module.css';\n\nconst LABEL: Record<ToolPhase, string> = { preparing: '输入生成中', running: '执行中', returned: '已返回', succeeded: '已完成', failed: '失败', interrupted: '已中断' };\nconst ICONS = { write: IconEditOutlineRegular, read: IconBrowseOutlineRegular, terminal: IconApiOutlineRegular, search: IconSearchOutlineRegular, web: IconSearchOutlineRegular, code: IconApiOutlineRegular, other: IconSparkleRegular } satisfies Record<ToolCategory, unknown>;\nconst number = new Intl.NumberFormat('zh-CN');\nconst preparingTerminalLabels = { ...terminalBlockLabels, running: '正在生成命令' };\nconst language = (path: string | undefined) => path?.split('.').at(-1);\nconst duration = (ms: number) => ms < 1000 ? `${Math.round(ms)} 毫秒` : `${(ms / 1000).toFixed(ms < 10000 ? 1 : 0)} 秒`;\n\nfunction generatedInput(content: string, target: string | undefined, preparing: boolean) {\n const lines = content.split('\\n').map((text, index) => ({ number: index + 1, text }));\n const visible = preparing ? lines.slice(-12) : lines.slice(0, 1600);\n return <div data-reader-tool-file><p className={css.toolDetailNote}>{preparing ? '正在生成的输入 · 尚未执行 · 末尾 12 行' : '工具输入中的文件内容'}{!preparing && lines.length > visible.length ? ' · 预览前 1,600 行,完整内容在原始数据中' : ''}</p>\n <ReadBlock label={target ?? '文件内容'} lang={language(target)} lines={visible} totalLines={lines.length} maxLines={16} labels={readBlockLabels} />\n </div>;\n}\n\nfunction InputView({ model, phase, fillComposer }: { model: ReturnType<typeof activitySummary>; phase: ToolPhase; fillComposer: BlockRenderProps['fillComposer'] }) {\n const preparing = phase === 'preparing';\n const inProgress = preparing || phase === 'running';\n if ((model.name === 'render_ui' || model.name === 'show_widget') && typeof model.args?.html === 'string') {\n return preparing\n ? <StreamingMcpAppPlaceholder title={typeof model.args.title === 'string' ? (model.args.title as string) : undefined} />\n : <McpAppFrame html={model.args.html as string} title={typeof model.args.title === 'string' ? (model.args.title as string) : undefined} fillComposer={fillComposer} />;\n }\n if (model.content) return generatedInput(model.content, model.target, preparing);\n if (model.command) return <div data-reader-tool-terminal><p className={css.toolDetailNote}>{preparing ? '正在生成命令 · 尚未执行' : '提交的命令'}</p><TerminalBlock command={model.command} cwd={model.cwd} running={inProgress} labels={preparing ? preparingTerminalLabels : terminalBlockLabels} /></div>;\n if (model.category === 'terminal' && preparing && model.argsState === 'partial') return <p className={css.toolDetailNote} data-reader-tool-command-pending>命令仍在生成,收到可识别的命令文本后会显示预览。</p>;\n return <JsonTree data={model.args} label={preparing ? '已收到的输入字段' : '工具输入'} labels={jsonTreeLabels} />;\n}\n\nfunction readLines(value: unknown): ReadBlockLine[] | null {\n if (!Array.isArray(value)) return null;\n const lines: ReadBlockLine[] = [];\n for (const item of value) {\n const row = objectValue(item);\n if (typeof row?.number !== 'number' || !Number.isInteger(row.number) || typeof row.text !== 'string') return null;\n lines.push({ number: row.number, text: row.text });\n }\n return lines;\n}\n\n/** A step past this reads as slow rather than merely in progress. */\nconst SLOW_TOOL_MS = 10_000;\n\nfunction diffHunks(value: unknown): DiffHunk[] | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n const diffs: DiffHunk[] = [];\n for (const item of value) {\n const row = objectValue(item);\n if (typeof row?.path !== 'string' || (row.oldText !== null && typeof row.oldText !== 'string') || typeof row.newText !== 'string') return null;\n diffs.push({ path: row.path, oldText: row.oldText, newText: row.newText });\n }\n return diffs;\n}\n\nfunction searchFiles(value: unknown): SearchFileGroup[] | null {\n if (!Array.isArray(value)) return null;\n const files: SearchFileGroup[] = [];\n for (const item of value) {\n const row = objectValue(item);\n if (typeof row?.path !== 'string' || !Array.isArray(row.matches)) return null;\n const matches: { lineNumber: number; line: string }[] = [];\n for (const itemMatch of row.matches) {\n const match = objectValue(itemMatch);\n if (typeof match?.lineNumber !== 'number' || !Number.isInteger(match.lineNumber) || typeof match.line !== 'string') return null;\n matches.push({ lineNumber: match.lineNumber, line: match.line });\n }\n files.push({ path: row.path, matches });\n }\n return files;\n}\n\nfunction ResultView(props: BlockRenderProps & { entry: ToolActivityEntry; model: ReturnType<typeof activitySummary>; phase: ToolPhase }) {\n const { official, entry, model } = props;\n const fallback = <ResultFallback {...props} />;\n if (!official || !entry.block || model.name === 'render_ui' || model.name === 'show_widget') return fallback;\n return <OfficialTool {...props} official={official} block={entry.block} toolName={model.name} cwd={props.cwd ?? model.cwd} fallback={fallback} />;\n}\n\nfunction ResultFallback({ entry, model, phase, ...render }: BlockRenderProps & { entry: ToolActivityEntry; model: ReturnType<typeof activitySummary>; phase: ToolPhase }) {\n if ((model.name === 'render_ui' || model.name === 'show_widget') && typeof model.args?.html === 'string') {\n return <McpAppFrame html={model.args.html as string} title={typeof model.args.title === 'string' ? (model.args.title as string) : undefined} fillComposer={render.fillComposer} />;\n }\n const block = entry.block;\n if (!block || !('kind' in block)) return <>\n <p className={css.toolDetailNote}>{phase === 'interrupted' ? '已中断,没有工具结果。已生成的输入仍可查看。' : phase === 'preparing' ? '模型正在生成工具输入,工具还未开始执行。' : '工具已开始执行,正在等待结果。'}</p>\n <InputView model={model} phase={phase} fillComposer={render.fillComposer} />\n </>;\n const meta = objectValue(block.meta);\n const text = block.content.filter(item => item.type === 'text').map(item => item.text).join('\\n');\n if (phase === 'interrupted') return <><p className={css.toolDetailNote}>工具已取消,未正常完成。输入和原始返回记录仍可查看。</p><InputView model={model} phase={phase} fillComposer={render.fillComposer} /><pre className={css.toolRaw}>{text}</pre></>;\n\n if (model.category === 'terminal') {\n const facts = executionFacts(block);\n const output = text.replace(/\\n\\[(?:exit code: \\d+|killed by signal: [^\\]\\n]+)\\]$/, '');\n return <div data-reader-tool-terminal><TerminalBlock command={model.command ?? model.name} cwd={model.cwd}\n output={output} exitCode={facts.exitCode} signal={facts.signal} maxLines={18} labels={terminalBlockLabels} /></div>;\n }\n const lines = readLines(meta?.lines);\n if (model.category === 'read' && typeof meta?.path === 'string' && typeof meta.totalLines === 'number' && lines) return <div data-reader-tool-file><ReadBlock label={meta.path} lang={typeof meta.lang === 'string' ? meta.lang : undefined} lines={lines} totalLines={meta.totalLines} maxLines={18} labels={readBlockLabels} /></div>;\n // The host's own hunks when it sent them; otherwise derive them from the call's\n // arguments, which is also what the official row does while a write is pending.\n // Both the counts and this card read the same source, so they cannot disagree.\n const diffs = diffHunks(meta?.diffs) ?? callDiffHunks(block, model.args, model.name);\n if (diffs.length) return <div data-reader-tool-diff><DiffBlock diffs={diffs} maxLines={18} labels={diffBlockLabels} /></div>;\n if (model.category === 'search' && typeof meta?.total === 'number' && typeof meta.truncated === 'boolean') {\n if (meta.shape === 'paths' && Array.isArray(meta.paths) && meta.paths.every((path): path is string => typeof path === 'string')) return <div data-reader-tool-search><SearchBlock kind=\"paths\" paths={meta.paths} total={meta.total} truncated={meta.truncated} maxLines={18} labels={searchBlockLabels} /></div>;\n const files = searchFiles(meta.files);\n if (meta.shape === 'matches' && files) return <div data-reader-tool-search><SearchBlock kind=\"matches\" files={files} total={meta.total} truncated={meta.truncated} maxLines={18} labels={searchBlockLabels} /></div>;\n }\n if (model.category === 'web' && typeof meta?.truncated === 'boolean') {\n if (model.name === 'web_fetch' && typeof meta.url === 'string' && typeof meta.statusCode === 'number') return <div data-reader-tool-web><WebBlock kind=\"fetch\" url={meta.url} statusCode={meta.statusCode} truncated={meta.truncated} labels={webBlockLabels} /></div>;\n if (model.name === 'web_search' && Array.isArray(meta.sources)) {\n const sources = meta.sources.flatMap(source => {\n const item = objectValue(source);\n return typeof item?.url === 'string' ? [{ url: item.url, ...(typeof item.title === 'string' ? { title: item.title } : {}), ...(typeof item.snippet === 'string' ? { snippet: item.snippet } : {}), ...(typeof item.publishedAt === 'string' ? { publishedAt: item.publishedAt } : {}) }] : [];\n });\n if (sources.length === meta.sources.length) return <div data-reader-tool-web><WebBlock kind=\"search\" sources={sources} answer={typeof meta.answer === 'string' ? meta.answer : undefined} truncated={meta.truncated} labels={webBlockLabels} /></div>;\n }\n }\n // A trace/export may omit wire presentation. Keep the generated input clearly\n // labelled; it is not proof of an applied diff or a successful file mutation.\n if (model.category === 'write' && model.content && !block.isError) return <>\n <p className={css.toolDetailNote}>文件工具已返回。以下为提交的内容;完整返回记录可在「原始数据」查看。</p>\n {generatedInput(model.content, model.target, false)}\n </>;\n const content: ToolResultNode['content'] = block.content;\n // A code interpreter's product is its result, not prose. Without this branch\n // the output fell through to the generic document path below, which emits it\n // as reader answer text — so a run_code card sat in the transcript outside\n // every fold, the exact block the reader wanted to be able to close.\n if (model.category === 'code') {\n const output = content.filter(item => item.type === 'text').map(item => item.text).join('\\n');\n const facts = executionFacts(block);\n if (output.trim()) return <div data-reader-tool-code>\n <TerminalBlock command={model.command ?? model.name} cwd={model.cwd} output={output}\n exitCode={facts.exitCode} signal={facts.signal} maxLines={18} labels={terminalBlockLabels} />\n </div>;\n return <p className={css.toolDetailNote}>代码已执行,没有可展示的输出。</p>;\n }\n if (content.some(item => item.type === 'text')) return <div className={css.toolDocument}><Blocks {...render} blocks={contentBlocks(content).filter(item => item.kind === 'text')} source=\"tool\" /></div>;\n if (content.length) return <p className={css.toolDetailNote}>图片或扩展内容已在对话中单独展示。</p>;\n return <p className={css.toolDetailNote}>工具没有返回可展示的内容。</p>;\n}\n\n/** One occurrence, keyed by call id all the way from generation to result. */\nexport const ToolActivity = memo(function ToolActivityView({ entry, motion, turnClosed, onRead, depth = 0, ...render }: BlockRenderProps & {\n entry: ToolActivityEntry; motion: boolean; turnClosed: boolean; onRead: () => void; depth?: number;\n}) {\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState<'result' | 'input' | 'raw'>('result');\n const control = useRef<HTMLElement | null>(null);\n const panel = useRef<HTMLDivElement>(null);\n const [selected, setSelected] = useState(false);\n const detailId = useId();\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const model = useMemo(() => activitySummary(entry), [entry.block, entry.draft]);\n const phase = activityPhase(entry, turnClosed);\n const heldPreview = useRef({ entry, model, phase });\n if (!selected) heldPreview.current = { entry, model, phase };\n const preview = heldPreview.current;\n useEffect(() => {\n const track = () => {\n const selection = document.getSelection();\n setSelected(!!selection && !selection.isCollapsed && !!selection.anchorNode && !!panel.current?.contains(selection.anchorNode));\n };\n document.addEventListener('selectionchange', track);\n return () => document.removeEventListener('selectionchange', track);\n }, []);\n const facts = executionFacts(entry.block);\n const Icon = model.name === 'skill' ? IconSkillOutlineRegular : ICONS[model.category];\n const block = entry.block;\n const native = block ? toolRowModel(model.name, block) : null;\n const skillName = typeof model.args?.name === 'string' ? model.args.name.split('\\n')[0] : model.raw.split('\\n')[0];\n const rowTitle = model.name === 'skill' ? 'Skill' : native?.title ?? VARIANT_TITLES[classifyTool(model.name)];\n const rowSummary = phase === 'interrupted' ? '已停止 · 调用记录保留' : model.name === 'skill' ? skillName : native?.errorSummary ?? native?.summary\n ?? (classifyTool(model.name) === 'others' ? `${model.name} · ${model.target ?? model.title}` : model.target ?? model.title);\n // Files that changed get the same +/- line counts the official tool row shows,\n // read straight from the diff the host attached to the result.\n const diff = useMemo(() => diffTotals(block, model.args, model.name), [block, model.args, model.name]);\n // The changed lines ride in the row's own expansion, the way the official tool\n // row shows them — one disclosure, not a second floating widget.\n const showState = phase === 'preparing' || phase === 'running' || phase === 'failed' || phase === 'interrupted';\n const running = phase === 'preparing' || phase === 'running';\n // A step that has not returned yet counts its own seconds, so a long command\n // reads as progress rather than as a stall. The clock counts from the call's\n // stamped start — a session event time, not the moment this view mounted —\n // so switching conversations and back keeps it running instead of resetting\n // it to zero, and it disappears the moment the result arrives.\n const [liveMs, setLiveMs] = useState<number | null>(null);\n useEffect(() => {\n if (!running) { forgetCallClock(entry.callId); setLiveMs(null); return; }\n const base = runningClockBase(entry.callId, block);\n const tick = () => setLiveMs(Math.max(0, Date.now() - base));\n tick();\n const timer = setInterval(tick, 200);\n return () => clearInterval(timer);\n }, [running, block, entry.callId]);\n const elapsed = block && 'kind' in block && block.callTime != null ? Math.max(0, block.time - block.callTime) : null;\n // A step that ran long keeps showing how long it took after it returns: the\n // number is the point of the readout. A fast step shows nothing once it is done.\n const shownMs = liveMs ?? (elapsed !== null && elapsed >= SLOW_TOOL_MS ? elapsed : null);\n const rawResult = useMemo(() => {\n const value = preview.entry.block;\n return value && 'kind' in value ? JSON.stringify({ content: value.content, isError: value.isError, meta: value.meta }, null, 2) : '';\n }, [preview.entry.block]);\n const tabs = [['result', phase === 'preparing' ? '生成预览' : '结果'], ['input', '输入'], ['raw', '原始数据']] as const;\n const activate = (index: number) => { const item = tabs[(index + tabs.length) % tabs.length]!; setTab(item[0]); tabRefs.current[(index + tabs.length) % tabs.length]?.focus(); };\n if (depth > 6) return <p className={css.meta}>更深的嵌套调用可在原对话查看。</p>;\n return <div ref={element => { control.current = element?.querySelector<HTMLElement>('[data-disclosure-row]') ?? null; }} className={css.toolActivity} data-reader-tool-call={entry.callId} data-tool-phase={phase} data-tool-args-length={model.raw.length} data-tool-category={model.category} data-expanded={open} data-ud-check=\"reader-tool-activity\">\n <DisclosureRow icon={<Icon size={14} />} title={rowTitle} open={open} expandable expandOnRowClick keepContentWhenOpen\n onToggle={() => { onRead(); setOpen(value => !value); }} rowClassName={css.nativeToolRow}\n collapsedContent={<><span className={css.rowSeparator} aria-hidden /><span className={css.nativeToolSummary} title={rowSummary} data-reader-tool-summary\n {...(running ? { 'data-running': '' } : {})}>{rowSummary}</span>\n {shownMs !== null && <span className={css.toolElapsed} data-reader-tool-elapsed\n {...(shownMs >= SLOW_TOOL_MS ? { 'data-slow': '' } : {})}>\n {(shownMs / 1000).toFixed(shownMs < 10000 ? 1 : 0)}s</span>}\n {diff && <span className={css.diffStat} data-reader-diff-stat>\n {diff.added > 0 && <span className={css.diffAdded}>+{number.format(diff.added)}</span>}\n {diff.removed > 0 && <span className={css.diffRemoved}>-{number.format(diff.removed)}</span>}\n </span>}\n {showState && <span className={css.toolState} data-phase={phase}>{LABEL[phase]}</span>}</>} />\n <ProcessFragment open={open} motion={motion} onRead={onRead} returnFocusTo={control} nodeKey={`${entry.key}:detail`} framed>\n <div id={detailId} className={css.toolDetails}>\n <div className={css.toolLedger} aria-live=\"off\">\n <span>工具 · <span className={css.toolEngine}>{model.name}</span></span>\n <span data-reader-tool-progress>{phase === 'preparing' ? `已接收 ${number.format(model.raw.length)} 字符输入` : phase === 'running' ? '已提交 · 等待工具返回' : phase === 'interrupted' ? '已停止 · 输入记录保留' : elapsed !== null ? `执行 ${duration(elapsed)}` : '结果已记录'}</span>\n {facts.exitCode !== undefined && <span>退出码 {facts.exitCode}</span>}\n {facts.signal && <span>信号 {facts.signal}</span>}\n </div>\n <div className={css.toolTabs} role=\"tablist\" aria-label={`${model.title}的执行数据`} onKeyDown={event => {\n const index = tabs.findIndex(item => item[0] === tab);\n if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') { event.preventDefault(); activate(index + (event.key === 'ArrowRight' ? 1 : -1)); }\n else if (event.key === 'Home' || event.key === 'End') { event.preventDefault(); activate(event.key === 'Home' ? 0 : tabs.length - 1); }\n }}>{tabs.map(([id, title], index) => <button key={id} ref={element => { tabRefs.current[index] = element; }} type=\"button\" role=\"tab\" id={`${detailId}-${id}`} aria-selected={tab === id} aria-controls={`${detailId}-panel`} tabIndex={tab === id ? 0 : -1} onClick={() => setTab(id)}>{title}</button>)}</div>\n <div ref={panel} id={`${detailId}-panel`} className={css.toolPanel} role=\"tabpanel\" aria-labelledby={`${detailId}-${tab}`} tabIndex={0}>\n {selected && <p className={css.toolDetailNote}>为保留选区,预览暂停更新;当前状态见卡片标题。</p>}\n {tab === 'result' && <ResultView {...render} {...preview} />}\n {tab === 'input' && <><InputView model={preview.model} phase={preview.phase} fillComposer={render.fillComposer} /><details className={css.detail}><summary>全部输入字段</summary><JsonTree data={preview.model.args} label=\"输入字段\" labels={jsonTreeLabels} /></details></>}\n {tab === 'raw' && <><p className={css.toolDetailNote}>完整记录 · 只读 · 不执行其中的代码</p><h4 className={css.toolRawLabel}>工具输入</h4><pre className={css.toolRaw}>{preview.model.raw || '输入尚未到达'}</pre>{rawResult && <><h4 className={css.toolRawLabel}>工具结果</h4><pre className={css.toolRaw}>{rawResult}</pre></>}</>}\n </div>\n </div>\n </ProcessFragment>\n {!!block?.subCalls.length && <div className={css.toolChildren} aria-label=\"子调用\">{block.subCalls.map((child, index) => <ToolActivity key={child.callId} {...render}\n entry={{ kind: 'tool', key: `reader-tool:${child.callId}`, callId: child.callId, step: entry.step, order: index, block: child }}\n motion={motion} turnClosed={turnClosed} onRead={onRead} depth={depth + 1} />)}</div>}\n </div>;\n}, (previous, next) => previous.entry.callId === next.entry.callId && previous.entry.block === next.entry.block\n && previous.entry.draft === next.entry.draft && previous.entry.step === next.entry.step\n && previous.motion === next.motion && previous.turnClosed === next.turnClosed && previous.depth === next.depth\n && previous.onRead === next.onRead && previous.renderSlotChain === next.renderSlotChain && previous.loadImage === next.loadImage && previous.fillComposer === next.fillComposer\n && previous.official === next.official && previous.cwd === next.cwd && previous.openFile === next.openFile);\n\n/** Rich media (images, MCP widgets) rendered outside the folded tool ledger. */\nexport function ToolMedia({ block, depth = 0, ...render }: BlockRenderProps & { block: ToolCallBlock; depth?: number }) {\n if (depth > 6) return null;\n const settled = 'kind' in block;\n const visible = settled ? contentBlocks(block.content).filter(item => item.kind === 'image' || item.kind === 'other') : [];\n return <>\n {visible.length > 0 && <Blocks {...render} blocks={visible} source=\"tool\" />}\n {block.subCalls.map(child => <ToolMedia key={child.callId} {...render} block={child} depth={depth + 1} />)}\n </>;\n}\n","import { isAbsoluteWorkspacePath } from '../workspace-path.js';\n\nexport type DeliverableOpenMode = 'external' | 'sidebar';\n\nexport interface OpenModeSnapshot {\n getSnapshot: () => { deliverableOpenMode?: DeliverableOpenMode };\n subscribe?: (fn: () => void) => () => void;\n}\n\nexport function deliverableOpenModeOf(value: unknown): DeliverableOpenMode {\n return value === 'sidebar' ? 'sidebar' : 'external';\n}\n\nexport function modeFromSnapshot(store: OpenModeSnapshot | undefined): DeliverableOpenMode {\n try {\n return deliverableOpenModeOf(store?.getSnapshot()?.deliverableOpenMode);\n } catch {\n return 'external';\n }\n}\n\n/** Workspace-folder affordances stay on the OS opener, not the Sidebar switch. */\nexport function isFolderOpenPath(path: string): boolean {\n return path === '.' || path === '';\n}\n\nfunction encodeSegment(segment: string): string {\n return encodeURIComponent(segment).replace(/%3A/gi, ':');\n}\n\nfunction encodePath(path: string): string {\n return path.split('/').map(encodeSegment).join('/');\n}\n\n/**\n * Session-scoped `dsh-resource://file/session/<id>/…` address.\n * Matches official `fileAddressFor` / `sessionFileAddress` (0.1.5).\n */\nexport function fileAddressFor(sessionId: string, cwd: string | undefined, path: string): string {\n const normalized = path.replace(/\\\\/g, '/');\n const address = (relative: string): string => {\n const cleaned = relative.replace(/\\\\/g, '/').replace(/^(?:\\.\\/)+/, '');\n return `dsh-resource://file/session/${encodeSegment(sessionId)}/${encodePath(cleaned)}`;\n };\n if (!isAbsoluteWorkspacePath(normalized)) return address(normalized);\n const root = cwd === undefined ? '' : cwd.replace(/\\\\/g, '/').replace(/\\/+$/, '');\n if (root !== '' && normalized === root) return address('');\n if (root !== '' && normalized.startsWith(`${root}/`)) return address(normalized.slice(root.length + 1));\n return address(normalized);\n}\n\nexport function resolveOpenWorkspacePath(\n cwd: string | undefined,\n path: string,\n resolveWorkspacePath: (cwd: string | undefined, path: string) => string,\n): string {\n return isFolderOpenPath(path) ? (cwd ?? '.') : resolveWorkspacePath(cwd, path);\n}\n\nexport async function openDeliverableFile(args: {\n path: string;\n mode: DeliverableOpenMode;\n sessionId: string;\n cwd: string | undefined;\n resolveWorkspacePath: (cwd: string | undefined, path: string) => string;\n openExternal: (absolutePath: string) => Promise<void>;\n openSidebar?: (address: string) => void;\n fileAddressFor?: (sessionId: string, cwd: string | undefined, path: string) => string;\n warn?: (message: string, extra?: unknown) => void;\n}): Promise<'sidebar' | 'external'> {\n const targetPath = resolveOpenWorkspacePath(args.cwd, args.path, args.resolveWorkspacePath);\n const useSidebar = args.mode === 'sidebar' && !isFolderOpenPath(args.path);\n if (useSidebar) {\n if (typeof args.openSidebar !== 'function') {\n args.warn?.('[dsh-better-display] sidebarRight.openResource is not available; falling back to system app');\n } else {\n try {\n const address = (args.fileAddressFor ?? fileAddressFor)(args.sessionId, args.cwd, args.path);\n args.openSidebar(address);\n return 'sidebar';\n } catch (error) {\n args.warn?.('[dsh-better-display] sidebar open failed; falling back to system app', error);\n }\n }\n }\n await args.openExternal(targetPath);\n return 'external';\n}\n","/** Official PendingSubmission.images is optional at runtime; text-only sends omit it. */\n\nexport interface PendingSubmissionImage {\n readonly previewUrl: string;\n readonly width?: number;\n readonly height?: number;\n readonly name?: string;\n}\n\nexport interface PendingSubmissionLike {\n readonly images?: readonly PendingSubmissionImage[] | null;\n readonly attachments?: readonly {\n readonly type?: string;\n readonly value?: PendingSubmissionImage;\n }[] | null;\n}\n\nexport interface PendingSubmissionEcho extends PendingSubmissionLike {\n readonly requestId: string;\n readonly text?: string;\n readonly time?: number;\n readonly placement?: string;\n}\n\nexport function asReadonlyArray<T>(value: unknown): readonly T[] {\n return Array.isArray(value) ? value as readonly T[] : [];\n}\n\nfunction isImage(value: unknown): value is PendingSubmissionImage {\n return value !== null && typeof value === 'object' && typeof (value as PendingSubmissionImage).previewUrl === 'string';\n}\n\n/**\n * Safe image list for conversation.view pending echoes.\n * Official 0.1.5 uses `images`; older hosts used `attachments`.\n * Either field may be missing — never read `.length` on undefined.\n */\nexport function pendingSubmissionImages(submission: PendingSubmissionLike | null | undefined): readonly PendingSubmissionImage[] {\n if (submission == null) return [];\n if (Array.isArray(submission.images)) return submission.images.filter(isImage);\n if (Array.isArray(submission.attachments)) {\n const images: PendingSubmissionImage[] = [];\n for (const item of submission.attachments) {\n if (item?.type === 'image' && isImage(item.value)) images.push(item.value);\n }\n return images;\n }\n return [];\n}\n","import { useEffect, useState } from 'react';\nimport { formatRunDuration } from './message-chrome.js';\nimport css from './Reader.module.css';\n\n/** Past this, a wait stops being a pause and reads as the model not answering. */\nexport const WAIT_OVERTIME_MS = 10_000;\n\n/**\n * How long the model has been given the turn, counted in plain seconds.\n *\n * Just the number and, past ten seconds, a「暂未响应」badge — no bar, because the\n * question the reader has is「how long has this been hanging」, not「how far\n * along」: there is no known total to be a fraction of.\n *\n * The clock restarts whenever the anchor changes, so each wait is timed from the\n * event that started it rather than from the beginning of the turn.\n */\nexport function WaitClock({ startTime }: { startTime: number | null }) {\n const [mountedAt] = useState(() => Date.now());\n const [now, setNow] = useState(() => Date.now());\n const anchor = startTime ?? mountedAt;\n useEffect(() => {\n const id = setInterval(() => setNow(Date.now()), 250);\n return () => clearInterval(id);\n }, []);\n const waited = Math.max(0, now - anchor);\n const overtime = waited >= WAIT_OVERTIME_MS;\n return <span className={css.waitClock} data-reader-wait-clock\n {...(overtime ? { 'data-overtime': '' } : {})}>\n <span className={css.waitSeconds}>{formatRunDuration(waited)}</span>\n {overtime && <span className={css.waitOvertime} data-reader-wait-badge>暂未响应</span>}\n </span>;\n}\n","import { WaitClock } from './WaitClock.js';\nimport type { WaitingAnchor } from './waiting-clock.js';\nimport css from './Reader.module.css';\n\nexport function WaitingStatus({ anchor, label }: { anchor: WaitingAnchor; label: string }) {\n // A new input gets its own clock even if the waiting indicator stays mounted;\n // the readout itself is shared with the group status so the two never disagree.\n return <div className={css.turnStatus} role=\"status\" aria-live=\"polite\" data-reader-turn-status\n data-reader-wait-start={anchor.time ?? ''}>\n <span className={css.turnStatusLabel}>{label}</span>\n <WaitClock key={anchor.key} startTime={anchor.time} />\n </div>;\n}\n","import type { ChatNodeKind } from '@deepseek-ai/dsh-client-ui-chat/client';\n\nexport interface WaitingAnchor { key: string; time: number | null }\ntype InputNode = { kind: string; data: unknown };\ntype Submission = { requestId: string; time?: number; placement?: string };\nconst timestamp = (value: number | undefined): number | null => typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;\n\n/**\n * Chat-layer kinds that hand the turn back to the model unconditionally.\n *\n * These are `ChatNodeDataMap` keys, NOT conversation-layer `ConversationNode` kinds.\n * The two layers name the same idea differently: a returned tool is `tool-result`\n * in the conversation contract, but the row the reader sees is the `tool-call` node.\n * A name copied from the wrong layer silently disables the branch it guards, so\n * the `satisfies` below makes the compiler reject any name that is not a real kind.\n */\nexport const WAIT_AFTER = new Set<ChatNodeKind>(['context', 'model-retry']);\n\n/**\n * Every chat-kind the handover logic reasons about, checked against the host's own\n * kind union at compile time. Adding a name here that the host does not register\n * fails `tsc` instead of failing silently at runtime.\n */\nexport const HANDOVER_KINDS = [\n 'user', 'steering', 'context', 'model-retry', 'tool-call', 'command',\n] as const satisfies readonly ChatNodeKind[];\n\n/**\n * Mirrors the host's `isSettledTool`: a running call has no `kind`, a settled one\n * carries `kind: 'tool-result'`. Kept local so this module stays dependency-free,\n * and pinned by a test against the host's own helper contract.\n */\nfunction toolSettled(data: unknown): boolean {\n const root = (data as { root?: unknown } | undefined)?.root;\n return typeof root === 'object' && root !== null && (root as { kind?: unknown }).kind === 'tool-result';\n}\n\n/** A command that is still executing has no outcome yet; only a settled one hands over. */\nfunction commandSettled(data: unknown): boolean {\n return (data as { outcome?: unknown } | undefined)?.outcome != null;\n}\n\n/**\n * Does this node leave the model on the hook for the next move?\n *\n * A tool or command that is *still running* is not a wait — the tool is the one\n * working. Only its returned form hands control back, which is exactly the moment\n * the model can stall.\n */\nexport function handsBackToModel(node: InputNode): boolean {\n if (node.kind === 'user' || node.kind === 'steering') return true;\n if (node.kind === 'tool-call') return toolSettled(node.data);\n if (node.kind === 'command') return commandSettled(node.data);\n return WAIT_AFTER.has(node.kind as ChatNodeKind);\n}\n\n/**\n * The moment the current wait began.\n *\n * This is the time of the **last** node that handed control to the model — a\n * returned tool, an injected context, or the user's own message. Anchoring on the\n * user's message alone made the readout count the entire turn, so a wait that had\n * only just begun showed the minutes the tools had already spent.\n */\nexport function waitingAnchor(order: readonly string[], get: (key: string) => InputNode | undefined, pending: readonly Submission[] = []): WaitingAnchor {\n let anchor: WaitingAnchor = { key: 'unresolved', time: null };\n for (let i = order.length - 1; i >= 0; i--) {\n const node = get(order[i]);\n if (!node) continue;\n if (!handsBackToModel(node)) continue;\n const time = node.data && typeof node.data === 'object' && 'time' in node.data && typeof node.data.time === 'number' ? node.data.time : undefined;\n anchor = { key: order[i], time: timestamp(time) };\n break;\n }\n for (let i = pending.length - 1; i >= 0; i--) {\n const input = pending[i];\n if (input.placement === 'queued') continue;\n const time = timestamp(input.time);\n if (time === null || anchor.time === null || time >= anchor.time) return { key: `pending:${input.requestId}`, time };\n break;\n }\n return anchor;\n}\n","import type { ReactNode } from 'react'\nimport {\n IconBrowseOutlineRegular, IconFolderCloseRegular,\n} from '@deepseek-ai/dsh-client-ui-primitives'\n\n/** Reference domains with distinct composer and transcript glyphs. */\nexport type ReferenceIconKind = 'session' | 'file' | 'folder'\n\n/** Props shared by inline reference glyphs. */\nexport interface ReferenceIconProps {\n kind: ReferenceIconKind\n size?: number\n className?: string | undefined\n}\n\n/**\n * Render the icon that identifies one inline reference domain.\n * @param props - Reference kind, optional size, and optional CSS class.\n * @returns The corresponding current-color SVG glyph.\n */\nexport function ReferenceIcon({ kind, size = 16, className }: ReferenceIconProps): ReactNode {\n switch (kind) {\n case 'session':\n return (\n <svg width={size} height={size} className={className} viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path\n d=\"M8 0.597656C3.91296 0.597656 0.599716 3.91103 0.599609 7.99805C0.599609 9.13171 0.854567 10.2079 1.31152 11.1699L1.59277 11.7607L2.77441 11.1992L2.49414 10.6084L2.36035 10.3076C2.06865 9.59612 1.90723 8.81645 1.90723 7.99805C1.90733 4.63362 4.63554 1.90625 8 1.90625C11.3644 1.90635 14.0917 4.63368 14.0918 7.99805C14.0918 11.3625 11.3644 14.0907 8 14.0908C7.311 14.0908 6.80642 14.0414 6.35938 13.918C5.919 13.7963 5.50105 13.5929 5.00098 13.2441C4.26805 12.7329 3.21756 12.5526 2.35156 13.0996L2.33789 13.1084L2.32422 13.1182L1.74805 13.5234L2.18164 14.8184L3.05957 14.2002C3.37505 14.0068 3.84248 14.0319 4.25195 14.3174C4.84447 14.7307 5.39718 15.009 6.01172 15.1787C6.61963 15.3465 7.25579 15.3984 8 15.3984C12.087 15.3983 15.4004 12.0851 15.4004 7.99805C15.4003 3.9111 12.087 0.59776 8 0.597656ZM4.56836 8.50977V9.80371H8.12402V8.50977H4.56836ZM4.56836 7.30078H11.4619V6.00684H4.56836V7.30078Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'file': return <IconBrowseOutlineRegular size={size} className={className} />\n case 'folder': return <IconFolderCloseRegular size={size} className={className} />\n }\n}\n","// Expanded bodies for the context disclosure, one per durable context form.\n// The producer declares the form; this module only chooses a presentation for\n// it. Every form falls back to OpaqueBody, which is the documented default for\n// an absent, unknown, or malformed form — a resumed or foreign log must render\n// even when this UI version has never seen its producer.\n\nimport type { ReactNode } from 'react'\nimport type { ContextMessageNode, KnownContextForm } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport { JsonBlock } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport css from './ContextBody.module.css'\n\n/** Model-facing text stays bounded at the disclosure, not at the producer. */\nconst MAX_CHARS = 20_000\n\n/** Rows a list body materializes before summarizing the remainder. */\nconst MAX_ENTRIES = 200\n\ntype Translate = TranslateNS<'chat'>\n\n/** One durable source narrowed to the readable-record shape; null for anything else. */\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? value as Record<string, unknown>\n : null\n}\n\n/** One run of the model-facing content: adjacent text, or one unknown block. */\ntype ContentRun = { text: string } | { block: unknown }\n\n/**\n * The content blocks as runs, IN THE ORDER the model received them.\n *\n * Adjacent text blocks join with no separator, matching how provider adapters\n * flatten them — inserting a line break would show the reader a line the model\n * never saw. An unknown block breaks the run and keeps its own fallback rather\n * than being hoisted past the text around it or vanishing; the block union is\n * merge-extensible, so a foreign log may interleave shapes this build does not\n * know.\n */\nfunction contentRuns(content: ContextMessageNode['content']): ContentRun[] {\n const runs: ContentRun[] = []\n for (const block of content) {\n if (block.type !== 'text') {\n runs.push({ block })\n continue\n }\n const last = runs[runs.length - 1]\n if (last !== undefined && 'text' in last) last.text += block.text\n else runs.push({ text: block.text })\n }\n return runs\n}\n\n/** Only the blocks this UI version does not know, for bodies that replace the text. */\nfunction unknownBlocks(content: ContextMessageNode['content']): unknown[] {\n return contentRuns(content).flatMap(run => 'block' in run ? [run.block] : [])\n}\n\n/** The model-facing text, truncated to the display bound. */\nfunction boundedText(text: string, t: Translate): string {\n return text.length > MAX_CHARS\n ? `${text.slice(0, MAX_CHARS)}\\n${t('json.truncated', { total: text.length })}`\n : text\n}\n\n/**\n * One source field rendered as a value row; nested shapes stay compact JSON.\n * Bounded on its own, because source fields are as unbounded as the text: an unknown\n * producer may record an arbitrarily large string or array.\n */\nfunction fieldValue(value: unknown, t: Translate): string {\n const text = typeof value === 'string'\n ? value\n : typeof value === 'number' || typeof value === 'boolean' ? String(value) : JSON.stringify(value)\n return boundedText(text, t)\n}\n\n/**\n * Source fields as a key/value list. `kind` is always omitted because the\n * row header already names the producer. `form` is omitted only when a\n * dedicated body rendered for it — then the presentation the reader is looking\n * at IS that value. On the opaque fallback the declaration is kept, because\n * that is the one place a form this version cannot present would otherwise\n * disappear from the UI entirely.\n */\nfunction SourceFields({ source, formRendered, t }: {\n source: unknown\n formRendered: boolean\n t: Translate\n}): ReactNode {\n const record = asRecord(source)\n if (record === null) return null\n const hidden = formRendered ? ['kind', 'form'] : ['kind']\n const rows = Object.entries(record).filter(([key]) => !hidden.includes(key))\n if (rows.length === 0) return null\n return (\n <dl className={css.fields} data-context-fields>\n {rows.map(([key, value]) => (\n <div key={key} className={css.field}>\n <dt className={css.fieldKey}>{key}</dt>\n <dd className={css.fieldValue}>{fieldValue(value, t)}</dd>\n </div>\n ))}\n </dl>\n )\n}\n\n/**\n * Content blocks this UI version does not know, kept visible rather than\n * dropped: the block union is merge-extensible, so a newer or foreign log may\n * carry a shape this build has no presentation for.\n * @param props - The unrecognized blocks and the locale seat.\n * @returns One generic JSON block per unknown entry.\n */\nfunction UnknownBlocks({ blocks, t }: { blocks: readonly unknown[]; t: Translate }): ReactNode {\n return (\n <>\n {blocks.map((block, index) => (\n <JsonBlock\n key={index}\n label={t('message.unknownBlock')}\n payload={block}\n truncatedLabel={total => t('json.truncated', { total })}\n />\n ))}\n </>\n )\n}\n\n/**\n * The model-facing content of one context, shared by every form that shows it:\n * the text with its real line breaks, then any block this UI version does not\n * know, which keeps its own fallback rather than vanishing.\n * @param props - Durable content and the locale seat.\n * @returns The content blocks as the model received them.\n */\nfunction ModelFacingContent({ content, t }: {\n content: ContextMessageNode['content']\n t: Translate\n}): ReactNode {\n return (\n <>\n {contentRuns(content).map((run, index) => ('text' in run\n ? run.text !== '' && (\n <pre key={index} className={css.text} data-context-text>{boundedText(run.text, t)}</pre>\n )\n : (\n <JsonBlock\n key={index}\n label={t('message.unknownBlock')}\n payload={run.block}\n truncatedLabel={total => t('json.truncated', { total })}\n />\n )))}\n </>\n )\n}\n\n/**\n * Default presentation: the model-facing text as text, with its real line\n * breaks, and the remaining source fields beneath it. This is what every form\n * this UI version does not recognize renders as.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The opaque context body.\n */\nexport function OpaqueBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n return (\n <>\n <ModelFacingContent content={content} t={t} />\n <SourceFields source={source} formRendered={false} t={t} />\n </>\n )\n}\n\n/** One reconciled instruction file, as the durable source records it. */\ninterface InstructionChange {\n action: 'set' | 'replace' | 'remove'\n path: string\n digest?: string\n}\n\n/**\n * Instruction changes read off the source, or null when the record is not a\n * usable instruction list.\n *\n * The read is all-or-nothing: silently dropping one unreadable entry would show\n * a confident, incomplete file list for a log this version cannot fully read.\n * Paths are deduplicated in first-seen order, matching how the header label is\n * derived from the same array.\n */\nfunction instructionChanges(source: unknown): InstructionChange[] | null {\n const record = asRecord(source)\n const list = record === null ? undefined : record['changes']\n if (!Array.isArray(list)) return null\n const changes: InstructionChange[] = []\n const seen = new Set<string>()\n for (const entry of list as readonly unknown[]) {\n const change = asRecord(entry)\n if (change === null) return null\n const path = change['path']\n if (typeof path !== 'string' || path === '') return null\n const action = change['action']\n // The action decides which word the row shows, so an unrecognized one is\n // not a readable change — it would be presented as loaded or updated.\n if (action !== 'set' && action !== 'replace' && action !== 'remove') return null\n const digest = change['digest']\n if (seen.has(path)) continue\n seen.add(path)\n changes.push({ action, path, ...typeof digest === 'string' ? { digest } : {} })\n }\n return changes.length === 0 ? null : changes\n}\n\n/**\n * Locale key for one reconciled file. The baseline loads a file; a later delta\n * distinguishes a newly reconciled path from a rewritten one, which `set` and\n * `replace` already separate at the producer.\n * @param action - the durable change action.\n * @param baseline - whether this context is the startup/resume baseline.\n * @returns the key naming what happened to that file.\n */\nfunction instructionAction(\n action: InstructionChange['action'],\n baseline: boolean,\n): 'message.context.instructions.removed' | 'message.context.instructions.loaded'\n | 'message.context.instructions.added' | 'message.context.instructions.updated' {\n if (action === 'remove') return 'message.context.instructions.removed'\n if (baseline) return 'message.context.instructions.loaded'\n return action === 'set' ? 'message.context.instructions.added' : 'message.context.instructions.updated'\n}\n\n/**\n * `instructions` form: the files this context reconciled, then their text.\n *\n * The text keeps its `<system-reminder>` framing verbatim — the framing is part\n * of what the model read, so hiding it would misreport the request.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The instructions context body, or the opaque body when the change\n * list is unreadable.\n */\nexport function InstructionsBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n const changes = instructionChanges(source)\n if (changes === null) return <OpaqueBody content={content} source={source} t={t} />\n const baseline = asRecord(source)?.['baseline'] === true\n return (\n <>\n <ul className={css.files} data-context-files>\n {changes.map(change => (\n <li key={change.path} className={css.file} title={change.digest}>\n <span className={css.filePath}>{change.path}</span>\n <span className={css.fileAction}>\n {t(instructionAction(change.action, baseline))}\n </span>\n </li>\n ))}\n </ul>\n <ModelFacingContent content={content} t={t} />\n </>\n )\n}\n\n/** One catalog entry, as the durable source records it. */\ninterface CatalogEntry {\n name: string\n description: string\n}\n\n/**\n * Catalog entries read off the source, or null when the record is not a usable\n * catalog. All-or-nothing for the same reason as the instruction list: this body\n * replaces the model-facing text, so a partial list would hide the only complete\n * account of what the model read.\n */\nfunction catalogEntries(source: unknown): CatalogEntry[] | null {\n const record = asRecord(source)\n const list = record === null ? undefined : record['entries']\n if (!Array.isArray(list)) return null\n const entries: CatalogEntry[] = []\n for (const item of list as readonly unknown[]) {\n const entry = asRecord(item)\n if (entry === null) return null\n const name = entry['name']\n const description = entry['description']\n if (typeof name !== 'string' || name === '' || typeof description !== 'string') return null\n entries.push({ name, description })\n }\n // An empty list is a real catalog: a replacement with no entries retires\n // every earlier name. Only an unreadable shape falls back.\n return entries\n}\n\n/**\n * `catalog` form: the published entries as a list, read from the source rather\n * than re-parsed out of the model-facing prose.\n *\n * A catalog whose source carries no usable entries falls through to the opaque\n * body, so an older or hand-edited log still shows its text.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The catalog context body, or the opaque body when the entry list is\n * unreadable.\n */\nexport function CatalogBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n const entries = catalogEntries(source)\n if (entries === null) return <OpaqueBody content={content} source={source} t={t} />\n const update = asRecord(source)?.['update'] === true\n // Entry count is unbounded (a provider may publish any number of skills), and\n // the scrollport bounds height, not node count — so the list bounds itself.\n const shown = entries.slice(0, MAX_ENTRIES)\n const rest = unknownBlocks(content)\n return (\n <>\n {update && <p className={css.catalogNotice} data-context-catalog-update>{t('message.context.catalog.replaced')}</p>}\n <ul className={css.entries} data-context-entries>\n {shown.map((entry, index) => (\n // Index key: a hand-edited or foreign log may repeat a name, and a\n // duplicate React key would drop a row the model did see.\n <li key={index} className={css.entry}>\n <code className={css.entryName}>{entry.name}</code>\n <span className={css.entryDescription}>{entry.description}</span>\n </li>\n ))}\n </ul>\n {shown.length < entries.length && (\n <p className={css.catalogNotice} data-context-entries-truncated>\n {t('message.context.catalog.more', { count: entries.length - shown.length })}\n </p>\n )}\n {/* The block union is merge-extensible: a catalog message carrying an\n unknown block still shows it rather than dropping model-visible content. */}\n <UnknownBlocks blocks={rest} t={t} />\n </>\n )\n}\n\n/** One named contribution to a runtime snapshot, as the durable source records it. */\ninterface SnapshotSection {\n name: string\n text: string\n}\n\n/** Snapshot sections read off the source, or null when the record is unusable. */\nfunction snapshotSections(source: unknown): SnapshotSection[] | null {\n const record = asRecord(source)\n const list = record === null ? undefined : record['sections']\n if (!Array.isArray(list)) return null\n const sections: SnapshotSection[] = []\n for (const item of list as readonly unknown[]) {\n const section = asRecord(item)\n if (section === null) return null\n const name = section['name']\n const text = section['text']\n if (typeof name !== 'string' || name === '' || typeof text !== 'string') return null\n sections.push({ name, text })\n }\n return sections.length === 0 ? null : sections\n}\n\n/**\n * `snapshot` form: the named contributions this snapshot assembled, in order.\n *\n * The sections are the same bytes the model read, split at the boundaries the\n * producer assembled them on, so a reader sees which subsystem contributed\n * which state instead of one undifferentiated wall.\n *\n * One sentence of the model-facing text is NOT in any section: the producer's\n * framing line declaring that this snapshot supersedes earlier ones. Unlike the\n * `<system-reminder>` wrapper an instruction context carries — which wraps\n * content and cannot be separated from it — that line states the form's own\n * semantics, so the body states them as a caption instead of reprinting the\n * joined prose beside the sections it was split from.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The snapshot context body, or the opaque body when unreadable.\n */\nexport function SnapshotBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n const sections = snapshotSections(source)\n /* v8 ignore next -- contextBody reads the sections before choosing this body. */\n if (sections === null) return <OpaqueBody content={content} source={source} t={t} />\n return (\n <>\n <p className={css.catalogNotice} data-context-snapshot-supersedes>\n {t('message.context.snapshot.supersedes')}\n </p>\n <dl className={css.sections} data-context-sections>\n {sections.map((section, index) => (\n <div key={index} className={css.section}>\n <dt className={css.sectionName}>{section.name}</dt>\n <dd className={css.sectionText}>{boundedText(section.text, t)}</dd>\n </div>\n ))}\n </dl>\n </>\n )\n}\n\n/**\n * `notice` form: what just happened, with the model-facing text beneath it.\n *\n * The one-line account also rides the collapsed row ({@link contextBody}), so a\n * notice is usually readable without expanding at all.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The notice context body.\n */\nexport function NoticeBody({ content, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n return <ModelFacingContent content={content} t={t} />\n}\n\n/**\n * `relay` form: which agent sent this, then what it said.\n *\n * The sender is an opaque session id; it is shown as a field rather than a\n * label, because this client cannot resolve it to a title.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The relay context body.\n */\nexport function RelayBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n const sender = relaySender(source)\n /* v8 ignore next -- contextBody resolves the sender before choosing this body. */\n if (sender === null) return <OpaqueBody content={content} source={source} t={t} />\n return (\n <>\n <p className={css.relaySender} data-context-relay-sender>\n {t('message.context.relay.from', { session: sender })}\n </p>\n <ModelFacingContent content={content} t={t} />\n </>\n )\n}\n\n/** The sending agent's session id, or null when the record does not name one. */\nfunction relaySender(source: unknown): string | null {\n const sender = asRecord(source)?.['senderSessionId']\n return typeof sender === 'string' && sender !== '' ? sender : null\n}\n\n/** One recalled session, as the durable source records it. */\ninterface RecalledSession {\n label: string\n retained: number\n omitted: number\n truncated: boolean\n}\n\n/** Recalled sessions read off the source, or null when the record is unusable. */\nfunction recalledSessions(source: unknown): RecalledSession[] | null {\n const record = asRecord(source)\n const list = record === null ? undefined : record['references']\n if (!Array.isArray(list)) return null\n const sessions: RecalledSession[] = []\n for (const item of list as readonly unknown[]) {\n const reference = asRecord(item)\n if (reference === null) return null\n const label = reference['label']\n const retained = reference['retainedMessages']\n const omitted = reference['omittedMessages']\n const truncated = reference['truncated']\n // Completeness is the fact this card exists to report, so a reference that\n // cannot state it is not a readable recall — showing the label alone would\n // present a confident card over unknown loss.\n if (typeof label !== 'string' || label === ''\n || typeof retained !== 'number' || typeof omitted !== 'number'\n || typeof truncated !== 'boolean') return null\n sessions.push({ label, retained, omitted, truncated })\n }\n return sessions.length === 0 ? null : sessions\n}\n\n/**\n * `recall` form: which sessions this material came from and how much of each\n * survived the read, then the material itself.\n *\n * Completeness is the fact a reader needs first: recalled context is bounded on\n * the way in, so a card that hid the omitted count would overstate what the\n * model received.\n * @param props - Durable content, its source, and the locale seat.\n * @returns The recall context body, or the opaque body when unreadable.\n */\nexport function RecallBody({ content, source, t }: {\n content: ContextMessageNode['content']\n source: unknown\n t: Translate\n}): ReactNode {\n const sessions = recalledSessions(source)\n if (sessions === null) return <OpaqueBody content={content} source={source} t={t} />\n return (\n <>\n <ul className={css.recalls} data-context-recalls>\n {sessions.map((session, index) => (\n <li key={index} className={css.recall}>\n <span className={css.recallLabel}>{session.label}</span>\n <span className={css.recallCounts}>\n {t('message.context.recall.counts', {\n retained: session.retained,\n omitted: session.omitted,\n })}\n </span>\n {session.truncated && (\n <span className={css.recallCounts}>{t('message.context.recall.truncated')}</span>\n )}\n </li>\n ))}\n </ul>\n <ModelFacingContent content={content} t={t} />\n </>\n )\n}\n\n/** The one-line account a `notice` puts on its collapsed row, when it records one. */\nfunction noticeSummary(source: unknown): string | null {\n const summary = asRecord(source)?.['summary']\n return typeof summary === 'string' && summary !== '' ? summary : null\n}\n\n/**\n * Choose the body for one context node.\n *\n * Returns the form the body actually rendered as, which is not always the\n * declared one: a declared form whose fields are unreadable falls back to\n * opaque, and the caller labels the row with what it really shows.\n * `summary` is the collapsed row's one-line account, which only a `notice`\n * records: its whole point is being readable without expanding.\n * @param form - the producer-declared form projected onto the node.\n * @param props - durable content, its source, and the locale seat.\n * @returns the rendered form (null for opaque), its collapsed summary, and its body.\n */\nexport function contextBody(\n form: ContextMessageNode['form'],\n props: { content: ContextMessageNode['content']; source: unknown; t: Translate },\n): { rendered: KnownContextForm | null; summary: string | null; body: ReactNode } {\n const opaque = { rendered: null, summary: null, body: <OpaqueBody {...props} /> }\n switch (form) {\n case 'instructions':\n return instructionChanges(props.source) === null\n ? opaque\n : { rendered: 'instructions', summary: null, body: <InstructionsBody {...props} /> }\n case 'catalog':\n return catalogEntries(props.source) === null\n ? opaque\n : { rendered: 'catalog', summary: null, body: <CatalogBody {...props} /> }\n case 'snapshot':\n return snapshotSections(props.source) === null\n ? opaque\n : { rendered: 'snapshot', summary: null, body: <SnapshotBody {...props} /> }\n case 'notice': {\n const summary = noticeSummary(props.source)\n return summary === null\n ? opaque\n : { rendered: 'notice', summary, body: <NoticeBody {...props} /> }\n }\n case 'relay':\n return relaySender(props.source) === null\n ? opaque\n : { rendered: 'relay', summary: null, body: <RelayBody {...props} /> }\n case 'recall':\n return recalledSessions(props.source) === null\n ? opaque\n : { rendered: 'recall', summary: null, body: <RecallBody {...props} /> }\n case null:\n return opaque\n /* v8 ignore next 4 -- closed-union backstop; the compiler rejects a new\n KnownContextForm here rather than letting it degrade to opaque silently. */\n default: {\n const unreachable: never = form\n throw new Error(`unreachable context form: ${String(unreachable)}`)\n }\n }\n}\n","/** One developer tool-change block the 0.1.7-rc.2 context row names in place. */\nexport interface ToolChangeBlock {\n type: 'tool-addition' | 'tool-removal'\n toolName: string\n}\n\n/** Names collected from a context whose every block is a tool change. */\nexport interface ToolUpdateRows {\n added: readonly string[]\n removed: readonly string[]\n /** The only block, when the row is a single add or removal. */\n single: ToolChangeBlock | null\n}\n\n/**\n * Classify a context as the rc.2 tool-update row.\n * Mixed or empty content stays on the generic injection presentation.\n * @param content - durable context blocks.\n * @returns collected names, or null when any block is not a tool change.\n */\nexport function toolUpdateRows(content: readonly { readonly type: string; readonly toolName?: string }[]): ToolUpdateRows | null {\n if (content.length === 0) return null\n const rows: ToolChangeBlock[] = []\n for (const block of content) {\n if (block.type !== 'tool-addition' && block.type !== 'tool-removal') return null\n if (typeof block.toolName !== 'string') return null\n rows.push({ type: block.type, toolName: block.toolName })\n }\n const added = rows.flatMap(row => row.type === 'tool-addition' ? [row.toolName] : [])\n const removed = rows.flatMap(row => row.type === 'tool-removal' ? [row.toolName] : [])\n return { added, removed, single: rows.length === 1 ? rows[0]! : null }\n}\n","import { useState } from 'react'\nimport type { ContextMessageNode } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport { DisclosureRow, IconBrowseOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { ReferenceIcon } from './ReferenceIcon.js'\nimport { contextBody } from './ContextBody.js'\nimport { toolUpdateRows } from './tool-update.js'\nimport css from './ContextInjectionRow.module.css'\n\n/** Props for the logged non-user message presentation. */\nexport interface ContextInjectionRowProps {\n content: ContextMessageNode['content']\n source: ContextMessageNode['source']\n /**\n * Role and producer name projected from the durable source.\n *\n * Host generations disagree on the field name: newer builds project\n * `provenance`, the 0.1.6-alpha generations project `producer`. Both are\n * optional here and resolved below, so the row renders on either host instead\n * of throwing on `undefined.role` and degrading its whole block boundary.\n */\n provenance?: ContextMessageNode['producer'] | null\n /** Alpha-generation spelling of {@link provenance}. */\n producer?: ContextMessageNode['producer'] | null\n /** Producer-declared information form; null renders the opaque body. */\n form: ContextMessageNode['form']\n /** The owning view's locale seat, passed down as a plain prop. */\n t: TranslateNS<'chat'>\n}\n\n/**\n * Render logged context with the Tool calls disclosure chrome from Figma.\n *\n * The header names the role the context plays and, beside it, the producer the\n * durable source identifies, so a reader can tell an injected skill catalog\n * from a workspace instruction file or a recalled session without expanding.\n * The expanded body follows the producer-declared form; an absent or unknown\n * form renders the opaque body.\n * @param props - Durable content, its projected producer role/name and form, and the locale seat.\n * @returns A collapsed context row with a bounded, form-specific body.\n */\nexport function ContextInjectionRow({ content, source, provenance, producer, form, t }: ContextInjectionRowProps) {\n const [open, setOpen] = useState(false)\n // Two host generations, one component. A row whose projection is absent\n // entirely still renders: the marker falls back to a plain injection.\n const view = provenance ?? producer ?? { role: 'inject' as const, label: null }\n // Resolved rather than declared: a form whose fields are unreadable renders\n // the opaque body, and the marker must say what the row actually shows.\n const { rendered, summary, body } = contextBody(form, { content, source, t })\n const tools = toolUpdateRows(content)\n const toolSummary = tools === null || tools.single !== null ? null\n : tools.added.length > 0 && tools.removed.length > 0\n ? t('message.toolsChanged', { added: tools.added.length, removed: tools.removed.length })\n : tools.added.length > 0\n ? t('message.toolsAddedCount', { count: tools.added.length })\n : t('message.toolsRemovedCount', { count: tools.removed.length })\n\n return (\n <DisclosureRow\n className={css.root}\n icon={view.role === 'recall' && tools === null\n ? <span data-context-recall-icon><ReferenceIcon kind=\"session\" /></span>\n : <IconBrowseOutlineRegular size={14} />}\n chevronClassName={css.chevron}\n title={tools?.single !== undefined && tools.single !== null\n ? t(tools.single.type === 'tool-addition' ? 'message.toolAdded' : 'message.toolRemoved', { name: tools.single.toolName })\n : tools !== null\n ? t('message.toolsUpdated')\n : t(view.role === 'recall' ? 'message.contextRecall' : 'message.contextInjection')}\n collapsedContent={toolSummary !== null ? (\n <>\n <span className={css.sep} aria-hidden />\n <span className={css.summary}>{toolSummary}</span>\n </>\n ) : tools !== null || view.label === null ? undefined : (\n /* ToolRow's separator shape: an aria-hidden dot, so the accessible name\n stays the two readable parts and the two disclosure rows expose one\n name shape. A source that names no producer drops the dot with it. */\n <>\n <span className={css.sep} aria-hidden />\n <span className={css.source} data-context-source>{view.label}</span>\n {summary !== null && (\n <>\n <span className={css.sep} aria-hidden />\n <span className={css.summary} data-context-summary>{summary}</span>\n </>\n )}\n </>\n )}\n keepContentWhenOpen\n open={open && tools?.single == null}\n expandable={tools?.single == null}\n expandOnRowClick\n onToggle={() => { setOpen(value => !value) }}\n >\n <div className={css.body} data-context-injection-body data-context-form={rendered ?? undefined}>\n {tools === null ? body : (\n <div className={css.toolChanges}>\n {tools.added.length > 0 && <div>{t('message.toolsAdded', { names: tools.added.join(', ') })}</div>}\n {tools.removed.length > 0 && <div>{t('message.toolsRemoved', { names: tools.removed.join(', ') })}</div>}\n </div>\n )}\n </div>\n </DisclosureRow>\n )\n}\n","import {\n memo, useEffect, useId, useRef, useState,\n type CSSProperties, type MouseEvent, type PointerEvent,\n} from 'react';\nimport type { TimelineItem } from './timeline.js';\nimport css from './TimelineRail.module.css';\n\ninterface TimelineRailProps {\n items: readonly TimelineItem[];\n activeTurn: number | null;\n busyTurn?: number | null;\n onNavigate: (item: TimelineItem) => void;\n}\n\nconst TURN_SPACING_PX = 12;\nconst RAIL_INSET_PX = 6;\nconst FADE_PX = 24;\n\ntype TurnPositionStyle = CSSProperties & {\n readonly '--turn-natural-position': string;\n};\n\ntype TurnFrameStyle = CSSProperties & {\n readonly '--turn-natural-height': string;\n readonly '--turn-rail-inset': string;\n readonly '--turn-scroll-top': string;\n};\n\nfunction itemPosition(index: number): TurnPositionStyle {\n return { '--turn-natural-position': `${index * TURN_SPACING_PX}px` };\n}\n\nfunction frameStyle(count: number, scrollTop: number): TurnFrameStyle {\n return {\n '--turn-natural-height': `${(count - 1) * TURN_SPACING_PX + 2 * RAIL_INSET_PX}px`,\n '--turn-rail-inset': `${RAIL_INSET_PX}px`,\n '--turn-scroll-top': `${scrollTop}px`,\n };\n}\n\nfunction itemIndexAtPointer(\n items: readonly TimelineItem[],\n frame: HTMLElement,\n scrollTop: number,\n clientY: number,\n): number {\n const rect = frame.getBoundingClientRect();\n const offset = clientY - rect.top + scrollTop - RAIL_INSET_PX;\n return Math.max(0, Math.min(items.length - 1, Math.round(offset / TURN_SPACING_PX)));\n}\n\ninterface RailScrollState {\n readonly top: number;\n readonly canScrollUp: boolean;\n readonly canScrollDown: boolean;\n}\n\nconst RAIL_AT_REST: RailScrollState = { top: 0, canScrollUp: false, canScrollDown: false };\n\nfunction railScrollState(scroller: HTMLElement): RailScrollState {\n const top = scroller.scrollTop;\n return {\n top,\n canScrollUp: top > 1,\n canScrollDown: top < scroller.scrollHeight - scroller.clientHeight - 1,\n };\n}\n\nexport const TimelineRail = memo(function TimelineRail({\n items,\n activeTurn,\n busyTurn,\n onNavigate,\n}: TimelineRailProps) {\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n const [scrollState, setScrollState] = useState<RailScrollState>(RAIL_AT_REST);\n const scrollerRef = useRef<HTMLDivElement | null>(null);\n const pointerInsideRef = useRef(false);\n const previewId = useId();\n\n const syncScrollState = () => {\n const scroller = scrollerRef.current;\n if (!scroller) return;\n const next = railScrollState(scroller);\n setScrollState(cur => (cur.top === next.top && cur.canScrollUp === next.canScrollUp && cur.canScrollDown === next.canScrollDown ? cur : next));\n };\n\n useEffect(() => {\n const scroller = scrollerRef.current;\n if (!scroller || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(syncScrollState);\n observer.observe(scroller);\n return () => observer.disconnect();\n }, []);\n\n useEffect(syncScrollState, [items.length]);\n\n // Keep active mark visible\n useEffect(() => {\n const scroller = scrollerRef.current;\n const index = items.findIndex(item => item.turn === activeTurn);\n if (!scroller || index < 0 || pointerInsideRef.current) return;\n const markTop = index * TURN_SPACING_PX + RAIL_INSET_PX;\n const viewTop = scroller.scrollTop;\n const viewHeight = scroller.clientHeight;\n if (viewHeight <= 0 || (markTop >= viewTop + FADE_PX && markTop <= viewTop + viewHeight - FADE_PX)) return;\n const target = Math.max(0, markTop - viewHeight / 2);\n if (typeof scroller.scrollTo === 'function') {\n scroller.scrollTo({ top: target, behavior: 'smooth' });\n } else {\n scroller.scrollTop = target;\n }\n syncScrollState();\n }, [activeTurn, items]);\n\n if (items.length < 2) return null;\n\n const preview = hoveredIndex !== null && hoveredIndex >= 0 ? items[hoveredIndex] : undefined;\n const previewPosition = hoveredIndex !== null && hoveredIndex >= 0 ? itemPosition(hoveredIndex) : undefined;\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n const scroller = scrollerRef.current;\n const scrollTop = scroller?.scrollTop ?? 0;\n const idx = itemIndexAtPointer(items, event.currentTarget, scrollTop, event.clientY);\n setHoveredIndex(idx);\n };\n\n const onPointerLeave = () => {\n pointerInsideRef.current = false;\n setHoveredIndex(null);\n };\n\n const navigateAtPointer = (event: MouseEvent<HTMLElement>) => {\n const scroller = scrollerRef.current;\n const scrollTop = scroller?.scrollTop ?? 0;\n const idx = itemIndexAtPointer(items, event.currentTarget, scrollTop, event.clientY);\n const item = items[idx];\n if (item !== undefined) onNavigate(item);\n };\n\n const fadeClasses = [css.scroller];\n if (scrollState.canScrollUp) fadeClasses.push(css.fadeTop);\n if (scrollState.canScrollDown) fadeClasses.push(css.fadeBottom);\n\n return (\n <div className={css.slot}>\n <nav\n className={css.frame}\n style={frameStyle(items.length, scrollState.top)}\n aria-label=\"轮次导航时间轴\"\n onClick={navigateAtPointer}\n onPointerMove={onPointerMove}\n onPointerEnter={() => { pointerInsideRef.current = true; }}\n onPointerLeave={onPointerLeave}\n onMouseDown={event => { event.preventDefault(); }}\n >\n <div\n ref={scrollerRef}\n className={fadeClasses.join(' ')}\n onScroll={syncScrollState}\n >\n <div className={css.marks}>\n {items.map((item, index) => {\n const isBusy = busyTurn === item.turn;\n const isActive = activeTurn === item.turn;\n const isUnloaded = item.anchor.kind === 'unloaded';\n\n // Wave calculation: peak at cursor, smoothly tapering off in width and height\n let width = isUnloaded ? 6 : 8;\n let height = 2;\n let opacity = isUnloaded ? 0.3 : 0.45;\n let background = 'var(--dsw-alias-label-tertiary)';\n\n if (hoveredIndex !== null) {\n const diff = Math.abs(index - hoveredIndex);\n if (diff === 0) {\n // Cursor peak (最长最高)\n width = 26;\n height = 2.8;\n opacity = 1.0;\n background = 'var(--dsw-alias-label-primary)';\n } else if (diff === 1) {\n // 旁边第 1 阶 (次长次高)\n width = 18;\n height = 2.2;\n opacity = 0.8;\n background = 'var(--dsw-alias-label-primary)';\n } else if (diff === 2) {\n // 旁边第 2 阶 (继续变矮变短)\n width = 13;\n height = 1.8;\n opacity = 0.6;\n background = 'var(--dsw-alias-label-secondary)';\n } else if (diff === 3) {\n // 旁边第 3 阶 (平缓过渡)\n width = 9;\n height = 1.6;\n opacity = 0.45;\n background = 'var(--dsw-alias-label-tertiary)';\n } else {\n // 远离光标的基线\n width = 8;\n height = 2;\n opacity = 0.35;\n background = 'var(--dsw-alias-label-tertiary)';\n }\n } else if (isActive) {\n width = 20;\n height = 2.4;\n opacity = 0.95;\n background = 'var(--dsw-alias-label-primary)';\n }\n\n const tickStyle: CSSProperties = {\n width: `${width}px`,\n height: `${height}px`,\n opacity,\n backgroundColor: background,\n };\n\n const markClasses = [css.mark];\n if (isBusy) markClasses.push(css.markBusy);\n\n return (\n <div key={item.turn} className={css.markPosition} style={itemPosition(index)}>\n <button\n type=\"button\"\n className={markClasses.join(' ')}\n aria-label={`第 ${item.turn + 1} 轮`}\n aria-current={isActive ? 'true' : undefined}\n aria-busy={isBusy ? 'true' : undefined}\n aria-describedby={hoveredIndex === index ? previewId : undefined}\n onMouseDown={event => { event.preventDefault(); }}\n onClick={(e) => {\n e.stopPropagation();\n onNavigate(item);\n }}\n onFocus={() => setHoveredIndex(index)}\n onBlur={() => setHoveredIndex(null)}\n >\n <span className={css.tick} style={tickStyle} />\n </button>\n </div>\n );\n })}\n </div>\n </div>\n\n {preview !== undefined && previewPosition !== undefined && (\n <div id={previewId} role=\"tooltip\" className={css.preview} style={previewPosition}>\n <div className={css.previewPrompt}>\n {preview.prompt || `第 ${preview.turn + 1} 轮`}\n </div>\n {preview.response !== '' && (\n <div className={css.previewResponse}>{preview.response}</div>\n )}\n </div>\n )}\n </nav>\n </div>\n );\n});\n","/**\n * Conversation-column scroll helpers. Official ChatView lands Turns by writing\n * the enclosing `[data-conversation-scroll]` box; `Element.scrollIntoView`\n * also walks ancestor scrollers and can lift the sticky composer off the\n * bottom of the viewport (rail jump to top, then to bottom).\n */\n\n/** Reading-line offset used by ui-chat ChatView.landOnRow. */\nexport const READING_LINE_OFFSET_PX = 24;\n\n/** Active column host when present; otherwise the view-local scroller. */\nexport function scrollerOf(from: HTMLElement): HTMLElement {\n return from.closest('[data-conversation-scroll]') ?? from;\n}\n\n/** Row position in scrollport coordinates (viewport-independent). */\nexport function flowTop(row: HTMLElement, scrollport: HTMLElement): number {\n return row.getBoundingClientRect().top - scrollport.getBoundingClientRect().top;\n}\n\n/**\n * Place `row` on the conversation scroller only. Never calls scrollIntoView.\n * @param row - a rendered `[data-reader-turn]` row.\n * @param scrollport - `scrollerOf` of the reader root.\n */\nexport function landTurn(row: HTMLElement, scrollport: HTMLElement, offsetPx = READING_LINE_OFFSET_PX): void {\n scrollport.scrollTop += flowTop(row, scrollport) - offsetPx;\n}\n","export interface TimelineItem {\n readonly turn: number;\n readonly prompt: string;\n readonly response: string;\n readonly hasDeliverables: boolean;\n readonly anchor:\n | { readonly kind: 'loaded'; readonly key: string }\n | { readonly kind: 'unloaded'; readonly seq: number };\n}\n\ninterface RawOutlineEntry {\n readonly turn?: unknown;\n readonly seq?: unknown;\n readonly prompt?: unknown;\n readonly response?: unknown;\n}\n\ninterface LoadedTurnNavigationItem {\n readonly turn: number;\n readonly anchorKey: string;\n readonly prompt: string;\n readonly response: string;\n}\n\n/**\n * Merge host turn outline with loaded navigation items and turn deliverables.\n * Guarantees strictly ascending turn order and dedupes entries.\n */\nexport function mergeTimelineItems(\n loaded: readonly LoadedTurnNavigationItem[] | undefined,\n outline: unknown,\n turnsWithDeliverables?: ReadonlySet<number>,\n): readonly TimelineItem[] {\n const byTurn = new Map<number, TimelineItem>();\n\n // 1. Process host whole-log outline (if available)\n if (Array.isArray(outline)) {\n for (const raw of outline) {\n if (typeof raw !== 'object' || raw === null) continue;\n const entry = raw as RawOutlineEntry;\n if (typeof entry.turn !== 'number' || !Number.isSafeInteger(entry.turn) || entry.turn < 0) continue;\n if (typeof entry.seq !== 'number' || !Number.isSafeInteger(entry.seq) || entry.seq < 0) continue;\n\n byTurn.set(entry.turn, {\n turn: entry.turn,\n prompt: typeof entry.prompt === 'string' ? entry.prompt.trim() : '',\n response: typeof entry.response === 'string' ? entry.response.trim() : '',\n hasDeliverables: turnsWithDeliverables?.has(entry.turn) ?? false,\n anchor: { kind: 'unloaded', seq: entry.seq },\n });\n }\n }\n\n // 2. Overlay loaded items (taking loaded anchor, preferring freshest previews)\n if (Array.isArray(loaded)) {\n for (const item of loaded) {\n if (typeof item.turn !== 'number') continue;\n const preview = byTurn.get(item.turn);\n const prompt = item.prompt?.trim() || preview?.prompt || '';\n const response = item.response?.trim() || preview?.response || '';\n const hasDeliverables = turnsWithDeliverables?.has(item.turn) ?? preview?.hasDeliverables ?? false;\n\n byTurn.set(item.turn, {\n turn: item.turn,\n prompt,\n response,\n hasDeliverables,\n anchor: { kind: 'loaded', key: item.anchorKey },\n });\n }\n }\n\n if (byTurn.size === 0) return [];\n return [...byTurn.values()].sort((a, b) => a.turn - b.turn);\n}\n","import type { AssistantChatData, ChatConversationViewNode } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport type { AssistantBlock } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport { assistantSegments, hasVisibleBody } from './projection.js';\nimport type { TurnBoundary } from './projection.js';\nimport type { ReaderFlowEntry, ToolActivityEntry } from './tool-activity.js';\n\nexport type LiveStep =\n | { kind: 'reasoning'; key: string; nodeKey: string; start: number; blocks: AssistantBlock[]; step: number }\n | { kind: 'body'; key: string; nodeKey: string; start: number; blocks: AssistantBlock[]; step: number }\n | { kind: 'tool'; key: string; entry: ToolActivityEntry }\n | { kind: 'user'; key: string; nodeKey: string }\n | { kind: 'other'; key: string; nodeKey: string };\n\nexport type LiveTurnItem =\n | { kind: 'user'; key: string; step: Extract<LiveStep, { kind: 'user' }> }\n | { kind: 'fold'; key: string; steps: readonly LiveStep[]; summary: string }\n | { kind: 'open'; key: string; step: LiveStep };\n\nexport function liveFoldEnabled(boundary: TurnBoundary): boolean {\n return boundary.status === 'open';\n}\n\nexport function foldSummary(steps: readonly LiveStep[]): string {\n let reasoning = 0;\n let body = 0;\n let tool = 0;\n let extra = 0;\n for (const step of steps) {\n if (step.kind === 'reasoning') reasoning += 1;\n else if (step.kind === 'body') body += 1;\n else if (step.kind === 'tool') tool += 1;\n else if (step.kind !== 'user') extra += 1;\n }\n const parts: string[] = [];\n if (reasoning) parts.push(`思考×${reasoning}`);\n if (body) parts.push(`输出×${body}`);\n if (tool) parts.push(`工具×${tool}`);\n if (extra) parts.push(`记录×${extra}`);\n return parts.join(' · ') || '此前步骤';\n}\n\nfunction skipReasoning(part: { kind: string; blocks: AssistantBlock[] }): boolean {\n return part.kind === 'reasoning' && !part.blocks.some(block => block.kind === 'reasoning' && block.text.trim() !== '');\n}\n\nfunction skipBody(part: { kind: string; blocks: AssistantBlock[] }): boolean {\n return part.kind === 'body' && !hasVisibleBody(part.blocks);\n}\n\nfunction stepsFromAssistant(\n nodeKey: string,\n data: AssistantChatData,\n toolsByCallId: Map<string, ToolActivityEntry>,\n consumed: Set<string>,\n): LiveStep[] {\n const marks: { at: number; step: LiveStep }[] = [];\n for (const part of assistantSegments(data.blocks)) {\n if (skipReasoning(part) || skipBody(part)) continue;\n marks.push({\n at: part.start,\n step: {\n kind: part.kind,\n key: `${nodeKey}:${part.kind}:${part.start}`,\n nodeKey,\n start: part.start,\n blocks: part.blocks,\n step: data.step,\n },\n });\n }\n data.blocks.forEach((block, index) => {\n if (block.kind !== 'tool-call' || !block.callId) return;\n const tool = toolsByCallId.get(block.callId);\n if (!tool || consumed.has(tool.callId)) return;\n consumed.add(tool.callId);\n marks.push({ at: index, step: { kind: 'tool', key: tool.key, entry: tool } });\n });\n marks.sort((left, right) => left.at - right.at || left.step.key.localeCompare(right.step.key));\n return marks.map(mark => mark.step);\n}\n\n/** Expand readerFlow into source-ordered live steps using existing block boundaries. */\nexport function segmentLiveTurn(\n flow: readonly ReaderFlowEntry[],\n get: (key: string) => ChatConversationViewNode | undefined,\n): LiveStep[] {\n const steps: LiveStep[] = [];\n const consumed = new Set<string>();\n const toolsByCallId = new Map<string, ToolActivityEntry>();\n for (const entry of flow) {\n if (entry.kind === 'tool') toolsByCallId.set(entry.callId, entry);\n }\n for (const entry of flow) {\n if (entry.kind === 'tool') {\n if (!consumed.has(entry.callId)) {\n steps.push({ kind: 'tool', key: entry.key, entry });\n consumed.add(entry.callId);\n }\n continue;\n }\n const node = get(entry.nodeKey);\n if (!node || node.visibility === 'hidden' || node.kind === 'turn-tail') continue;\n if (node.kind === 'user' || node.kind === 'steering') {\n steps.push({ kind: 'user', key: entry.key, nodeKey: entry.nodeKey });\n continue;\n }\n if (node.kind === 'assistant-step') {\n steps.push(...stepsFromAssistant(entry.nodeKey, node.data as AssistantChatData, toolsByCallId, consumed));\n continue;\n }\n steps.push({ kind: 'other', key: entry.key, nodeKey: entry.nodeKey });\n }\n return steps;\n}\n\n/** Only a run that contains real thinking/tool work is worth folding. */\nfunction foldableRun(run: readonly LiveStep[]): boolean {\n return run.some(step => step.kind === 'reasoning' || step.kind === 'tool');\n}\n\n/**\n * One live chain: narration stays visible, while every earlier reasoning/tool\n * run collapses into its own box at its original position.\n */\nexport function presentLiveTurn(steps: readonly LiveStep[], boundary: TurnBoundary, autoFold = true): LiveTurnItem[] {\n const live = autoFold && liveFoldEnabled(boundary);\n const items: LiveTurnItem[] = [];\n const open = (step: LiveStep) => items.push({ kind: 'open', key: step.key, step });\n const fold = (run: readonly LiveStep[]) => {\n if (!run.length) return;\n if (live && foldableRun(run)) {\n items.push({ kind: 'fold', key: `live-fold:${run[0]!.key}`, steps: run, summary: foldSummary(run) });\n } else {\n for (const step of run) open(step);\n }\n };\n let run: LiveStep[] = [];\n const flush = () => { fold(run); run = []; };\n\n // A user insert resets the chain: steps before it are never folded by\n // reasoning after it. Split into user-delimited segments and walk each one.\n const segments: LiveStep[][] = [];\n let segment: LiveStep[] = [];\n for (const step of steps) {\n if (step.kind === 'user') {\n segments.push(segment); segments.push([step]); segment = [];\n } else {\n segment.push(step);\n }\n }\n segments.push(segment);\n\n for (const part of segments) {\n if (!part.length) continue;\n const first = part[0]!;\n if (part.length === 1 && first.kind === 'user') {\n items.push({ kind: 'user', key: first.key, step: first });\n continue;\n }\n if (!live) {\n for (const step of part) open(step);\n continue;\n }\n // Narration is never folded. Once a later reasoning step exists, every\n // reasoning/tool run before it folds at its own position, so the latest\n // thinking and everything after it stay open while earlier steps collapse —\n // even across narration blocks, which the reader still renders in place.\n const lastReasoning = part.findLastIndex(step => step.kind === 'reasoning');\n if (lastReasoning <= 0) {\n for (const step of part) open(step);\n continue;\n }\n for (let index = 0; index < part.length; index++) {\n const step = part[index]!;\n if (index < lastReasoning) {\n if (step.kind === 'body') { flush(); open(step); }\n else run.push(step);\n } else {\n if (index === lastReasoning) flush();\n open(step);\n }\n }\n flush();\n }\n return items;\n}\n\n/**\n * Summaries for collapsed process that sits between two narration blocks.\n *\n * A live-fold cell already shows that summary while the turn is open. Drawing\n * the seam as well repeats the same counts, so a run whose every step is\n * already inside a fold cell contributes neither a seam nor `after`. `after`\n * is what marks the previous body with `data-reader-seam-after` and drops its\n * bottom padding; skipping the seam must leave that spacing alone.\n */\nexport function planProcessSeams(\n steps: readonly LiveStep[],\n liveItems: readonly LiveTurnItem[],\n expanded: boolean,\n): { before: Map<string, string>; after: Set<string> } {\n const before = new Map<string, string>();\n const after = new Set<string>();\n if (expanded) return { before, after };\n const liveFolded = new Set(\n liveItems.flatMap(item => item.kind === 'fold' ? item.steps.map(step => step.key) : []),\n );\n let previousBody: Extract<LiveStep, { kind: 'body' }> | undefined;\n let process: LiveStep[] = [];\n for (const step of steps) {\n if (step.kind === 'body') {\n const folded = process.filter(item => item.kind !== 'user');\n const coveredByLiveFold = folded.length > 0 && folded.every(item => liveFolded.has(item.key));\n if (!coveredByLiveFold && previousBody\n && folded.some(item => item.kind === 'reasoning' || item.kind === 'tool' || item.kind === 'other')) {\n before.set(step.key, foldSummary(folded));\n after.add(previousBody.key);\n }\n previousBody = step;\n process = [];\n } else if (step.kind === 'user') {\n previousBody = undefined;\n process = [];\n } else {\n process.push(step);\n }\n }\n return { before, after };\n}\n","/** Three-stop fold intensity persisted on `dsh.reader.v1`. Default is standard. */\nexport type FoldIntensity = 0 | 1 | 2;\n\nexport const FOLD_INTENSITY_DEFAULT: FoldIntensity = 1;\n\n/** Level 0: nothing auto-folds. Level 1: current-main choreography. Level 2: process summaries. */\nexport function foldIntensityOf(state: unknown): FoldIntensity {\n const rec = state && typeof state === 'object' ? state as Record<string, unknown> : {};\n if (rec.foldIntensity === 0 || rec.foldIntensity === 1 || rec.foldIntensity === 2) return rec.foldIntensity;\n if (rec.processOnly === true) return 2;\n if (rec.autoFold === false) return 0;\n return FOLD_INTENSITY_DEFAULT;\n}\n\nexport function frostedGlassOf(state: unknown): boolean {\n if (state && typeof state === 'object' && 'frostedGlass' in state) {\n return (state as { frostedGlass?: unknown }).frostedGlass === true;\n }\n return state === true;\n}\n\nexport function autoFoldFromIntensity(intensity: FoldIntensity): boolean {\n return intensity !== 0;\n}\n\nexport function processOnlyFromIntensity(intensity: FoldIntensity): boolean {\n return intensity === 2;\n}\n","import { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { DiffBlock, diffTotals } from '@deepseek-ai/dsh-client-ui-primitives';\nimport css from './Reader.module.css';\nimport { diffBlockLabels } from './primitive-labels.js';\nimport { FOLD_TIMING } from './fold-choreography.js';\nimport { foldDiffHunks } from './tool-activity.js';\nimport type { LiveStep } from './live-turn.js';\n\n/**\n * Reveals and withdraws its child by animating real height, in the plugin's own\n * motion language. Height is the animated property rather than transform because\n * the panel pushes the transcript down and the reading scroll measures that\n * growth; the curve and duration are the fold choreography's, so this reads as\n * the same gesture as opening a digest.\n *\n * Closing animates too: the child stays mounted until the shrink finishes, which\n * is why the owner keeps it alive on an `open` flag instead of unmounting it.\n */\nfunction MorphPanel({ open, children, onSettled, onClosed }: {\n open: boolean; children: ReactNode; onSettled?: (element: HTMLElement) => void; onClosed: () => void;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n const element = ref.current;\n if (!element) return;\n element.dispatchEvent(new CustomEvent('reader-layout-start', { bubbles: true }));\n let released = false;\n const release = () => { if (!released) { released = true; element.dispatchEvent(new CustomEvent('reader-layout-end', { bubbles: true })); } };\n if (typeof element.animate !== 'function') { release(); if (!open) onClosed(); return; }\n const height = element.scrollHeight;\n const frames = open\n ? [{ height: '0px', opacity: 0, transform: 'translateY(-6px)' },\n { height: `${height}px`, opacity: 1, transform: 'translateY(0)' }]\n : [{ height: `${height}px`, opacity: 1 },\n { height: '0px', opacity: 0 }];\n const animation = element.animate(frames, {\n duration: FOLD_TIMING.reveal + FOLD_TIMING.settle,\n easing: 'cubic-bezier(.4,0,.2,1)',\n });\n let settled = false;\n const settle = () => {\n if (settled) return;\n settled = true;\n release();\n if (open) {\n element.style.height = 'auto';\n element.style.overflow = 'visible';\n onSettled?.(element);\n } else {\n onClosed();\n }\n };\n animation.onfinish = settle;\n const deadline = window.setTimeout(settle, FOLD_TIMING.reveal + FOLD_TIMING.settle + 240);\n return () => { window.clearTimeout(deadline); animation.cancel(); release(); };\n }, [open]);\n return <div ref={ref} className={css.diffOverlay}>{children}</div>;\n}\n\n/**\n * Keeps a newly opened panel on screen.\n *\n * Opening grows the row downward, so a badge near the fold reveals its card below\n * the viewport and the reader has to chase it. The scroll container is not known\n * here, so the nearest scrollable ancestor is found and the card's head is brought\n * to the top of it — the same thing a jump-to-anchor does.\n */\nfunction revealPanel(element: HTMLElement): void {\n let port: HTMLElement | null = element.parentElement;\n while (port && port.scrollHeight <= port.clientHeight + 1) port = port.parentElement;\n if (!port) { element.scrollIntoView({ block: 'nearest' }); return; }\n const gap = element.getBoundingClientRect().top - port.getBoundingClientRect().top;\n // Already fully visible: leave the scroll alone rather than jumping on every open.\n if (gap >= 0 && element.getBoundingClientRect().bottom <= port.getBoundingClientRect().bottom) return;\n port.scrollTop += gap - 8;\n}\n\n/**\n * Line counts for everything a folded run of steps changed.\n *\n * A run that touched no files renders nothing, so an ordinary process digest is\n * unchanged. Clicking the counts opens the same diff surface the official tool\n * row uses — one file at a time, red removed / green added, expandable.\n */\nexport function DiffStat({ steps, label }: { steps: readonly LiveStep[]; label: string }) {\n const hunks = useMemo(() => foldDiffHunks(steps), [steps]);\n const [open, setOpen] = useState(false);\n const [visible, setVisible] = useState(false);\n const totals = useMemo(() => diffTotals(hunks), [hunks]);\n const [active, setActive] = useState(0);\n if (!hunks.length) return null;\n const current = hunks[Math.min(active, hunks.length - 1)]!;\n return <>\n <span className={css.diffStatRoot}>\n <button type=\"button\" className={css.diffStatButton} aria-expanded={open}\n aria-label={`${label} · 改动 ${totals.added} 行,删除 ${totals.removed} 行`}\n onClick={event => {\n event.stopPropagation();\n if (open) { setOpen(false); return; }\n setVisible(true);\n setOpen(true);\n }}>\n <span className={css.diffCaret} aria-hidden>{open ? '\\u25be' : '\\u25b8'}</span>\n {totals.added > 0 && <span className={css.diffAdded}>+{totals.added}</span>}\n {totals.removed > 0 && <span className={css.diffRemoved}>-{totals.removed}</span>}\n </button>\n </span>\n {visible && <div className={css.diffOverlayRow}>\n <MorphPanel open={open} onSettled={revealPanel} onClosed={() => setVisible(false)}>\n {hunks.length > 1 && <div className={css.diffTabs}>\n {hunks.map((hunk, index) => <button key={`${hunk.path}:${index}`} type=\"button\"\n className={css.diffTab} data-active={index === active || undefined}\n onClick={() => setActive(index)} title={hunk.path}>\n {hunk.path.split(/[/\\\\]+/).filter(Boolean).slice(-1)[0] ?? hunk.path}\n </button>)}\n </div>}\n <div className={css.diffScrollArea}>\n <DiffBlock diffs={[current]} maxLines={36} labels={diffBlockLabels} />\n </div>\n </MorphPanel>\n </div>}\n </>;\n}\n","import { createContext, useContext, useLayoutEffect, useRef } from 'react';\nimport type { ReactNode } from 'react';\n\nconst MIN_LANE_PX = 40;\ntype LaneOwners = Map<string, HTMLElement>;\n\nconst LaneOwnerContext = createContext<LaneOwners | null>(null);\nconst ownersByRoot = new WeakMap<HTMLElement, LaneOwners>();\n\n/** One map per Reader, so two roots that both contain turn 1 do not share a writer. */\nexport function ReaderLaneScope({ children }: { children: ReactNode }) {\n const owners = useRef<LaneOwners>(new Map());\n useLayoutEffect(() => {\n const map = owners.current;\n return () => { map.clear(); };\n }, []);\n return <LaneOwnerContext.Provider value={owners.current}>{children}</LaneOwnerContext.Provider>;\n}\n\nfunction laneScope(el: HTMLElement) {\n return el.closest<HTMLElement>('[data-reader-turn]') ?? el.closest<HTMLElement>('[data-dsh-better-display]');\n}\n\nfunction ownersFor(el: HTMLElement, scoped: LaneOwners | null) {\n if (scoped) return scoped;\n const root = el.closest<HTMLElement>('[data-dsh-better-display]') ?? el;\n let owners = ownersByRoot.get(root);\n if (!owners) {\n owners = new Map();\n ownersByRoot.set(root, owners);\n }\n return owners;\n}\n\nfunction publishedLanePx(el: HTMLElement) {\n return Math.max(MIN_LANE_PX, Math.ceil(el.getBoundingClientRect().height));\n}\n\n/** One writer per turn inside a single Reader. A retiring summary cannot clear the lane that replaced it. */\nexport function publishLaneHeight(el: HTMLElement, property: string, scoped: LaneOwners | null = null) {\n const scope = laneScope(el);\n if (!scope) return () => {};\n const owners = ownersFor(el, scoped);\n const root = el.closest<HTMLElement>('[data-dsh-better-display]');\n const key = `${property}\\0${scope.getAttribute('data-reader-turn') ?? 'root'}`;\n const update = () => {\n if (owners.get(key) !== el) return;\n scope.style.setProperty(property, `${publishedLanePx(el)}px`);\n };\n owners.set(key, el);\n update();\n const observer = new ResizeObserver(update);\n observer.observe(el);\n return () => {\n observer.disconnect();\n if (owners.get(key) !== el) return;\n owners.delete(key);\n scope.style.removeProperty(property);\n if (!scoped && root && owners.size === 0) ownersByRoot.delete(root);\n };\n}\n\nexport function usePublishedHeight(property: string) {\n const owners = useContext(LaneOwnerContext);\n const ref = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n return publishLaneHeight(el, property, owners);\n }, [owners, property]);\n return ref;\n}\n\nexport function useSummaryLane(ref: { readonly current: HTMLElement | null }, active: boolean) {\n const owners = useContext(LaneOwnerContext);\n useLayoutEffect(() => {\n const el = ref.current;\n if (!active || !el) return;\n return publishLaneHeight(el, '--reader-summary-height', owners);\n }, [active, owners, ref]);\n}\n\n/** Publish real lane geometry; wrapped labels must not collide with statistics. */\nexport function StickyLane({ kind, className, children }: { kind: 'toolbar' | 'status'; className: string; children: ReactNode }) {\n const ref = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n const el = ref.current;\n const scope = el?.closest<HTMLElement>(kind === 'toolbar' ? '[data-dsh-better-display]' : '[data-reader-turn]');\n if (!el || !scope) return;\n const property = kind === 'toolbar' ? '--reader-toolbar-height' : '--reader-status-height';\n const update = () => {\n scope.style.setProperty(property, `${Math.max(MIN_LANE_PX, el.getBoundingClientRect().height)}px`);\n if (kind !== 'toolbar') return;\n // The status lane is sized as calc(100% - --reader-control-width), so this\n // must reserve the WHOLE control group. Measuring only the first button\n // left every later control painted over by the status lane.\n const controls = el.querySelectorAll('button');\n let width = 80;\n if (controls.length > 0) {\n const first = controls[0]!.getBoundingClientRect();\n const last = controls[controls.length - 1]!.getBoundingClientRect();\n width = last.right - first.left;\n }\n scope.style.setProperty('--reader-control-width', `${width + 28}px`);\n };\n update();\n const observer = new ResizeObserver(update);\n observer.observe(el);\n if (kind === 'toolbar') for (const control of el.querySelectorAll('button')) observer.observe(control);\n return () => { observer.disconnect(); scope.style.removeProperty(property); if (kind === 'toolbar') scope.style.removeProperty('--reader-control-width'); };\n }, [kind]);\n return <div ref={ref} className={className} data-reader-lane={kind} data-ud-check={kind === 'toolbar' ? 'reader-toolbar' : undefined}>{children}</div>;\n}\n","import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport type { ReaderProps } from './types.js';\nimport type { LiveStep, LiveTurnItem } from './live-turn.js';\nimport { collapseRows, containsNewUser, flowRows, FOLD_TIMING, retiringKeys } from './fold-choreography.js';\nimport type { FoldPhase } from './fold-choreography.js';\nimport { Disclosure } from './motion.js';\nimport { FoldSummaryText } from './LiveFold.js';\nimport { DiffStat } from './DiffPanel.js';\nimport { StreamMotionContext } from './streaming.js';\nimport css from './Reader.module.css';\nimport { useSummaryLane } from './StickyLane.js';\n\nconst FlowSnapshot = createContext<ChatSnapshot | null>(null);\n/** Public projection only. Descendants cannot leak live data through a frozen frame. */\nexport const useFlowChat: ReaderProps['useChat'] = selector => {\n const snapshot = useContext(FlowSnapshot);\n if (!snapshot) throw new Error('Flow snapshot provider missing');\n return selector(snapshot);\n};\n\nexport type PresentationFrame = { items: readonly LiveTurnItem[]; snapshot: ChatSnapshot };\ntype Transaction = {\n phase: FoldPhase; shown: PresentationFrame; target: PresentationFrame;\n retiring: readonly string[]; beforeKeys: ReadonlySet<string>;\n};\nconst idle = (frame: PresentationFrame): Transaction => ({ phase: 'idle', shown: frame, target: frame, retiring: [], beforeKeys: new Set() });\n\nfunction Summary({ item, open, onChange, motion }: {\n item: Extract<LiveTurnItem, { kind: 'fold' }>; open: boolean; onChange: (open: boolean) => void; motion: boolean;\n}) {\n const button = useRef<HTMLButtonElement>(null);\n return <div data-reader-live-fold data-expanded={open} data-reader-live-fold-summary={item.summary}>\n <div className={css.summaryRow}>\n <Disclosure open={open} onChange={onChange} buttonRef={button} ariaLabel=\"此前步骤\"\n label={<FoldSummaryText summary={item.summary} motion={motion} />} />\n <DiffStat steps={item.steps} label={item.summary} />\n </div>\n </div>;\n}\n\n/** Manual disclosure shares the measured-size path; children survive until finish. */\nfunction FlowCell({ hidden, instant, motion, rowKey, children, summary = false }: {\n hidden: boolean; instant: boolean; motion: boolean; rowKey: string; children: ReactNode; summary?: boolean;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n useSummaryLane(ref, summary);\n const [present, setPresent] = useState(!hidden);\n const previous = useRef(hidden);\n if (!hidden && !present) setPresent(true);\n useLayoutEffect(() => {\n const el = ref.current;\n const changed = previous.current !== hidden;\n previous.current = hidden;\n if (!el) return;\n if (!changed || instant || !motion) { setPresent(!hidden); return; }\n const height = el.scrollHeight;\n const animation = el.animate([\n { height: `${hidden ? height : 0}px`, opacity: hidden ? 1 : 0 },\n { height: `${hidden ? 0 : height}px`, opacity: hidden ? 0 : 1 },\n ], { duration: 220, easing: 'cubic-bezier(.4,0,.2,1)', fill: 'both' });\n el.dispatchEvent(new CustomEvent('reader-layout-start', { bubbles: true }));\n let released = false;\n const release = () => { if (!released) { released = true; el.dispatchEvent(new CustomEvent('reader-layout-end', { bubbles: true })); } };\n // Do NOT cancel here. `fill: 'both'` is what currently holds the cell at its\n // collapsed size; cancelling on finish drops that fill before React has\n // committed the removal, so the cell snaps back to full height for one frame\n // — the flash before it disappears. The state change alone retires it; the\n // cleanup below cancels the animation once that has actually rendered.\n let settled = false;\n const settle = () => {\n if (settled) return;\n settled = true;\n // Expanding retires nothing: the fill only pins the measured height. Drop it\n // now — if the cell's content later shrinks, the stale fill would hold the\n // empty space open. Collapsing still keeps the fill until React commits\n // the removal (see the comment above), then the cleanup cancels it.\n if (!hidden) animation.cancel();\n setPresent(!hidden);\n release();\n };\n animation.onfinish = settle;\n // \\`fill: 'both'\\` pins the opening keyframe for the whole run, so if this\n // animation never advances the cell stays at height 0 and opacity 0: the row is\n // in the DOM but reads as \"clicked it and nothing happened\". A cancelled\n // animation, or one inside a subtree the compositor skips, never fires\n // onfinish. Fall back to the state change on a deadline; the cleanup then\n // cancels the animation and drops the fill.\n const deadline = window.setTimeout(settle, 220 + 240);\n return () => { window.clearTimeout(deadline); animation.cancel(); release(); };\n // `present` is a dependency so that committing it re-runs this effect: the\n // cleanup then cancels the finished animation *after* the removal has been\n // applied, which is the only moment the fill can be dropped safely. Without\n // it the animation was never cancelled at all and every folded cell kept one.\n }, [hidden, instant, motion, present]);\n return <div ref={ref} className={css.flowCell} data-flow-key={rowKey} data-flow-summary={summary || undefined}\n hidden={hidden && !present} aria-hidden={hidden || undefined} {...(hidden ? { inert: '' } : {})}>\n {present && <div className={css.flowCellInner}>{children}</div>}\n </div>;\n}\n\nexport function ChoreographedFlow({ frame, motion, enabled, urgent, open, onOpenChange, processOpen, renderStep, id }: {\n frame: PresentationFrame; motion: boolean; enabled: boolean; urgent: boolean;\n open: Readonly<Record<string, boolean>>; onOpenChange: (key: string, value: boolean) => void;\n processOpen: boolean; renderStep: (step: LiveStep, folded: boolean) => ReactNode; id: string;\n}) {\n const root = useRef<HTMLDivElement>(null);\n const stream = useContext(StreamMotionContext);\n const latest = useRef(frame); latest.current = frame;\n const [visible, setVisible] = useState(() => !document.hidden);\n const [state, setState] = useState<Transaction>(() => idle(frame));\n const bypass = !motion || !enabled || urgent || !visible || !processOpen || (state.phase !== 'idle' && Object.values(open).some(Boolean));\n // Render-time adjustment prevents even one paint of the new authoritative layout.\n if ((bypass || containsNewUser(state.shown.items, frame.items)) && (state.phase !== 'idle' || state.shown !== frame)) {\n setState(idle(frame));\n } else if (state.phase === 'idle' && state.shown !== frame) {\n const retiring = retiringKeys(state.shown.items, frame.items, open);\n setState(retiring.length ? { ...state, phase: 'collapse', target: frame, retiring,\n beforeKeys: new Set(flowRows(state.shown.items).map(row => row.key)) } : idle(frame));\n }\n useEffect(() => {\n const update = () => setVisible(!document.hidden);\n document.addEventListener('visibilitychange', update);\n return () => document.removeEventListener('visibilitychange', update);\n }, []);\n useLayoutEffect(() => {\n if (state.phase !== 'collapse') return;\n const el = root.current;\n if (!el) return;\n const retiring = new Set(state.retiring);\n const animations: Animation[] = [];\n el.dispatchEvent(new CustomEvent('reader-layout-start', { bubbles: true }));\n for (const cell of el.querySelectorAll<HTMLElement>(':scope > [data-flow-key]')) {\n const key = cell.dataset.flowKey!;\n const isHeader = cell.dataset.flowSummary && !state.beforeKeys.has(key);\n if (!retiring.has(key) && !isHeader) continue;\n const height = cell.getBoundingClientRect().height;\n animations.push(cell.animate(isHeader ? [\n { height: '0px', opacity: 0 }, { height: `${height}px`, opacity: 1 },\n ] : [\n { height: `${height}px`, opacity: 1 },\n { height: `${height * .5}px`, opacity: .85, offset: .5 },\n { height: '0px', opacity: 0 },\n ], { duration: FOLD_TIMING.collapse, easing: 'cubic-bezier(.4,0,.2,1)', fill: 'both' }));\n }\n let cancelled = false;\n // Coalesce everything received during shrink, once. No animation restarts.\n // Idempotent and phase-checked: the promise and the deadline race, and\n // whichever arrives first wins while the other becomes a no-op.\n let advanced = false;\n const advance = () => {\n if (cancelled || advanced) return;\n advanced = true;\n setState(current => current.phase === 'collapse' ? { ...current, phase: 'count', target: latest.current } : current);\n };\n // `finished` rejects when an animation is cancelled and can stay pending when a\n // compositor never runs it to completion, so the promise alone cannot be the only\n // way out of this phase. Without a deadline a stalled phase would hold the frame\n // source at `shown` and keep the reveal paused, which reads as a frozen turn\n // until the view remounts.\n const deadline = window.setTimeout(advance, FOLD_TIMING.collapse + FOLD_TIMING.watchdogSlack);\n Promise.all(animations.map(animation => animation.finished)).then(advance, advance);\n return () => {\n cancelled = true;\n window.clearTimeout(deadline);\n animations.forEach(animation => animation.cancel());\n el.dispatchEvent(new CustomEvent('reader-layout-end', { bubbles: true }));\n };\n }, [state.phase]);\n useEffect(() => {\n if (state.phase !== 'count' && state.phase !== 'settle' && state.phase !== 'reveal') return;\n const phase = state.phase;\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n setState(current => {\n if (current.phase !== phase) return current;\n if (phase === 'count') return { ...current, phase: 'settle' };\n if (phase === 'settle') return { ...current, phase: 'reveal' };\n return idle(current.target);\n });\n };\n // Count visible presentation time, not a timer that can expire before a\n // busy browser paints. Each attention phase must get actual rendered frames.\n let elapsed = 0;\n let previous: number | undefined;\n let raf = 0;\n const tick = (now: number) => {\n if (previous !== undefined) elapsed += Math.min(40, now - previous);\n previous = now;\n if (elapsed < FOLD_TIMING[phase]) { raf = requestAnimationFrame(tick); return; }\n finish();\n };\n raf = requestAnimationFrame(tick);\n // A hidden tab gets no frames at all, so the frame counter above would never\n // reach its budget and the phase would hold forever. The wall-clock deadline\n // advances it anyway; a non-idle phase is what freezes the turn.\n const deadline = window.setTimeout(finish, FOLD_TIMING[phase] + FOLD_TIMING.watchdogSlack);\n return () => { window.clearTimeout(deadline); cancelAnimationFrame(raf); };\n }, [state.phase]);\n useLayoutEffect(() => {\n if (state.phase !== 'reveal' || !root.current) return;\n const el = root.current;\n el.dispatchEvent(new CustomEvent('reader-layout-start', { bubbles: true }));\n // Opacity alone still inserts the new layout in one frame. Open real space\n // first; text stays paused until this entry finishes, then catches up.\n const animations = Array.from(el.children).filter(child => !(child as HTMLElement).hidden && !state.beforeKeys.has((child as HTMLElement).dataset.flowKey!))\n .map(child => child.animate([\n { height: '0px', opacity: 0 },\n { height: `${child.getBoundingClientRect().height}px`, opacity: 1 },\n ], { duration: FOLD_TIMING.reveal, easing: 'cubic-bezier(.4,0,.2,1)', fill: 'both' }));\n return () => {\n animations.forEach(animation => animation.cancel());\n el.dispatchEvent(new CustomEvent('reader-layout-end', { bubbles: true }));\n };\n }, [state.phase]);\n\n const blocked = state.phase === 'collapse' || state.phase === 'count' || state.phase === 'settle';\n const source = state.phase === 'idle' || state.phase === 'collapse' ? state.shown : state.target;\n const rows = state.phase === 'collapse' ? collapseRows(state.shown.items, state.target.items) : flowRows(source.items);\n return <FlowSnapshot.Provider value={source.snapshot}>\n <StreamMotionContext.Provider value={{ ...stream, paused: state.phase !== 'idle', resumed: state.phase === 'reveal' }}>\n <div id={id} ref={root} className={css.choreographedFlow} data-reader-flow data-reader-transition={state.phase} data-ud-motion=\"fold-choreography\">\n {rows.map(row => {\n if (row.kind === 'summary') return <FlowCell key={row.key} rowKey={row.key} hidden={false} instant motion={motion} summary>\n <Summary item={row.item} open={processOpen && !!open[row.key]} onChange={value => onOpenChange(row.key, value)} motion={motion && state.phase !== 'collapse'} />\n </FlowCell>;\n const hidden = !!row.foldKey && (!processOpen || !open[row.foldKey]) || (blocked && state.phase !== 'collapse' && !state.beforeKeys.has(row.key));\n // Keep retiring child props unchanged until it has actually shrunk.\n return <FlowCell key={row.key} rowKey={row.key} hidden={hidden} instant={state.phase !== 'idle'} motion={motion}>\n {renderStep(row.step, !!row.foldKey)}\n </FlowCell>;\n })}\n </div>\n </StreamMotionContext.Provider>\n </FlowSnapshot.Provider>;\n}\n","import { useRef } from 'react';\nimport css from './Reader.module.css';\nimport { Disclosure } from './motion.js';\nimport { FoldSummaryText } from './LiveFold.js';\nimport { foldSummary } from './live-turn.js';\nimport { DiffStat } from './DiffPanel.js';\nimport { usePublishedHeight } from './StickyLane.js';\nimport type { LiveStep } from './live-turn.js';\n\n/** Keep process counts discoverable after the live-fold presentation retires. */\nexport function ClosedProcessSummary({ steps, open, onChange, controls }: {\n steps: readonly LiveStep[]; open: boolean; onChange: (value: boolean) => void; controls: string;\n}) {\n const button = useRef<HTMLButtonElement>(null);\n const lane = usePublishedHeight('--reader-summary-height');\n if (!steps.length) return null;\n const summary = foldSummary(steps);\n return <div ref={lane} className={css.closedProcessSummary} data-reader-closed-summary={summary}>\n <div className={css.summaryRow}>\n <Disclosure open={open} onChange={onChange} controls={controls} buttonRef={button} ariaLabel=\"本轮过程详情\"\n label={<FoldSummaryText summary={summary} motion={false} />} />\n <DiffStat steps={steps} label={summary} />\n </div>\n </div>;\n}\n","import type {} from '@deepseek-ai/dsh-session-turn-outline/types';\nimport type {} from '@deepseek-ai/dsh-agent/types';\nimport { Fragment, memo, useCallback, useEffect, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport type { ReactNode, RefObject } from 'react';\nimport type { ChatConversationViewNode, ChatNode, ChatNodeKind, ChatNodeOwnerProps } from '@deepseek-ai/dsh-client-ui-chat/client';\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store';\nimport { JsonBlock, MarkdownText } from '@deepseek-ai/dsh-client-ui-primitives';\nimport { BlockBoundary, Blocks, contentBlocks, UserMessageActions } from './Blocks.js';\nimport { AssistantNode } from './AssistantNode.js';\nimport { ToolActivity, ToolMedia } from './ToolActivity.js';\nimport { OfficialNode, OfficialTail } from './OfficialContent.js';\nimport { OFFICIAL_SEATS, readerGroupAction } from './official-slots.js';\nimport { preparingLabel, readerFlow } from './tool-activity.js';\nimport { Disclosure, ProcessFragment, RetiringTurns, StatusText, useMotionAllowed, usePinnedSelection, useReadingScroll } from './motion.js';\nimport { StreamMotionContext } from './streaming.js';\nimport { boundaryOf, forkAnchorSeq, groupNodes, hasProcessContent, processChoiceKey, processExpanded, terminalLabel } from './projection.js';\nimport { basename, createProducedFileMentions, dirname, getTurnDeliverables, showDeliverablesRow } from './deliverables.js';\nimport { deliverableOpenModeOf, type DeliverableOpenMode } from './open-file.js';\nimport { asReadonlyArray, pendingSubmissionImages, type PendingSubmissionEcho } from './pending-submission.js';\nimport { WaitingStatus } from './WaitingStatus.js';\nimport { handsBackToModel, waitingAnchor } from './waiting-clock.js';\nimport { ContextInjectionRow } from './native/ContextInjectionRow.js';\nimport { TimelineRail } from './TimelineRail.js';\nimport { landTurn, scrollerOf } from './conversation-scroll.js';\nimport { mergeTimelineItems, type TimelineItem } from './timeline.js';\nimport { planProcessSeams, presentLiveTurn, segmentLiveTurn } from './live-turn.js';\nimport type { LiveStep } from './live-turn.js';\nimport { frostedGlassOf } from './fold-intensity.js';\nimport { ChoreographedFlow, useFlowChat } from './ChoreographedFlow.js';\nimport { ClosedProcessSummary } from './ClosedProcessSummary.js';\nimport { ReaderLaneScope, StickyLane } from './StickyLane.js';\nimport type { ReaderGroup, TurnBoundary } from './projection.js';\nimport type { BlockRenderProps, ReaderProps } from './types.js';\nimport css from './Reader.module.css';\nimport { markdownLabels, truncatedJsonLabel } from './primitive-labels.js';\nimport { chatSeatProps } from './chat-seat.js';\nimport { visibleChatKeys, visibleChatSignature } from './rewind-cut.js';\nimport { ensureStyles } from './styles.js';\n\nfunction isNode<K extends ChatNodeKind>(node: ChatConversationViewNode, kind: K): node is ChatNode<K> {\n return node.kind === kind;\n}\n\nfunction observedInputIds(order: readonly string[], getNode: (key: string) => ChatConversationViewNode | undefined): Set<string> {\n const ids = new Set<string>();\n for (const key of order) {\n const node = getNode(key);\n if (!node || (node.kind !== 'user' && node.kind !== 'steering' && node.kind !== 'turn-trigger')) continue;\n const source = (node.data as { source?: { kind?: string; rpcId?: unknown } }).source;\n if (source?.kind === 'user' && typeof source.rpcId === 'string') ids.add(source.rpcId);\n }\n return ids;\n}\n\nfunction inboxText(item: { content?: readonly unknown[] }): string {\n return (item.content ?? []).filter((block): block is { type: 'text'; text: string } => {\n return typeof block === 'object' && block !== null && (block as { type?: unknown }).type === 'text' && typeof (block as { text?: unknown }).text === 'string';\n }).map(block => block.text).join('');\n}\n\nfunction inboxAttachmentCount(item: { content?: readonly unknown[] }): number {\n return (item.content ?? []).filter(block => typeof block === 'object' && block !== null && (block as { type?: unknown }).type !== 'text').length;\n}\n\nfunction cleanErrorMessage(raw: string | undefined): string {\n if (!raw) return '模型服务暂时无响应或连接中断,请稍后重试。';\n let str = raw.trim();\n if (str.includes('\"error\"') || str.startsWith('{')) {\n try {\n const idx = str.indexOf('{');\n const parsed = JSON.parse(str.slice(idx));\n const msg = parsed?.error?.message || parsed?.message || parsed?.error;\n if (typeof msg === 'string') str = msg;\n } catch {\n // keep\n }\n }\n return str;\n}\n\ntype SeatProps = BlockRenderProps & Pick<ReaderProps, 'useChat' | 'sessionId'> & {\n nodeKey: string; boundary: TurnBoundary; pinned?: boolean; processOpen?: boolean;\n};\n\nconst CompactionDivider = memo(function CompactionDivider({ data }: {\n data: { summary?: string | null; shadowedItemCount?: number | null; shadowedTokenCount?: number | null } | null;\n}) {\n const [open, setOpen] = useState(false);\n if (!data) return null;\n\n const hasSummary = typeof data.summary === 'string' && data.summary.trim().length > 0;\n const items = data.shadowedItemCount;\n const tokens = data.shadowedTokenCount;\n\n let label = '已压缩历史上下文';\n if (items && tokens) {\n const kTokens = tokens >= 1000 ? `${(tokens / 1000).toFixed(1)}k` : String(tokens);\n label = `已压缩 ${items} 条上下文 · 释放约 ${kTokens} tokens`;\n } else if (items) {\n label = `已压缩 ${items} 条上下文`;\n } else if (tokens) {\n const kTokens = tokens >= 1000 ? `${(tokens / 1000).toFixed(1)}k` : String(tokens);\n label = `已压缩上下文 · 释放约 ${kTokens} tokens`;\n }\n\n return (\n <div className={css.compactionRow} data-reader-compaction>\n <div className={css.compactionLine}>\n {hasSummary ? (\n <button\n type=\"button\"\n className={`${css.compactionPill} ${css.compactionButton}`}\n onClick={() => setOpen(v => !v)}\n aria-expanded={open}\n title={open ? '收起历史记忆摘要' : '展开查看此节点提炼的记忆摘要'}\n >\n <svg className={css.compactionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z\" strokeWidth=\"1.2\" />\n <path d=\"M8 5v3.2l2 1.8\" strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n <span>{label}</span>\n <span className={css.compactionToggle}>{open ? '收起备忘' : '查看备忘'}</span>\n </button>\n ) : (\n <span className={css.compactionPill}>\n <svg className={css.compactionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z\" strokeWidth=\"1.2\" />\n <path d=\"M8 5v3.2l2 1.8\" strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n <span>{label}</span>\n </span>\n )}\n </div>\n {open && hasSummary && (\n <div className={css.compactionSummaryBox} data-reader-anchor>\n <div className={css.compactionSummaryHeader}>前期对话要点备忘</div>\n <MarkdownText text={data.summary!} labels={markdownLabels} />\n </div>\n )}\n </div>\n );\n});\n\nconst ProcessNode = memo(function ProcessNode({ useChat, t, nodeKey, open, motion, onRead, returnFocusTo }: Pick<ReaderProps, 'useChat' | 't'> & {\n nodeKey: string; open: boolean; motion: boolean; onRead: () => void; returnFocusTo: RefObject<HTMLButtonElement>;\n}) {\n const node = useChat(snapshot => snapshot.nodes.get(nodeKey));\n if (!node || node.visibility === 'hidden') return null;\n let content: ReactNode = null;\n if (isNode(node, 'context')) content = <ContextInjectionRow {...node.data} t={t} />;\n else if (isNode(node, 'system-prompt')) content = <details className={css.detail}><summary>系统提示词</summary><pre className={css.systemPrompt}>{node.data.text}</pre></details>;\n else if (isNode(node, 'model-retry')) content = <JsonBlock label=\"模型重试记录\" payload={node.data.attempts} truncatedLabel={truncatedJsonLabel} />;\n else if (isNode(node, 'manual-compaction')) {\n if (node.data.command.outcome?.kind === 'error') {\n content = <div className={css.error} role=\"alert\">\n <svg className={css.errorIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" strokeWidth=\"1.2\" />\n <path d=\"M8 5v3.5M8 11.2h.01\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n <div className={css.errorCopy}>\n <div className={css.errorTitle}><strong>上下文压缩未成功</strong></div>\n <p className={css.errorMessage}>{node.data.command.outcome.text}</p>\n </div>\n </div>;\n } else {\n content = node.data.compaction ? <CompactionDivider data={node.data.compaction} /> : null;\n }\n }\n else if (isNode(node, 'compaction')) content = <CompactionDivider data={node.data} />;\n else if (isNode(node, 'command')) content = <JsonBlock label=\"命令记录\" payload={node.data} truncatedLabel={truncatedJsonLabel} />;\n return content && <ProcessFragment open={open} motion={motion} onRead={onRead} returnFocusTo={returnFocusTo} nodeKey={nodeKey} framed>{content}</ProcessFragment>;\n});\n\nconst MainNode = memo(function MainNode({ useChat, nodeKey, boundary, pinned, processOpen: _processOpen = false, ...render }: SeatProps) {\n const node = useChat(snapshot => snapshot.nodes.get(nodeKey));\n const [disclosureReset] = useState(() => createSnapshotStore(0));\n if (!node || node.visibility === 'hidden') return null;\n if (isNode(node, 'user') || isNode(node, 'steering')) {\n const blocks = contentBlocks(node.data.content);\n const imageBlocks = blocks.filter(b => b.kind === 'image');\n const otherBlocks = blocks.filter(b => b.kind !== 'image');\n const text = otherBlocks.filter((block): block is Extract<typeof block, { kind: 'text' }> => block.kind === 'text').map(block => block.text).join('\\n\\n');\n const time = node.data.time;\n const fallback = <>\n {node.kind === 'steering' && <p className={css.meta}>补充消息</p>}\n {imageBlocks.length > 0 && <div className={css.userImages}>\n <Blocks {...render} blocks={imageBlocks} source=\"user\" />\n </div>}\n {otherBlocks.length > 0 && <div className={css.user}>\n <Blocks {...render} blocks={otherBlocks} source=\"user\" />\n </div>}\n <UserMessageActions text={text} time={time} />\n </>;\n const official = render.official;\n let rendered: ReactNode = fallback;\n if (official) {\n const turn = node.location.kind === 'turn' || node.location.kind === 'step' ? node.location.turn : undefined;\n const owner: ChatNodeOwnerProps & Pick<ReaderProps, 'sessionId'> = {\n cwd: render.cwd,\n openFile: render.openFile ?? (() => {}),\n forkAt: render.forkAt ?? (() => {}),\n inspectCall: callId => official.openView('trajectory', callId),\n loadImage: official.officialImageLoader,\n fileMentions: official.officialFileMentions,\n sessionId: render.sessionId,\n };\n const options = { hookContext: { turnData: turn?.data, disclosureReset, useGroupAction: readerGroupAction }, fallback };\n rendered = node.kind === 'user'\n ? official.renderSlot(OFFICIAL_SEATS.nodes, { ...owner, node }, { ...options, entryKey: 'user' })\n : official.renderSlot(OFFICIAL_SEATS.nodes, { ...owner, node }, { ...options, entryKey: 'steering' });\n }\n return <div className={css.userCluster} data-reader-anchor data-reader-key={nodeKey} {...chatSeatProps(node.kind, nodeKey)}>{rendered}</div>;\n }\n if (isNode(node, 'assistant-step')) return null;\n if (isNode(node, 'tool-call')) return <ToolMedia {...render} block={node.data.root} />;\n if (isNode(node, 'turn-error')) return <div className={css.error} role=\"alert\" data-reader-anchor>\n <svg className={css.errorIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" strokeWidth=\"1.2\" />\n <path d=\"M8 5v3.5M8 11.2h.01\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n <div className={css.errorCopy}>\n <div className={css.errorTitle}>\n <strong>本轮运行失败</strong>\n {node.data.code && <code className={css.errorCode}>{node.data.code}</code>}\n </div>\n <p className={css.errorMessage}>{cleanErrorMessage(node.data.message)}</p>\n </div>\n </div>;\n if (isNode(node, 'turn-max-tokens')) return <div className={css.notice}>已到达输出长度限制,回答尚未完整。</div>;\n if (isNode(node, 'model-retry')) return node.data.current.retryState === 'scheduled'\n ? <div className={css.notice} role=\"status\">模型请求未成功,正在等待重试。详情保留在执行过程中。</div> : null;\n if (isNode(node, 'command') && render.official) return <OfficialNode {...render} node={node} fallback={<JsonBlock label=\"命令记录\" payload={node.data} truncatedLabel={truncatedJsonLabel} />} />;\n if (isNode(node, 'command')) {\n if (node.data.outcome?.kind === 'error') return <div className={css.error} role=\"alert\">\n <svg className={css.errorIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" strokeWidth=\"1.2\" />\n <path d=\"M8 5v3.5M8 11.2h.01\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n <div className={css.errorCopy}>\n <div className={css.errorTitle}><strong>命令执行未成功</strong></div>\n <p className={css.errorMessage}>{node.data.outcome.text ?? node.data.name ?? '查看原对话中的命令记录'}</p>\n </div>\n </div>;\n return node.data.outcome?.text ? <MarkdownText text={node.data.outcome.text} labels={markdownLabels} /> : null;\n }\n if (isNode(node, 'manual-compaction') || isNode(node, 'compaction')) return null;\n if (node.kind === 'context' || node.kind === 'turn-tail' || node.kind === 'system-prompt' || node.kind === 'turn-process') return null;\n // No 'command-input' branch: that string is not a chat node kind in any released\n // host (it appears nowhere in the installed packages), so a slash command arrives\n // as 'command' above and is rendered there. Keeping the branch only made the file\n // look like it handled a case that cannot occur.\n return <OfficialNode {...render} node={node} fallback={<div className={css.unknown} data-reader-anchor>\n <p>此记录类型暂未接入阅读页:{node.kind}</p>\n {render.official && <button type=\"button\" className={css.textButton} onClick={() => render.official!.openView('chat', node.key)}>在对话中查看</button>}\n <JsonBlock label=\"查看原始记录\" payload={node.data} truncatedLabel={truncatedJsonLabel} />\n </div>} />;\n});\n\n/**\n * Sub-agents this turn dispatched, read from the host's own Turn-process row.\n *\n * The host already derives this from the dispatch tree (`subagentCount` on\n * `TurnProcessChatData`), so counting calls here would only risk disagreeing with\n * it. The row is otherwise hidden by the reader, which is why this is the one place\n * its counters are read.\n */\nfunction subagentCount(snapshot: { nodes: { get(key: string): ChatConversationViewNode | undefined } }, keys: readonly string[]): number {\n for (const key of keys) {\n const node = snapshot.nodes.get(key);\n if (!node || node.kind !== 'turn-process') continue;\n const value = (node.data as { subagentCount?: unknown }).subagentCount;\n if (typeof value === 'number' && Number.isFinite(value) && value > 0) return value;\n }\n return 0;\n}\n\nfunction GroupStatus({ group, useChat, pending, motion }: Pick<ReaderProps, 'useChat'> & { group: ReaderGroup; motion: boolean; pending: { kind?: string } | undefined }) {\n const text = useChat(snapshot => {\n const turn = group.turn === null ? undefined : snapshot.timeline.turns.get(group.turn);\n if (turn?.status === 'closed') {\n if (turn.end?.data.reason.kind !== 'completed') return '执行过程';\n const elapsed = turn.start && turn.end ? Math.max(0, Math.round((turn.end.time - turn.start.time) / 1000)) : null;\n return elapsed === null ? '执行过程' : elapsed < 60 ? `用时 ${elapsed} 秒` : `用时 ${Math.floor(elapsed / 60)} 分 ${elapsed % 60} 秒`;\n }\n if (turn?.status !== 'open') return '执行过程';\n if (pending !== undefined) return '等待你的操作';\n const current = turn.steps.at(-1)?.data.get('assistant-step');\n const last = current?.blocks.at(-1);\n if (current?.status === 'running' && last?.kind === 'tool-call') {\n const spawned = subagentCount(snapshot, group.keys);\n return spawned ? `${preparingLabel(last.name)}·${spawned} 个子代理` : preparingLabel(last.name);\n }\n for (let index = group.keys.length - 1; index >= 0; index--) {\n const node = snapshot.nodes.get(group.keys[index]);\n if (!node) continue;\n if (isNode(node, 'tool-call') && !('kind' in node.data.root)) return '正在使用工具';\n if (isNode(node, 'assistant-step') && node.data.status === 'running') {\n const last = node.data.blocks.at(-1);\n return last?.kind === 'reasoning' ? '正在思考' : last?.kind === 'text' ? '正在输出' : '正在准备回复';\n }\n }\n return '正在处理';\n });\n const busy = useChat(snapshot => group.turn !== null && snapshot.timeline.turns.get(group.turn)?.status === 'open' && pending === undefined);\n return <StatusText text={text} motion={motion} shimmer={busy} />;\n}\n\nconst DeliverableChip = memo(function DeliverableChip({ path, openFile, revealFile, openMode }: {\n path: string;\n openFile?: (path: string) => Promise<void> | void;\n revealFile?: (path: string) => Promise<void> | void;\n openMode: DeliverableOpenMode;\n}) {\n const [status, setStatus] = useState<'idle' | 'opened' | 'copied' | 'revealed'>('idle');\n const timer = useRef<ReturnType<typeof setTimeout>>();\n\n const flash = (next: 'opened' | 'copied' | 'revealed') => {\n setStatus(next);\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setStatus('idle'), 1600);\n };\n\n const onOpen = (event: React.MouseEvent) => {\n event.stopPropagation();\n try {\n openFile?.(path);\n flash('opened');\n } catch {\n // fallback\n }\n };\n\n const onReveal = (event: React.MouseEvent) => {\n event.stopPropagation();\n try {\n if (revealFile) {\n revealFile(path);\n } else {\n openFile?.(dirname(path));\n }\n flash('revealed');\n } catch {\n // fallback\n }\n };\n\n const onCopy = (event: React.MouseEvent) => {\n event.stopPropagation();\n try {\n void navigator.clipboard?.writeText(path);\n flash('copied');\n } catch {\n // fallback\n }\n };\n\n const name = basename(path);\n const folder = dirname(path);\n\n return (\n <div className={css.deliverableChip} data-status={status} title={path}>\n <button\n type=\"button\"\n className={css.chipMain}\n onClick={onOpen}\n onDoubleClick={onOpen}\n aria-label={openMode === 'sidebar' ? `在内置面板中打开 ${path}` : `用系统应用打开 ${path}`}\n >\n {status === 'opened' ? (\n <svg className={css.statusIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M3.5 8.5l3 3 6-7\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ) : (\n <svg className={css.deliverableIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M4 2.5h5l3 3V13.5H4V2.5z\" strokeWidth=\"1.2\" strokeLinejoin=\"round\" />\n <path d=\"M9 2.5v3h3\" strokeWidth=\"1.2\" strokeLinejoin=\"round\" />\n </svg>\n )}\n <span className={css.deliverableName}>\n {status === 'opened' ? (openMode === 'sidebar' ? '已在面板打开' : '已在外部打开') : name}\n </span>\n </button>\n\n <div className={css.chipActions} aria-label=\"文件操作\">\n <button\n type=\"button\"\n className={css.chipActionBtn}\n title={`在访达中定位所在目录 (${folder})`}\n aria-label=\"在访达中显示所在目录\"\n onClick={onReveal}\n >\n {status === 'revealed' ? (\n <svg className={css.actionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M3.5 8.5l3 3 6-7\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ) : (\n <svg className={css.actionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M2 4.5h4l1.5 2H14v6.5H2V4.5z\" strokeWidth=\"1.2\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </button>\n <button\n type=\"button\"\n className={css.chipActionBtn}\n title=\"复制相对路径\"\n aria-label=\"复制相对路径\"\n onClick={onCopy}\n >\n {status === 'copied' ? (\n <svg className={css.actionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M3.5 8.5l3 3 6-7\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ) : (\n <svg className={css.actionIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8\" rx=\"1.5\" strokeWidth=\"1.2\" />\n <path d=\"M4 10.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v1\" strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n </svg>\n )}\n </button>\n </div>\n </div>\n );\n});\n\nfunction DeliverablesRow({ deliverables, openFile, revealFile, openMode }: {\n deliverables: readonly string[];\n openFile?: (path: string) => Promise<void> | void;\n revealFile?: (path: string) => Promise<void> | void;\n openMode: DeliverableOpenMode;\n}) {\n const [folderStatus, setFolderStatus] = useState<'idle' | 'opened'>('idle');\n const onOpenWorkspace = () => {\n try {\n openFile?.('.');\n setFolderStatus('opened');\n setTimeout(() => setFolderStatus('idle'), 1600);\n } catch {\n // ignore\n }\n };\n\n return (\n <div className={css.deliverablesRoot} data-reader-deliverables>\n <span className={css.deliverablesLabel}>产物</span>\n <div className={css.deliverablesLane}>\n <div className={css.deliverablesRow}>\n {deliverables.slice(0, 8).map(path => (\n <DeliverableChip key={path} path={path} openFile={openFile} revealFile={revealFile} openMode={openMode} />\n ))}\n {deliverables.length > 8 && (\n <span className={css.deliverablesMore}>\n + {deliverables.length - 8} 个文件\n </span>\n )}\n {deliverables.length > 1 && (\n <button\n type=\"button\"\n className={css.deliverablesShowFolder}\n data-status={folderStatus}\n onClick={onOpenWorkspace}\n title=\"在访达中打开整个工作区目录\"\n >\n {folderStatus === 'opened' && (\n <svg className={css.statusIcon} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\">\n <path d=\"M3.5 8.5l3 3 6-7\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )}\n <span>{folderStatus === 'opened' ? '已打开访达' : '在文件夹中显示'}</span>\n </button>\n )}\n </div>\n </div>\n </div>\n );\n}\n\nconst TurnGroup = memo(function TurnGroup({ group, motion, autoFold, pinnedKeys, selectedProcessKeys, isAwaitingModel = false, ...props }: ReaderProps & { group: ReaderGroup; motion: boolean; autoFold: boolean; pinnedKeys: readonly string[]; selectedProcessKeys: readonly string[]; isAwaitingModel?: boolean }) {\n const snapshot = props.useChat(snapshot => snapshot);\n const nodes = snapshot.nodes;\n const turn = group.turn === null ? undefined : snapshot.timeline.turns.get(group.turn);\n const interaction = props.useSessionStatus(snapshot => snapshot.get(props.sessionId)?.pendingInteraction);\n const sessionRunning = props.useSession(snapshot => snapshot.running);\n const boundary = useMemo(() => boundaryOf(turn), [turn]);\n const choiceKey = processChoiceKey(group.key, boundary);\n const expansionChoice = props.useStore(state => state.expanded[choiceKey]);\n const flowId = useId();\n const processButton = useRef<HTMLButtonElement>(null);\n const setExpanded = useCallback((value: boolean) => props.actions.setExpanded(choiceKey, value), [props.actions, choiceKey]);\n const pinProcess = useCallback(() => setExpanded(true), [setExpanded]);\n const firstKind = props.useChat(snapshot => snapshot.nodes.get(group.keys[0])?.kind);\n const startsWithUser = firstKind === 'user';\n const mainKeys = startsWithUser ? group.keys.slice(1) : group.keys;\n const flow = useMemo(() => readerFlow({ ...group, keys: mainKeys }, turn, key => nodes.get(key), snapshot.order), [nodes, group, mainKeys, turn, snapshot.order]);\n const steps = useMemo(() => segmentLiveTurn(flow, key => nodes.get(key)), [flow, nodes]);\n const liveItems = useMemo(() => presentLiveTurn(steps, boundary, autoFold), [steps, boundary, autoFold]);\n const openMode = deliverableOpenModeOf(useSyncExternalStore(\n props.openPrefs?.subscribe ?? ((fn: () => void) => { void fn; return () => {}; }),\n () => props.openPrefs?.getSnapshot()?.deliverableOpenMode,\n () => 'external',\n ));\n const hasProcess = flow.some(item => item.kind === 'tool' || hasProcessContent(nodes.get(item.nodeKey), boundary));\n const showStatusLane = hasProcess && !isAwaitingModel;\n const showClosedSummary = boundary.status === 'closed' && hasProcess && autoFold;\n // Only a real, still-active text selection delays folding. Merely clicking,\n // focusing or scrolling the live card does not create a permanent override.\n const holdingSelection = selectedProcessKeys.some(key =>\n flow.some(item => item.key === key)\n || liveItems.some(item => item.kind === 'fold'\n ? item.key === key || item.steps.some(step => step.key === key || ('nodeKey' in step && step.nodeKey === key))\n : item.key === key || ('nodeKey' in item.step && item.step.nodeKey === key)));\n const expanded = !autoFold || holdingSelection || processExpanded(expansionChoice, boundary);\n // Seam between narration blocks. Skip a run a live-fold cell already\n // covers, and do not drop the previous body's bottom spacing.\n const seamPlan = useMemo(\n () => planProcessSeams(steps, liveItems, expanded),\n [steps, liveItems, expanded],\n );\n const [foldOpenByKey, setFoldOpenByKey] = useState<Record<string, boolean>>({});\n useLayoutEffect(() => {\n // Restoring automatic folding also releases live \"prior steps\" disclosures.\n if (autoFold) setFoldOpenByKey(current => Object.keys(current).length ? {} : current);\n }, [autoFold]);\n const deliverables = useMemo(() => getTurnDeliverables(turn, flow), [turn, flow]);\n const tailData = useMemo(() => {\n for (const key of group.keys) {\n const n = nodes.get(key);\n if (n && isNode(n, 'turn-tail')) return n.data;\n }\n return undefined;\n }, [group.keys, nodes]);\n const tailOwner = useMemo(() => turn && tailData ? {\n turn, seq: tailData.closing?.finalNode.seq ?? tailData.seq, openFile: props.openFile,\n } : undefined, [turn, tailData, props.openFile]);\n const fileMentions = useMemo(() => {\n const official = tailOwner ? props.officialFileMentions(tailOwner) : undefined;\n const reader = deliverables.length > 0 ? createProducedFileMentions(deliverables, props.openFile) : undefined;\n return official || reader ? { resolve: (value: string) => official?.resolve(value) ?? reader?.resolve(value) } : undefined;\n }, [tailOwner, props.officialFileMentions, deliverables, props.openFile]);\n const official = useMemo(() => ({\n renderSlot: props.renderSlot, renderSlotChain: props.renderSlotChain,\n officialImageLoader: props.officialImageLoader, officialFileMentions: props.officialFileMentions,\n officialPreviewFile: props.officialPreviewFile,\n officialHost: props.officialHost, openView: props.openView,\n }), [props.renderSlot, props.renderSlotChain, props.officialImageLoader, props.officialFileMentions, props.officialPreviewFile, props.officialHost, props.openView]);\n const cwd = props.useSessions(state => state.byId[props.sessionId]?.cwd);\n const runMs = turn?.start && turn?.end ? Math.max(0, turn.end.time - turn.start.time) : undefined;\n const metrics = useMemo(() => ({\n usage: tailData?.tokenUsage,\n runMs,\n tokensPerSecond: (tailData as { tokensPerSecond?: number } | undefined)?.tokensPerSecond,\n ttftMs: (tailData as { ttftMs?: number } | undefined)?.ttftMs,\n endedAt: tailData?.closing?.time ?? turn?.end?.time,\n }), [tailData, runMs, turn?.end?.time]);\n const forkSeq = forkAnchorSeq([tailData?.closing?.finalNode]);\n const presentation = useMemo(() => {\n // ChatNodeStore exposes live keyed readers. Materialize this turn instead of\n // retaining a live get() function and mistakenly calling it a frozen frame.\n const captured = new Map(group.keys.flatMap(key => {\n const node = nodes.get(key); return node ? [[key, node] as const] : [];\n }));\n return { items: holdingSelection ? presentLiveTurn(steps, boundary, false) : liveItems,\n snapshot: { ...snapshot, nodes: { ...nodes, get: (key: string) => captured.get(key), values: () => [...captured.values()] } } };\n }, [snapshot, nodes, group, steps, boundary, liveItems, holdingSelection]);\n const shared = {\n useChat: useFlowChat,\n renderSlotChain: props.renderSlotChain,\n loadImage: props.loadImage,\n fillComposer: props.fillComposer,\n openFile: props.openFile,\n revealFile: props.revealFile,\n forkAt: props.forkAt,\n forkSeq,\n fileMentions,\n metrics,\n official,\n sessionId: props.sessionId,\n cwd,\n };\n const terminal = terminalLabel(boundary.reason);\n const hasTurnError = flow.some(item => item.kind === 'node' && nodes.get(item.nodeKey)?.kind === 'turn-error');\n // A stopped turn normally stays quiet, but a stopped turn that produced no\n // prose at all reads as if its answer vanished into the process fold. Say so.\n const hasAnswerProse = steps.some(step => step.kind === 'body'\n && step.blocks.some(block => block.kind === 'text' && block.text.trim() !== ''));\n const stoppedWithoutAnswer = (boundary.reason === 'interrupted' || boundary.reason === 'aborted') && !hasAnswerProse;\n const showTerminalNotice = terminal && !hasTurnError\n && (stoppedWithoutAnswer || (boundary.reason !== 'interrupted' && boundary.reason !== 'aborted'));\n const renderStep = (step: LiveStep, folded: boolean) => {\n const processOpen = folded || expanded;\n if (step.kind === 'reasoning' || step.kind === 'body') return <BlockBoundary>\n <AssistantNode {...shared} boundary={boundary} nodeKey={step.nodeKey} partStart={step.start} pinned={pinnedKeys.includes(step.nodeKey)} processOpen={processOpen} folded={folded} motion={motion} onRead={pinProcess} returnFocusTo={processButton}\n seamSummary={step.kind === 'body' ? seamPlan.before.get(step.key) : undefined}\n seamAfter={step.kind === 'body' && seamPlan.after.has(step.key)} />\n </BlockBoundary>;\n if (step.kind === 'tool') return <BlockBoundary><ProcessFragment open={processOpen} motion={motion} onRead={pinProcess} returnFocusTo={processButton} nodeKey={step.key} framed>\n <ToolActivity {...shared} entry={step.entry} motion={motion} turnClosed={boundary.status === 'closed'} onRead={pinProcess} />\n {step.entry.block && <ToolMedia {...shared} block={step.entry.block} />}\n </ProcessFragment></BlockBoundary>;\n if (step.kind === 'user') return <BlockBoundary><MainNode {...shared} boundary={boundary} nodeKey={step.nodeKey} /></BlockBoundary>;\n return <Fragment>\n <BlockBoundary><ProcessNode useChat={useFlowChat} t={props.t} nodeKey={step.nodeKey} open={processOpen} motion={motion} onRead={pinProcess} returnFocusTo={processButton} /></BlockBoundary>\n <BlockBoundary><MainNode {...shared} boundary={boundary} nodeKey={step.nodeKey} pinned={pinnedKeys.includes(step.nodeKey)} processOpen={processOpen} /></BlockBoundary>\n </Fragment>;\n };\n return <section className={css.turn} data-reader-turn={group.turn ?? 'unresolved'} data-reader-turn-state={boundary.status} data-reader-turn-result={boundary.reason ?? undefined}>\n {startsWithUser && <BlockBoundary><MainNode {...shared} useChat={props.useChat} boundary={boundary} nodeKey={group.keys[0]} /></BlockBoundary>}\n <div className={css.turnStickyRegion} data-reader-sticky-region>\n {(showStatusLane || showClosedSummary) && <div className={css.turnStickyLanes}>\n {showStatusLane && <StickyLane kind=\"status\" className={css.turnProcessSticky}>\n <Disclosure open={expanded} onChange={setExpanded} controls={flowId} buttonRef={processButton}\n label={<GroupStatus group={group} useChat={props.useChat} pending={interaction} motion={motion} />} />\n </StickyLane>}\n {showClosedSummary && <ClosedProcessSummary open={expanded} onChange={setExpanded} controls={flowId}\n steps={steps.filter(step => step.kind !== 'user' && step.kind !== 'body')} />}\n </div>}\n <ChoreographedFlow id={flowId} frame={presentation} motion={motion} enabled={autoFold && boundary.status === 'open' && !holdingSelection}\n urgent={hasTurnError || interaction !== undefined || !sessionRunning} open={foldOpenByKey} processOpen={expanded}\n onOpenChange={(key, value) => { pinProcess(); setFoldOpenByKey(current => ({ ...current, [key]: value })); }} renderStep={renderStep} />\n </div>\n {/* 状态指示永远排在流程之后:AI 的响应永远出现在最新消息(含补充消息)的下方 */}\n {!hasProcess && boundary.status === 'open' && !isAwaitingModel && <div className={css.disclosure} data-reader-status-only>\n <GroupStatus group={group} useChat={props.useChat} pending={interaction} motion={motion} />\n </div>}\n {showDeliverablesRow(boundary.status, deliverables) && <DeliverablesRow deliverables={deliverables} openFile={props.openFile} revealFile={props.revealFile} openMode={openMode} />}\n {boundary.status === 'closed' && <BlockBoundary><OfficialTail official={official} owner={tailOwner} produced={deliverables} /></BlockBoundary>}\n {showTerminalNotice && <div className={css.notice} data-reader-terminal>{terminal}</div>}\n </section>;\n});\n\nexport function Reader(props: ReaderProps) {\n useInsertionEffect(() => { ensureStyles(); }, []);\n const root = useRef<HTMLDivElement>(null);\n const activatedAt = useRef(Date.now());\n const order = props.useChat(snapshot => snapshot.order);\n const nodes = props.useChat(snapshot => snapshot.nodes);\n // A rewind upserts the command row in place, so order and nodes keep their identity.\n const rewindSignature = props.useChat(snapshot => visibleChatSignature(snapshot));\n const renderKeys = useMemo(() => visibleChatKeys({ order, nodes }), [order, nodes, rewindSignature]);\n const timeline = props.useChat(snapshot => snapshot.timeline);\n const running = props.useSession(snapshot => snapshot.running);\n const pending = props.useSessionStatus(snapshot => snapshot.get(props.sessionId)?.pendingInteraction);\n const openError = props.useSession(snapshot => snapshot.openError);\n const loading = props.useSession(snapshot => snapshot.openState === 'loading');\n const hasMore = props.useSession(snapshot => snapshot.hasMore);\n const loadingOlder = props.useSession(snapshot => snapshot.loadingOlder);\n const pendingSubmissions = props.useSession(snapshot => snapshot.pendingSubmissions);\n const pendingList = asReadonlyArray<PendingSubmissionEcho>(pendingSubmissions);\n const inbox = props.useProjection?.('inbox');\n type PendingInboxItem = { source?: { kind?: string; rpcId?: unknown }; content?: readonly unknown[] };\n const inboxSteering = asReadonlyArray<PendingInboxItem>(inbox?.['next-step']).filter(item => item.source?.kind === 'user');\n const observed = useMemo(() => observedInputIds(order, key => nodes.get(key)), [order, nodes]);\n const visibleSubmissions = useMemo(() => pendingList.filter(sub => sub.placement !== 'queued' && !observed.has(sub.requestId)), [pendingList, observed]);\n const pendingInputs = useMemo(() => {\n const local = new Map<string, PendingSubmissionEcho>(visibleSubmissions.map(sub => [sub.requestId, sub]));\n const localIds = new Set(pendingList.filter(sub => sub.placement !== 'queued').map(sub => sub.requestId));\n const rows: Array<PendingSubmissionEcho | (typeof inboxSteering)[number]> = [];\n for (const item of inboxSteering) {\n const rpcId = typeof item.source?.rpcId === 'string' ? item.source.rpcId : undefined;\n if (!rpcId) { rows.push(item); continue; }\n const submission = local.get(rpcId);\n if (submission) { local.delete(rpcId); rows.push(submission); }\n else if (!localIds.has(rpcId)) rows.push(item);\n }\n rows.push(...local.values());\n return rows;\n }, [inboxSteering, pendingList, visibleSubmissions]);\n const waitAnchor = waitingAnchor(renderKeys, key => nodes.get(key), pendingList);\n const motionPreference = props.useStore(state => state.motion);\n const motion = useMotionAllowed(motionPreference);\n const prefsSnap = useSyncExternalStore(\n props.openPrefs?.subscribe ?? ((fn: () => void) => { void fn; return () => {}; }),\n () => props.openPrefs?.getSnapshot?.(),\n () => undefined,\n );\n const storeAutoFold = props.useStore(state => state.autoFold);\n const autoFold = prefsSnap?.autoFold ?? (prefsSnap?.foldIntensity !== undefined ? prefsSnap.foldIntensity !== 0 : undefined) ?? storeAutoFold ?? true;\n const previousAutoFold = useRef(autoFold);\n useLayoutEffect(() => {\n const restored = autoFold && !previousAutoFold.current;\n previousAutoFold.current = autoFold;\n // Watch the effective preference so toolbar and Settings changes behave alike.\n // Reading while folding is off must not pin completed process content forever.\n if (restored) props.actions.resetExpanded();\n }, [autoFold, props.actions]);\n const frostedGlass = frostedGlassOf(prefsSnap);\n const streamMotion = useMemo(() => ({ enabled: motion, activatedAt: activatedAt.current }), [motion]);\n const groups = useMemo(() => groupNodes(renderKeys, key => nodes.get(key)), [renderKeys, nodes, timeline]);\n const isAwaitingModel = useMemo(() => {\n // 状态机铁律:「深度求索中」与「正在处理/思考」永远互斥。\n // 1. 仅空闲发送(!running)的本地回显窗口:用户按下回车第 0 毫秒立即反馈。\n // 忙碌时的 queued/steering 回显不算等待——模型本来就在工作。\n if (!running && pendingList.length > 0) return true;\n\n const lastKey = renderKeys.at(-1);\n const lastNode = lastKey ? nodes.get(lastKey) : undefined;\n if (!lastKey || !lastNode) return false;\n\n // 2. 模型已经产出内容:等待结束,计时器必须立刻消失。\n // 「产出」= assistant-step 已带 block(正文/思维链/工具调用都算)。\n if (lastNode.kind === 'assistant-step') {\n const data = lastNode.data as { status?: string; blocks?: unknown[] };\n const blocks = data.blocks ?? [];\n // 空 block 且仍在跑 = 请求已发出、模型还没吐字,正是要计时的那一刻。\n return blocks.length === 0 && data.status === 'running';\n }\n\n // 3. 球在模型脚下:用户刚发言,或工具已返回、上下文已注入、命令已执行。\n // 这些时刻模型随时可能卡住,正是要计时的地方;工具执行期间不计时,\n // 因为那时忙的是工具而不是模型。\n // handsBackToModel 内部按 chat 层 kind 判定,并区分「工具已返回」与\n // 「工具仍在跑」——后者不算等待。\n const modelOwesResponse = handsBackToModel(lastNode);\n if (!modelOwesResponse) return false;\n\n // 轮次已结束就没什么可等的。\n const lastGroup = groups.at(-1);\n const turn = lastGroup?.turn === null || lastGroup?.turn === undefined ? undefined : timeline.turns.get(lastGroup.turn);\n return turn?.status !== 'closed';\n }, [running, pendingList, renderKeys, nodes, groups, timeline]);\n const scroll = useReadingScroll(root, motion);\n const pinnedKeys = usePinnedSelection(root);\n const selectedProcessKeys = usePinnedSelection(root, '[data-reader-process]');\n const [historyError, setHistoryError] = useState(false);\n\n // 1. Navigation items from Chat snapshot\n const turnNavigationItems = props.useChat(snapshot => snapshot.navigation?.items ? snapshot.navigation.items() : undefined);\n // 2. Whole-log turn outline projection\n const turnOutline = props.useProjection?.('turnOutline');\n // 3. Track turns with deliverables\n const turnsWithDeliverables = useMemo(() => {\n const set = new Set<number>();\n for (const [turnNum, loc] of timeline.turns) {\n const deliv = (loc.data as { get(key: string): unknown } | undefined)?.get('deliverables') as { produced?: unknown[] } | undefined;\n if (Array.isArray(deliv?.produced) && deliv.produced.length > 0) {\n set.add(turnNum);\n }\n }\n return set;\n }, [timeline]);\n\n // 4. Merged timeline items for the rail\n const timelineItems = useMemo(\n () => mergeTimelineItems(turnNavigationItems, turnOutline, turnsWithDeliverables),\n [turnNavigationItems, turnOutline, turnsWithDeliverables],\n );\n\n // 5. Active & busy turn tracking\n const [activeTurn, setActiveTurn] = useState<number | null>(null);\n const [busyTurn, setBusyTurn] = useState<number | null>(null);\n\n // Scroll spy to update activeTurn\n useEffect(() => {\n const el = root.current;\n if (!el) return;\n const scroller = el.closest('[data-conversation-scroll]') ?? el;\n\n let ticking = false;\n const updateActive = () => {\n if (ticking) return;\n ticking = true;\n requestAnimationFrame(() => {\n ticking = false;\n const line = (scroller instanceof HTMLElement ? scroller.clientHeight : window.innerHeight) * 0.35;\n const turnRows = el.querySelectorAll<HTMLElement>('[data-reader-turn]:not([data-reader-turn=\"unresolved\"])');\n let current: number | null = null;\n for (const row of turnRows) {\n const rect = row.getBoundingClientRect();\n if (rect.top <= line) {\n const num = Number(row.dataset.readerTurn);\n if (Number.isSafeInteger(num)) current = num;\n } else {\n break;\n }\n }\n if (current !== null) {\n setActiveTurn(current);\n } else if (turnRows.length > 0) {\n const first = Number(turnRows[0].dataset.readerTurn);\n if (Number.isSafeInteger(first)) setActiveTurn(first);\n }\n });\n };\n\n scroller.addEventListener('scroll', updateActive, { passive: true });\n updateActive();\n return () => scroller.removeEventListener('scroll', updateActive);\n }, [groups]);\n\n // Navigation handler (supports loaded jump & unloaded loadThrough).\n // Land on the conversation scroller only — scrollIntoView also moves\n // ancestor boxes and can lift the sticky composer after a top→bottom jump.\n const onNavigateTurn = useCallback(async (item: TimelineItem) => {\n const el = root.current;\n if (!el) return;\n const port = scrollerOf(el);\n const reveal = (turn: number) => {\n const targetRow = el.querySelector<HTMLElement>(`[data-reader-turn=\"${turn}\"]`);\n if (!targetRow) return;\n const last = timelineItems.at(-1);\n if (last !== undefined && last.turn === turn) {\n scroll.jump();\n } else {\n scroll.release();\n landTurn(targetRow, port);\n }\n setActiveTurn(turn);\n };\n\n if (item.anchor.kind === 'loaded') {\n reveal(item.turn);\n return;\n }\n\n setBusyTurn(item.turn);\n try {\n if (props.loadThrough) {\n await props.loadThrough(item.anchor.seq);\n } else {\n await props.loadOlder();\n }\n setTimeout(() => { reveal(item.turn); }, 50);\n } finally {\n setBusyTurn(null);\n }\n }, [props.loadThrough, props.loadOlder, scroll.jump, scroll.release, timelineItems]);\n\n const lastKey = renderKeys.at(-1);\n const lastNode = lastKey ? nodes.get(lastKey) : undefined;\n const lastSubmissionId = pendingList.length ? pendingList[pendingList.length - 1].requestId : null;\n const lastOrderKeyRef = useRef<string | undefined>(lastKey);\n const lastSubmissionRef = useRef<string | null>(lastSubmissionId);\n\n useLayoutEffect(() => {\n const appendedUser = lastKey !== lastOrderKeyRef.current && (lastNode?.kind === 'user' || lastNode?.kind === 'steering');\n const appendedSubmission = lastSubmissionId !== null && lastSubmissionId !== lastSubmissionRef.current;\n lastOrderKeyRef.current = lastKey;\n lastSubmissionRef.current = lastSubmissionId;\n\n if (appendedUser || appendedSubmission) {\n scroll.jump();\n }\n }, [lastKey, lastNode?.kind, lastSubmissionId, scroll]);\n\n // ChatView publishes data-chat-flow=\"\" on its column. Skins treat a\n // scrollport without that hook as inspect-only and hide [data-composer-seat].\n // dsh-claude-style 0.19.x also hides the host seat whenever the first tab\n // is not 对话. Reader.module.css restores that seat only while this root\n // (data-dsh-better-display) is mounted.\n return <StreamMotionContext.Provider value={streamMotion}><ReaderLaneScope><div ref={root} className={css.root} data-reader-build=\"0.3.4\" data-dsh-better-display=\"0.3.4\" data-reader-wait-clock-version=\"input-v1\" data-reader-wait-start={waitAnchor.time ?? undefined} data-motion={motion ? 'on' : 'off'} data-reader-glass={frostedGlass || undefined} data-reader-auto-fold={autoFold ? 'on' : 'off'}>\n <TimelineRail items={timelineItems} activeTurn={activeTurn} busyTurn={busyTurn} onNavigate={onNavigateTurn} />\n <div className={css.column} data-chat-flow=\"\" tabIndex={-1}>\n <StickyLane kind=\"toolbar\" className={css.toolbar}>\n <button\n type=\"button\"\n className={css.textButton}\n aria-pressed={autoFold}\n onClick={() => {\n props.actions.setAutoFold(!autoFold);\n props.openPrefs?.actions?.setAutoFold?.(!autoFold);\n }}\n title=\"新思考产生时,是否自动将此前步骤收拢为一行汇总。关闭后完整保留原始过程与流式输出。\"\n >\n {`自动折叠${autoFold ? '开' : '关'}`}\n </button>\n </StickyLane>\n {hasMore && <button type=\"button\" className={css.historyButton} disabled={loadingOlder} onClick={async () => {\n setHistoryError(false);\n try { await props.loadOlder(); } catch { setHistoryError(true); }\n }}>{loadingOlder ? '正在加载更早记录' : '加载更早记录'}</button>}\n {historyError && <div className={css.notice}>历史记录加载失败,可再次尝试;现有内容未改变。</div>}\n {openError && <div className={css.error} role=\"alert\">会话暂时无法读取:{openError.message}</div>}\n {loading && groups.length === 0 && <p className={css.empty} role=\"status\">正在读取会话…</p>}\n <RetiringTurns groups={groups} render={group => <TurnGroup {...props} group={group} motion={motion} autoFold={autoFold} pinnedKeys={pinnedKeys} selectedProcessKeys={selectedProcessKeys} isAwaitingModel={isAwaitingModel && group.key === groups.at(-1)?.key} />} />\n {pendingInputs.map((item, index) => {\n const submission = 'requestId' in item ? item : undefined;\n const text = submission?.text ?? inboxText(item as PendingInboxItem);\n const images = submission ? pendingSubmissionImages(submission) : [];\n const attachmentCount = submission ? images.length : inboxAttachmentCount(item as PendingInboxItem);\n const requestId = submission?.requestId ?? `inbox-${index}`;\n return (\n <div key={requestId} className={css.userCluster} data-reader-pending-submission data-pending-steering={submission ? undefined : ''} data-pending-attachment-count={attachmentCount}>\n {images.length > 0 && (\n <div className={css.userImages}>\n {images.map((item, idx) => (\n <figure key={idx} className={css.imageFigure}>\n <div className={css.imageFrame} style={{ aspectRatio: `${item.width || 4} / ${item.height || 3}` }}>\n <img src={item.previewUrl} alt={item.name ?? '发送的图片'} className={css.pendingImage} />\n </div>\n </figure>\n ))}\n </div>\n )}\n {text ? (\n <div className={css.user}>\n <div className={css.blocks}>{text}</div>\n </div>\n ) : null}\n <UserMessageActions text={text} time={submission?.time} />\n </div>\n );\n })}\n {isAwaitingModel && <WaitingStatus anchor={waitAnchor} label={props.t ? props.t('chat.deepDiving') : '深度求索中...'} />}\n {pending !== undefined && <div className={css.attention} role=\"alert\" data-reader-attention>\n <strong>{pending.kind === 'question' ? '需要你回答一个问题' : '需要你的确认'}</strong>\n <span>请在下方原生操作区处理。此提示不会收进执行过程。</span>\n </div>}\n {scroll.detached && <div className={css.jumpDock}><button type=\"button\" className={css.jump} aria-label=\"回到底部\" title=\"回到底部\" onClick={scroll.jump}>\n <svg viewBox=\"0 0 14 14\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M3 5.5 7 9.5 11 5.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n </button></div>}\n </div>\n </div></ReaderLaneScope></StreamMotionContext.Provider>;\n}\n","import { defineStore } from '@deepseek-ai/dsh-client-store';\nimport type { EngineStoreHandle } from '@deepseek-ai/dsh-client-store';\nimport {\n FOLD_INTENSITY_DEFAULT,\n autoFoldFromIntensity,\n processOnlyFromIntensity,\n type FoldIntensity,\n} from './fold-intensity.js';\nimport type { DeliverableOpenMode } from './open-file.js';\n\nexport interface ReaderState {\n expanded: Record<string, boolean>;\n motion: boolean;\n /** Derived from foldIntensity; kept so older persisted snapshots still read. */\n autoFold: boolean;\n /** Default stays the system app. `sidebar` is opt-in. */\n deliverableOpenMode: DeliverableOpenMode;\n /**\n * 0 = no auto-fold, 1 = current-main fold-on-next-reasoning (default),\n * 2 = process-summary mode from community PR #14.\n */\n foldIntensity: FoldIntensity;\n /** Translucent frosted chrome. Default off so opaque main chrome stays. */\n frostedGlass: boolean;\n /** Derived from foldIntensity === 2; kept for older #14 snapshots. */\n processOnly: boolean;\n}\ntype ReaderActions = {\n setExpanded: (draft: ReaderState, key: string, value: boolean) => void;\n resetExpanded: (draft: ReaderState) => void;\n setMotion: (draft: ReaderState, value: boolean) => void;\n setAutoFold: (draft: ReaderState, value: boolean) => void;\n setDeliverableOpenMode: (draft: ReaderState, value: DeliverableOpenMode) => void;\n setFoldIntensity: (draft: ReaderState, value: FoldIntensity) => void;\n setFrostedGlass: (draft: ReaderState, value: boolean) => void;\n};\n\nfunction applyFoldIntensity(draft: ReaderState, value: FoldIntensity): void {\n draft.foldIntensity = value;\n draft.autoFold = autoFoldFromIntensity(value);\n draft.processOnly = processOnlyFromIntensity(value);\n}\n\nexport function createReaderStore(): EngineStoreHandle<ReaderState, ReaderActions> {\n return defineStore({\n init: (): ReaderState => ({\n expanded: {},\n motion: true,\n autoFold: true,\n deliverableOpenMode: 'external',\n foldIntensity: FOLD_INTENSITY_DEFAULT,\n frostedGlass: false,\n processOnly: false,\n }),\n persist: 'dsh.reader.v1',\n actions: {\n setExpanded: (draft, key: string, value: boolean) => { draft.expanded[key] = value; },\n resetExpanded: draft => { draft.expanded = {}; },\n setMotion: (draft, value: boolean) => { draft.motion = value; },\n setAutoFold: (draft, value: boolean) => {\n applyFoldIntensity(draft, value\n ? (draft.foldIntensity === 2 ? 2 : 1)\n : 0);\n },\n setDeliverableOpenMode: (draft, value: DeliverableOpenMode) => { draft.deliverableOpenMode = value; },\n setFoldIntensity: (draft, value: FoldIntensity) => { applyFoldIntensity(draft, value); },\n setFrostedGlass: (draft, value: boolean) => { draft.frostedGlass = value; },\n },\n });\n}\n","/** Select the reading view on entry, without fighting a later explicit tab choice. */\nexport class ReaderEntryPolicy {\n private entered = false;\n\n constructor(private readonly requested: boolean, private readonly consumeRequest: () => void = () => {}) {}\n\n select(view: string | null | undefined): 'reader' | null {\n const requested = !this.entered && this.requested;\n if (!this.entered) {\n this.entered = true;\n if (this.requested) this.consumeRequest();\n }\n return (requested || view == null) && view !== 'reader' ? 'reader' : null;\n }\n}\n\nexport function readerEntryRequested(search: string): boolean {\n const value = new URLSearchParams(search).get('reader');\n return value === '1' || /^0\\.1\\.0-trial\\.\\d+$/.test(value ?? '');\n}\n","import { useLayoutEffect } from 'react';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ConversationStore } from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type { PropsRuntime, PropsStore, StoreDecl } from '@deepseek-ai/dsh-client-ui-slots';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport { ReaderEntryPolicy, readerEntryRequested } from './entry-policy.js';\n\nfunction isConversationStore(store: StoreDecl | undefined): store is ConversationStore {\n return typeof store === 'object' && store !== null\n && store.spec.persist === 'dsh.conversation'\n && typeof store.spec.actions.setView === 'function';\n}\n\ntype EntryProps = PropsRuntime<'conversation.input.dock'> & PropsStore<ConversationStore> & { policy: ReaderEntryPolicy };\n\nfunction ReaderEntry({ useStore, actions, policy }: EntryProps) {\n const view = useStore(state => state.view);\n useLayoutEffect(() => {\n const next = policy.select(view);\n if (next) actions.setView(next);\n }, [view, actions, policy]);\n return null;\n}\n\n/** Reuse the native store handle; its framework-owned instance preserves drafts. */\nexport function installReaderEntry(ctx: Context): () => void {\n const native = ctx.slots.entriesOfSlot('conversation.session')[0]?.store;\n if (!isConversationStore(native)) throw new Error('DSH Reader cannot bind the native conversation view store.');\n const policy = new ReaderEntryPolicy(readerEntryRequested(location.search), () => {\n const url = new URL(location.href);\n url.searchParams.delete('reader');\n history.replaceState(history.state, '', `${url.pathname}${url.search}${url.hash}`);\n });\n return ctx.slots.register({\n name: 'conversation.input.dock',\n id: 'dsh-better-display-entry',\n store: native,\n inject: () => ({ policy }),\n }, ReaderEntry);\n}\n","export type SettingsCopyKey =\n | 'nav'\n | 'openTitle'\n | 'openDescription'\n | 'glassTitle'\n | 'glassDescription'\n | 'foldTitle'\n | 'foldDescription'\n | 'foldNone'\n | 'foldStandard'\n | 'foldSummary'\n | 'shortcutTitle'\n | 'shortcutDescription'\n | 'shortcutAllow'\n | 'shortcutAlways'\n | 'shortcutReject'\n | 'shortcutRecording'\n | 'shortcutDisabled'\n | 'shortcutDisable'\n | 'shortcutReset'\n | 'shortcutErrorKey'\n | 'shortcutErrorModifier'\n | 'shortcutErrorConflict';\n\nexport type SettingsCopy = Record<SettingsCopyKey, string>;\n\nexport const en: SettingsCopy = {\n nav: 'Better Chat',\n openTitle: 'Open deliverables in built-in panel',\n openDescription: 'Off by default: chips and inline file mentions open in the system app. Turn this on to preview them in the right Sidebar, matching official chat. Reveal and folder actions still use the system file manager.',\n glassTitle: 'Translucent frosted glass',\n glassDescription: 'Off by default: reading chrome stays opaque, matching the current Host look. Turn this on to let wallpaper and skins show through the panel; path and count chips stay clear until hover or focus.',\n foldTitle: 'Auto-fold process',\n foldDescription: 'Default on: collapses earlier steps when new thoughts appear. Turn off to keep all thinking and tools expanded in full.',\n foldNone: 'Off',\n foldStandard: 'On',\n foldSummary: 'Summary',\n shortcutTitle: 'Approval card shortcuts',\n shortcutDescription: 'Click a keycap and press the new combination. Allow-type actions use Enter, reject uses Esc; modifiers are free. Esc alone cancels while recording. Stored in the plugin config.',\n shortcutAllow: 'Allow once',\n shortcutAlways: 'Always allow',\n shortcutReject: 'Reject',\n shortcutRecording: 'Press keys…',\n shortcutDisabled: 'Not set',\n shortcutDisable: 'Clear',\n shortcutReset: 'Restore defaults',\n shortcutErrorKey: 'Allow actions must use Enter; reject must use Esc.',\n shortcutErrorModifier: 'Always allow needs at least one modifier key.',\n shortcutErrorConflict: 'That combination is already used by another action.',\n};\n\nexport const zh: SettingsCopy = {\n nav: 'Better Chat',\n openTitle: '在内置面板中打开产物',\n openDescription: '默认关闭:产物芯片和正文中的文件提及会用系统应用打开。打开后与官方对话一致,在右侧栏预览。访达 / 资源管理器中的显示与打开所在文件夹不受此开关控制。',\n glassTitle: '半透明毛玻璃',\n glassDescription: '默认关闭:阅读栏保持不透明,和现在的 Host 观感一致。打开后透出宿主壁纸与皮肤;路径、行数等标签静止时透明,悬停或聚焦才显出轮廓。',\n foldTitle: '自动折叠过程',\n foldDescription: '默认开启:新思考产生时自动折叠此前步骤。关闭后全程展开,完整保留原始思考与工具流。',\n foldNone: '关闭',\n foldStandard: '开启',\n foldSummary: '摘要',\n shortcutTitle: '审批卡快捷键',\n shortcutDescription: '点键帽后按下新的组合键。允许类只能用 Enter,拒绝只能用 Esc,修饰键随意;录制时单独按 Esc 取消。保存在插件配置里,重启后仍在。',\n shortcutAllow: '允许(单次)',\n shortcutAlways: '始终允许',\n shortcutReject: '拒绝',\n shortcutRecording: '按下组合键…',\n shortcutDisabled: '未设置',\n shortcutDisable: '清除',\n shortcutReset: '恢复默认',\n shortcutErrorKey: '允许类动作只能用 Enter,拒绝只能用 Esc。',\n shortcutErrorModifier: '「始终允许」至少需要一个修饰键(Ctrl/Shift/Alt)。',\n shortcutErrorConflict: '这个组合键已经被另一个动作占用。',\n};\n\nexport function settingsLanguage(tag: string | undefined): 'zh' | 'en' {\n return (tag ?? '').toLowerCase().startsWith('zh') ? 'zh' : 'en';\n}\n\nexport function settingsCopyFor(tag: string | undefined): SettingsCopy {\n return settingsLanguage(tag) === 'zh' ? zh : en;\n}\n","import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';\nimport { frostedGlassOf, type FoldIntensity } from './fold-intensity.js';\nimport {\n BINDINGS_CHANGED_EVENT,\n bindingKeycap,\n normalizeBindings,\n validateBinding,\n type ApprovalAction,\n type ApprovalBinding,\n} from './chat/bindings.js';\nimport type { ChatPrefs } from './chat/bindings-store.js';\nimport { deliverableOpenModeOf, type DeliverableOpenMode } from './open-file.js';\nimport { settingsCopyFor, type SettingsCopy, type SettingsCopyKey } from './settings-copy.js';\nimport css from './SettingsSection.module.css';\n\nexport interface ReaderPrefsSnapshot {\n deliverableOpenMode?: DeliverableOpenMode;\n frostedGlass?: boolean;\n foldIntensity?: FoldIntensity;\n autoFold?: boolean;\n processOnly?: boolean;\n}\n\nexport interface OpenPrefs {\n getSnapshot: () => ReaderPrefsSnapshot;\n subscribe: (fn: () => void) => () => void;\n actions: {\n setDeliverableOpenMode: (value: DeliverableOpenMode) => void;\n setFrostedGlass: (value: boolean) => void;\n setFoldIntensity?: (value: FoldIntensity) => void;\n setAutoFold?: (value: boolean) => void;\n };\n}\n\nexport interface BetterDisplaySettingsInjected {\n prefs: OpenPrefs;\n chat?: ChatPrefs;\n copy?: SettingsCopy;\n languageTag?: string;\n}\n\ntype SettingsProps = BetterDisplaySettingsInjected & {\n /** Official settings.section owner share; unused here. */\n close?: () => void;\n t?: (key: SettingsCopyKey) => string;\n};\n\nfunction text(props: SettingsProps, copy: SettingsCopy, key: keyof SettingsCopy): string {\n if (typeof props.t === 'function') {\n try {\n const value = props.t(key);\n if (typeof value === 'string' && value.length > 0 && value !== key) return value;\n } catch {\n // Fall through to the bundled dictionaries.\n }\n }\n return copy[key];\n}\n\nexport function SettingsSection(props: SettingsProps) {\n const copy = props.copy ?? settingsCopyFor(props.languageTag);\n const snap = useSyncExternalStore(\n props.prefs.subscribe,\n () => props.prefs.getSnapshot() ?? ({} as ReaderPrefsSnapshot),\n () => ({} as ReaderPrefsSnapshot),\n );\n const mode = deliverableOpenModeOf(snap.deliverableOpenMode);\n const glass = frostedGlassOf(snap);\n const autoFold = snap.autoFold !== false && snap.foldIntensity !== 0;\n const setMode = (value: DeliverableOpenMode) => {\n props.prefs.actions.setDeliverableOpenMode(value);\n };\n const on = mode === 'sidebar';\n\n // 审批快捷键:读插件配置(dsh.better-chat.v1),保存后派发事件让卡片提示立即重建。\n const chat = props.chat;\n const chatSnap = useSyncExternalStore(\n chat?.subscribe ?? (() => () => {}),\n () => chat?.getSnapshot() ?? ({ bindings: undefined } as never),\n () => ({ bindings: undefined } as never),\n );\n const bindings = normalizeBindings(chatSnap);\n const mac = typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.platform);\n const [recording, setRecording] = useState<ApprovalAction | null>(null);\n const [keyError, setKeyError] = useState<string | undefined>();\n\n const announceBindings = useCallback(() => {\n if (typeof window === 'undefined') return;\n window.dispatchEvent(new CustomEvent(BINDINGS_CHANGED_EVENT));\n }, []);\n\n useEffect(() => {\n if (!recording || !chat) return;\n const onKey = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (event.key === 'Escape' && recording !== 'reject'\n && !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {\n setRecording(null);\n setKeyError(undefined);\n return;\n }\n const key = event.key === 'Enter' ? 'Enter' : event.key === 'Escape' ? 'Escape' : undefined;\n if (!key) {\n setKeyError(copy.shortcutErrorKey);\n return;\n }\n const binding: ApprovalBinding = {\n key,\n primary: event.ctrlKey || event.metaKey,\n shift: event.shiftKey,\n alt: event.altKey,\n };\n const verdict = validateBinding(recording, binding, bindings);\n if (verdict === 'key') { setKeyError(copy.shortcutErrorKey); return; }\n if (verdict === 'modifier') { setKeyError(copy.shortcutErrorModifier); return; }\n if (verdict === 'conflict') { setKeyError(copy.shortcutErrorConflict); return; }\n chat.actions.setApprovalBinding(recording, binding);\n announceBindings();\n setRecording(null);\n setKeyError(undefined);\n };\n window.addEventListener('keydown', onKey, true);\n return () => window.removeEventListener('keydown', onKey, true);\n }, [recording, chat, chatSnap, copy, bindings, announceBindings]);\n\n return (\n <div className={css.section} data-better-display-settings>\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'openTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'openDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={on}\n className={css.switch}\n data-on={on || undefined}\n data-better-display-open-mode={mode}\n onClick={() => { setMode(on ? 'external' : 'sidebar'); }}\n />\n </div>\n\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'glassTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'glassDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={glass}\n className={css.switch}\n data-on={glass || undefined}\n data-better-display-glass={glass ? 'on' : 'off'}\n onClick={() => { props.prefs.actions.setFrostedGlass(!glass); }}\n />\n </div>\n\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'foldTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'foldDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={autoFold}\n className={css.switch}\n data-on={autoFold || undefined}\n data-better-display-auto-fold={autoFold ? 'on' : 'off'}\n onClick={() => {\n props.prefs.actions.setAutoFold?.(!autoFold);\n props.prefs.actions.setFoldIntensity?.(!autoFold ? 1 : 0);\n }}\n />\n </div>\n\n {chat ? (\n <section className={css.block} data-better-chat-shortcuts>\n <div className={css.title}>{text(props, copy, 'shortcutTitle')}</div>\n <p className={css.desc}>{text(props, copy, 'shortcutDescription')}</p>\n {([\n ['allow', 'shortcutAllow', bindings.allow],\n ['always', 'shortcutAlways', bindings.always],\n ['reject', 'shortcutReject', bindings.reject],\n ] as const).map(([action, title, binding]) => (\n <div className={css.row} key={action}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, title)}</div>\n </div>\n <div className={css.keyActions}>\n <button\n type=\"button\"\n className={css.keyButton}\n data-recording={recording === action || undefined}\n onClick={() => { setKeyError(undefined); setRecording(action); }}\n >\n {recording === action\n ? text(props, copy, 'shortcutRecording')\n : binding ? bindingKeycap(binding, mac) : text(props, copy, 'shortcutDisabled')}\n </button>\n {action === 'always' && binding ? (\n <button\n type=\"button\"\n className={css.button}\n onClick={() => {\n chat.actions.setApprovalBinding('always', null);\n announceBindings();\n setKeyError(undefined);\n }}\n >\n {text(props, copy, 'shortcutDisable')}\n </button>\n ) : null}\n </div>\n </div>\n ))}\n {keyError ? <p className={css.error} data-better-chat-key-error>{keyError}</p> : null}\n <div className={css.actions}>\n <button\n type=\"button\"\n className={css.button}\n onClick={() => {\n chat.actions.resetApprovalBindings();\n announceBindings();\n setRecording(null);\n setKeyError(undefined);\n }}\n >\n {text(props, copy, 'shortcutReset')}\n </button>\n </div>\n </section>\n ) : null}\n </div>\n );\n}\n","import type { Context } from '@deepseek-ai/cordis';\nimport type {} from './settings-slots.js';\nimport { settingsCopyFor, zh, en } from './settings-copy.js';\nimport { SettingsSection, type BetterDisplaySettingsInjected, type OpenPrefs } from './SettingsSection.js';\nimport type { ChatPrefs } from './chat/bindings-store.js';\n\ninterface LocaleFace {\n register?: (ns: string, dicts: { zh: unknown; en: unknown }) => () => void;\n bind?: (ns: string) => (key: string) => string;\n getSnapshot?: () => { locale?: string; language?: string };\n}\n\nfunction languageTag(ctx: Context): string | undefined {\n const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;\n const snap = locale?.getSnapshot?.();\n return snap?.locale ?? snap?.language\n ?? (typeof document !== 'undefined' ? document.documentElement.lang : undefined)\n ?? (typeof navigator !== 'undefined' ? navigator.language : undefined);\n}\n\n/**\n * Own locale namespace and settings-section id. The merged plugin used to reuse\n * dsh-better-display's `better-display` id; while the standalone display plugin\n * is still installed, the two registrations collided and the nav label flipped\n * between \"Better Display\" and \"Better Chat\" depending on load order.\n */\nconst SETTINGS_LOCALE_NS = 'better-chat'\nconst SETTINGS_SECTION_ID = 'better-chat'\n\nexport function installBetterDisplaySettings(ctx: Context, prefs: OpenPrefs, chat?: ChatPrefs): void {\n const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;\n if (locale?.register) {\n ctx.effect(() => locale.register!(SETTINGS_LOCALE_NS, { zh, en }), 'dsh-better-chat: settings copy');\n }\n const injected = (): BetterDisplaySettingsInjected => ({\n prefs,\n chat,\n copy: settingsCopyFor(languageTag(ctx)),\n languageTag: languageTag(ctx),\n });\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: SETTINGS_SECTION_ID,\n order: 40,\n label: () => locale?.bind?.(SETTINGS_LOCALE_NS)?.('nav') || settingsCopyFor(languageTag(ctx)).nav,\n locale: locale?.bind ? SETTINGS_LOCALE_NS : undefined,\n inject: injected,\n }, SettingsSection));\n}\n","import type { Context } from '@deepseek-ai/cordis';\nimport type {} from '@deepseek-ai/dsh-api-remotes/client';\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client';\nimport type {} from '@deepseek-ai/dsh-client-connection/client';\nimport type { SessionId } from '@deepseek-ai/dsh-session/types';\nimport { resolveWorkspacePath } from '@deepseek-ai/dsh-util-workspace-path';\nimport * as workspacePathPkg from '@deepseek-ai/dsh-util-workspace-path';\nimport { dirname } from './deliverables.js';\nimport { isAbsoluteWorkspacePath } from '../workspace-path.js';\nimport { ensureStyles } from './styles.js';\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport { Reader } from './Reader.js';\nimport { createReaderStore } from './store.js';\nimport { installReaderEntry } from './entry.js';\nimport { installBetterDisplaySettings } from './settings.js';\nimport type { ChatPrefs } from './chat/bindings-store.js';\nimport { fillComposerDom } from './mcp-app.js';\nimport { fileAddressFor, modeFromSnapshot, openDeliverableFile } from './open-file.js';\nimport type { ReaderInjected } from './types.js';\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';\nimport { installOfficialSlots, officialChildren, type CompositionRegistry } from './official-slots.js';\nimport { TEXT_TRANSFORM_SERVICE, createTextTransformRegistry, installTextTransformRegistry } from './text-transform.js';\n\n/** Structural face of the sanctioned per-session composer writer. */\ninterface ComposerShell {\n setDraft: (text: string) => void;\n}\ninterface ConversationFace {\n input?: { shell?: (id: SessionId) => ComposerShell };\n}\n\ninterface SidebarRightFace {\n openResource?: (address: string, options?: { params?: { line?: number } }) => void;\n}\n\nconst officialFileAddressFor = (workspacePathPkg as {\n fileAddressFor?: typeof fileAddressFor;\n}).fileAddressFor;\n\nasync function openWorkspacePath(\n ctx: Context,\n path: string,\n): Promise<void> {\n const remote = ctx.remote as unknown as { session?: { openWorkspacePath: (arg: { path: string }) => Promise<{ ok: boolean; error?: { message: string } }> } } | undefined;\n const remoteSession = remote?.session\n ?? (ctx.get?.('remote.session') as unknown as { openWorkspacePath: (arg: { path: string }) => Promise<{ ok: boolean; error?: { message: string } }> } | undefined)\n ?? ((ctx.get?.('remote') as unknown as { session?: { openWorkspacePath: (arg: { path: string }) => Promise<{ ok: boolean; error?: { message: string } }> } })?.session);\n if (remoteSession?.openWorkspacePath) {\n const result = await remoteSession.openWorkspacePath({ path });\n if (!result?.ok) {\n console.warn('[dsh-better-display] openWorkspacePath failed:', result?.error?.message);\n }\n } else {\n console.warn('[dsh-better-display] remote.session is not available');\n }\n}\n\nexport type { ReaderBlockOwner, ReaderBlockPresentation } from './types.js';\nexport type { DisplayCursor, DisplayText, DisplayTextKind, DisplayTextRequest, DisplayTextTransformer, TextTransformRegistry } from './text-transform.js';\nexport { McpAppFrame } from './McpAppFrame.js';\nexport { TEXT_TRANSFORM_SERVICE, createTextTransformRegistry, originalAnswerText } from './text-transform.js';\nexport const name = 'dsh-better-display-client';\nexport const inject = ['slots', 'sessions', 'conversation', 'uiConversation', 'remote', 'remote.session'];\n\n// All CSS imports have injected their nodes before this module's body runs.\nensureStyles();\n\nexport function apply(ctx: Context, options: { chatPrefs?: ChatPrefs } = {}): void {\n const textTransform = createTextTransformRegistry();\n const restoreTextTransform = installTextTransformRegistry(textTransform);\n ctx.provide(TEXT_TRANSFORM_SERVICE, textTransform);\n ctx.effect(() => restoreTextTransform);\n const store = createReaderStore();\n // conversation.view is session-scoped, so session persist keys are\n // `dsh.reader.v1.<sessionId>`. One root instance keeps glass, fold\n // intensity, and open-mode on the unsuffixed `dsh.reader.v1` key.\n const prefs = store.create();\n installBetterDisplaySettings(ctx, prefs, options.chatPrefs);\n ctx.slots.inject('conversation.chat.node', function* () {\n yield ctx.slots.register({\n name: 'conversation.view',\n id: 'reader',\n order: -5,\n label: () => '阅读',\n locale: 'chat',\n children: {\n 'dsh-better-display.block': { kind: 'chain', scope: 'session' },\n ...officialChildren(ctx.slots as unknown as CompositionRegistry),\n },\n store,\n inject: (sessionId: SessionId): ReaderInjected => {\n const session = () => {\n const current = ctx.sessions.binding(sessionId)?.session;\n if (!current) throw new Error('阅读页对应的会话已关闭。');\n return current;\n };\n return {\n openPrefs: prefs,\n officialImageLoader: Object.assign(\n (attachment: ImageAttachmentRef) => ctx.uiConversation.imageUrl(sessionId, attachment),\n { peek: (attachment: ImageAttachmentRef) => ctx.uiConversation.peekImageUrl(sessionId, attachment) },\n ),\n officialFileMentions: owner => ctx.get('chatFileMentions')?.forClosing(owner, sessionId),\n officialPreviewFile: path => {\n const cwd = ctx.sessions.list.getSnapshot().byId[sessionId]?.cwd;\n const sidebar = ctx.get('sidebarRight') as SidebarRightFace | undefined;\n if (!sidebar?.openResource) throw new Error('文件预览面板不可用。');\n sidebar.openResource((officialFileAddressFor ?? fileAddressFor)(sessionId, cwd, path));\n },\n officialHost: {\n getSnapshot: () => ctx.remote.$host,\n subscribe: listener => ctx.on('connection/reset', listener),\n },\n loadOlder: async () => { await session().loadOlder(); },\n loadImage: async attachment => {\n const receipt = await session().readAttachment(attachment.attachmentId);\n if (!receipt.ok) throw new Error(receipt.error.message);\n return { data: Uint8Array.from(receipt.value.data), mediaType: receipt.value.attachment.mediaType };\n },\n openFile: async (path, options) => {\n try {\n const cwd = ctx.sessions?.list?.getSnapshot?.()?.byId[sessionId]?.cwd;\n const sidebar = (\n ctx.get?.('sidebarRight')\n ?? (ctx as unknown as { sidebarRight?: SidebarRightFace }).sidebarRight\n ) as SidebarRightFace | undefined;\n await openDeliverableFile({\n path,\n mode: modeFromSnapshot(prefs),\n sessionId,\n cwd,\n resolveWorkspacePath,\n openExternal: async (absolutePath) => { await openWorkspacePath(ctx, absolutePath); },\n openSidebar: typeof sidebar?.openResource === 'function'\n ? (address) => { sidebar.openResource!(address, options?.line === undefined ? undefined : { params: { line: options.line } }); }\n : undefined,\n fileAddressFor: officialFileAddressFor ?? fileAddressFor,\n warn: (message, extra) => { console.warn(message, extra); },\n });\n } catch (error) {\n console.warn('[dsh-better-display] openFile error:', error);\n }\n },\n revealFile: async (path: string) => {\n try {\n const cwd = ctx.sessions?.list?.getSnapshot?.()?.byId[sessionId]?.cwd;\n const targetPath = resolveWorkspacePath(cwd, path);\n // 1. Try dedicated host endpoint for native file highlighting (open -R / explorer /select)\n try {\n const res = await fetch('/better-display/reveal', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ path: targetPath, sessionId }),\n });\n if (res.ok) {\n const data = await res.json();\n if (data.ok) return;\n }\n } catch {\n // Server endpoint not yet available, fallback to directory open\n }\n\n // 2. Fallback to official opener with parent directory\n const parentDir = dirname(targetPath);\n if (!isAbsoluteWorkspacePath(parentDir)) {\n console.warn('[dsh-better-display] reveal failed; refusing to open a relative parent:', targetPath);\n return;\n }\n const remote = ctx.remote as unknown as { session?: { openWorkspacePath: (arg: { path: string }) => Promise<{ ok: boolean; error?: { message: string } }> } } | undefined;\n const remoteSession = remote?.session\n ?? (ctx.get?.('remote.session') as unknown as { openWorkspacePath: (arg: { path: string }) => Promise<{ ok: boolean; error?: { message: string } }> } | undefined);\n if (remoteSession?.openWorkspacePath) {\n await remoteSession.openWorkspacePath({ path: parentDir });\n }\n } catch (error) {\n console.warn('[dsh-better-display] revealFile error:', error);\n }\n },\n forkAt: (seq: number) => {\n // A missing anchor would silently fork the whole session instead of\n // the intended turn prefix, so refuse it loudly rather than guessing.\n if (typeof seq !== 'number' || !Number.isFinite(seq)) {\n console.warn('[dsh-better-display] fork refused: missing anchor seq');\n return;\n }\n try {\n const sessionsApi = ctx.sessions as unknown as {\n fork: (arg: { sessionId: string; atSeq: number; increaseTitle: boolean }) => Promise<string>;\n open: (sessionId: string) => void;\n } | undefined;\n if (sessionsApi?.fork) {\n sessionsApi.fork({ sessionId, atSeq: seq, increaseTitle: true })\n .then(childId => { sessionsApi.open?.(childId); })\n .catch(err => { console.warn('[dsh-better-display] fork failed:', err); });\n }\n } catch (error) {\n console.warn('[dsh-better-display] forkAt error:', error);\n }\n },\n loadThrough: async (seq: unknown) => {\n try {\n const current = session() as unknown as { loadThrough?: (seq: unknown) => Promise<void> };\n if (typeof current?.loadThrough === 'function') {\n await current.loadThrough(seq);\n } else {\n await session().loadOlder();\n }\n } catch (error) {\n console.warn('[dsh-better-display] loadThrough error:', error);\n }\n },\n fillComposer: (text: string) => {\n // Sanctioned path: the conversation input shell owns the Lexical\n // editor, so setDraft lands in the draft store deterministically.\n try {\n const conversation = (ctx as unknown as { conversation?: ConversationFace }).conversation;\n const shell = conversation?.input?.shell?.(sessionId);\n if (shell && typeof shell.setDraft === 'function') {\n shell.setDraft(text);\n return true;\n }\n } catch {\n // Fall through to the DOM path below.\n }\n try {\n return fillComposerDom(text);\n } catch {\n return false;\n }\n },\n\n };\n },\n }, Reader);\n yield installOfficialSlots(ctx);\n yield installReaderEntry(ctx);\n });\n}\n","/**\n * dsh-better-chat 客户端入口(合并后)。\n *\n * 两个半场共用一个 client 产物:\n * - 阅读视图(原 dsh-better-display):reader-plugin.tsx 及其整棵 React 源码树;\n * - 聊天增强(原 dsh-better-chat):审批键盘/提示、权限 UI、商店更新按钮。\n *\n * 入口必须导出一个静态字符串 inject 数组(宿主 Cordis 服务注入),\n * 并在这里统一 apply。审批快捷键的配置存在 dsh.better-chat.v1,由设置页写入。\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { install as installApprovalKeys } from './chat/approval-keys.js'\nimport { createChatStore, currentBindings } from './chat/bindings-store.js'\nimport { installKeyHints } from './chat/key-hint.js'\nimport { installPermissionPolicy } from './chat/permission-policy.js'\nimport { storeUpdatePlugin } from './chat/store-update.js'\nimport { apply as applyReader, name as readerName } from './reader-plugin.js'\n\nexport const name = 'dsh-better-chat'\n\n/** 阅读视图所需的宿主客户端服务;聊天增强不额外依赖服务。 */\nexport const inject = [\n 'slots',\n 'sessions',\n 'conversation',\n 'uiConversation',\n 'remote',\n 'remote.session',\n]\n\nexport function apply(ctx: Context): void {\n // 审批快捷键:持久化实例在 apply 里创建,避免模块级单例跨插件重载残留。\n const chatPrefs = createChatStore().create()\n const getBindings = () => currentBindings(chatPrefs)\n\n // 聊天增强:纯 DOM 观察,不依赖任何宿主服务。\n ctx.effect(() => installApprovalKeys(document, getBindings), 'dsh-better-chat: approval key routing')\n ctx.effect(() => installKeyHints(document, { getBindings }), 'dsh-better-chat: approval key hints')\n ctx.effect(\n () => installPermissionPolicy(document, () => (ctx as { sessions?: unknown }).sessions),\n 'dsh-better-chat: permission policy (no full access, auto review by default)',\n )\n try {\n ctx.plugin(storeUpdatePlugin as any)\n } catch {\n // 子插件挂不上(旧宿主等)不影响主功能。\n }\n\n // 阅读视图:注册 slots、设置页(含快捷键配置)与文本变换服务。\n applyReader(ctx, { chatPrefs })\n void readerName\n}\n"],"ignoreList":[6,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,106,107],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAmCA,MAAa,iBAAkC;GAAE,KAAK;GAAS,SAAS;GAAM,OAAO;GAAO,KAAK;EAAM;EAEvG,MAAa,mBAAqC;GAChD,OAAO;IAAE,KAAK;IAAS,SAAS;IAAO,OAAO;IAAO,KAAK;GAAM;GAChE,QAAQ;GACR,QAAQ;IAAE,KAAK;IAAU,SAAS;IAAO,OAAO;IAAO,KAAK;GAAM;EACpE;;EAGA,MAAa,yBAAyB;;EAGtC,SAAgB,WAAW,QAAyC;GAClE,OAAO,WAAW,WAAW,WAAW;EAC1C;;EAGA,SAAgB,cAAc,SAA0B,KAAsB;GAC5E,MAAM,QAAkB,CAAC;GACzB,IAAI,QAAQ,SAAS,MA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;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,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,2CAA2C,KAAK;QAC/D;OACF;OACA,eAAe,SAAiB;QAG9B,IAAI;SAEF,MAAM,QADgB,IAAuD,cACjD,OAAO,QAAQ,SAAS;SACpD,IAAI,SAAS,OAAO,MAAM,aAAa,YAAY;UACjD,MAAM,SAAS,IAAI;UACnB,OAAO;SACT;QACF,QAAQ,CAER;QACA,IAAI;SACF,OAAO,gBAAgB,IAAI;QAC7B,QAAQ;SACN,OAAO;QACT;OACF;MAEF;KACF;IACA,GAAG,MAAM;IACT,MAAM,qBAAqB,GAAG;IAC9B,MAAM,mBAAmB,GAAG;GAC9B,CAAC;EACH;;EC5NA,MAAa,OAAO;;EAGpB,MAAa,SAAS;GACpB;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,SAAgB,MAAM,KAAoB;GAExC,MAAM,YAAY,gBAAgB,CAAC,CAAC,OAAO;GAC3C,MAAM,oBAAoB,gBAAgB,SAAS;GAGnD,IAAI,aAAaC,QAAoB,UAAU,WAAW,GAAG,uCAAuC;GACpG,IAAI,aAAa,gBAAgB,UAAU,EAAE,YAAY,CAAC,GAAG,qCAAqC;GAClG,IAAI,aACI,wBAAwB,gBAAiB,IAA+B,QAAQ,GACtF,6EACF;GACA,IAAI;IACF,IAAI,OAAO,iBAAwB;GACrC,QAAQ,CAER;GAGAC,QAAY,KAAK,EAAE,UAAU,CAAC;EAEhC"} \ No newline at end of file +{"version":3,"file":"client.js","names":["CARD_SELECTOR","defineStore","useSyncExternalStore","useState","useCallback","useEffect","css","installApprovalKeys"],"sources":["../src/client/chat/bindings.ts","../src/client/chat/approval-keys.ts","../src/client/chat/bindings-store.ts","../src/client/chat/key-hint.ts","../src/client/chat/permission-policy.ts","../src/client/chat/store-update.ts","../src/client/settings-copy.ts","../src/client/fold-intensity.ts","../src/client/open-file.ts","../src/client/SettingsSection.tsx","../src/client/settings.tsx","../src/client/index.tsx"],"sourcesContent":["/**\n * 审批卡快捷键模型:默认 Enter 允许(单次)、Ctrl+Enter 始终允许、Esc 拒绝。\n *\n * 允许自定义:允许/始终允许固定在 Enter 上、拒绝固定在 Esc 上,只让修饰键可调,\n * 避免把普通字母键变成全局快捷键。`primary` 表示 Windows/Linux 的 Ctrl、macOS 的\n * Cmd —— 判定时 Ctrl 或 Meta 任一按下即算命中,展示时按平台显示 Ctrl/Cmd。\n */\n\nexport type ApprovalAction = 'allow' | 'always' | 'reject'\nexport type ApprovalBaseKey = 'Enter' | 'Escape'\n\nexport interface ApprovalBinding {\n key: ApprovalBaseKey\n /** Ctrl(Windows/Linux)或 Cmd(macOS)。 */\n primary: boolean\n shift: boolean\n alt: boolean\n}\n\nexport interface ApprovalBindings {\n allow: ApprovalBinding\n /** null = 不绑定「始终允许」。 */\n always: ApprovalBinding | null\n reject: ApprovalBinding\n}\n\nexport interface KeyEventLike {\n key: string\n ctrlKey?: boolean\n metaKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n}\n\n/** 「始终允许」的默认键帽;单列出来,展开时不会沾上 `null` 带来的可选键。 */\nexport const DEFAULT_ALWAYS: ApprovalBinding = { key: 'Enter', primary: true, shift: false, alt: false }\n\nexport const DEFAULT_BINDINGS: ApprovalBindings = {\n allow: { key: 'Enter', primary: false, shift: false, alt: false },\n always: DEFAULT_ALWAYS,\n reject: { key: 'Escape', primary: false, shift: false, alt: false },\n}\n\n/** 设置页保存快捷键后派发的窗口事件;提示与判定都靠实时 getter,无需重启。 */\nexport const BINDINGS_CHANGED_EVENT = 'better-chat:bindings-changed'\n\n/** 每个动作允许的基础键:允许类只能用 Enter,拒绝只能用 Esc。 */\nexport function baseKeyFor(action: ApprovalAction): ApprovalBaseKey {\n return action === 'reject' ? 'Escape' : 'Enter'\n}\n\n/** 展示用键帽文案,例如 Enter / Ctrl+Enter / Shift+Alt+Enter / Esc。 */\nexport function bindingKeycap(binding: ApprovalBinding, mac: boolean): string {\n const parts: string[] = []\n if (binding.primary) parts.push(mac ? 'Cmd' : 'Ctrl')\n if (binding.shift) parts.push('Shift')\n if (binding.alt) parts.push('Alt')\n parts.push(binding.key === 'Escape' ? 'Esc' : binding.key)\n return parts.join('+')\n}\n\n/** 纯判定:按键事件是否命中这条绑定(修饰键必须完全一致)。 */\nexport function bindingMatches(binding: ApprovalBinding, event: KeyEventLike): boolean {\n const primary = Boolean(event.ctrlKey) || Boolean(event.metaKey)\n return event.key === binding.key\n && primary === binding.primary\n && Boolean(event.shiftKey) === binding.shift\n && Boolean(event.altKey) === binding.alt\n}\n\n/** 是否是不带任何修饰键的裸键(Enter / Esc)。 */\nexport function isPlainBinding(binding: ApprovalBinding | null | undefined): boolean {\n return Boolean(binding) && !binding!.primary && !binding!.shift && !binding!.alt\n}\n\n/** 两条绑定是否相同。 */\nexport function bindingsEqual(\n left: ApprovalBinding | null | undefined,\n right: ApprovalBinding | null | undefined,\n): boolean {\n if (!left || !right) return left === right\n return left.key === right.key\n && left.primary === right.primary\n && left.shift === right.shift\n && left.alt === right.alt\n}\n\nfunction booleanOrFalse(value: unknown): boolean {\n return value === true\n}\n\n/** 校验并收敛一条绑定;形状不对时返回 undefined。 */\nexport function normalizeBinding(value: unknown): ApprovalBinding | undefined {\n if (!value || typeof value !== 'object') return undefined\n const record = value as Record<string, unknown>\n if (record.key !== 'Enter' && record.key !== 'Escape') return undefined\n return {\n key: record.key,\n primary: booleanOrFalse(record.primary),\n shift: booleanOrFalse(record.shift),\n alt: booleanOrFalse(record.alt),\n }\n}\n\n/**\n * 把持久化快照收敛成合法绑定;`{ bindings: ... }` 或内层对象都接受。\n * 缺失/非法/冲突的项回落到默认值,保证任何旧快照都能用。\n */\nexport function normalizeBindings(value: unknown): ApprovalBindings {\n const inner = value && typeof value === 'object' && 'bindings' in (value as Record<string, unknown>)\n ? (value as Record<string, unknown>).bindings\n : value\n const record = inner && typeof inner === 'object' ? inner as Record<string, unknown> : {}\n const allowRaw = normalizeBinding(record.allow)\n const rejectRaw = normalizeBinding(record.reject)\n const allow = allowRaw && allowRaw.key === 'Enter' ? allowRaw : { ...DEFAULT_BINDINGS.allow }\n const reject = rejectRaw && rejectRaw.key === 'Escape' ? rejectRaw : { ...DEFAULT_BINDINGS.reject }\n const alwaysRaw = 'always' in record ? record.always : DEFAULT_ALWAYS\n const alwaysParsed = alwaysRaw === null ? null : normalizeBinding(alwaysRaw)\n const always: ApprovalBinding | null = alwaysRaw === null\n ? null\n : alwaysParsed && alwaysParsed.key === 'Enter'\n ? alwaysParsed\n : { ...DEFAULT_ALWAYS }\n\n const out: ApprovalBindings = { allow, always, reject }\n // 冲突(或「始终允许」没修饰键)时把 allow/always 一起回落到默认,\n // 避免一个按键命中两个动作;默认值本身互不冲突。\n if (out.always && (!hasModifier(out.always) || bindingsEqual(out.allow, out.always))) {\n out.allow = { ...DEFAULT_BINDINGS.allow }\n out.always = { ...DEFAULT_ALWAYS }\n }\n if (out.always && bindingsEqual(out.reject, out.always)) {\n out.reject = { ...DEFAULT_BINDINGS.reject }\n }\n if (bindingsEqual(out.allow, out.reject)) {\n out.allow = { ...DEFAULT_BINDINGS.allow }\n out.reject = { ...DEFAULT_BINDINGS.reject }\n }\n return out\n}\n\nfunction hasModifier(binding: ApprovalBinding): boolean {\n return binding.primary || binding.shift || binding.alt\n}\n\nexport type BindingVerdict = 'ok' | 'key' | 'modifier' | 'conflict'\n\n/**\n * 保存前的校验:基础键是否匹配动作、始终允许是否有修饰键、是否与其他动作冲突。\n */\nexport function validateBinding(\n action: ApprovalAction,\n binding: ApprovalBinding,\n current: ApprovalBindings,\n): BindingVerdict {\n if (binding.key !== baseKeyFor(action)) return 'key'\n if (action === 'always' && !hasModifier(binding)) return 'modifier'\n const others: ApprovalBinding[] = []\n if (action !== 'allow') others.push(current.allow)\n if (action !== 'always' && current.always) others.push(current.always)\n if (action !== 'reject') others.push(current.reject)\n if (others.some((other) => bindingsEqual(other, binding))) return 'conflict'\n return 'ok'\n}\n","/**\n * 功能一:审批卡片的回车批准 / Esc 拒绝(自动送入焦点 + 全局兜底路由)。\n *\n * 背景(@deepseek-ai/dsh-client-ui-approval):官方审批卡自带键盘处理\n * —— Enter 批准(单次)、Esc 拒绝 —— 但 keydown 挂在卡片根节点上,且\n * 要求焦点先落在卡片内。审批弹出时焦点往往还在对话区,按回车毫无反应。\n *\n * 本模块补两件事,不改官方任何逻辑:\n * 1. 审批卡出现时,若用户没有正在别处输入,把焦点送进卡片详情区。\n * 2. 焦点不在卡片内时兜底路由:document 捕获阶段拦 keydown,点击卡片\n * 操作行里的按钮 —— 回车点「允许(单次)」,Esc 点「拒绝」。\n */\n\nconst CARD_SELECTOR = '[data-approval-key]'\nconst SCROLL_SELECTOR = '[data-approval-scroll]'\nconst EDITABLE_SELECTOR = 'input, textarea, select, [contenteditable=\"true\"], [contenteditable=\"\"]'\n\nimport {\n DEFAULT_BINDINGS,\n bindingMatches,\n isPlainBinding,\n type ApprovalAction,\n type ApprovalBinding,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport interface KeyActionInput {\n key: string\n ctrlKey?: boolean\n metaKey?: boolean\n altKey?: boolean\n shiftKey?: boolean\n repeat?: boolean\n isComposing?: boolean\n keyCode?: number\n defaultPrevented?: boolean\n target?: Element | null\n activeElement?: Element | null\n card?: Element | null\n /** 卡片是否有可用的「始终允许」按钮(第三个操作按钮)。 */\n hasAlways?: boolean\n /** 当前快捷键绑定;缺省使用 DEFAULT_BINDINGS。 */\n bindings?: ApprovalBindings\n}\n\n/** 卡片操作行的按钮:详情滚动区之外的全部按钮,顺序 [拒绝, 允许, 始终允许?]。 */\nexport function actionButtons(card: Element): HTMLButtonElement[] {\n return [...card.querySelectorAll('button')].filter(\n (button) => !button.closest(SCROLL_SELECTOR),\n ) as HTMLButtonElement[]\n}\n\n/** 找当前可作答的审批卡(DOM 顺序第一张未作答、按钮齐全的卡)。 */\nexport function findPendingCard(doc: Document): Element | null {\n for (const card of doc.querySelectorAll(CARD_SELECTOR)) {\n if (card.getAttribute('aria-busy') === 'true') continue\n const buttons = actionButtons(card)\n if (buttons.length >= 2 && !buttons[0].disabled && !buttons[1].disabled) return card\n }\n return null\n}\n\n/**\n * 纯判定:这次 keydown 是否应该路由到审批卡。\n *\n * 默认绑定:Enter → 允许(单次)、Ctrl/Cmd+Enter → 始终允许、Esc → 拒绝;\n * 绑定可由设置页改写(见 bindings.ts),基础键固定 Enter/Escape,只调修饰键。\n * 官方卡片本身对带修饰键的按键不作答,所以带修饰键的绑定即使在卡内也由\n * 本插件处理;裸 Enter/Esc 在卡内交给官方。\n *\n * @returns 'allow' | 'reject' | 'always' | null\n */\nexport function decideKeyAction(input: KeyActionInput): 'allow' | 'reject' | 'always' | null {\n const {\n repeat, isComposing, keyCode, defaultPrevented, target, activeElement, card, hasAlways,\n } = input\n if (!card) return null\n if (defaultPrevented) return null\n if (repeat || isComposing || keyCode === 229) return null\n // 正在输入控件里打字时一律不拦截(含卡片内的输入框)。\n if (target && typeof target.closest === 'function' && target.closest(EDITABLE_SELECTOR) !== null) {\n return null\n }\n\n const bindings = input.bindings ?? DEFAULT_BINDINGS\n const candidates: Array<[ApprovalAction, ApprovalBinding | null]> = [\n ['allow', bindings.allow],\n ['always', hasAlways ? bindings.always : null],\n ['reject', bindings.reject],\n ]\n\n for (const [action, binding] of candidates) {\n if (!binding || !bindingMatches(binding, input)) continue\n if (isPlainBinding(binding)) {\n // 裸键在卡内交给官方;Enter 落在别的按钮/链接上时保留它自己的行为。\n if (activeElement && card.contains(activeElement)) return null\n if (binding.key === 'Enter' && target && typeof target.closest === 'function'\n && target.closest('button, a[href], [role=\"button\"]') !== null) {\n return null\n }\n }\n return action\n }\n return null\n}\n\n/** 纯判定:审批卡出现时是否应该把焦点送进详情区。 */\nexport function shouldAutoFocus(activeElement: Element | null | undefined, card: Element): boolean {\n if (!activeElement) return true\n if (activeElement === card.ownerDocument?.body) return true\n if (card.contains(activeElement)) return false // 已经在卡里\n if (typeof activeElement.closest === 'function' && activeElement.closest(EDITABLE_SELECTOR) !== null) {\n return false // 正在别处输入\n }\n return true\n}\n\n/** 安装审批键盘增强,返回卸载函数。 */\nexport function install(doc: Document, getBindings?: () => ApprovalBindings): () => void {\n const focusedCards = new WeakSet<Element>()\n\n const tryAutoFocus = (): void => {\n const card = findPendingCard(doc)\n if (!card || focusedCards.has(card)) return\n focusedCards.add(card)\n if (!shouldAutoFocus(doc.activeElement, card)) return\n const region = card.querySelector(SCROLL_SELECTOR)\n if (region && typeof (region as HTMLElement).focus === 'function') (region as HTMLElement).focus()\n }\n\n const observer = new MutationObserver(tryAutoFocus)\n observer.observe(doc.documentElement, { childList: true, subtree: true })\n tryAutoFocus()\n\n const onKeyDown = (event: KeyboardEvent): void => {\n const card = findPendingCard(doc)\n if (!card) return\n const buttons = actionButtons(card)\n const hasAlways = buttons.length >= 3 && !buttons[2].disabled\n const action = decideKeyAction({\n key: event.key,\n ctrlKey: event.ctrlKey, metaKey: event.metaKey, altKey: event.altKey, shiftKey: event.shiftKey,\n repeat: event.repeat, isComposing: event.isComposing, keyCode: event.keyCode,\n defaultPrevented: event.defaultPrevented,\n target: event.target as Element | null, activeElement: doc.activeElement, card, hasAlways,\n bindings: getBindings?.() ?? DEFAULT_BINDINGS,\n })\n if (!action) return\n const button = action === 'allow'\n ? buttons[1]\n : action === 'always'\n ? buttons[2]\n : buttons[0]\n if (!button || button.disabled) return\n event.preventDefault()\n event.stopPropagation()\n button.click()\n }\n doc.addEventListener('keydown', onKeyDown, true)\n\n return () => {\n observer.disconnect()\n doc.removeEventListener('keydown', onKeyDown, true)\n }\n}\n","/**\n * 聊天增强的持久化设置:审批卡快捷键。存储键 `dsh.better-chat.v1`,由宿主\n * 客户端 store 的 persist 机制写入配置,重启后仍在。\n */\nimport { defineStore } from '@deepseek-ai/dsh-client-store'\nimport type { EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\nimport {\n normalizeBindings,\n type ApprovalAction,\n type ApprovalBinding,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport interface ChatState {\n bindings: ApprovalBindings\n}\n\nexport type ChatActionsDecl = {\n setApprovalBinding: (draft: ChatState, action: ApprovalAction, binding: ApprovalBinding | null) => void\n resetApprovalBindings: (draft: ChatState) => void\n}\n\nexport interface ChatPrefs {\n getSnapshot: () => ChatState\n subscribe: (fn: () => void) => () => void\n actions: {\n setApprovalBinding: (action: ApprovalAction, binding: ApprovalBinding | null) => void\n resetApprovalBindings: () => void\n }\n}\n\nexport const CHAT_PREFS_KEY = 'dsh.better-chat.v1'\n\nexport function createChatStore(): EngineStoreHandle<ChatState, ChatActionsDecl> {\n return defineStore({\n init: (): ChatState => ({ bindings: normalizeBindings(undefined) }),\n persist: CHAT_PREFS_KEY,\n actions: {\n setApprovalBinding: (draft, action: ApprovalAction, binding: ApprovalBinding | null) => {\n draft.bindings = normalizeBindings({ ...draft.bindings, [action]: binding })\n },\n resetApprovalBindings: (draft) => {\n draft.bindings = normalizeBindings(undefined)\n },\n },\n })\n}\n\n/** 从设置实例读取当前绑定;旧快照/非法值自动回落默认。 */\nexport function currentBindings(prefs: ChatPrefs | undefined): ApprovalBindings {\n try {\n return normalizeBindings(prefs?.getSnapshot())\n } catch {\n return normalizeBindings(undefined)\n }\n}\n","/**\n * 审批卡键盘提示:在操作行左侧显示「Enter 允许(单次) · Ctrl+Enter\n * 始终允许 · Esc 拒绝」的键帽提示,文案直接取卡片按钮的实际文字。\n *\n * 提示只是说明,不参与点击:pointer-events: none、aria-hidden,且只挂在\n * 卡片操作行里(详情滚动区之外)。React 重渲染把提示冲掉时,MutationObserver\n * 会按按钮文案的签名重新挂回去;卡片作答后(aria-busy)立即移除。\n */\nimport { actionButtons } from './approval-keys.js'\nimport {\n BINDINGS_CHANGED_EVENT,\n DEFAULT_BINDINGS,\n bindingKeycap,\n type ApprovalBindings,\n} from './bindings.js'\n\nexport const HINT_ATTR = 'data-better-chat-keyhint'\nconst CARD_SELECTOR = '[data-approval-key]'\nconst SEPARATOR = '·'\n\nexport interface HintPart {\n key: string\n label: string\n}\n\nexport interface HintLabels {\n allow?: string\n always?: string\n reject?: string\n}\n\n/** 纯判定:当前平台是否用 Cmd 代替 Ctrl(只影响提示文案)。 */\nexport function isMacPlatform(platform: string | undefined | null): boolean {\n return typeof platform === 'string' && /Mac|iPhone|iPad|iPod/.test(platform)\n}\n\n/**\n * 纯函数:根据卡片上实际存在的按钮文案与当前绑定,生成提示的分段。\n * 「始终允许」被关掉(binding 为 null)时就不显示这一段。\n */\nexport function hintParts(\n labels: HintLabels,\n mac: boolean,\n bindings: ApprovalBindings = DEFAULT_BINDINGS,\n): HintPart[] {\n const parts: HintPart[] = []\n if (labels.allow) parts.push({ key: bindingKeycap(bindings.allow, mac), label: labels.allow })\n // Use the word \"Cmd\" instead of the ⌘ glyph: the glyph falls back to a CJK\n // character under some font stacks, while \"Cmd\" is always legible.\n if (labels.always && bindings.always) {\n parts.push({ key: bindingKeycap(bindings.always, mac), label: labels.always })\n }\n if (labels.reject) parts.push({ key: bindingKeycap(bindings.reject, mac), label: labels.reject })\n return parts\n}\n\n/** 纯函数:提示内容的签名,用于判断是否需要重建。 */\nexport function hintSignature(parts: readonly HintPart[]): string {\n return parts.map((part) => `${part.key}=${part.label}`).join('|')\n}\n\nconst HINT_CSS = [\n 'margin-right:auto',\n 'display:inline-flex',\n 'flex-wrap:wrap',\n 'align-items:center',\n 'gap:6px',\n 'font-size:12px',\n 'line-height:18px',\n 'color:var(--dsw-alias-label-tertiary,#8b919b)',\n 'user-select:none',\n 'pointer-events:none',\n].join(';')\n\nconst KEYCAP_CSS = [\n 'display:inline-flex',\n 'align-items:center',\n 'justify-content:center',\n 'height:18px',\n 'padding:0 5px',\n 'border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.35))',\n 'border-bottom-width:2px',\n 'border-radius:5px',\n 'background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.08))',\n 'font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace)',\n 'font-size:11px',\n 'line-height:1',\n 'letter-spacing:.2px',\n].join(';')\n\nconst PAIR_CSS = 'display:inline-flex;align-items:center;gap:5px'\nconst SEPARATOR_CSS = 'opacity:.45;margin:0 2px'\n\nfunction labelOf(button: HTMLButtonElement | undefined): string | undefined {\n if (!button) return undefined\n const text = button.textContent?.trim()\n return text ? text : undefined\n}\n\nfunction buildHint(doc: Document, parts: readonly HintPart[]): HTMLElement {\n const hint = doc.createElement('div')\n hint.setAttribute(HINT_ATTR, '')\n hint.setAttribute('role', 'note')\n hint.setAttribute('aria-hidden', 'true')\n hint.style.cssText = HINT_CSS\n parts.forEach((part, index) => {\n if (index > 0) {\n const separator = doc.createElement('span')\n separator.textContent = SEPARATOR\n separator.style.cssText = SEPARATOR_CSS\n hint.append(separator)\n }\n const pair = doc.createElement('span')\n pair.style.cssText = PAIR_CSS\n const keycap = doc.createElement('span')\n keycap.textContent = part.key\n keycap.style.cssText = KEYCAP_CSS\n const label = doc.createElement('span')\n label.textContent = part.label\n pair.append(keycap, label)\n hint.append(pair)\n })\n return hint\n}\n\nfunction removeHints(doc: Document): void {\n for (const hint of doc.querySelectorAll(`[${HINT_ATTR}]`)) hint.remove()\n}\n\nexport interface KeyHintOptions {\n /** 用于区分 Cmd/Ctrl;默认读 navigator.platform。 */\n platform?: string | null\n /** 当前绑定;设置页保存后会派发 BINDINGS_CHANGED_EVENT 触发重建。 */\n getBindings?: () => ApprovalBindings\n}\n\n/** 安装审批卡键盘提示,返回卸载函数。 */\nexport function installKeyHints(doc: Document, options: KeyHintOptions = {}): () => void {\n const platform = options.platform ?? doc.defaultView?.navigator?.platform\n const mac = isMacPlatform(platform)\n const getBindings = options.getBindings ?? (() => DEFAULT_BINDINGS)\n let disposed = false\n\n const syncCard = (card: Element): void => {\n const buttons = actionButtons(card)\n const existing = card.querySelector(`[${HINT_ATTR}]`)\n const answered = card.getAttribute('aria-busy') === 'true'\n if (answered || buttons.length < 2 || buttons[0].disabled || buttons[1].disabled) {\n existing?.remove()\n return\n }\n const always = buttons.length >= 3 && !buttons[2].disabled ? buttons[2] : undefined\n const parts = hintParts({\n allow: labelOf(buttons[1]),\n always: labelOf(always),\n reject: labelOf(buttons[0]),\n }, mac, getBindings())\n if (parts.length === 0) {\n existing?.remove()\n return\n }\n const signature = hintSignature(parts)\n if (existing && existing.getAttribute('data-signature') === signature) return\n existing?.remove()\n const row = buttons[0].parentElement\n if (!row) return\n const hint = buildHint(doc, parts)\n hint.setAttribute('data-signature', signature)\n row.insertBefore(hint, row.firstChild)\n }\n\n const sync = (): void => {\n if (disposed) return\n const cards = doc.querySelectorAll(CARD_SELECTOR)\n if (cards.length === 0) {\n removeHints(doc)\n return\n }\n for (const card of cards) syncCard(card)\n }\n\n const observer = new MutationObserver(sync)\n observer.observe(doc.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-busy', 'disabled'],\n })\n const view = doc.defaultView\n view?.addEventListener?.(BINDINGS_CHANGED_EVENT, sync)\n sync()\n\n return () => {\n disposed = true\n observer.disconnect()\n view?.removeEventListener?.(BINDINGS_CHANGED_EVENT, sync)\n removeHints(doc)\n }\n}\n","/**\n * 功能二:权限策略 —— 去掉「完全权限」选项,新会话默认「自动审查」。\n *\n * 会话权限有四个预设值:read-only(仅可查看)、workspace-write(工作区内\n * 修改)、danger-full-access(完全权限)、auto(自动审查,EXP)。「自动\n * 审查」由实验层 @deepseek-ai/dsh-experimental-auto-review 提供,开启后才\n * 出现在当前会话的选择器里;通用设置不提供 auto,新会话默认值里也选不到它。\n *\n * 本模块做两件事:\n * 1. 界面移除「完全权限」:观察 DOM,把选择器/菜单/设置下拉里标签为「完全\n * 权限 / Full access」的选项摘掉。只动界面,手动输入命令仍可达。\n * 2. 新建/空白会话默认「自动审查」:首次见到空白顶层会话且其权限不是 auto\n * 时,通过宿主命令通道 `/permission auto` 切过去。已处理过的会话 id 会\n * 持久化在 localStorage(`dsh.better-chat.permission-handled.v1`),且已\n * 有对话内容的会话(`blank === false`)和子代理会话不会被改写;用户手\n * 动切回只读/工作区修改后,刷新或重载也不会被覆盖。\n */\n\n/** 完全权限的预设机器值。 */\nexport const FULL_ACCESS_PRESET = 'danger-full-access'\n/** 自动审查的预设机器值。 */\nexport const AUTO_REVIEW_PRESET = 'auto'\n/** 完全权限在各语言界面里的选项标签(选项文字以标签开头)。 */\nexport const FULL_ACCESS_LABELS = ['完全权限', 'Full access']\n/** 已处理会话 id 的浏览器持久化键,避免刷新后覆盖用户手动改过的权限。 */\nexport const HANDLED_STORAGE_KEY = 'dsh.better-chat.permission-handled.v1'\nconst MAX_HANDLED_IDS = 500\n\n/** 纯判定:一段选项文字是否就是「完全权限」选项(标签打头,或恰好相等)。 */\nexport function isFullAccessLabel(text: unknown): boolean {\n if (typeof text !== 'string') return false\n const trimmed = text.trim()\n return FULL_ACCESS_LABELS.some((label) => trimmed === label || trimmed.startsWith(label))\n}\n\n/** 纯判定:这个会话现在是否应该被切到自动审查。 */\nexport function shouldAutoSwitch(preset: string | undefined | null, alreadyHandled: boolean): boolean {\n return preset !== undefined && preset !== null && preset !== AUTO_REVIEW_PRESET && !alreadyHandled\n}\n\nexport interface LiveSession {\n id: string\n live: any\n}\n\n/**\n * 防御式枚举宿主的 live 会话:\n * 1. `keys() + binding()`(测试桩或旧形状)\n * 2. DSH 0.2.2 `ClientSessions`:`scopes` Map 与 `list.getSnapshot()`(`ids` / `byId`)配合 `binding(id)`\n * 3. `list()` 函数回退\n * 服务形状对不上时安静返回空数组,绝不抛错。\n */\nexport function liveSessions(sessions: any): LiveSession[] {\n const out: LiveSession[] = []\n if (!sessions || typeof sessions !== 'object') return out\n try {\n if (typeof sessions.keys === 'function' && typeof sessions.binding === 'function') {\n for (const id of sessions.keys()) {\n const live = sessions.binding(id)?.session\n if (live) out.push({ id, live })\n }\n return out\n }\n if (typeof sessions.binding === 'function' || sessions.scopes instanceof Map) {\n const seen = new Set<string>()\n const addCandidate = (id: unknown) => {\n if (typeof id !== 'string' || !id || seen.has(id)) return\n const live =\n (typeof sessions.binding === 'function' ? sessions.binding(id)?.session : undefined) ??\n (sessions.scopes instanceof Map ? sessions.scopes.get(id)?.binding?.session : undefined)\n if (live) {\n seen.add(id)\n out.push({ id, live })\n }\n }\n if (sessions.scopes instanceof Map) {\n for (const id of sessions.scopes.keys()) addCandidate(id)\n }\n const listSnap = typeof sessions.list?.getSnapshot === 'function' ? sessions.list.getSnapshot() : undefined\n if (Array.isArray(listSnap?.ids)) {\n for (const id of listSnap.ids) addCandidate(id)\n }\n if (listSnap?.byId && typeof listSnap.byId === 'object') {\n for (const id of Object.keys(listSnap.byId)) addCandidate(id)\n }\n if (out.length > 0 || typeof sessions.list !== 'function') return out\n }\n if (typeof sessions.list === 'function') {\n for (const session of (sessions.list() ?? []) as any[]) {\n if (session && session.sessionId) out.push({ id: session.sessionId, live: session })\n }\n }\n } catch {\n // 服务形状不同:放弃枚举\n }\n return out\n}\n\n/**\n * 读会话当前的权限预设值(投影不可用时返回 undefined)。\n * 兼容 DSH 0.2.2 的 `{ currentValue: string }` 投影视图与直接返回字符串的测试桩。\n */\nexport function currentPreset(live: any): string | undefined {\n try {\n const snap = live?.projections?.faceOf?.('permissions')?.getSnapshot?.()\n if (typeof snap === 'string') return snap\n if (snap && typeof snap === 'object' && typeof (snap as { currentValue?: unknown }).currentValue === 'string') {\n return (snap as { currentValue: string }).currentValue\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * 判定会话是否允许执行首次默认自动审查切换:\n * - 已有对话内容的会话(`blank === false`)不改;\n * - 子代理会话(`origin === 'subagent'`)不改;\n * - 其余空白新建会话(以及未提供 blank 元数据的轻量测试桩)允许首次切换。\n */\nexport function isAutoSwitchEligible(id: string, live: any, sessions?: any): boolean {\n try {\n if (live?.getSnapshot?.()?.blank === false) return false\n const summary = sessions?.list?.getSnapshot?.()?.byId?.[id]\n if (summary?.blank === false) return false\n if (summary?.origin === 'subagent') return false\n } catch {\n // 忽略元数据读取异常\n }\n return true\n}\n\nfunction loadHandledIds(doc: Document): Set<string> {\n const set = new Set<string>()\n try {\n const storage = (doc as any)?.defaultView?.localStorage\n const raw = storage?.getItem?.(HANDLED_STORAGE_KEY)\n if (typeof raw === 'string' && raw) {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n for (const item of parsed) {\n if (typeof item === 'string' && item) set.add(item)\n }\n }\n }\n } catch {\n // localStorage 不可用时仅在内存保存\n }\n return set\n}\n\nfunction saveHandledIds(doc: Document, set: Set<string>): void {\n try {\n const storage = (doc as any)?.defaultView?.localStorage\n if (!storage?.setItem) return\n const items = [...set].slice(-MAX_HANDLED_IDS)\n storage.setItem(HANDLED_STORAGE_KEY, JSON.stringify(items))\n } catch {\n // 忽略写入异常\n }\n}\n\n/**\n * 把「完全权限」选项从当前文档里摘掉:原生 select 的 option、弹出\n * 选择器(role=listbox)与菜单(role=menu)里的 option/menuitem。\n * @returns 摘掉的个数\n */\nexport function pruneFullAccess(doc: Document): number {\n let removed = 0\n for (const option of doc.querySelectorAll('option')) {\n if (isFullAccessLabel(option.textContent)) {\n option.remove()\n removed++\n }\n }\n for (const item of doc.querySelectorAll('[role=\"listbox\"] [role=\"option\"], [role=\"menu\"] [role=\"menuitem\"]')) {\n if (isFullAccessLabel(item.textContent)) {\n item.remove()\n removed++\n }\n }\n return removed\n}\n\nexport interface PolicyTimers {\n setInterval?: (fn: () => void, ms: number) => number\n clearInterval?: (id: number) => void\n setTimeout: (fn: () => void, ms: number) => number\n clearTimeout: (id: number) => void\n}\n\nconst defaultTimers: Required<PolicyTimers> = {\n setInterval: (fn, ms) => setInterval(fn, ms) as unknown as number,\n clearInterval: (id) => clearInterval(id),\n setTimeout: (fn, ms) => setTimeout(fn, ms) as unknown as number,\n clearTimeout: (id) => clearTimeout(id),\n}\n\n/**\n * 安装权限策略:\n * 1. 观察 DOM、摘掉「完全权限」选项;\n * 2. 观察/轮询空白新建会话,首次见到时自动切到 `auto`(自动审查)。\n * @returns 卸载函数\n */\nexport function installPermissionPolicy(\n doc: Document,\n getSessions?: () => any,\n timers: PolicyTimers = defaultTimers,\n): () => void {\n let disposed = false\n let scanTimer = 0\n const setTimerInterval = timers.setInterval ?? defaultTimers.setInterval\n const clearTimerInterval = timers.clearInterval ?? defaultTimers.clearInterval\n const scheduleScan = (): void => {\n if (disposed || scanTimer) return\n scanTimer = timers.setTimeout(() => {\n scanTimer = 0\n if (!disposed) pruneFullAccess(doc)\n }, 120)\n }\n const observer = new MutationObserver(scheduleScan)\n if (doc.body) observer.observe(doc.body, { childList: true, subtree: true })\n pruneFullAccess(doc)\n\n const handled = loadHandledIds(doc)\n const inFlight = new Set<string>()\n const projectionUnsubs = new Map<string, () => void>()\n let listUnsub: (() => void) | undefined\n\n const markHandled = (id: string): void => {\n if (!handled.has(id)) {\n handled.add(id)\n saveHandledIds(doc, handled)\n }\n const unsub = projectionUnsubs.get(id)\n if (unsub) {\n projectionUnsubs.delete(id)\n try { unsub() } catch { /* ignore */ }\n }\n }\n\n const watchProjection = (id: string, live: any): void => {\n if (projectionUnsubs.has(id) || handled.has(id)) return\n const face = live?.projections?.faceOf?.('permissions')\n if (typeof face?.subscribe !== 'function') return\n try {\n const unsub = face.subscribe(() => {\n if (!disposed) void tick()\n })\n if (typeof unsub === 'function') projectionUnsubs.set(id, unsub)\n } catch {\n // ignore\n }\n }\n\n const tick = async (): Promise<void> => {\n if (disposed || typeof getSessions !== 'function') return\n let sessions: any\n try {\n sessions = getSessions()\n } catch {\n return\n }\n if (!listUnsub && typeof sessions?.list?.subscribe === 'function') {\n try {\n listUnsub = sessions.list.subscribe(() => {\n if (!disposed) void tick()\n })\n } catch {\n // ignore\n }\n }\n for (const { id, live } of liveSessions(sessions)) {\n if (handled.has(id) || inFlight.has(id)) continue\n if (!isAutoSwitchEligible(id, live, sessions)) {\n markHandled(id)\n continue\n }\n const preset = currentPreset(live)\n if (!shouldAutoSwitch(preset, handled.has(id))) {\n if (preset !== undefined && preset !== null) {\n markHandled(id)\n } else {\n watchProjection(id, live)\n }\n continue\n }\n markHandled(id)\n if (typeof live?.command !== 'function') continue\n inFlight.add(id)\n try {\n const result = await live.command(`/permission ${AUTO_REVIEW_PRESET}`)\n if (!result?.ok) {\n console.info('[dsh-better-chat] auto review not applied for session', id, result?.error?.code ?? '')\n }\n } catch {\n console.info('[dsh-better-chat] auto review switch failed for session', id)\n } finally {\n inFlight.delete(id)\n }\n }\n }\n\n const intervalId = typeof getSessions === 'function' ? setTimerInterval(() => { void tick() }, 2500) : 0\n if (typeof getSessions === 'function') void tick()\n\n return () => {\n disposed = true\n observer.disconnect()\n if (scanTimer) timers.clearTimeout(scanTimer)\n if (intervalId) clearTimerInterval(intervalId)\n if (listUnsub) {\n try { listUnsub() } catch { /* ignore */ }\n listUnsub = undefined\n }\n for (const unsub of projectionUnsubs.values()) {\n try { unsub() } catch { /* ignore */ }\n }\n projectionUnsubs.clear()\n }\n}\n","/**\n * 功能三:插件商店「更新」按钮。\n *\n * DSH 只给官方插件原地更新;从自定义索引装的插件在发现页只有「有新版本」\n * 标签、没有按钮。这里补一个真按钮:数据与动作都走宿主自己的远程服务\n * ——pluginMarket 查索引和安装状态,pluginManager.installBundle 按索引\n * 给出的精确 spec 覆盖安装——与官方安装流程同一套接口,不模拟点击、\n * 不动官方状态。\n *\n * 服务经子插件声明 inject 取用:主插件保持自己的 inject,商店功能不\n * 依赖这些服务;未启用实验性插件索引时子插件不生效,本功能静默关闭。\n */\n\nconst UPDATE_LABELS = ['有新版本', 'Update available']\n\nexport interface StoreUpdate {\n name: string\n title: string\n installedVersion: string\n version: string\n spec: string\n registry?: string\n}\n\n/** 索引条目的本地化标题在当前语言下的文本(与发现页行内展示一致)。 */\nexport function localizedTitle(title: unknown, lang: string): string {\n if (typeof title === 'string') return title\n if (!title || typeof title !== 'object') return ''\n const record = title as Record<string, unknown>\n const chain = [lang, lang && lang.split('-')[0], 'zh-CN', 'en']\n for (const key of chain) {\n if (key && typeof record[key] === 'string' && record[key]) return record[key] as string\n }\n const values = Object.values(record)\n return typeof values[0] === 'string' ? (values[0] as string) : ''\n}\n\n/** 从各索引的搜索结果里挑出「有新版本」的条目,整理成可执行的更新计划。 */\nexport function pickUpdates(searchResults: any[], lang: string): StoreUpdate[] {\n const updates: StoreUpdate[] = []\n for (const result of searchResults ?? []) {\n const entries = result?.value?.entries ?? result?.entries ?? []\n for (const entry of entries as any[]) {\n if (entry?.installation?.status !== 'update-available') continue\n const versions = entry.versions ?? []\n const version = versions.find((candidate: any) => candidate.version === entry.defaultVersion) ?? versions[0]\n const spec = version?.install?.spec\n if (!entry.name || !version?.version || !spec) continue\n updates.push({\n name: entry.name,\n title: localizedTitle(entry.title, lang) || entry.name,\n installedVersion: entry.installation.installedVersion ?? '',\n version: version.version,\n spec,\n registry: version.install.registry,\n })\n }\n }\n return updates\n}\n\n/** 执行一次更新:按索引 spec 覆盖安装,宿主结果信封原样返回。 */\nexport async function runUpdate(remote: any, update: StoreUpdate, makeRequestId?: () => string | undefined): Promise<any> {\n const requestId = makeRequestId ? makeRequestId() : 'better-chat-update-' + Date.now()\n return remote.pluginManager.installBundle(update.spec, {\n enabled: true,\n requestId,\n ...(update.registry ? { registry: update.registry } : {}),\n })\n}\n\n/**\n * 发现页里某个插件的行:状态标签本身是个按钮,从它向上找第一个\n * 同时包含插件标题、且文本总量还像一行的祖先。\n */\nexport function findUpdateRow(doc: Document, title: string): Element | null {\n for (const element of doc.querySelectorAll('button')) {\n if (!UPDATE_LABELS.includes(element.textContent?.trim() ?? '')) continue\n let node: Element | null = element\n for (let depth = 0; depth < 6 && node; depth++) {\n node = node.parentElement\n if (node && node.textContent?.includes(title) && node.textContent.length < 600) return node\n }\n }\n return null\n}\n\n/** 更新按钮的点击处理:确认 → 调宿主覆盖安装 → 按结果改按钮文案。 */\nexport function makeUpdateClickHandler(\n doc: Document,\n getRemote: () => any,\n update: StoreUpdate,\n button: HTMLButtonElement,\n): (event?: Event) => Promise<void> {\n return async (event?: Event): Promise<void> => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n const view = doc.defaultView as (Window & typeof globalThis) | null\n const ask = view?.confirm ?? (globalThis as any).confirm\n const message = '更新「' + update.title + '」'\n + (update.installedVersion ? ' ' + update.installedVersion : '')\n + ' → ' + update.version + '?\\n会直接覆盖安装新版,插件数据保留。'\n if (ask && !ask.call(view ?? globalThis, message)) return\n button.disabled = true\n button.textContent = '更新中…'\n try {\n const result = await runUpdate(getRemote(), update, () => (globalThis as any).crypto?.randomUUID?.() ?? undefined)\n if (result?.value?.application === 'applied') {\n button.textContent = '已更新,重启 DSH 后生效'\n } else {\n console.error('[dsh-better-chat] update failed for', update.name, result?.value?.error ?? result)\n button.disabled = false\n button.textContent = '更新失败,点此重试'\n }\n } catch (error) {\n console.error('[dsh-better-chat] update failed for', update.name, error)\n button.disabled = false\n button.textContent = '更新失败,点此重试'\n }\n }\n}\n\nexport interface StoreTimers {\n setInterval: (fn: () => void, ms: number) => number\n clearInterval: (id: number) => void\n}\n\n/** 发现页增强:轮询索引状态,把「更新」按钮挂到有新版本的行上。 */\nexport function installStoreUpdateButtons(\n doc: Document,\n getRemote: () => any,\n timers: StoreTimers = {\n setInterval: (fn, ms) => setInterval(fn, ms) as unknown as number,\n clearInterval: (id) => clearInterval(id),\n },\n): () => void {\n let disposed = false\n let updates: StoreUpdate[] = []\n const decorate = (): void => {\n for (const update of updates) {\n const row = findUpdateRow(doc, update.title)\n if (!row || row.querySelector('[data-better-chat-update]')) continue\n const button = doc.createElement('button')\n button.type = 'button'\n button.setAttribute('data-better-chat-update', update.name)\n button.textContent = '更新到 ' + update.version\n button.style.cssText = 'flex:none;margin-left:8px;padding:2px 10px;border:1px solid #7f7f7f55;border-radius:999px;background:transparent;color:inherit;font-size:12px;cursor:pointer'\n button.addEventListener('click', makeUpdateClickHandler(doc, getRemote, update, button))\n row.appendChild(button)\n }\n }\n const refresh = async (): Promise<void> => {\n try {\n const remote = getRemote()\n if (!remote?.pluginMarket || !remote?.pluginManager) return\n const indexes = await remote.pluginMarket.listIndexes()\n const urls = (indexes?.value ?? indexes ?? []).map((entry: any) => entry?.url).filter(Boolean)\n const results: any[] = []\n for (const url of urls) {\n results.push(await remote.pluginMarket.search(url, { sort: { kind: 'index' }, offset: 0, limit: 100 }))\n }\n if (disposed) return\n updates = pickUpdates(results, doc.documentElement?.lang || 'zh-CN')\n decorate()\n } catch {\n // 索引服务不可用(未启用实验性插件索引等):静默关闭本功能。\n }\n }\n const observer = new MutationObserver(() => decorate())\n observer.observe(doc.documentElement, { childList: true, subtree: true })\n const timer = timers.setInterval(() => { void refresh() }, 30000)\n void refresh()\n return () => {\n disposed = true\n observer.disconnect()\n timers.clearInterval(timer)\n }\n}\n\n/** 商店更新子插件:单独声明远程服务 inject,与主功能互相隔离。 */\nexport const storeUpdatePlugin = {\n name: 'dsh-better-chat-store-update',\n inject: ['remote', 'remote.pluginMarket', 'remote.pluginManager'],\n apply(childCtx: any): void {\n childCtx.effect(\n () => installStoreUpdateButtons(document, () => childCtx.remote),\n 'dsh-better-chat: store update buttons',\n )\n },\n}\n","export type SettingsCopyKey =\n | 'nav'\n | 'openTitle'\n | 'openDescription'\n | 'glassTitle'\n | 'glassDescription'\n | 'foldTitle'\n | 'foldDescription'\n | 'foldNone'\n | 'foldStandard'\n | 'foldSummary'\n | 'shortcutTitle'\n | 'shortcutDescription'\n | 'shortcutAllow'\n | 'shortcutAlways'\n | 'shortcutReject'\n | 'shortcutRecording'\n | 'shortcutDisabled'\n | 'shortcutDisable'\n | 'shortcutReset'\n | 'shortcutErrorKey'\n | 'shortcutErrorModifier'\n | 'shortcutErrorConflict';\n\nexport type SettingsCopy = Record<SettingsCopyKey, string>;\n\nexport const en: SettingsCopy = {\n nav: 'Better Chat',\n openTitle: 'Open deliverables in built-in panel',\n openDescription: 'Off by default: chips and inline file mentions open in the system app. Turn this on to preview them in the right Sidebar, matching official chat. Reveal and folder actions still use the system file manager.',\n glassTitle: 'Translucent frosted glass',\n glassDescription: 'Off by default: reading chrome stays opaque, matching the current Host look. Turn this on to let wallpaper and skins show through the panel; path and count chips stay clear until hover or focus.',\n foldTitle: 'Auto-fold process',\n foldDescription: 'Default on: collapses earlier steps when new thoughts appear. Turn off to keep all thinking and tools expanded in full.',\n foldNone: 'Off',\n foldStandard: 'On',\n foldSummary: 'Summary',\n shortcutTitle: 'Approval card shortcuts',\n shortcutDescription: 'Click a keycap and press the new combination. Allow-type actions use Enter, reject uses Esc; modifiers are free. Esc alone cancels while recording. Stored in the plugin config.',\n shortcutAllow: 'Allow once',\n shortcutAlways: 'Always allow',\n shortcutReject: 'Reject',\n shortcutRecording: 'Press keys…',\n shortcutDisabled: 'Not set',\n shortcutDisable: 'Clear',\n shortcutReset: 'Restore defaults',\n shortcutErrorKey: 'Allow actions must use Enter; reject must use Esc.',\n shortcutErrorModifier: 'Always allow needs at least one modifier key.',\n shortcutErrorConflict: 'That combination is already used by another action.',\n};\n\nexport const zh: SettingsCopy = {\n nav: 'Better Chat',\n openTitle: '在内置面板中打开产物',\n openDescription: '默认关闭:产物芯片和正文中的文件提及会用系统应用打开。打开后与官方对话一致,在右侧栏预览。访达 / 资源管理器中的显示与打开所在文件夹不受此开关控制。',\n glassTitle: '半透明毛玻璃',\n glassDescription: '默认关闭:阅读栏保持不透明,和现在的 Host 观感一致。打开后透出宿主壁纸与皮肤;路径、行数等标签静止时透明,悬停或聚焦才显出轮廓。',\n foldTitle: '自动折叠过程',\n foldDescription: '默认开启:新思考产生时自动折叠此前步骤。关闭后全程展开,完整保留原始思考与工具流。',\n foldNone: '关闭',\n foldStandard: '开启',\n foldSummary: '摘要',\n shortcutTitle: '审批卡快捷键',\n shortcutDescription: '点键帽后按下新的组合键。允许类只能用 Enter,拒绝只能用 Esc,修饰键随意;录制时单独按 Esc 取消。保存在插件配置里,重启后仍在。',\n shortcutAllow: '允许(单次)',\n shortcutAlways: '始终允许',\n shortcutReject: '拒绝',\n shortcutRecording: '按下组合键…',\n shortcutDisabled: '未设置',\n shortcutDisable: '清除',\n shortcutReset: '恢复默认',\n shortcutErrorKey: '允许类动作只能用 Enter,拒绝只能用 Esc。',\n shortcutErrorModifier: '「始终允许」至少需要一个修饰键(Ctrl/Shift/Alt)。',\n shortcutErrorConflict: '这个组合键已经被另一个动作占用。',\n};\n\nexport function settingsLanguage(tag: string | undefined): 'zh' | 'en' {\n return (tag ?? '').toLowerCase().startsWith('zh') ? 'zh' : 'en';\n}\n\nexport function settingsCopyFor(tag: string | undefined): SettingsCopy {\n return settingsLanguage(tag) === 'zh' ? zh : en;\n}\n","/** Three-stop fold intensity persisted on `dsh.reader.v1`. Default is standard. */\nexport type FoldIntensity = 0 | 1 | 2;\n\nexport const FOLD_INTENSITY_DEFAULT: FoldIntensity = 1;\n\n/** Level 0: nothing auto-folds. Level 1: current-main choreography. Level 2: process summaries. */\nexport function foldIntensityOf(state: unknown): FoldIntensity {\n const rec = state && typeof state === 'object' ? state as Record<string, unknown> : {};\n if (rec.foldIntensity === 0 || rec.foldIntensity === 1 || rec.foldIntensity === 2) return rec.foldIntensity;\n if (rec.processOnly === true) return 2;\n if (rec.autoFold === false) return 0;\n return FOLD_INTENSITY_DEFAULT;\n}\n\nexport function frostedGlassOf(state: unknown): boolean {\n if (state && typeof state === 'object' && 'frostedGlass' in state) {\n return (state as { frostedGlass?: unknown }).frostedGlass === true;\n }\n return state === true;\n}\n\nexport function autoFoldFromIntensity(intensity: FoldIntensity): boolean {\n return intensity !== 0;\n}\n\nexport function processOnlyFromIntensity(intensity: FoldIntensity): boolean {\n return intensity === 2;\n}\n","import { isAbsoluteWorkspacePath } from '../workspace-path.js';\n\nexport type DeliverableOpenMode = 'external' | 'sidebar';\n\nexport interface OpenModeSnapshot {\n getSnapshot: () => { deliverableOpenMode?: DeliverableOpenMode };\n subscribe?: (fn: () => void) => () => void;\n}\n\nexport function deliverableOpenModeOf(value: unknown): DeliverableOpenMode {\n return value === 'sidebar' ? 'sidebar' : 'external';\n}\n\nexport function modeFromSnapshot(store: OpenModeSnapshot | undefined): DeliverableOpenMode {\n try {\n return deliverableOpenModeOf(store?.getSnapshot()?.deliverableOpenMode);\n } catch {\n return 'external';\n }\n}\n\n/** Workspace-folder affordances stay on the OS opener, not the Sidebar switch. */\nexport function isFolderOpenPath(path: string): boolean {\n return path === '.' || path === '';\n}\n\nfunction encodeSegment(segment: string): string {\n return encodeURIComponent(segment).replace(/%3A/gi, ':');\n}\n\nfunction encodePath(path: string): string {\n return path.split('/').map(encodeSegment).join('/');\n}\n\n/**\n * Session-scoped `dsh-resource://file/session/<id>/…` address.\n * Matches official `fileAddressFor` / `sessionFileAddress` (0.1.5).\n */\nexport function fileAddressFor(sessionId: string, cwd: string | undefined, path: string): string {\n const normalized = path.replace(/\\\\/g, '/');\n const address = (relative: string): string => {\n const cleaned = relative.replace(/\\\\/g, '/').replace(/^(?:\\.\\/)+/, '');\n return `dsh-resource://file/session/${encodeSegment(sessionId)}/${encodePath(cleaned)}`;\n };\n if (!isAbsoluteWorkspacePath(normalized)) return address(normalized);\n const root = cwd === undefined ? '' : cwd.replace(/\\\\/g, '/').replace(/\\/+$/, '');\n if (root !== '' && normalized === root) return address('');\n if (root !== '' && normalized.startsWith(`${root}/`)) return address(normalized.slice(root.length + 1));\n return address(normalized);\n}\n\nexport function resolveOpenWorkspacePath(\n cwd: string | undefined,\n path: string,\n resolveWorkspacePath: (cwd: string | undefined, path: string) => string,\n): string {\n return isFolderOpenPath(path) ? (cwd ?? '.') : resolveWorkspacePath(cwd, path);\n}\n\nexport async function openDeliverableFile(args: {\n path: string;\n mode: DeliverableOpenMode;\n sessionId: string;\n cwd: string | undefined;\n resolveWorkspacePath: (cwd: string | undefined, path: string) => string;\n openExternal: (absolutePath: string) => Promise<void>;\n openSidebar?: (address: string) => void;\n fileAddressFor?: (sessionId: string, cwd: string | undefined, path: string) => string;\n warn?: (message: string, extra?: unknown) => void;\n}): Promise<'sidebar' | 'external'> {\n const targetPath = resolveOpenWorkspacePath(args.cwd, args.path, args.resolveWorkspacePath);\n const useSidebar = args.mode === 'sidebar' && !isFolderOpenPath(args.path);\n if (useSidebar) {\n if (typeof args.openSidebar !== 'function') {\n args.warn?.('[dsh-better-display] sidebarRight.openResource is not available; falling back to system app');\n } else {\n try {\n const address = (args.fileAddressFor ?? fileAddressFor)(args.sessionId, args.cwd, args.path);\n args.openSidebar(address);\n return 'sidebar';\n } catch (error) {\n args.warn?.('[dsh-better-display] sidebar open failed; falling back to system app', error);\n }\n }\n }\n await args.openExternal(targetPath);\n return 'external';\n}\n","import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';\nimport { frostedGlassOf, type FoldIntensity } from './fold-intensity.js';\nimport {\n BINDINGS_CHANGED_EVENT,\n bindingKeycap,\n normalizeBindings,\n validateBinding,\n type ApprovalAction,\n type ApprovalBinding,\n} from './chat/bindings.js';\nimport type { ChatPrefs } from './chat/bindings-store.js';\nimport { deliverableOpenModeOf, type DeliverableOpenMode } from './open-file.js';\nimport { settingsCopyFor, type SettingsCopy, type SettingsCopyKey } from './settings-copy.js';\nimport css from './SettingsSection.module.css';\n\nexport interface ReaderPrefsSnapshot {\n deliverableOpenMode?: DeliverableOpenMode;\n frostedGlass?: boolean;\n foldIntensity?: FoldIntensity;\n autoFold?: boolean;\n processOnly?: boolean;\n}\n\nexport interface OpenPrefs {\n getSnapshot: () => ReaderPrefsSnapshot;\n subscribe: (fn: () => void) => () => void;\n actions: {\n setDeliverableOpenMode: (value: DeliverableOpenMode) => void;\n setFrostedGlass: (value: boolean) => void;\n setFoldIntensity?: (value: FoldIntensity) => void;\n setAutoFold?: (value: boolean) => void;\n };\n}\n\nexport interface BetterDisplaySettingsInjected {\n prefs?: OpenPrefs;\n chat?: ChatPrefs;\n copy?: SettingsCopy;\n languageTag?: string;\n}\n\ntype SettingsProps = BetterDisplaySettingsInjected & {\n /** Official settings.section owner share; unused here. */\n close?: () => void;\n t?: (key: SettingsCopyKey) => string;\n};\n\nfunction text(props: SettingsProps, copy: SettingsCopy, key: keyof SettingsCopy): string {\n if (typeof props.t === 'function') {\n try {\n const value = props.t(key);\n if (typeof value === 'string' && value.length > 0 && value !== key) return value;\n } catch {\n // Fall through to the bundled dictionaries.\n }\n }\n return copy[key];\n}\n\nexport function SettingsSection(props: SettingsProps) {\n const copy = props.copy ?? settingsCopyFor(props.languageTag);\n const prefs = props.prefs;\n const snap = useSyncExternalStore(\n prefs?.subscribe ?? (() => () => {}),\n () => prefs?.getSnapshot() ?? ({} as ReaderPrefsSnapshot),\n () => ({} as ReaderPrefsSnapshot),\n );\n const mode = deliverableOpenModeOf(snap.deliverableOpenMode);\n const glass = frostedGlassOf(snap);\n const autoFold = snap.autoFold !== false && snap.foldIntensity !== 0;\n const setMode = (value: DeliverableOpenMode) => {\n prefs?.actions.setDeliverableOpenMode(value);\n };\n const on = mode === 'sidebar';\n\n // 审批快捷键:读插件配置(dsh.better-chat.v1),保存后派发事件让卡片提示立即重建。\n const chat = props.chat;\n const chatSnap = useSyncExternalStore(\n chat?.subscribe ?? (() => () => {}),\n () => chat?.getSnapshot() ?? ({ bindings: undefined } as never),\n () => ({ bindings: undefined } as never),\n );\n const bindings = normalizeBindings(chatSnap);\n const mac = typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.platform);\n const [recording, setRecording] = useState<ApprovalAction | null>(null);\n const [keyError, setKeyError] = useState<string | undefined>();\n\n const announceBindings = useCallback(() => {\n if (typeof window === 'undefined') return;\n window.dispatchEvent(new CustomEvent(BINDINGS_CHANGED_EVENT));\n }, []);\n\n useEffect(() => {\n if (!recording || !chat) return;\n const onKey = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (event.key === 'Escape' && recording !== 'reject'\n && !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {\n setRecording(null);\n setKeyError(undefined);\n return;\n }\n const key = event.key === 'Enter' ? 'Enter' : event.key === 'Escape' ? 'Escape' : undefined;\n if (!key) {\n setKeyError(copy.shortcutErrorKey);\n return;\n }\n const binding: ApprovalBinding = {\n key,\n primary: event.ctrlKey || event.metaKey,\n shift: event.shiftKey,\n alt: event.altKey,\n };\n const verdict = validateBinding(recording, binding, bindings);\n if (verdict === 'key') { setKeyError(copy.shortcutErrorKey); return; }\n if (verdict === 'modifier') { setKeyError(copy.shortcutErrorModifier); return; }\n if (verdict === 'conflict') { setKeyError(copy.shortcutErrorConflict); return; }\n chat.actions.setApprovalBinding(recording, binding);\n announceBindings();\n setRecording(null);\n setKeyError(undefined);\n };\n window.addEventListener('keydown', onKey, true);\n return () => window.removeEventListener('keydown', onKey, true);\n }, [recording, chat, chatSnap, copy, bindings, announceBindings]);\n\n return (\n <div className={css.section} data-better-display-settings>\n {prefs ? (<>\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'openTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'openDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={on}\n className={css.switch}\n data-on={on || undefined}\n data-better-display-open-mode={mode}\n onClick={() => { setMode(on ? 'external' : 'sidebar'); }}\n />\n </div>\n\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'glassTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'glassDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={glass}\n className={css.switch}\n data-on={glass || undefined}\n data-better-display-glass={glass ? 'on' : 'off'}\n onClick={() => { prefs?.actions.setFrostedGlass(!glass); }}\n />\n </div>\n\n <div className={css.row}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, 'foldTitle')}</div>\n <div className={css.desc}>{text(props, copy, 'foldDescription')}</div>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={autoFold}\n className={css.switch}\n data-on={autoFold || undefined}\n data-better-display-auto-fold={autoFold ? 'on' : 'off'}\n onClick={() => {\n prefs?.actions.setAutoFold?.(!autoFold);\n prefs?.actions.setFoldIntensity?.(!autoFold ? 1 : 0);\n }}\n />\n </div>\n </>) : null}\n\n {chat ? (\n <section className={css.block} data-better-chat-shortcuts>\n <div className={css.title}>{text(props, copy, 'shortcutTitle')}</div>\n <p className={css.desc}>{text(props, copy, 'shortcutDescription')}</p>\n {([\n ['allow', 'shortcutAllow', bindings.allow],\n ['always', 'shortcutAlways', bindings.always],\n ['reject', 'shortcutReject', bindings.reject],\n ] as const).map(([action, title, binding]) => (\n <div className={css.row} key={action}>\n <div className={css.rowText}>\n <div className={css.title}>{text(props, copy, title)}</div>\n </div>\n <div className={css.keyActions}>\n <button\n type=\"button\"\n className={css.keyButton}\n data-recording={recording === action || undefined}\n onClick={() => { setKeyError(undefined); setRecording(action); }}\n >\n {recording === action\n ? text(props, copy, 'shortcutRecording')\n : binding ? bindingKeycap(binding, mac) : text(props, copy, 'shortcutDisabled')}\n </button>\n {action === 'always' && binding ? (\n <button\n type=\"button\"\n className={css.button}\n onClick={() => {\n chat.actions.setApprovalBinding('always', null);\n announceBindings();\n setKeyError(undefined);\n }}\n >\n {text(props, copy, 'shortcutDisable')}\n </button>\n ) : null}\n </div>\n </div>\n ))}\n {keyError ? <p className={css.error} data-better-chat-key-error>{keyError}</p> : null}\n <div className={css.actions}>\n <button\n type=\"button\"\n className={css.button}\n onClick={() => {\n chat.actions.resetApprovalBindings();\n announceBindings();\n setRecording(null);\n setKeyError(undefined);\n }}\n >\n {text(props, copy, 'shortcutReset')}\n </button>\n </div>\n </section>\n ) : null}\n </div>\n );\n}\n","import type { Context } from '@deepseek-ai/cordis';\nimport type {} from './settings-slots.js';\nimport { settingsCopyFor, zh, en } from './settings-copy.js';\nimport { SettingsSection, type BetterDisplaySettingsInjected, type OpenPrefs } from './SettingsSection.js';\nimport type { ChatPrefs } from './chat/bindings-store.js';\n\ninterface LocaleFace {\n register?: (ns: string, dicts: { zh: unknown; en: unknown }) => () => void;\n bind?: (ns: string) => (key: string) => string;\n getSnapshot?: () => { locale?: string; language?: string };\n}\n\nfunction languageTag(ctx: Context): string | undefined {\n const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;\n const snap = locale?.getSnapshot?.();\n return snap?.locale ?? snap?.language\n ?? (typeof document !== 'undefined' ? document.documentElement.lang : undefined)\n ?? (typeof navigator !== 'undefined' ? navigator.language : undefined);\n}\n\n/**\n * Own locale namespace and settings-section id. The merged plugin used to reuse\n * dsh-better-display's `better-display` id; while the standalone display plugin\n * is still installed, the two registrations collided and the nav label flipped\n * between \"Better Display\" and \"Better Chat\" depending on load order.\n */\nconst SETTINGS_LOCALE_NS = 'better-chat'\nconst SETTINGS_SECTION_ID = 'better-chat'\n\nexport function installBetterDisplaySettings(ctx: Context, prefs?: OpenPrefs, chat?: ChatPrefs): void {\n const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;\n if (locale?.register) {\n ctx.effect(() => locale.register!(SETTINGS_LOCALE_NS, { zh, en }), 'dsh-better-chat: settings copy');\n }\n const injected = (): BetterDisplaySettingsInjected => ({\n prefs,\n chat,\n copy: settingsCopyFor(languageTag(ctx)),\n languageTag: languageTag(ctx),\n });\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: SETTINGS_SECTION_ID,\n order: 40,\n label: () => locale?.bind?.(SETTINGS_LOCALE_NS)?.('nav') || settingsCopyFor(languageTag(ctx)).nav,\n locale: locale?.bind ? SETTINGS_LOCALE_NS : undefined,\n inject: injected,\n }, SettingsSection));\n}\n","/**\n * dsh-better-chat 客户端入口。\n *\n * 聊天增强(原 dsh-better-chat):审批键盘/提示、权限 UI、商店更新按钮。\n * 阅读视图(原 dsh-better-display)已移除,不再注册“阅读”页签与文本变换服务;\n * 另保留 Better Chat 设置页(仅审批快捷键录制)。\n *\n * 入口必须导出一个静态字符串 inject 数组(宿主 Cordis 服务注入),\n * 并在这里统一 apply。审批快捷键的配置存在 dsh.better-chat.v1。\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { install as installApprovalKeys } from './chat/approval-keys.js'\nimport { createChatStore, currentBindings } from './chat/bindings-store.js'\nimport { installKeyHints } from './chat/key-hint.js'\nimport { installPermissionPolicy } from './chat/permission-policy.js'\nimport { storeUpdatePlugin } from './chat/store-update.js'\nimport { installBetterDisplaySettings } from './settings.js'\n\nexport const name = 'dsh-better-chat'\n\n/** 阅读视图已移除;这里保留宿主客户端服务注入,聊天增强本身不额外依赖。 */\nexport const inject = [\n 'slots',\n 'sessions',\n 'conversation',\n 'uiConversation',\n 'remote',\n 'remote.session',\n]\n\nexport function apply(ctx: Context): void {\n // 审批快捷键:持久化实例在 apply 里创建,避免模块级单例跨插件重载残留。\n const chatPrefs = createChatStore().create()\n const getBindings = () => currentBindings(chatPrefs)\n\n // 聊天增强:纯 DOM 观察,不依赖任何宿主服务。\n ctx.effect(() => installApprovalKeys(document, getBindings), 'dsh-better-chat: approval key routing')\n ctx.effect(() => installKeyHints(document, { getBindings }), 'dsh-better-chat: approval key hints')\n ctx.effect(\n () => installPermissionPolicy(document, () => (ctx as { sessions?: unknown }).sessions),\n 'dsh-better-chat: permission policy (no full access, auto review by default)',\n )\n try {\n ctx.plugin(storeUpdatePlugin as any)\n } catch {\n // 子插件挂不上(旧宿主等)不影响主功能。\n }\n\n // Better Chat 设置页:仅保留审批快捷键录制(阅读视图已移除,不再有开/玻璃/折叠项)。\n installBetterDisplaySettings(ctx, undefined, chatPrefs)\n}\n"],"mappings":";;;;;;;;;;;EAmCA,MAAa,iBAAkC;GAAE,KAAK;GAAS,SAAS;GAAM,OAAO;GAAO,KAAK;EAAM;EAEvG,MAAa,mBAAqC;GAChD,OAAO;IAAE,KAAK;IAAS,SAAS;IAAO,OAAO;IAAO,KAAK;GAAM;GAChE,QAAQ;GACR,QAAQ;IAAE,KAAK;IAAU,SAAS;IAAO,OAAO;IAAO,KAAK;GAAM;EACpE;;EAGA,MAAa,yBAAyB;;EAGtC,SAAgB,WAAW,QAAyC;GAClE,OAAO,WAAW,WAAW,WAAW;EAC1C;;EAGA,SAAgB,cAAc,SAA0B,KAAsB;GAC5E,MAAM,QAAkB,CAAC;GACzB,IAAI,QAAQ,SAAS,MAAM,KAAK,MAAM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AAG,CAAC,CAAC,CAAC;IAC9F,QAAQ,QAAQ,OAAO,qBAAqB,KAAA;IAC5C,QAAQ;GACV,GAAG,eAAe,CAAC;EACrB;;EC9BA,MAAa,OAAO;;EAGpB,MAAa,SAAS;GACpB;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,SAAgB,MAAM,KAAoB;GAExC,MAAM,YAAY,gBAAgB,CAAC,CAAC,OAAO;GAC3C,MAAM,oBAAoB,gBAAgB,SAAS;GAGnD,IAAI,aAAaC,QAAoB,UAAU,WAAW,GAAG,uCAAuC;GACpG,IAAI,aAAa,gBAAgB,UAAU,EAAE,YAAY,CAAC,GAAG,qCAAqC;GAClG,IAAI,aACI,wBAAwB,gBAAiB,IAA+B,QAAQ,GACtF,6EACF;GACA,IAAI;IACF,IAAI,OAAO,iBAAwB;GACrC,QAAQ,CAER;GAGA,6BAA6B,KAAK,KAAA,GAAW,SAAS;EACxD"} \ No newline at end of file diff --git a/src/client/SettingsSection.tsx b/src/client/SettingsSection.tsx index efd2138..2444d1d 100644 --- a/src/client/SettingsSection.tsx +++ b/src/client/SettingsSection.tsx @@ -33,7 +33,7 @@ export interface OpenPrefs { } export interface BetterDisplaySettingsInjected { - prefs: OpenPrefs; + prefs?: OpenPrefs; chat?: ChatPrefs; copy?: SettingsCopy; languageTag?: string; @@ -59,16 +59,17 @@ function text(props: SettingsProps, copy: SettingsCopy, key: keyof SettingsCopy) export function SettingsSection(props: SettingsProps) { const copy = props.copy ?? settingsCopyFor(props.languageTag); + const prefs = props.prefs; const snap = useSyncExternalStore( - props.prefs.subscribe, - () => props.prefs.getSnapshot() ?? ({} as ReaderPrefsSnapshot), + prefs?.subscribe ?? (() => () => {}), + () => prefs?.getSnapshot() ?? ({} as ReaderPrefsSnapshot), () => ({} as ReaderPrefsSnapshot), ); const mode = deliverableOpenModeOf(snap.deliverableOpenMode); const glass = frostedGlassOf(snap); const autoFold = snap.autoFold !== false && snap.foldIntensity !== 0; const setMode = (value: DeliverableOpenMode) => { - props.prefs.actions.setDeliverableOpenMode(value); + prefs?.actions.setDeliverableOpenMode(value); }; const on = mode === 'sidebar'; @@ -126,6 +127,7 @@ export function SettingsSection(props: SettingsProps) { return ( <div className={css.section} data-better-display-settings> + {prefs ? (<> <div className={css.row}> <div className={css.rowText}> <div className={css.title}>{text(props, copy, 'openTitle')}</div> @@ -154,7 +156,7 @@ export function SettingsSection(props: SettingsProps) { className={css.switch} data-on={glass || undefined} data-better-display-glass={glass ? 'on' : 'off'} - onClick={() => { props.prefs.actions.setFrostedGlass(!glass); }} + onClick={() => { prefs?.actions.setFrostedGlass(!glass); }} /> </div> @@ -171,11 +173,12 @@ export function SettingsSection(props: SettingsProps) { data-on={autoFold || undefined} data-better-display-auto-fold={autoFold ? 'on' : 'off'} onClick={() => { - props.prefs.actions.setAutoFold?.(!autoFold); - props.prefs.actions.setFoldIntensity?.(!autoFold ? 1 : 0); + prefs?.actions.setAutoFold?.(!autoFold); + prefs?.actions.setFoldIntensity?.(!autoFold ? 1 : 0); }} /> </div> + </>) : null} {chat ? ( <section className={css.block} data-better-chat-shortcuts> diff --git a/src/client/index.tsx b/src/client/index.tsx index cc79026..e13e217 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -1,12 +1,12 @@ /** - * dsh-better-chat 客户端入口(合并后)。 + * dsh-better-chat 客户端入口。 * - * 两个半场共用一个 client 产物: - * - 阅读视图(原 dsh-better-display):reader-plugin.tsx 及其整棵 React 源码树; - * - 聊天增强(原 dsh-better-chat):审批键盘/提示、权限 UI、商店更新按钮。 + * 聊天增强(原 dsh-better-chat):审批键盘/提示、权限 UI、商店更新按钮。 + * 阅读视图(原 dsh-better-display)已移除,不再注册“阅读”页签与文本变换服务; + * 另保留 Better Chat 设置页(仅审批快捷键录制)。 * * 入口必须导出一个静态字符串 inject 数组(宿主 Cordis 服务注入), - * 并在这里统一 apply。审批快捷键的配置存在 dsh.better-chat.v1,由设置页写入。 + * 并在这里统一 apply。审批快捷键的配置存在 dsh.better-chat.v1。 */ import type { Context } from '@deepseek-ai/cordis' import { install as installApprovalKeys } from './chat/approval-keys.js' @@ -14,11 +14,11 @@ import { createChatStore, currentBindings } from './chat/bindings-store.js' import { installKeyHints } from './chat/key-hint.js' import { installPermissionPolicy } from './chat/permission-policy.js' import { storeUpdatePlugin } from './chat/store-update.js' -import { apply as applyReader, name as readerName } from './reader-plugin.js' +import { installBetterDisplaySettings } from './settings.js' export const name = 'dsh-better-chat' -/** 阅读视图所需的宿主客户端服务;聊天增强不额外依赖服务。 */ +/** 阅读视图已移除;这里保留宿主客户端服务注入,聊天增强本身不额外依赖。 */ export const inject = [ 'slots', 'sessions', @@ -46,7 +46,6 @@ export function apply(ctx: Context): void { // 子插件挂不上(旧宿主等)不影响主功能。 } - // 阅读视图:注册 slots、设置页(含快捷键配置)与文本变换服务。 - applyReader(ctx, { chatPrefs }) - void readerName + // Better Chat 设置页:仅保留审批快捷键录制(阅读视图已移除,不再有开/玻璃/折叠项)。 + installBetterDisplaySettings(ctx, undefined, chatPrefs) } diff --git a/src/client/settings.tsx b/src/client/settings.tsx index 88b84a9..3e6421f 100644 --- a/src/client/settings.tsx +++ b/src/client/settings.tsx @@ -27,7 +27,7 @@ function languageTag(ctx: Context): string | undefined { const SETTINGS_LOCALE_NS = 'better-chat' const SETTINGS_SECTION_ID = 'better-chat' -export function installBetterDisplaySettings(ctx: Context, prefs: OpenPrefs, chat?: ChatPrefs): void { +export function installBetterDisplaySettings(ctx: Context, prefs?: OpenPrefs, chat?: ChatPrefs): void { const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined; if (locale?.register) { ctx.effect(() => locale.register!(SETTINGS_LOCALE_NS, { zh, en }), 'dsh-better-chat: settings copy');