aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornetop://ウィビ <paul@webb.page>2026-10-21 16:47:38 -0700
committernetop://ウィビ <paul@webb.page>2026-10-21 16:47:38 -0700
commit389ad1349c4ff245a3466a2e361c1cd1dd11d2ba (patch)
tree0ad0638f60ab0a77c7a095e96b472312ab39f83b
parentbbcbb02ef64d094f0f13de22ae135eeba1ff4c5d (diff)
downloadgq-primary.tar.gz
gq-primary.zip
MAJOR RELEASEHEADprimary
- inlined vendored dependencies from npm - makes this module work in Ende
-rw-r--r--deno.json16
-rw-r--r--deno.lock122
-rw-r--r--ende.json21
-rwxr-xr-xentry.ts9
-rwxr-xr-xsource/common.ts2
-rw-r--r--source/gql.ts3
-rw-r--r--source/graphiql/assets.ts28
-rw-r--r--source/graphiql/favicon.svg15
-rwxr-xr-xsource/graphiql/render.ts56
-rw-r--r--source/graphiql/standalone.css2
-rw-r--r--source/graphiql/standalone.js207
-rw-r--r--source/graphiql/version.ts1
-rwxr-xr-xsource/http.ts10
-rw-r--r--source/import.ts2
-rw-r--r--source/utility/pubsub.ts64
-rwxr-xr-xsource/utility/types.ts2
-rw-r--r--source/ws.ts4
-rw-r--r--vendor/deps.d.ts14536
-rw-r--r--vendor/deps.js190
-rw-r--r--vendor/deps.ts5
-rw-r--r--vendor/package.json16
-rw-r--r--vendor/tsconfig.json12
22 files changed, 15147 insertions, 176 deletions
diff --git a/deno.json b/deno.json
deleted file mode 100644
index bddf2d3..0000000
--- a/deno.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "exports": "./entry.ts",
- "imports": {
- "@eeeooolll/graphiql": "npm:@eeeooolll/graphiql@0.4.2",
- "@graphql-tools/schema": "npm:@graphql-tools/schema@^10.0.33",
- "@netopwibby/dedent": "jsr:@netopwibby/dedent@^0.1.0",
- "@std/path": "jsr:@std/path@^1.1.4",
- "graphql": "npm:graphql@^16.13.2",
- "graphql-subscriptions": "npm:graphql-subscriptions@^2.0.0",
- "graphql-ws": "npm:graphql-ws@^5.16.0",
- "xss": "npm:xss@^1.0.15"
- },
- "license": "MIT",
- "name": "@eol/gq",
- "version": "0.6.1"
-}
diff --git a/deno.lock b/deno.lock
deleted file mode 100644
index ebfe5b7..0000000
--- a/deno.lock
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "version": "5",
- "specifiers": {
- "jsr:@netopwibby/dedent@0.1": "0.1.0",
- "jsr:@std/internal@^1.0.12": "1.0.13",
- "jsr:@std/path@^1.1.4": "1.1.4",
- "npm:@graphql-tools/schema@^10.0.33": "10.0.33_graphql@16.13.2",
- "npm:graphql-subscriptions@2": "2.0.0_graphql@16.13.2",
- "npm:graphql-ws@^5.16.0": "5.16.2_graphql@16.13.2",
- "npm:graphql@^16.13.2": "16.13.2",
- "npm:xss@^1.0.15": "1.0.15"
- },
- "jsr": {
- "@netopwibby/dedent@0.1.0": {
- "integrity": "fcd8ffe607efdbe11ddcefa9169935514744b6b064ed634390818227fa0b401e"
- },
- "@std/internal@1.0.13": {
- "integrity": "2f9546691d4ac2d32859c82dff284aaeac980ddeca38430d07941e7e288725c0"
- },
- "@std/path@1.1.4": {
- "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5",
- "dependencies": [
- "jsr:@std/internal"
- ]
- }
- },
- "npm": {
- "@graphql-tools/merge@9.1.9_graphql@16.13.2": {
- "integrity": "sha512-iHUWNjRHeQRYdgIMIuChThOwoKzA9vrzYeslgfBo5eUYEyHGZCoDPjAavssoYXLwstYt1dZj2J22jSzc2DrN0Q==",
- "dependencies": [
- "@graphql-tools/utils",
- "graphql",
- "tslib"
- ]
- },
- "@graphql-tools/schema@10.0.33_graphql@16.13.2": {
- "integrity": "sha512-O6P3RIftO0jafnSsFAqpjurUuUxJ43s/AdPVLQsBkI6y4Ic/tKm4C1Qm1KKQsCDTOxXPJClh/v3g7k7yLKCFBQ==",
- "dependencies": [
- "@graphql-tools/merge",
- "@graphql-tools/utils",
- "graphql",
- "tslib"
- ]
- },
- "@graphql-tools/utils@11.1.0_graphql@16.13.2": {
- "integrity": "sha512-PtFVG4r8Z2LEBSaPYQMusBiB3o6kjLVJyjCLbnWem/SpSuM21v6LTmgpkXfYU1qpBV2UGsFyuEnSJInl8fR1Ag==",
- "dependencies": [
- "@graphql-typed-document-node/core",
- "@whatwg-node/promise-helpers",
- "cross-inspect",
- "graphql",
- "tslib"
- ]
- },
- "@graphql-typed-document-node/core@3.2.0_graphql@16.13.2": {
- "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==",
- "dependencies": [
- "graphql"
- ]
- },
- "@whatwg-node/promise-helpers@1.3.2": {
- "integrity": "sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==",
- "dependencies": [
- "tslib"
- ]
- },
- "commander@2.20.3": {
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
- },
- "cross-inspect@1.0.1": {
- "integrity": "sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A==",
- "dependencies": [
- "tslib"
- ]
- },
- "cssfilter@0.0.10": {
- "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
- },
- "graphql-subscriptions@2.0.0_graphql@16.13.2": {
- "integrity": "sha512-s6k2b8mmt9gF9pEfkxsaO1lTxaySfKoEJzEfmwguBbQ//Oq23hIXCfR1hm4kdh5hnR20RdwB+s3BCb+0duHSZA==",
- "dependencies": [
- "graphql",
- "iterall"
- ]
- },
- "graphql-ws@5.16.2_graphql@16.13.2": {
- "integrity": "sha512-E1uccsZxt/96jH/OwmLPuXMACILs76pKF2i3W861LpKBCYtGIyPQGtWLuBLkND4ox1KHns70e83PS4te50nvPQ==",
- "dependencies": [
- "graphql"
- ]
- },
- "graphql@16.13.2": {
- "integrity": "sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig=="
- },
- "iterall@1.3.0": {
- "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg=="
- },
- "tslib@2.8.1": {
- "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="
- },
- "xss@1.0.15": {
- "integrity": "sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==",
- "dependencies": [
- "commander",
- "cssfilter"
- ],
- "bin": true
- }
- },
- "workspace": {
- "dependencies": [
- "jsr:@netopwibby/dedent@0.1",
- "jsr:@std/path@^1.1.4",
- "npm:@eeeooolll/graphiql@0.4.2",
- "npm:@graphql-tools/schema@^10.0.33",
- "npm:graphql-subscriptions@2",
- "npm:graphql-ws@^5.16.0",
- "npm:graphql@^16.13.2",
- "npm:xss@^1.0.15"
- ]
- }
-}
diff --git a/ende.json b/ende.json
new file mode 100644
index 0000000..59f5661
--- /dev/null
+++ b/ende.json
@@ -0,0 +1,21 @@
+{
+ "exclude": [
+ "vendor/"
+ ],
+ "exports": "./entry.ts",
+ "imports": {
+ "@ende/path": "jsr:@ende/path@^2026.10.15",
+ "@netopwibby/dedent": "jsr:@netopwibby/dedent@^0.1.0",
+ "#deps": "./vendor/deps.js"
+ },
+ "license": "MIT",
+ "name": "@eol/gq",
+ "publish": {
+ "exclude": [
+ "!vendor/",
+ "Icon*",
+ "**/Icon*"
+ ]
+ },
+ "version": "0.7.0"
+}
diff --git a/entry.ts b/entry.ts
index 6c43287..0ab9b1f 100755
--- a/entry.ts
+++ b/entry.ts
@@ -7,10 +7,10 @@ export * from "./source/common.ts";
export * from "./source/http.ts";
export * from "./source/ws.ts";
-export { makeExecutableSchema as executeSchema } from "@graphql-tools/schema";
+export { makeExecutableSchema as executeSchema } from "#deps";
export { gql } from "./source/gql.ts";
export { importQL } from "./source/import.ts";
-export { PubSub } from "graphql-subscriptions";
+export { PubSub } from "./source/utility/pubsub.ts";
export type {
DocumentNode,
@@ -22,6 +22,7 @@ export type {
GraphQLSchema,
GraphQLTypeResolver,
Source
-} from "graphql";
+} from "#deps";
-export type { PubSubEngine } from "graphql-subscriptions";
+// @ts-ignore: TS2305
+export type { PubSubEngine } from "#deps";
diff --git a/source/common.ts b/source/common.ts
index 902bdd0..777bb98 100755
--- a/source/common.ts
+++ b/source/common.ts
@@ -3,7 +3,7 @@
/*** IMPORT ------------------------------------------- ***/
-import { graphql, type ExecutionResult } from "graphql";
+import { graphql, type ExecutionResult } from "#deps";
/*** UTILITY ------------------------------------------ ***/
diff --git a/source/gql.ts b/source/gql.ts
index f88d8ff..823f73a 100644
--- a/source/gql.ts
+++ b/source/gql.ts
@@ -8,7 +8,7 @@ import {
type DefinitionNode,
type DocumentNode,
type Location
-} from "graphql";
+} from "#deps";
/*** UTILITY ------------------------------------------ ***/
@@ -143,6 +143,7 @@ function parseDocument(source: string) {
const cacheKey = normalize(source);
if (!docCache.has(cacheKey)) {
+ // @ts-ignore: TS2353
const parsed = parse(source, { allowLegacyFragmentVariables });
if (!parsed || parsed.kind !== "Document")
diff --git a/source/graphiql/assets.ts b/source/graphiql/assets.ts
new file mode 100644
index 0000000..d0848e7
--- /dev/null
+++ b/source/graphiql/assets.ts
@@ -0,0 +1,28 @@
+// source/graphiql/assets.ts
+import css from "./standalone.css" with { type: "text" };
+import favicon from "./favicon.svg" with { type: "text" };
+import js from "./standalone.js" with { type: "text" };
+import { GRAPHIQL_VERSION } from "./version.ts";
+
+const base = `/_graphiql/${GRAPHIQL_VERSION}`;
+
+export const assets: Record<string, { body: string; type: string }> = {
+ [`${base}/favicon.svg`]: { body: favicon, type: "image/svg+xml" },
+ [`${base}/standalone.css`]: { body: css, type: "text/css; charset=utf-8" },
+ [`${base}/standalone.js`]: { body: js, type: "text/javascript; charset=utf-8" }
+};
+
+export function serveAsset(request: { url: string }): Response | undefined {
+ const { pathname } = new URL(request.url);
+ const key = Object.keys(assets).find((path) => pathname.endsWith(path));
+
+ if (!key)
+ return;
+
+ return new Response(assets[key].body, {
+ headers: {
+ "cache-control": "public, max-age=31536000, immutable",
+ "content-type": assets[key].type
+ }
+ });
+}
diff --git a/source/graphiql/favicon.svg b/source/graphiql/favicon.svg
new file mode 100644
index 0000000..80a7a21
--- /dev/null
+++ b/source/graphiql/favicon.svg
@@ -0,0 +1,15 @@
+<svg fill="#e10098" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
+ <style>
+ svg {
+ fill: color(display-p3 0.8824 0 0.5961);
+ }
+ </style>
+
+ <path clip-rule="evenodd" d="M50 6.90308L87.323 28.4515V71.5484L50 93.0968L12.677 71.5484V28.4515L50 6.90308ZM16.8647 30.8693V62.5251L44.2795 15.0414L16.8647 30.8693ZM50 13.5086L18.3975 68.2457H81.6025L50 13.5086ZM77.4148 72.4334H22.5852L50 88.2613L77.4148 72.4334ZM83.1353 62.5251L55.7205 15.0414L83.1353 30.8693V62.5251Z" fill-rule="evenodd"/>
+ <circle cx="50" cy="9.3209" r="8.82"/>
+ <circle cx="85.2292" cy="29.6605" r="8.82"/>
+ <circle cx="85.2292" cy="70.3396" r="8.82"/>
+ <circle cx="50" cy="90.6791" r="8.82"/>
+ <circle cx="14.7659" cy="70.3396" r="8.82"/>
+ <circle cx="14.7659" cy="29.6605" r="8.82"/>
+</svg>
diff --git a/source/graphiql/render.ts b/source/graphiql/render.ts
index 7adec57..c846d34 100755
--- a/source/graphiql/render.ts
+++ b/source/graphiql/render.ts
@@ -4,26 +4,31 @@
/*** IMPORT ------------------------------------------- ***/
import { default as dedent } from "@netopwibby/dedent";
-import { filterXSS } from "xss";
+import { GRAPHIQL_VERSION } from "./version.ts";
/*** UTILITY ------------------------------------------ ***/
-const filter = (val: string) => filterXSS(val, {
- stripIgnoreTag: true,
- stripIgnoreTagBody: ["script"],
- whiteList: {}
-});
+const escapeHtml = (value: string) => value
+ .replaceAll("&", "&amp;")
+ .replaceAll("<", "&lt;")
+ .replaceAll(">", "&gt;")
+ .replaceAll("\"", "&quot;")
+ .replaceAll("'", "&#39;");
+
+const toScriptString = (value: string) => JSON.stringify(value).replaceAll("<", "\\u003c");
const buildAssetUrl = ({ cdnUrl, suffix, version }: {
- cdnUrl: string
- suffix: string
- version?: string
-}) => filter(`${cdnUrl}/@eeeooolll/graphiql${version ? `@${version}` : ""}/dist/${suffix}`);
+ cdnUrl?: string;
+ suffix: string;
+ version: string;
+}) => cdnUrl ?
+ `${cdnUrl}/@eeeooolll/graphiql@${version}/dist/${suffix}` :
+ `./_graphiql/${GRAPHIQL_VERSION}/${suffix}`;
/*** EXPORT ------------------------------------------- ***/
export interface RenderPageOptions {
- /** Base CDN. Defaults to jsDelivr. */
+ /** Load the bundle from this CDN base (e.g. `//cdn.jsdelivr.net/npm`) instead of the copy embedded in gq. */
cdnUrl?: string;
/** GraphQL endpoint the embedded fetcher posts to. */
endpoint?: string;
@@ -31,7 +36,7 @@ export interface RenderPageOptions {
faviconUrl?: string | null;
/** Document `<title>`. */
title?: string;
- /** Pin `@eeeooolll/graphiql` to a specific version on the CDN. */
+ /** `@eeeooolll/graphiql` version to load from `cdnUrl`. Defaults to the embedded version; ignored when self-hosting. */
version?: string;
}
@@ -39,31 +44,28 @@ export interface RenderPageOptions {
* Renders the GraphiQL HTML shell.
*
* Loads the prebuilt IIFE bundle from `@eeeooolll/graphiql` (registered as
- * `window.EolGraphiQL`) and mounts it against `endpoint`.
+ * `window.EolGraphiQL`) and mounts it against `endpoint`. The bundle is
+ * embedded in gq and served by `GraphQLHTTP`; set `cdnUrl` to load it
+ * from a CDN instead.
*
* Usually called indirectly via `GraphQLHTTP({ graphiql: true })`; invoke it
* directly if you need to embed GraphiQL in a custom route.
*/
export function renderPlaygroundPage(options: RenderPageOptions): string {
const {
- cdnUrl = "//cdn.jsdelivr.net/npm",
+ cdnUrl,
endpoint = "/graphql",
faviconUrl,
title = "GraphiQL",
- version
+ version = GRAPHIQL_VERSION
} = options;
- const safeEndpoint = filter(endpoint);
- const safeTitle = filter(title);
- const scriptUrl = buildAssetUrl({ cdnUrl, suffix: "standalone.js", version });
- const styleUrl = buildAssetUrl({ cdnUrl, suffix: "standalone.css", version });
+ const scriptUrl = escapeHtml(buildAssetUrl({ cdnUrl, suffix: "standalone.js", version }));
+ const styleUrl = escapeHtml(buildAssetUrl({ cdnUrl, suffix: "standalone.css", version }));
- const faviconLink =
- faviconUrl === null ?
- "" :
- typeof faviconUrl === "string" ?
- `<link rel="shortcut icon" href="${filter(faviconUrl)}"/>` :
- `<link rel="shortcut icon" href="${buildAssetUrl({ cdnUrl, suffix: "favicon.svg", version })}"/>`;
+ const faviconLink = faviconUrl === null ?
+ "" :
+ `<link rel="shortcut icon" href="${escapeHtml(faviconUrl ?? buildAssetUrl({ cdnUrl, suffix: "favicon.svg", version }))}"/>`;
return dedent`
<!DOCTYPE html>
@@ -71,7 +73,7 @@ export function renderPlaygroundPage(options: RenderPageOptions): string {
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>${safeTitle}</title>
+ <title>${escapeHtml(title)}</title>
${faviconLink}
<link rel="stylesheet" href="${styleUrl}"/>
@@ -106,7 +108,7 @@ export function renderPlaygroundPage(options: RenderPageOptions): string {
<script>
window.addEventListener("load", () => {
const root = document.getElementById("root");
- const fetcher = window.EolGraphiQL.createHttpFetcher({ url: "${safeEndpoint}" });
+ const fetcher = window.EolGraphiQL.createHttpFetcher({ url: ${toScriptString(endpoint)} });
window.EolGraphiQL.mount(root, { fetcher });
});
diff --git a/source/graphiql/standalone.css b/source/graphiql/standalone.css
new file mode 100644
index 0000000..7417883
--- /dev/null
+++ b/source/graphiql/standalone.css
@@ -0,0 +1,2 @@
+:root{--uchu-blue-1-raw:89.66% .046 260.67;--uchu-blue-1:oklch(89.66% .046 260.67);--uchu-blue-2-raw:80.17% .091 258.88;--uchu-blue-2:oklch(80.17% .091 258.88);--uchu-blue-3-raw:70.94% .136 258.06;--uchu-blue-3:oklch(70.94% .136 258.06);--uchu-blue-4-raw:62.39% .181 258.33;--uchu-blue-4:oklch(62.39% .181 258.33);--uchu-blue-5-raw:54.87% .222 260.33;--uchu-blue-5:oklch(54.87% .222 260.33);--uchu-blue-6-raw:51.15% .204 260.17;--uchu-blue-6:oklch(51.15% .204 260.17);--uchu-blue-7-raw:47.36% .185 259.89;--uchu-blue-7:oklch(47.36% .185 259.89);--uchu-blue-8-raw:43.48% .17 260.2;--uchu-blue-8:oklch(43.48% .17 260.2);--uchu-blue-9-raw:39.53% .15 259.87;--uchu-blue-9:oklch(39.53% .15 259.87);--uchu-gray-1-raw:95.57% .003 286.35;--uchu-gray-1:oklch(95.57% .003 286.35);--uchu-gray-2-raw:92.04% .002 197.12;--uchu-gray-2:oklch(92.04% .002 197.12);--uchu-gray-3-raw:88.28% .003 286.34;--uchu-gray-3:oklch(88.28% .003 286.34);--uchu-gray-4-raw:84.68% .002 197.12;--uchu-gray-4:oklch(84.68% .002 197.12);--uchu-gray-5-raw:80.73% .002 247.84;--uchu-gray-5:oklch(80.73% .002 247.84);--uchu-gray-6-raw:75.03% .002 247.85;--uchu-gray-6:oklch(75.03% .002 247.85);--uchu-gray-7-raw:69.01% .003 286.32;--uchu-gray-7:oklch(69.01% .003 286.32);--uchu-gray-8-raw:63.12% .004 219.55;--uchu-gray-8:oklch(63.12% .004 219.55);--uchu-gray-9-raw:56.82% .004 247.89;--uchu-gray-9:oklch(56.82% .004 247.89);--uchu-green-1-raw:93.96% .05 148.74;--uchu-green-1:oklch(93.96% .05 148.74);--uchu-green-2-raw:88.77% .096 147.71;--uchu-green-2:oklch(88.77% .096 147.71);--uchu-green-3-raw:83.74% .139 146.57;--uchu-green-3:oklch(83.74% .139 146.57);--uchu-green-4-raw:79.33% .179 145.62;--uchu-green-4:oklch(79.33% .179 145.62);--uchu-green-5-raw:75.23% .209 144.64;--uchu-green-5:oklch(75.23% .209 144.64);--uchu-green-6-raw:70.03% .194 144.71;--uchu-green-6:oklch(70.03% .194 144.71);--uchu-green-7-raw:64.24% .175 144.92;--uchu-green-7:oklch(64.24% .175 144.92);--uchu-green-8-raw:58.83% .158 145.05;--uchu-green-8:oklch(58.83% .158 145.05);--uchu-green-9-raw:52.77% .138 145.41;--uchu-green-9:oklch(52.77% .138 145.41);--uchu-orange-1-raw:93.83% .037 56.93;--uchu-orange-1:oklch(93.83% .037 56.93);--uchu-orange-2-raw:88.37% .072 55.8;--uchu-orange-2:oklch(88.37% .072 55.8);--uchu-orange-3-raw:83.56% .107 56.49;--uchu-orange-3:oklch(83.56% .107 56.49);--uchu-orange-4-raw:78.75% .141 54.32;--uchu-orange-4:oklch(78.75% .141 54.32);--uchu-orange-5-raw:74.61% .171 51.56;--uchu-orange-5:oklch(74.61% .171 51.56);--uchu-orange-6-raw:69.33% .157 52.18;--uchu-orange-6:oklch(69.33% .157 52.18);--uchu-orange-7-raw:63.8% .142 52.1;--uchu-orange-7:oklch(63.8% .142 52.1);--uchu-orange-8-raw:58.28% .128 52.2;--uchu-orange-8:oklch(58.28% .128 52.2);--uchu-orange-9-raw:52.49% .113 51.98;--uchu-orange-9:oklch(52.49% .113 51.98);--uchu-pink-1-raw:95.8% .023 354.27;--uchu-pink-1:oklch(95.8% .023 354.27);--uchu-pink-2-raw:92.14% .046 352.31;--uchu-pink-2:oklch(92.14% .046 352.31);--uchu-pink-3-raw:88.9% .066 354.39;--uchu-pink-3:oklch(88.9% .066 354.39);--uchu-pink-4-raw:85.43% .09 354.1;--uchu-pink-4:oklch(85.43% .09 354.1);--uchu-pink-5-raw:82.23% .112 355.33;--uchu-pink-5:oklch(82.23% .112 355.33);--uchu-pink-6-raw:76.37% .101 355.37;--uchu-pink-6:oklch(76.37% .101 355.37);--uchu-pink-7-raw:70.23% .092 354.96;--uchu-pink-7:oklch(70.23% .092 354.96);--uchu-pink-8-raw:64.11% .084 353.91;--uchu-pink-8:oklch(64.11% .084 353.91);--uchu-pink-9-raw:57.68% .074 353.14;--uchu-pink-9:oklch(57.68% .074 353.14);--uchu-purple-1-raw:89.1% .046 305.24;--uchu-purple-1:oklch(89.1% .046 305.24);--uchu-purple-2-raw:78.68% .091 305;--uchu-purple-2:oklch(78.68% .091 305);--uchu-purple-3-raw:68.5% .136 303.78;--uchu-purple-3:oklch(68.5% .136 303.78);--uchu-purple-4-raw:58.47% .181 302.06;--uchu-purple-4:oklch(58.47% .181 302.06);--uchu-purple-5-raw:49.39% .215 298.31;--uchu-purple-5:oklch(49.39% .215 298.31);--uchu-purple-6-raw:46.11% .198 298.4;--uchu-purple-6:oklch(46.11% .198 298.4);--uchu-purple-7-raw:42.77% .181 298.49;--uchu-purple-7:oklch(42.77% .181 298.49);--uchu-purple-8-raw:39.46% .164 298.29;--uchu-purple-8:oklch(39.46% .164 298.29);--uchu-purple-9-raw:36.01% .145 298.35;--uchu-purple-9:oklch(36.01% .145 298.35);--uchu-red-1-raw:88.98% .052 3.28;--uchu-red-1:oklch(88.98% .052 3.28);--uchu-red-2-raw:78.78% .109 4.54;--uchu-red-2:oklch(78.78% .109 4.54);--uchu-red-3-raw:69.86% .162 7.82;--uchu-red-3:oklch(69.86% .162 7.82);--uchu-red-4-raw:62.73% .209 12.37;--uchu-red-4:oklch(62.73% .209 12.37);--uchu-red-5-raw:58.63% .231 19.6;--uchu-red-5:oklch(58.63% .231 19.6);--uchu-red-6-raw:54.41% .214 19.06;--uchu-red-6:oklch(54.41% .214 19.06);--uchu-red-7-raw:49.95% .195 18.34;--uchu-red-7:oklch(49.95% .195 18.34);--uchu-red-8-raw:45.8% .177 17.7;--uchu-red-8:oklch(45.8% .177 17.7);--uchu-red-9-raw:41.17% .157 16.58;--uchu-red-9:oklch(41.17% .157 16.58);--uchu-yellow-1-raw:97.05% .039 91.2;--uchu-yellow-1:oklch(97.05% .039 91.2);--uchu-yellow-2-raw:95% .07 92.39;--uchu-yellow-2:oklch(95% .07 92.39);--uchu-yellow-3-raw:92.76% .098 92.58;--uchu-yellow-3:oklch(92.76% .098 92.58);--uchu-yellow-4-raw:90.92% .125 92.56;--uchu-yellow-4:oklch(90.92% .125 92.56);--uchu-yellow-5-raw:89% .146 91.5;--uchu-yellow-5:oklch(89% .146 91.5);--uchu-yellow-6-raw:82.39% .133 91.5;--uchu-yellow-6:oklch(82.39% .133 91.5);--uchu-yellow-7-raw:75.84% .122 92.21;--uchu-yellow-7:oklch(75.84% .122 92.21);--uchu-yellow-8-raw:69.14% .109 91.04;--uchu-yellow-8:oklch(69.14% .109 91.04);--uchu-yellow-9-raw:62.29% .097 91.9;--uchu-yellow-9:oklch(62.29% .097 91.9);--uchu-yin-1-raw:91.87% .003 264.54;--uchu-yin-1:oklch(91.87% .003 264.54);--uchu-yin-2-raw:84.61% .004 286.31;--uchu-yin-2:oklch(84.61% .004 286.31);--uchu-yin-3-raw:76.89% .004 247.87;--uchu-yin-3:oklch(76.89% .004 247.87);--uchu-yin-4-raw:69.17% .004 247.88;--uchu-yin-4:oklch(69.17% .004 247.88);--uchu-yin-5-raw:61.01% .005 271.34;--uchu-yin-5:oklch(61.01% .005 271.34);--uchu-yin-6-raw:52.79% .005 271.32;--uchu-yin-6:oklch(52.79% .005 271.32);--uchu-yin-7-raw:43.87% .005 271.3;--uchu-yin-7:oklch(43.87% .005 271.3);--uchu-yin-8-raw:35.02% .005 236.66;--uchu-yin-8:oklch(35.02% .005 236.66);--uchu-yin-9-raw:25.11% .006 258.36;--uchu-yin-9:oklch(25.11% .006 258.36);--uchu-yang:oklch(99.4% 0 0);--uchu-yin:oklch(14.38% .007 256.88)}.link.svelte-1lzwyfl{color:var(--uchu-blue-3);cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.link.svelte-1lzwyfl:not(:hover){text-decoration:underline}.field.svelte-1ckn7ri{gap:1.5rem;padding:.75rem 1rem;display:grid}.heading.svelte-1ckn7ri{font-size:.95rem;font-weight:600}.section-label.svelte-1ckn7ri,.description.svelte-1ckn7ri,.arg-description.svelte-1ckn7ri{color:var(--uchu-yin-6)}.section-label.svelte-1ckn7ri{letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.description.svelte-1ckn7ri{font-size:.8rem;line-height:1.4}.args.svelte-1ckn7ri{gap:1.5rem;display:grid}.arg.svelte-1ckn7ri{font-size:.8rem}.arg-description.svelte-1ckn7ri{margin-top:.125rem;margin-left:1rem;font-size:.7rem}.type.svelte-1lfer34{gap:1.5rem;padding:.75rem 1rem;display:grid}.heading.svelte-1lfer34{font-size:.95rem;font-weight:600}.kind.svelte-1lfer34,.description.svelte-1lfer34,.entry-description.svelte-1lfer34{color:var(--uchu-yin-6)}.kind.svelte-1lfer34{margin-right:.375rem;font-weight:400}.description.svelte-1lfer34{font-size:.8rem;line-height:1.4}.description.svelte-1lfer34 a{background-color:oklch(var(--uchu-blue-1-raw)/25%);color:var(--uchu-blue-4)}.description.svelte-1lfer34 code{background-color:var(--uchu-yellow-1)}.section-label.svelte-1lfer34{letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.list.svelte-1lfer34{gap:1.5rem;display:grid}.entry.svelte-1lfer34{font-size:.8rem}.entry-description.svelte-1lfer34{margin-top:.125rem;margin-left:1rem;font-size:.7rem}.field-button.svelte-1lfer34{cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.field-button.svelte-1lfer34:not(:hover){text-decoration:underline}.explorer.svelte-1qhgkss{background-color:color-mix(in oklch shorter hue, var(--uchu-gray-1) 20%, var(--uchu-yang) 80%);border-left:1px solid var(--uchu-gray-2);z-index:1;grid-template-rows:auto 1fr;height:100%;min-height:0;display:grid;overflow:hidden}.breadcrumbs.svelte-1qhgkss{border-bottom:1px solid var(--uchu-gray-2);flex-wrap:wrap;align-items:center;gap:.25rem;padding:.5rem .75rem;font-size:.8125rem;display:flex}.breadcrumbs.svelte-1qhgkss .crumb:where(.svelte-1qhgkss){cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.breadcrumbs.svelte-1qhgkss .crumb:where(.svelte-1qhgkss):not(.current){color:var(--uchu-blue-3);text-decoration:underline}.breadcrumbs.svelte-1qhgkss .crumb.current:where(.svelte-1qhgkss){color:var(--uchu-yin-4);cursor:default}.breadcrumbs.svelte-1qhgkss .crumb.current:where(.svelte-1qhgkss):hover{text-decoration:none}.separator.svelte-1qhgkss{color:var(--uchu-gray-3)}.body.svelte-1qhgkss{min-height:0;overflow-y:auto}.root.svelte-1qhgkss{gap:.75rem;padding:.75rem 1rem;display:grid}.root-list.svelte-1qhgkss{gap:.375rem;display:grid}.root-link.svelte-1qhgkss{color:var(--uchu-blue-3);cursor:pointer;text-align:left;background:0 0;border:none;padding:0;font-family:inherit;font-size:.95rem}.root-link.svelte-1qhgkss:hover{text-decoration:underline}.section-label.svelte-1qhgkss{color:var(--uchu-yin-6);letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.empty.svelte-1qhgkss{color:var(--uchu-yin-6);padding:.75rem 1rem;font-size:.8rem}.editor.svelte-mhzyj2{width:100%;height:100%}.editor.svelte-mhzyj2 .cm-editor{height:100%}.editor.svelte-mhzyj2 .cm-scroller{font-family:inherit}.panel.svelte-1x0f4yt{background-color:var(--uchu-yin-9);color:var(--uchu-yin-1);z-index:2;grid-template-rows:auto 1fr;height:100%;min-height:0;font-size:.8rem;display:grid;overflow:hidden}.header.svelte-1x0f4yt,.notice.svelte-1x0f4yt{border-bottom:1px solid var(--uchu-yin-8);justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .75rem;display:flex}.title.svelte-1x0f4yt{font-weight:600}.actions.svelte-1x0f4yt{gap:.5rem;display:flex}.actions.svelte-1x0f4yt .action:where(.svelte-1x0f4yt){cursor:pointer;background:0 0;border:none;padding:0;font-family:inherit;font-size:.75rem}.action.svelte-1x0f4yt:not(:hover),.notice-dismiss.svelte-1x0f4yt:not(:hover),.remove.svelte-1x0f4yt:not(:hover){color:var(--uchu-yin-5)}.action.svelte-1x0f4yt:hover,.notice-dismiss.svelte-1x0f4yt:hover,.remove.svelte-1x0f4yt:hover{color:var(--uchu-yin-1)}.hidden-input.svelte-1x0f4yt{display:none}.notice-dismiss.svelte-1x0f4yt,.remove.svelte-1x0f4yt{cursor:pointer;background:0 0;border:none;padding:0 .25rem;font-size:1rem;line-height:1}.list.svelte-1x0f4yt{min-height:0;display:grid;overflow-y:auto}.entry.svelte-1x0f4yt{cursor:pointer;grid-template-columns:auto 1fr auto;align-items:flex-start;gap:.125rem;padding:.375rem .75rem;transition:opacity .1s;display:grid}.entry.svelte-1x0f4yt:not(:last-of-type){border-bottom:1px solid var(--uchu-yin)}.entry.svelte-1x0f4yt:hover{background-color:var(--uchu-yin)}.list.svelte-1x0f4yt:has(.entry:where(.svelte-1x0f4yt):hover) .entry:where(.svelte-1x0f4yt):not(:hover){opacity:.4}.entry-title.svelte-1x0f4yt{text-overflow:ellipsis;white-space:nowrap;margin-bottom:.1rem;font-size:.8rem;overflow:hidden}.entry-time.svelte-1x0f4yt{color:var(--uchu-yin-5);font-size:.7rem}.star.svelte-1x0f4yt{cursor:pointer;background:0 0;border:none;align-self:center;padding:0 .375rem 0 0;font-size:.8rem}.star.svelte-1x0f4yt:not(.active){color:var(--uchu-yin-5)}.star.active.svelte-1x0f4yt{color:var(--uchu-orange-4)}.star.active.svelte-1x0f4yt svg:where(.svelte-1x0f4yt){fill:currentColor}.star.svelte-1x0f4yt svg:where(.svelte-1x0f4yt){width:1rem}.meta.svelte-1x0f4yt{align-self:center;min-width:0}.remove.svelte-1x0f4yt{align-self:center}.empty.svelte-1x0f4yt{color:var(--uchu-yin-5);padding:.75rem;font-size:.8rem}.result.svelte-1l6l2pw{flex-direction:column;height:100%;min-height:0;display:flex;position:relative}.label.svelte-1l6l2pw,.metadata.svelte-1l6l2pw,.footer.svelte-1l6l2pw{padding:.25rem .75rem;font-size:.75rem}.label.svelte-1l6l2pw,.metadata.svelte-1l6l2pw{background-color:var(--uchu-gray-2);color:var(--uchu-yin-7)}.label.svelte-1l6l2pw{border:1px solid var(--uchu-gray-3);letter-spacing:.05rem;pointer-events:none;text-transform:uppercase;z-index:1;font-weight:600;position:absolute;top:1rem;right:1rem}.metadata.svelte-1l6l2pw,.footer.svelte-1l6l2pw{position:relative}.metadata.svelte-1l6l2pw{flex-direction:row;align-items:center;display:flex}.metadata.svelte-1l6l2pw svg:where(.svelte-1l6l2pw){width:1rem;height:1rem;margin-right:.25rem}.footer.svelte-1l6l2pw{background-color:var(--uchu-gray-3);border-top:1px solid var(--uchu-gray-4)}.splitter.svelte-1f4xp5w{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex;position:relative}.splitter.svelte-1f4xp5w:after{content:"";border-radius:25rem;transition:background .12s;position:absolute}.splitter.svelte-1f4xp5w:not(:hover):not(.dragging){background-color:#0000}.splitter.svelte-1f4xp5w:not(:hover):not(.dragging):after{background-color:inherit}.splitter.svelte-1f4xp5w:hover,.splitter.dragging.svelte-1f4xp5w{background-color:oklch(var(--uchu-gray-2-raw)/25%)}.splitter.svelte-1f4xp5w:hover:after,.splitter.svelte-1f4xp5w:hover:after,.splitter.dragging.svelte-1f4xp5w:after,.splitter.dragging.svelte-1f4xp5w:after{background-color:var(--uchu-orange-4)}.splitter.horizontal.svelte-1f4xp5w{cursor:col-resize;width:6px;height:100%}.splitter.horizontal.svelte-1f4xp5w:after{width:3px;height:60%}.splitter.vertical.svelte-1f4xp5w{cursor:row-resize;width:100%;height:6px}.splitter.vertical.svelte-1f4xp5w:after{width:60%;height:3px}.tabbar.svelte-1s5m1m3{background-color:var(--uchu-gray-2);align-items:stretch;min-height:2rem;font-size:.8rem;display:flex;overflow-x:auto}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3){cursor:pointer;border:none;align-items:center;gap:.5rem;padding:0 .75rem;display:flex}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):not(:hover):not(.active){color:var(--uchu-yin-5)}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):hover:not(.active){color:var(--uchu-yin-8)}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):not(.active){background-color:#0000}.tabbar.svelte-1s5m1m3 .tab.active:where(.svelte-1s5m1m3){background-color:var(--uchu-gray-3);color:var(--uchu-yin-8)}.title.svelte-1s5m1m3{white-space:nowrap}.edit.svelte-1s5m1m3{background-color:var(--uchu-orange-5);border:1px solid var(--uchu-orange-5);color:var(--uchu-yang);font-family:inherit;font-size:inherit;outline:none;min-width:6rem;padding:.125rem .25rem}.close.svelte-1s5m1m3{color:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:1rem;line-height:1}.close.svelte-1s5m1m3:not(:hover){opacity:.6}.close.svelte-1s5m1m3:hover{opacity:1}.add.svelte-1s5m1m3{border:none;border-left:1px solid var(--uchu-gray-3);cursor:pointer;background:0 0;padding:0 .75rem;font-size:1rem}.add.svelte-1s5m1m3:not(:hover){color:var(--uchu-yin-5)}.add.svelte-1s5m1m3:hover{color:var(--uchu-yin-8)}.toolbar.svelte-50ld1a{background-color:var(--uchu-yang);align-items:center;gap:.75rem;padding:.5rem .75rem;display:flex}.run.svelte-50ld1a,.toggle.svelte-50ld1a{border:none;flex-direction:row;align-items:center;padding:.2rem .75rem .2rem .5rem;font-size:.8rem;display:flex}.run.svelte-50ld1a:not(:disabled),.toggle.svelte-50ld1a:not(:disabled){cursor:pointer}.run.svelte-50ld1a:disabled,.toggle.svelte-50ld1a:disabled{cursor:not-allowed;opacity:.5}.run.svelte-50ld1a svg:where(.svelte-50ld1a),.toggle.svelte-50ld1a svg:where(.svelte-50ld1a){fill:currentColor;width:1rem;height:1rem;margin-right:.25rem}.run.svelte-50ld1a{background-color:var(--uchu-orange-5);color:var(--uchu-yang)}.run.svelte-50ld1a:hover:not(:disabled){color:var(--uchu-orange-1)}.hint.svelte-50ld1a{color:var(--uchu-yin-5);font-size:.75rem}.picker.svelte-50ld1a{border:none;border-radius:0;padding:.2rem .75rem .2rem .5rem;font-size:.8rem}.picker.svelte-50ld1a:not(:focus-visible){background-color:var(--uchu-gray-1);color:var(--uchu-yin-5)}.picker.svelte-50ld1a:focus-visible{background-color:var(--uchu-orange-5);color:var(--uchu-yang);outline-color:var(--uchu-orange-5);outline-offset:-1px;outline-style:solid}.spacer.svelte-50ld1a{flex:1}.toggle.svelte-50ld1a{background-color:var(--uchu-gray-1);color:var(--uchu-yin-5)}.toggle.active.svelte-50ld1a{background-color:var(--uchu-yin);color:var(--uchu-yang)}.toggle.svelte-50ld1a:not(.active):hover:not(:disabled){color:var(--uchu-yin-8)}.graphiql.svelte-pvt4yg{background-color:var(--uchu-yang);width:100%;height:100%;color:var(--uchu-yin-9);overscroll-behavior:none;font-family:Berkeley Mono,ui-monospace,SFMono-Regular,monospace;font-size:16px;overflow:hidden}@media (width>=1025px){.graphiql.svelte-pvt4yg{grid-template-rows:auto auto 1fr;display:grid}}@media (width<=1024px){.graphiql.svelte-pvt4yg{flex-direction:column;display:flex}}.panes.svelte-pvt4yg{grid-template-columns:1fr;min-height:0;display:grid}@media (width<=1024px){.panes.svelte-pvt4yg{height:-webkit-fill-available;height:-moz-available;height:stretch}}.panes.history-open.svelte-pvt4yg{grid-template-columns:var(--graphiql-history-width) 6px 1fr}.panes.docs-open.svelte-pvt4yg{grid-template-columns:1fr 6px var(--graphiql-docs-width)}.panes.history-open.docs-open.svelte-pvt4yg{grid-template-columns:var(--graphiql-history-width) 6px 1fr 6px var(--graphiql-docs-width)}.center.svelte-pvt4yg,.left.svelte-pvt4yg{min-width:0;min-height:0;margin-right:-6px}@media (width>=1025px){.center.svelte-pvt4yg{grid-template-columns:var(--graphiql-left-width) 6px calc(100% - var(--graphiql-left-width) - 6px);display:grid}}@media (width<=1024px){.center.svelte-pvt4yg{flex-direction:column;display:flex}}.center.svelte-pvt4yg .query:where(.svelte-pvt4yg){flex:2;min-height:0;margin-bottom:-6px}.center.svelte-pvt4yg .bottom:where(.svelte-pvt4yg){flex:1;min-height:0}.center.svelte-pvt4yg .left:where(.svelte-pvt4yg){flex-direction:column;display:flex;overflow-x:hidden}@media (width<=1024px){.center.svelte-pvt4yg .left:where(.svelte-pvt4yg){flex:2}}.center.svelte-pvt4yg .right:where(.svelte-pvt4yg){min-height:0}@media (width<=1024px){.center.svelte-pvt4yg .right:where(.svelte-pvt4yg){border-top:2px solid var(--uchu-gray-3);flex:1}}.switcher.svelte-pvt4yg{background-color:var(--uchu-gray-2);flex-direction:row;display:flex}.switcher.svelte-pvt4yg .switch:where(.svelte-pvt4yg){cursor:pointer;letter-spacing:.05rem;text-transform:uppercase;background:0 0;border:none;padding:.375rem .75rem;font-family:Berkeley Mono,ui-monospace,SFMono-Regular,monospace;font-size:.75rem;font-weight:600}.switcher.svelte-pvt4yg .switch:where(.svelte-pvt4yg):not(.active){color:var(--uchu-yin-5)}.switcher.svelte-pvt4yg .switch.active:where(.svelte-pvt4yg){background-color:var(--uchu-gray-3)}.status.svelte-pvt4yg{background-color:var(--uchu-yellow-2);border-top:1px solid var(--uchu-yellow-3);color:var(--uchu-yellow-9);padding:.25rem .75rem;font-size:.75rem}.status.svelte-pvt4yg span:where(.svelte-pvt4yg){text-transform:uppercase}
+/*$vite$:1*/ \ No newline at end of file
diff --git a/source/graphiql/standalone.js b/source/graphiql/standalone.js
new file mode 100644
index 0000000..ca9e99f
--- /dev/null
+++ b/source/graphiql/standalone.js
@@ -0,0 +1,207 @@
+var EolGraphiQL=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),i=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},a=Array.isArray,o=Array.prototype.indexOf,s=Array.prototype.includes,c=Array.from,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function _(e){for(var t=0;t<e.length;t++)e[t]()}function v(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var y=1024,b=2048,x=4096,S=8192,ee=16384,C=32768,te=1<<25,ne=65536,re=1<<19,ie=1<<20,ae=1<<25,oe=65536,se=1<<21,ce=1<<22,le=1<<23,ue=Symbol(`$state`),de=Symbol(`legacy props`),fe=Symbol(``),pe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function he(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ge(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function _e(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function ve(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ye(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function be(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function xe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Se(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ce(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function we(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Te(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var De={},Oe=Symbol(),ke=`http://www.w3.org/1999/xhtml`,Ae=`http://www.w3.org/2000/svg`,je=`http://www.w3.org/1998/Math/MathML`;function Me(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ne(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Pe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Fe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function Ie(e){w=e}var Le;function Re(e){if(e===null)throw Ne(),De;return Le=e}function ze(){return Re(vn(Le))}function T(e){if(w){if(vn(Le)!==null)throw Ne(),De;Le=e}}function Be(e=1){if(w){for(var t=e,n=Le;t--;)n=vn(n);Le=n}}function Ve(e=!0){for(var t=0,n=Le;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=vn(n);e&&n.remove(),n=i}}function He(e){if(!e||e.nodeType!==8)throw Ne(),De;return e.data}function Ue(e){return e===this.v}function We(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ge(e){return!We(e,this.v)}var Ke=!1,qe=!1,Je=null;function Ye(e){Je=e}function Xe(e,t=!1,n){Je={p:Je,i:!1,c:null,e:null,s:e,x:null,r:or,l:qe&&!t?{s:null,u:null,$:[]}:null}}function Ze(e){var t=Je,n=t.e;if(n!==null){t.e=null;for(var r of n)Pn(r)}return e!==void 0&&(t.x=e),t.i=!0,Je=t.p,e??{}}function Qe(){return!qe||Je!==null&&Je.l===null}var $e=[];function et(){var e=$e;$e=[],_(e)}function tt(e){if($e.length===0&&!vt){var t=$e;queueMicrotask(()=>{t===$e&&et()})}$e.push(e)}function nt(){for(;$e.length>0;)et()}function rt(e){var t=or;if(t===null)return rr.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;it(e,t)}function it(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var at=~(b|x|y);function ot(e,t){e.f=e.f&at|t}function st(e){e.f&512||e.deps===null?ot(e,y):ot(e,x)}function ct(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=oe,ct(t.deps))}function lt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ct(e.deps),ot(e,y)}var ut=!1,dt=!1;function ft(e){var t=dt;try{return dt=!1,[e(),dt]}finally{dt=t}}var pt=new Set,mt=null,ht=null,gt=null,_t=null,vt=!1,yt=!1,bt=null,xt=null,St=0,Ct=1,wt=class e{id=Ct++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Set;#r=new Map;#i=new Map;#a=null;#o=[];#s=[];#c=new Set;#l=new Set;#u=new Map;#d=new Set;is_fork=!1;#f=!1;#p=new Set;#m(){return this.is_fork||this.#i.size>0}#h(){for(let n of this.#p)for(let r of n.#i.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#u.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#u.has(e)||this.#u.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#u.get(e);if(n){this.#u.delete(e);for(var r of n.d)ot(r,b),t(r);for(r of n.m)ot(r,x),t(r)}this.#d.add(e)}#g(){if(St++>1e3&&(pt.delete(this),Et()),!this.#m()){for(let e of this.#c)this.#l.delete(e),ot(e,b),this.schedule(e);for(let e of this.#l)ot(e,x),this.schedule(e)}let t=this.#o;this.#o=[],this.apply();var n=bt=[],r=[],i=xt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Nt(e),t}if(mt=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(bt=null,xt=null,this.#m()||this.#h()){this.#v(r),this.#v(n);for(let[e,t]of this.#u)Mt(e,t)}else{this.#r.size===0&&pt.delete(this),this.#c.clear(),this.#l.clear();for(let e of this.#e)e(this);this.#e.clear(),ht=this,Ot(r),Ot(n),ht=null,this.#a?.resolve()}var o=mt;if(this.#o.length>0){let e=o??=this;e.#o.push(...this.#o.filter(t=>!e.#o.includes(t)))}o!==null&&(pt.add(o),o.#g()),Ke&&!pt.has(this)&&this.#y()}#_(e,t,n){e.f^=y;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#u.has(r))&&r.fn!==null){a?r.f^=y:i&4?t.push(r):Ke&&i&16777224?n.push(r):yr(r)&&(i&16&&this.#l.add(r),wr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(e){for(var t=0;t<e.length;t+=1)lt(e[t],this.#c,this.#l)}capture(e,t,n=!1){e.v!==Oe&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),gt?.set(e,t)),this.is_fork||(e.v=t)}activate(){mt=this}deactivate(){mt=null,gt=null}flush(){try{yt=!0,mt=this,this.#g()}finally{St=0,_t=null,bt=null,xt=null,yt=!1,mt=null,gt=null,Qt.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),this.#n.clear(),pt.delete(this)}register_created_effect(e){this.#s.push(e)}#y(){for(let l of pt){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#d)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#v([e])});l.activate();var i=new Set,a=new Map;for(var o of t)kt(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#s)!(e.f&155648)&&At(e,s,a)&&(e.f&4194320?(ot(e,b),l.schedule(e)):l.#c.add(e));if(l.#o.length>0){l.apply();for(var c of l.#o)l.#_(c,[],[]);l.#o=[]}l.deactivate()}}for(let e of pt)e.#p.has(this)&&(e.#p.delete(this),e.#p.size===0&&!e.#m()&&(e.activate(),e.#g()))}increment(e,t){let n=this.#r.get(t)??0;if(this.#r.set(t,n+1),e){let e=this.#i.get(t)??0;this.#i.set(t,e+1)}}decrement(e,t,n){let r=this.#r.get(t)??0;if(r===1?this.#r.delete(t):this.#r.set(t,r-1),e){let e=this.#i.get(t)??0;e===1?this.#i.delete(t):this.#i.set(t,e-1)}this.#f||n||(this.#f=!0,tt(()=>{this.#f=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#c.add(t);for(let e of t)this.#l.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}on_fork_commit(e){this.#n.add(e)}run_fork_commit_callbacks(){for(let e of this.#n)e(this);this.#n.clear()}settled(){return(this.#a??=v()).promise}static ensure(){if(mt===null){let t=mt=new e;yt||(pt.add(mt),vt||tt(()=>{mt===t&&t.flush()}))}return mt}apply(){if(!Ke||!this.is_fork&&pt.size===1){gt=null;return}gt=new Map;for(let[e,[t]]of this.current)gt.set(e,t);for(let n of pt)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#p.add(n);else for(let[e,t]of n.previous)gt.has(e)||gt.set(e,t)}}schedule(e){if(_t=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(bt!==null&&t===or&&(Ke||(rr===null||!(rr.f&2))&&!ut))return;if(n&96){if(!(n&1024))return;t.f^=y}}this.#o.push(t)}};function Tt(e){var t=vt;vt=!0;try{var n;for(e&&(mt!==null&&!mt.is_fork&&mt.flush(),n=e());;){if(nt(),mt===null)return n;mt.flush()}}finally{vt=t}}function Et(){try{xe()}catch(e){it(e,_t)}}var Dt=null;function Ot(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&yr(r)&&(Dt=new Set,wr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&qn(r),Dt?.size>0)){Qt.clear();for(let e of Dt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Dt.has(n)&&(Dt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||wr(n)}}Dt.clear()}}Dt=null}}function kt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?kt(i,t,n,r):e&4194320&&!(e&2048)&&At(i,t,r)&&(ot(i,b),jt(i))}}function At(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(s.call(t,r))return!0;if(r.f&2&&At(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function jt(e){mt.schedule(e)}function Mt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ot(e,y);for(var n=e.first;n!==null;)Mt(n,t),n=n.next}}function Nt(e){ot(e,y);for(var t=e.first;t!==null;)Nt(t),t=t.next}function Pt(e){let t=0,n=en(0),r;return()=>{jn()&&(k(n),Rn(()=>(t===0&&(r=Or(()=>e(()=>on(n)))),t+=1,()=>{tt(()=>{--t,t===0&&(r?.(),r=void 0,on(n))})})))}}var Ft=ne|re;function It(e,t,n,r){new Lt(e,t,n,r)}var Lt=class{parent;is_pending=!1;transform_error;#e;#t=w?Le:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Pt(()=>(this.#m=en(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=or;t.b=this,t.f|=128,n(e)},this.parent=or.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Bn(()=>{if(w){let e=this.#t;ze();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},Ft),w&&(this.#e=Le)}#g(){try{this.#a=Vn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Vn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Vn(()=>e(this.#e)),tt(()=>{var e=this.#c=document.createDocumentFragment(),t=gn();e.append(t),this.#a=this.#x(()=>Vn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Jn(this.#o,()=>{this.#o=null}),this.#b(mt))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Vn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Qn(this.#a,e);let t=this.#n.pending;this.#o=Vn(()=>t(this.#e))}else this.#b(mt)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){lt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=or,n=rr,r=Je;sr(this.#i),ar(this.#i),Ye(this.#i.ctx);try{return wt.ensure(),e()}catch(e){return rt(e),null}finally{sr(t),ar(n),Ye(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Jn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,tt(()=>{this.#d=!1,this.#m&&rn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),k(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;mt?.is_fork?(this.#a&&mt.skip_effect(this.#a),this.#o&&mt.skip_effect(this.#o),this.#s&&mt.skip_effect(this.#s),mt.on_fork_commit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(Gn(this.#a),null),this.#o&&=(Gn(this.#o),null),this.#s&&=(Gn(this.#s),null),w&&(Re(this.#t),Be(),Re(Ve()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Fe();return}r=!0,i&&Ee(),this.#s!==null&&Jn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){it(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Vn(()=>{var t=or;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return it(e,this.#i.parent),null}}))};tt(()=>{var t;try{t=this.transform_error(e)}catch(e){it(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>it(e,this.#i&&this.#i.parent)):o(t)})}};function Rt(e,t,n,r){let i=Qe()?Ht:Gt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=or,s=zt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||it(e,o)}Bt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Vt();function d(){Promise.all(n.map(e=>Ut(e))).then(e=>l([...t.map(i),...e])).catch(e=>it(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Bt()}):d()}function zt(){var e=or,t=rr,n=Je,r=mt;return function(i=!0){sr(e),ar(t),Ye(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Bt(e=!0){sr(null),ar(null),Ye(null),e&&mt?.deactivate()}function Vt(){var e=or,t=e.b,n=mt,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ht(e){var t=2|b;return or!==null&&(or.f|=re),{ctx:Je,deps:null,effects:null,equals:Ue,f:t,fn:e,reactions:null,rv:0,v:Oe,wv:0,parent:or,ac:null}}function Ut(e,t,n){let r=or;r===null&&ge();var i=void 0,a=en(Oe),o=!rr,s=new Map;return Ln(()=>{var t=or,n=v();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Bt)}catch(e){n.reject(e),Bt()}var c=mt;if(o){if(t.f&32768)var l=Vt();if(r.b.is_rendered())s.get(c)?.reject(pe),s.delete(c);else{for(let e of s.values())e.reject(pe);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===pe),!(n===pe||t.f&16384)){if(c.activate(),n)a.f|=le,rn(a,n);else{a.f&8388608&&(a.f^=le),rn(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(pe)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Mn(()=>{for(let e of s.values())e.reject(pe)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Wt(e){let t=Ht(e);return Ke||lr(t),t}function Gt(e){let t=Ht(e);return t.equals=Ge,t}function Kt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Gn(t[n])}}function qt(e){var t,n=or,r=e.parent;if(!tr&&r!==null&&r.f&24576)return Me(),e.v;sr(r);try{e.f&=~oe,Kt(e),t=xr(e)}finally{sr(n)}return t}function Jt(e){var t=qt(e);if(!e.equals(t)&&(e.wv=vr(),(!mt?.is_fork||e.deps===null)&&(mt===null?e.v=t:mt.capture(e,t,!0),e.deps===null))){ot(e,y);return}tr||(gt===null?st(e):(jn()||mt?.is_fork)&&gt.set(e,t))}function Yt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(pe),t.teardown=g,t.ac=null,Cr(t,0),Un(t))}function Xt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&wr(t)}var Zt=new Set,Qt=new Map,$t=!1;function en(e,t){return{f:0,v:e,reactions:null,equals:Ue,rv:0,wv:0}}function tn(e,t){let n=en(e,t);return lr(n),n}function nn(e,t=!1,n=!0){let r=en(e);return t||(r.equals=Ge),qe&&n&&Je!==null&&Je.l!==null&&(Je.l.s??=[]).push(r),r}function E(e,t,n=!1){return rr!==null&&(!ir||rr.f&131072)&&Qe()&&rr.f&4325394&&(cr===null||!s.call(cr,e))&&Te(),rn(e,n?cn(t):t,xt)}function rn(e,t,n=null){if(!e.equals(t)){Qt.set(e,tr?t:e.v);var r=wt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&qt(t),gt===null&&st(t)}e.wv=vr(),sn(e,b,n),Qe()&&or!==null&&or.f&1024&&!(or.f&96)&&(fr===null?pr([e]):fr.push(e)),!r.is_fork&&Zt.size>0&&!$t&&an()}return t}function an(){$t=!1;for(let e of Zt)e.f&1024&&ot(e,x),yr(e)&&wr(e);Zt.clear()}function on(e){E(e,e.v+1)}function sn(e,t,n){var r=e.reactions;if(r!==null)for(var i=Qe(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===or)){var l=(c&b)===0;if(l&&ot(s,t),c&2){var u=s;gt?.delete(u),c&65536||(c&512&&(or===null||!(or.f&2097152))&&(s.f|=oe),sn(u,x,n))}else if(l){var d=s;c&16&&Dt!==null&&Dt.add(d),n===null?jt(d):n.push(d)}}}}function cn(e){if(typeof e!=`object`||!e||ue in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var n=new Map,r=a(e),i=tn(0),o=null,s=gr,c=e=>{if(gr===s)return e();var t=rr,n=gr;ar(null),_r(s);var r=e();return ar(t),_r(n),r};return r&&n.set(`length`,tn(e.length,o)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Ce();var i=n.get(t);return i===void 0?c(()=>{var e=tn(r.value,o);return n.set(t,e),e}):E(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=c(()=>tn(Oe,o));n.set(t,e),on(i)}}else E(r,Oe),on(i);return!0},get(t,r,i){if(r===ue)return e;var a=n.get(r),s=r in t;if(a===void 0&&(!s||u(t,r)?.writable)&&(a=c(()=>tn(cn(s?t[r]:Oe),o)),n.set(r,a)),a!==void 0){var l=k(a);return l===Oe?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=k(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Oe)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===ue)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Oe||Reflect.has(e,t);return(r!==void 0||or!==null&&(!i||u(e,t)?.writable))&&(r===void 0&&(r=c(()=>tn(i?cn(e[t]):Oe,o)),n.set(t,r)),k(r)===Oe)?!1:i},set(e,t,a,s){var l=n.get(t),d=t in e;if(r&&t===`length`)for(var f=a;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=c(()=>tn(Oe,o)),n.set(f+``,p)):E(p,Oe)}if(l===void 0)(!d||u(e,t)?.writable)&&(l=c(()=>tn(void 0,o)),E(l,cn(a)),n.set(t,l));else{d=l.v!==Oe;var m=c(()=>cn(a));E(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,a),!d){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&E(g,_+1)}on(i)}return!0},ownKeys(e){k(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Oe});for(var[r,a]of n)a.v!==Oe&&!(r in e)&&t.push(r);return t},setPrototypeOf(){we()}})}function ln(e){try{if(typeof e==`object`&&e&&ue in e)return e[ue]}catch{}return e}function un(e,t){return Object.is(ln(e),ln(t))}var dn,fn,pn,mn;function hn(){if(dn===void 0){dn=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;pn=u(t,`firstChild`).get,mn=u(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function gn(e=``){return document.createTextNode(e)}function _n(e){return pn.call(e)}function vn(e){return mn.call(e)}function D(e,t){if(!w)return _n(e);var n=_n(Le);if(n===null)n=Le.appendChild(gn());else if(t&&n.nodeType!==3){var r=gn();return n?.before(r),Re(r),r}return t&&Cn(n),Re(n),n}function yn(e,t=!1){if(!w){var n=_n(e);return n instanceof Comment&&n.data===``?vn(n):n}if(t){if(Le?.nodeType!==3){var r=gn();return Le?.before(r),Re(r),r}Cn(Le)}return Le}function O(e,t=1,n=!1){let r=w?Le:e;for(var i;t--;)i=r,r=vn(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=gn();return r===null?i?.after(a):r.before(a),Re(a),a}Cn(r)}return Re(r),r}function bn(e){e.textContent=``}function xn(){return!Ke||Dt!==null?!1:(or.f&C)!==0}function Sn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Cn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var wn=!1;function Tn(){wn||(wn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function En(e){var t=rr,n=or;ar(null),sr(null);try{return e()}finally{ar(t),sr(n)}}function Dn(e,t,n,r=n){e.addEventListener(t,()=>En(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),Tn()}function On(e){or===null&&(rr===null&&be(e),ye()),tr&&ve(e)}function kn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function An(e,t){var n=or;n!==null&&n.f&8192&&(e|=S);var r={ctx:Je,deps:null,nodes:null,f:e|b|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};mt?.register_created_effect(r);var i=r;if(e&4)bt===null?wt.ensure().schedule(r):bt.push(r);else if(t!==null){try{wr(r)}catch(e){throw Gn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&kn(i,n),rr!==null&&rr.f&2&&!(e&64))){var a=rr;(a.effects??=[]).push(i)}return r}function jn(){return rr!==null&&!ir}function Mn(e){let t=An(8,null);return ot(t,y),t.teardown=e,t}function Nn(e){On(`$effect`);var t=or.f;if(!rr&&t&32&&!(t&32768)){var n=Je;(n.e??=[]).push(e)}else return Pn(e)}function Pn(e){return An(4|ie,e)}function Fn(e){wt.ensure();let t=An(64|re,e);return(e={})=>new Promise(n=>{e.outro?Jn(t,()=>{Gn(t),n(void 0)}):(Gn(t),n(void 0))})}function In(e){return An(4,e)}function Ln(e){return An(ce|re,e)}function Rn(e,t=0){return An(8|t,e)}function zn(e,t=[],n=[],r=[]){Rt(r,t,n,t=>{An(8,()=>e(...t.map(k)))})}function Bn(e,t=0){return An(16|t,e)}function Vn(e){return An(32|re,e)}function Hn(e){var t=e.teardown;if(t!==null){let e=tr,n=rr;nr(!0),ar(null);try{t.call(null)}finally{nr(e),ar(n)}}}function Un(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&En(()=>{e.abort(pe)});var r=n.next;n.f&64?n.parent=null:Gn(n,t),n=r}}function Wn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Gn(t),t=n}}function Gn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Kn(e.nodes.start,e.nodes.end),n=!0),ot(e,te),Un(e,t&&!n),Cr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Hn(e),e.f^=te,e.f|=ee;var i=e.parent;i!==null&&i.first!==null&&qn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Kn(e,t){for(;e!==null;){var n=e===t?null:vn(e);e.remove(),e=n}}function qn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Jn(e,t,n=!0){var r=[];Yn(e,r,!0);var i=()=>{n&&Gn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Yn(e,t,n){if(!(e.f&8192)){e.f^=S;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Yn(i,t,o?n:!1)}i=a}}}function Xn(e){Zn(e,!0)}function Zn(e,t){if(e.f&8192){e.f^=S,e.f&1024||(ot(e,b),wt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Zn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Qn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:vn(n);t.append(n),n=i}}var $n=null,er=!1,tr=!1;function nr(e){tr=e}var rr=null,ir=!1;function ar(e){rr=e}var or=null;function sr(e){or=e}var cr=null;function lr(e){rr!==null&&(!Ke||rr.f&2)&&(cr===null?cr=[e]:cr.push(e))}var ur=null,dr=0,fr=null;function pr(e){fr=e}var mr=1,hr=0,gr=hr;function _r(e){gr=e}function vr(){return++mr}function yr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~oe),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(yr(a)&&Jt(a),a.wv>e.wv)return!0}t&512&&gt===null&&ot(e,y)}return!1}function br(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ke&&cr!==null&&s.call(cr,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?br(a,t,!1):t===a&&(n?ot(a,b):a.f&1024&&ot(a,x),jt(a))}}function xr(e){var t=ur,n=dr,r=fr,i=rr,a=cr,o=Je,s=ir,c=gr,l=e.f;ur=null,dr=0,fr=null,rr=l&96?null:e,cr=null,Ye(e.ctx),ir=!1,gr=++hr,e.ac!==null&&(En(()=>{e.ac.abort(pe)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=C;var f=e.deps,p=mt?.is_fork;if(ur!==null){var m;if(p||Cr(e,dr),f!==null&&dr>0)for(f.length=dr+ur.length,m=0;m<ur.length;m++)f[dr+m]=ur[m];else e.deps=f=ur;if(jn()&&e.f&512)for(m=dr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&dr<f.length&&(Cr(e,dr),f.length=dr);if(Qe()&&fr!==null&&!ir&&f!==null&&!(e.f&6146))for(m=0;m<fr.length;m++)br(fr[m],e);if(i!==null&&i!==e){if(hr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=hr;if(t!==null)for(let e of t)e.rv=hr;fr!==null&&(r===null?r=fr:r.push(...fr))}return e.f&8388608&&(e.f^=le),d}catch(e){return rt(e)}finally{e.f^=se,ur=t,dr=n,fr=r,rr=i,cr=a,Ye(o),ir=s,gr=c}}function Sr(e,t){let n=t.reactions;if(n!==null){var r=o.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(ur===null||!s.call(ur,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~oe),a.v!==Oe&&st(a),Yt(a),Cr(a,0)}}function Cr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Sr(e,n[r])}function wr(e){var t=e.f;if(!(t&16384)){ot(e,y);var n=or,r=er;or=e,er=!0;try{t&16777232?Wn(e):Un(e),Hn(e);var i=xr(e);e.teardown=typeof i==`function`?i:null,e.wv=mr}finally{er=r,or=n}}}async function Tr(){if(Ke)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Tt()}function k(e){var t=(e.f&2)!=0;if($n?.add(e),rr!==null&&!ir&&!(or!==null&&or.f&16384)&&(cr===null||!s.call(cr,e))){var n=rr.deps;if(rr.f&2097152)e.rv<hr&&(e.rv=hr,ur===null&&n!==null&&n[dr]===e?dr++:ur===null?ur=[e]:ur.push(e));else{(rr.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[rr]:s.call(r,rr)||r.push(rr)}}if(tr&&Qt.has(e))return Qt.get(e);if(t){var i=e;if(tr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Dr(i))&&(a=qt(i)),Qt.set(i,a),a}var o=(i.f&512)==0&&!ir&&rr!==null&&(er||(rr.f&512)!=0),c=(i.f&C)===0;yr(i)&&(o&&(i.f|=512),Jt(i)),o&&!c&&(Xt(i),Er(i))}if(gt?.has(e))return gt.get(e);if(e.f&8388608)throw e.v;return e.v}function Er(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Xt(t),Er(t))}function Dr(e){if(e.v===Oe)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Qt.has(t)||t.f&2&&Dr(t))return!0;return!1}function Or(e){var t=ir;try{return ir=!0,e()}finally{ir=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var kr=[`touchstart`,`touchmove`];function Ar(e){return kr.includes(e)}var jr=Symbol(`events`),Mr=new Set,Nr=new Set;function Pr(e,t,n,r={}){function i(e){if(r.capture||zr.call(t,e),!e.cancelBubble)return En(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?tt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Fr(e,t,n,r,i){var a={capture:r,passive:i},o=Pr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Mn(()=>{t.removeEventListener(e,o,a)})}function Ir(e,t,n){(t[jr]??={})[e]=n}function Lr(e){for(var t=0;t<e.length;t++)Mr.add(e[t]);for(var n of Nr)n(e)}var Rr=null;function zr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Rr=e;var o=0,s=Rr===e&&e[jr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[jr]=t;return}var u=i.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(a=i[o]||e.target,a!==t){l(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=rr,f=or;ar(null),sr(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[jr]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[jr]=t,delete e.currentTarget,ar(d),sr(f)}}}var Br=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Vr(e){return Br?.createHTML(e)??e}function Hr(e){var t=Sn(`template`);return t.innerHTML=Vr(e.replaceAll(`<!>`,`<!---->`)),t.content}function Ur(e,t){var n=or;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function A(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(w)return Ur(Le,null),Le;i===void 0&&(i=Hr(a?e:`<!>`+e),n||(i=_n(i)));var t=r||fn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=_n(t),s=t.lastChild;Ur(o,s)}else Ur(t,t);return t}}function Wr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(w)return Ur(Le,null),Le;if(!o){var e=_n(Hr(a));if(i)for(o=document.createDocumentFragment();_n(e);)o.appendChild(_n(e));else o=_n(e)}var t=o.cloneNode(!0);if(i){var n=_n(t),r=t.lastChild;Ur(n,r)}else Ur(t,t);return t}}function Gr(e,t){return Wr(e,t,`svg`)}function Kr(){if(w)return Ur(Le,null),Le;var e=document.createDocumentFragment(),t=document.createComment(``),n=gn();return e.append(t,n),Ur(t,n),e}function j(e,t){if(w){var n=or;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Le),ze();return}e!==null&&e.before(t)}function qr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function Jr(e,t){return Xr(e,t)}var Yr=new Map;function Xr(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){hn();var l=void 0,u=Fn(()=>{var o=n??t.appendChild(gn());It(o,{pending:()=>{}},t=>{Xe({});var n=Je;if(a&&(n.c=a),i&&(r.$$events=i),w&&Ur(t,null),l=e(t,r)||{},w&&(or.nodes.end=Le,Le===null||Le.nodeType!==8||Le.data!==`]`))throw Ne(),De;Ze()},s);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Ar(r);for(let e of[t,document]){var a=Yr.get(e);a===void 0&&(a=new Map,Yr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,zr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(c(Mr)),Nr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Yr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,zr),r.delete(e),r.size===0&&Yr.delete(n)):r.set(e,i)}Nr.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return Zr.set(l,u),l}var Zr=new WeakMap;function Qr(e,t){let n=Zr.get(e);return n?(Zr.delete(e),n(t)):Promise.resolve()}var $r=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Xn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Gn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Qn(r,t),t.append(gn()),this.#n.set(e,{effect:r,fragment:t})}else Gn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Jn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Gn(n.effect),this.#n.delete(e))};ensure(e,t){var n=mt,r=xn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=gn();i.append(a),this.#n.set(e,{effect:Vn(()=>t(a)),fragment:i})}else this.#t.set(e,Vn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else w&&(this.anchor=Le),this.#a(n)}};function ei(e,t,n=!1){var r;w&&(r=Le,ze());var i=new $r(e),a=n?ne:0;function o(e,t){if(w){var n=He(r);if(e!==parseInt(n.substring(1))){var a=Ve();Re(a),i.anchor=a,Ie(!1),i.ensure(e,t),Ie(!0);return}}i.ensure(e,t)}Bn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function ti(e,t){return t}function ni(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Jn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;ri(e,c(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;bn(d),d.append(u),e.items.clear()}ri(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function ri(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ae,Qn(a,document.createDocumentFragment())):Gn(t[i],n)}}var ii;function ai(e,t,n,r,i,o=null){var s=e,l=new Map;if(t&4){var u=e;s=w?Re(_n(u)):u.appendChild(gn())}w&&ze();var d=null,f=Gt(()=>{var e=n();return a(e)?e:e==null?[]:c(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,si(v,p,s,t,r),d!==null&&(p.length===0?d.f&33554432?(d.f^=ae,li(d,null,s)):Xn(d):Jn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Bn(()=>{p=k(f);var e=p.length;let a=!1;w&&He(s)===`[!`!=(e===0)&&(s=Ve(),Re(s),Ie(!1),a=!0);for(var c=new Set,u=mt,v=xn(),y=0;y<e;y+=1){w&&Le.nodeType===8&&Le.data===`]`&&(s=Le,a=!0,Ie(!1));var b=p[y],x=r(b,y),S=h?null:l.get(x);S?(S.v&&rn(S.v,b),S.i&&rn(S.i,y),v&&u.unskip_effect(S.e)):(S=ci(l,h?s:ii??=gn(),b,x,y,i,t,n),h||(S.e.f|=ae),l.set(x,S)),c.add(x)}if(e===0&&o&&!d&&(h?d=Vn(()=>o(s)):(d=Vn(()=>o(ii??=gn())),d.f|=ae)),e>c.size&&_e(``,``,``),w&&e>0&&Re(Ve()),!h)if(m.set(u,c),v){for(let[e,t]of l)c.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);a&&Ie(!0),k(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,w&&(s=Le)}function oi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function si(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,l=oi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Xn(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ae,_===l)li(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ui(e,d,_),ui(e,_,y),li(_,y,n),d=_,p=[],m=[],l=oi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)li(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);ui(e,S.prev,ee.next),ui(e,d,S),ui(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),li(_,l,n),ui(e,_.prev,_.next),ui(e,_,d===null?e.effect.first:d.next),ui(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=oi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=oi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(ri(e,c(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var C=[];if(u!==void 0)for(_ of u)_.f&8192||C.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&C.push(l),l=oi(l.next);var te=C.length;if(te>0){var ne=r&4&&o===0?n:null;if(a){for(v=0;v<te;v+=1)C[v].nodes?.a?.measure();for(v=0;v<te;v+=1)C[v].nodes?.a?.fix()}ni(e,C,ne)}}a&&tt(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function ci(e,t,n,r,i,a,o,s){var c=o&1?o&16?en(n):nn(n,!1,!1):null,l=o&2?en(i):null;return{v:c,i:l,e:Vn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function li(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=vn(r);if(a.before(r),r===i)return;r=o}}function ui(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function di(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;w&&(o=Re(_n(c)))}zn(()=>{var e=or;if(s===(s=t()??``)){w&&ze();return}if(n&&!w){e.nodes=null,c.innerHTML=s,s!==``&&Ur(_n(c),c.lastChild);return}if(e.nodes!==null&&(Kn(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(w){for(var a=Le.data,l=ze(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=vn(l);if(l===null)throw Ne(),De;Ur(Le,u),o=Re(l);return}var d=Sn(r?`svg`:i?`math`:`template`,r?Ae:i?je:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(Ur(_n(f),f.lastChild),r||i)for(;_n(f);)o.before(_n(f));else o.before(f)}})}function fi(e,t,...n){var r=new $r(e);Bn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ne)}var pi=[...`
+\r\f\xA0\v`];function mi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||pi.includes(r[o-1]))&&(s===r.length||pi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function hi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function gi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function _i(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(gi)),i&&c.push(...Object.keys(i).map(gi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=gi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=hi(r)),i&&(n+=hi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function vi(e,t,n,r,i,a){var o=e.__className;if(w||o!==n||o===void 0){var s=mi(n,r,a);(!w||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function yi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function bi(e,t,n,r){var i=e.__style;if(w||i!==t){var a=_i(t,r);(!w||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(yi(e,n?.[0],r[0]),yi(e,n?.[1],r[1],`important`)):yi(e,n,r));return r}function xi(e,t,n=!1){if(e.multiple){if(t==null)return;if(!a(t))return Pe();for(var r of e.options)r.selected=t.includes(Ci(r));return}for(r of e.options)if(un(Ci(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Si(e){var t=new MutationObserver(()=>{xi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Mn(()=>{t.disconnect()})}function Ci(e){return`__value`in e?e.__value:e.value}var wi=Symbol(`is custom element`),Ti=Symbol(`is html`),Ei=me?`link`:`LINK`;function Di(e){if(w){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Oi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Oi(e,`checked`,null),e.checked=r}}};e.__on_r=n,tt(n),Tn()}}function Oi(e,t,n,r){var i=ki(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ei)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ji(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ki(e){return e.__attributes??={[wi]:e.nodeName.includes(`-`),[Ti]:e.namespaceURI===ke}}var Ai=new Map;function ji(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ai.get(t);if(n)return n;Ai.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&n.push(o);i=m(i)}return n}function Mi(e,t,n=t){var r=new WeakSet;Dn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ni(e)?Pi(a):a,n(a),mt!==null&&r.add(mt),await Tr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(w&&e.defaultValue!==e.value||Or(t)==null&&e.value)&&(n(Ni(e)?Pi(e.value):e.value),mt!==null&&r.add(mt)),Rn(()=>{var n=t();if(e===document.activeElement){var i=Ke?ht:mt;if(r.has(i))return}Ni(e)&&n===Pi(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Ni(e){var t=e.type;return t===`number`||t===`range`}function Pi(e){return e===``?null:+e}function Fi(e,t){return e===t||e?.[ue]===t}function Ii(e={},t,n,r){var i=Je.r,a=or;return In(()=>{var o,s;return Rn(()=>{o=s,s=r?.()||[],Or(()=>{e!==n(...s)&&(t(e,...s),o&&Fi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Fi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Li(e,t,n,r){var i=!qe||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Or(r):r),s);let d;if(a){var f=ue in e||de in e;d=u(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=ft(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),d&&(i&&Se(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Ht:Gt)(()=>(_=!1,h()));a&&k(v);var y=or;return(function(e,t){if(arguments.length>0){let n=t?k(v):i&&a?cn(e):e;return E(v,n),_=!0,s!==void 0&&(s=n),e}return tr&&_||y.f&16384?v.v:k(v)})}function Ri(e){Je===null&&he(`onMount`),qe&&Je.l!==null?zi(Je).m.push(e):Nn(()=>{let t=Or(e);if(typeof t==`function`)return t})}function zi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Bi,Vi,Hi=n((()=>{Bi=`16.13.2`,Vi=Object.freeze({major:16,minor:13,patch:2,preReleaseTag:null})}));function Ui(e,t){if(!e)throw Error(t)}var Wi=n((()=>{}));function Gi(e){return typeof e?.then==`function`}var Ki=n((()=>{}));function qi(e){return typeof e==`object`&&!!e}var Ji=n((()=>{}));function Yi(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}var Xi=n((()=>{}));function Zi(e,t){let n=0,r=1;for(let i of e.body.matchAll(Qi)){if(typeof i.index==`number`||Yi(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}var Qi,$i=n((()=>{Xi(),Qi=/\r\n|[\n\r]/g}));function ea(e){return ta(e.source,Zi(e.source,e.start))}function ta(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+na([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+na([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function na(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
+`)}var ra=n((()=>{$i()}));function ia(e){let t=e[0];return t==null||`kind`in t||`length`in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function aa(e){return e===void 0||e.length===0?void 0:e}function oa(e){return e.toString()}function sa(e){return e.toJSON()}var M,N=n((()=>{Ji(),$i(),ra(),M=class e extends Error{constructor(t,...n){let{nodes:r,source:i,positions:a,path:o,originalError:s,extensions:c}=ia(n);super(t),this.name=`GraphQLError`,this.path=o??void 0,this.originalError=s??void 0,this.nodes=aa(Array.isArray(r)?r:r?[r]:void 0);let l=aa(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??l?.[0]?.source,this.positions=a??l?.map(e=>e.start),this.locations=a&&i?a.map(e=>Zi(i,e)):l?.map(e=>Zi(e.source,e.start));let u=qi(s?.extensions)?s?.extensions:void 0;this.extensions=c??u??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?Object.defineProperty(this,`stack`,{value:s.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,`stack`,{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
+
+`+ea(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
+
+`+ta(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}}));function ca(e,t,n){return new M(`Syntax Error: ${n}`,{source:e,positions:[t]})}var la=n((()=>{N()}));function ua(e){let t=e?.kind;return typeof t==`string`&&ma.has(t)}var da,fa,pa,ma,ha,ga=n((()=>{da=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},fa=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return`Token`}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},pa={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentSpread:[`name`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`locations`],SchemaExtension:[`directives`,`operationTypes`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},ma=new Set(Object.keys(pa)),(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(ha||={})})),P,_a=n((()=>{(function(e){e.QUERY=`QUERY`,e.MUTATION=`MUTATION`,e.SUBSCRIPTION=`SUBSCRIPTION`,e.FIELD=`FIELD`,e.FRAGMENT_DEFINITION=`FRAGMENT_DEFINITION`,e.FRAGMENT_SPREAD=`FRAGMENT_SPREAD`,e.INLINE_FRAGMENT=`INLINE_FRAGMENT`,e.VARIABLE_DEFINITION=`VARIABLE_DEFINITION`,e.SCHEMA=`SCHEMA`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.FIELD_DEFINITION=`FIELD_DEFINITION`,e.ARGUMENT_DEFINITION=`ARGUMENT_DEFINITION`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.ENUM_VALUE=`ENUM_VALUE`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.INPUT_FIELD_DEFINITION=`INPUT_FIELD_DEFINITION`})(P||={})})),F,va=n((()=>{(function(e){e.NAME=`Name`,e.DOCUMENT=`Document`,e.OPERATION_DEFINITION=`OperationDefinition`,e.VARIABLE_DEFINITION=`VariableDefinition`,e.SELECTION_SET=`SelectionSet`,e.FIELD=`Field`,e.ARGUMENT=`Argument`,e.FRAGMENT_SPREAD=`FragmentSpread`,e.INLINE_FRAGMENT=`InlineFragment`,e.FRAGMENT_DEFINITION=`FragmentDefinition`,e.VARIABLE=`Variable`,e.INT=`IntValue`,e.FLOAT=`FloatValue`,e.STRING=`StringValue`,e.BOOLEAN=`BooleanValue`,e.NULL=`NullValue`,e.ENUM=`EnumValue`,e.LIST=`ListValue`,e.OBJECT=`ObjectValue`,e.OBJECT_FIELD=`ObjectField`,e.DIRECTIVE=`Directive`,e.NAMED_TYPE=`NamedType`,e.LIST_TYPE=`ListType`,e.NON_NULL_TYPE=`NonNullType`,e.SCHEMA_DEFINITION=`SchemaDefinition`,e.OPERATION_TYPE_DEFINITION=`OperationTypeDefinition`,e.SCALAR_TYPE_DEFINITION=`ScalarTypeDefinition`,e.OBJECT_TYPE_DEFINITION=`ObjectTypeDefinition`,e.FIELD_DEFINITION=`FieldDefinition`,e.INPUT_VALUE_DEFINITION=`InputValueDefinition`,e.INTERFACE_TYPE_DEFINITION=`InterfaceTypeDefinition`,e.UNION_TYPE_DEFINITION=`UnionTypeDefinition`,e.ENUM_TYPE_DEFINITION=`EnumTypeDefinition`,e.ENUM_VALUE_DEFINITION=`EnumValueDefinition`,e.INPUT_OBJECT_TYPE_DEFINITION=`InputObjectTypeDefinition`,e.DIRECTIVE_DEFINITION=`DirectiveDefinition`,e.SCHEMA_EXTENSION=`SchemaExtension`,e.SCALAR_TYPE_EXTENSION=`ScalarTypeExtension`,e.OBJECT_TYPE_EXTENSION=`ObjectTypeExtension`,e.INTERFACE_TYPE_EXTENSION=`InterfaceTypeExtension`,e.UNION_TYPE_EXTENSION=`UnionTypeExtension`,e.ENUM_TYPE_EXTENSION=`EnumTypeExtension`,e.INPUT_OBJECT_TYPE_EXTENSION=`InputObjectTypeExtension`,e.TYPE_COORDINATE=`TypeCoordinate`,e.MEMBER_COORDINATE=`MemberCoordinate`,e.ARGUMENT_COORDINATE=`ArgumentCoordinate`,e.DIRECTIVE_COORDINATE=`DirectiveCoordinate`,e.DIRECTIVE_ARGUMENT_COORDINATE=`DirectiveArgumentCoordinate`})(F||={})}));function ya(e){return e===9||e===32}function ba(e){return e>=48&&e<=57}function xa(e){return e>=97&&e<=122||e>=65&&e<=90}function Sa(e){return xa(e)||e===95}function Ca(e){return xa(e)||ba(e)||e===95}var wa=n((()=>{}));function Ta(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=Ea(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function Ea(e){let t=0;for(;t<e.length&&ya(e.charCodeAt(t));)++t;return t}function Da(e){if(e===``)return!0;let t=!0,n=!1,r=!0,i=!1;for(let a=0;a<e.length;++a)switch(e.codePointAt(a)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||=t;break;default:r&&=n,t=!1}return!(t||r&&i)}function Oa(e,t){let n=e.replace(/"""/g,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||ya(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!(t!=null&&t.minimize)&&(!i||e.length>70||l||a||o),d=``,f=i&&ya(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
+`),d+=n,(u||l)&&(d+=`
+`),`"""`+d+`"""`}var ka=n((()=>{wa()})),I,Aa=n((()=>{(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.DOT=`.`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(I||={})}));function ja(e){return e===I.BANG||e===I.DOLLAR||e===I.AMP||e===I.PAREN_L||e===I.PAREN_R||e===I.DOT||e===I.SPREAD||e===I.COLON||e===I.EQUALS||e===I.AT||e===I.BRACKET_L||e===I.BRACKET_R||e===I.BRACE_L||e===I.PIPE||e===I.BRACE_R}function Ma(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Na(e,t){return Pa(e.charCodeAt(t))&&Fa(e.charCodeAt(t+1))}function Pa(e){return e>=55296&&e<=56319}function Fa(e){return e>=56320&&e<=57343}function Ia(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return I.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function La(e,t,n,r,i){let a=e.line;return new fa(t,n,r,a,1+n-e.lineStart,i)}function Ra(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return za(e,i);case 33:return La(e,I.BANG,i,i+1);case 36:return La(e,I.DOLLAR,i,i+1);case 38:return La(e,I.AMP,i,i+1);case 40:return La(e,I.PAREN_L,i,i+1);case 41:return La(e,I.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return La(e,I.SPREAD,i,i+3);break;case 58:return La(e,I.COLON,i,i+1);case 61:return La(e,I.EQUALS,i,i+1);case 64:return La(e,I.AT,i,i+1);case 91:return La(e,I.BRACKET_L,i,i+1);case 93:return La(e,I.BRACKET_R,i,i+1);case 123:return La(e,I.BRACE_L,i,i+1);case 124:return La(e,I.PIPE,i,i+1);case 125:return La(e,I.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Ja(e,i):Ha(e,i)}if(ba(t)||t===45)return Ba(e,i,t);if(Sa(t))return Ya(e,i);throw ca(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ma(t)||Na(n,i)?`Unexpected character: ${Ia(e,i)}.`:`Invalid character: ${Ia(e,i)}.`)}return La(e,I.EOF,r,r)}function za(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(Ma(e))++i;else if(Na(n,i))i+=2;else break}return La(e,I.COMMENT,t,i,n.slice(t+1,i))}function Ba(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),ba(a))throw ca(e.source,i,`Invalid number, unexpected digit after 0: ${Ia(e,i)}.`)}else i=Va(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=Va(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=Va(e,i,a),a=r.charCodeAt(i)),a===46||Sa(a))throw ca(e.source,i,`Invalid number, expected digit but got: ${Ia(e,i)}.`);return La(e,o?I.FLOAT:I.INT,t,i,r.slice(t,i))}function Va(e,t,n){if(!ba(n))throw ca(e.source,t,`Invalid number, expected digit but got: ${Ia(e,t)}.`);let r=e.source.body,i=t+1;for(;ba(r.charCodeAt(i));)++i;return i}function Ha(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),La(e,I.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Ua(e,i):Wa(e,i):qa(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(Ma(r))++i;else if(Na(n,i))i+=2;else throw ca(e.source,i,`Invalid character within String: ${Ia(e,i)}.`)}throw ca(e.source,i,`Unterminated string.`)}function Ua(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+ i++);if(e===125){if(i<5||!Ma(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ka(e),r<0)break}throw ca(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Wa(e,t){let n=e.source.body,r=Ga(n,t+2);if(Ma(r))return{value:String.fromCodePoint(r),size:6};if(Pa(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=Ga(n,t+8);if(Fa(e))return{value:String.fromCodePoint(r,e),size:12}}throw ca(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Ga(e,t){return Ka(e.charCodeAt(t))<<12|Ka(e.charCodeAt(t+1))<<8|Ka(e.charCodeAt(t+2))<<4|Ka(e.charCodeAt(t+3))}function Ka(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function qa(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:`"`,size:2};case 92:return{value:`\\`,size:2};case 47:return{value:`/`,size:2};case 98:return{value:`\b`,size:2};case 102:return{value:`\f`,size:2};case 110:return{value:`
+`,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw ca(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ja(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=La(e,I.BLOCK_STRING,t,a+3,Ta(c).join(`
+`));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(Ma(r))++a;else if(Na(n,a))a+=2;else throw ca(e.source,a,`Invalid character within String: ${Ia(e,a)}.`)}throw ca(e.source,a,`Unterminated string.`)}function Ya(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&Ca(n.charCodeAt(i));)++i;return La(e,I.NAME,t,i,n.slice(t,i))}var Xa,Za=n((()=>{la(),ga(),ka(),wa(),Aa(),Xa=class{constructor(e){let t=new fa(I.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==I.EOF)do if(e.next)e=e.next;else{let t=Ra(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===I.COMMENT);return e}}}));function Qa(e,t){let n=e.source.body,r=n.length,i=t;if(i<r){let t=n.charCodeAt(i);switch(t){case 46:return La(e,I.DOT,i,i+1);case 40:return La(e,I.PAREN_L,i,i+1);case 41:return La(e,I.PAREN_R,i,i+1);case 58:return La(e,I.COLON,i,i+1);case 64:return La(e,I.AT,i,i+1)}if(Sa(t))return Ya(e,i);throw ca(e.source,i,`Invalid character: ${Ia(e,i)}.`)}return La(e,I.EOF,r,r)}var $a,eo=n((()=>{la(),ga(),wa(),Za(),Aa(),$a=class{line=1;lineStart=0;constructor(e){let t=new fa(I.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t}get[Symbol.toStringTag](){return`SchemaCoordinateLexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==I.EOF){let t=Qa(this,e.end);e.next=t,t.prev=e,e=t}return e}}}));function L(e){return to(e,[])}function to(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return no(e,t);default:return String(e)}}function no(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(ro(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:to(t,n)}else if(Array.isArray(e))return ao(e,n);return io(e,n)}function ro(e){return typeof e.toJSON==`function`}function io(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>co?`[`+oo(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+to(n,t)).join(`, `)+` }`}function ao(e,t){if(e.length===0)return`[]`;if(t.length>co)return`[Array]`;let n=Math.min(so,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(to(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function oo(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}var so,co,lo=n((()=>{so=10,co=2})),uo,fo,po=n((()=>{lo(),uo=globalThis.process&&process.env.NODE_ENV===`production`,fo=uo?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e==`object`&&e){let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){let t=L(e);throw Error(`Cannot use ${n} "${t}" from another module or realm.
+
+Ensure that there is only one instance of "graphql" in the node_modules
+directory. If different versions of "graphql" are the dependencies of other
+relied on modules, use "resolutions" to ensure only one version is installed.
+
+https://yarnpkg.com/en/docs/selective-version-resolutions
+
+Duplicate "graphql" modules cannot be used at the same time since different
+versions may have different capabilities and behavior. The data from one
+version used in the function from another could produce confusing and
+spurious results.`)}}return!1}}));function mo(e){return fo(e,ho)}var ho,go=n((()=>{Wi(),lo(),po(),ho=class{constructor(e,t=`GraphQL request`,n={line:1,column:1}){typeof e==`string`||Ui(!1,`Body must be a string. Received: ${L(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ui(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||Ui(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}}}));function _o(e,t){let n=new wo(e,t),r=n.parseDocument();return Object.defineProperty(r,`tokenCount`,{enumerable:!1,value:n.tokenCount}),r}function vo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(I.EOF),r}function yo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseConstValueLiteral();return n.expectToken(I.EOF),r}function bo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseTypeReference();return n.expectToken(I.EOF),r}function xo(e){let t=new wo(e,{lexer:new $a(mo(e)?e:new ho(e))});t.expectToken(I.SOF);let n=t.parseSchemaCoordinate();return t.expectToken(I.EOF),n}function So(e){let t=e.value;return Co(e.kind)+(t==null?``:` "${t}"`)}function Co(e){return ja(e)?`"${e}"`:e}var wo,To=n((()=>{la(),ga(),_a(),va(),Za(),eo(),go(),Aa(),wo=class{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let t=mo(e)?e:new ho(e);this._lexer=new Xa(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(I.NAME);return this.node(e,{kind:F.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:F.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF)})}parseDefinition(){if(this.peek(I.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===I.BRACE_L)throw ca(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are not supported on shorthand queries.`);if(t.kind===I.NAME){switch(t.value){case`schema`:return this.parseSchemaDefinition();case`scalar`:return this.parseScalarTypeDefinition();case`type`:return this.parseObjectTypeDefinition();case`interface`:return this.parseInterfaceTypeDefinition();case`union`:return this.parseUnionTypeDefinition();case`enum`:return this.parseEnumTypeDefinition();case`input`:return this.parseInputObjectTypeDefinition();case`directive`:return this.parseDirectiveDefinition()}switch(t.value){case`query`:case`mutation`:case`subscription`:return this.parseOperationDefinition();case`fragment`:return this.parseFragmentDefinition()}if(e)throw ca(this._lexer.source,this._lexer.token.start,`Unexpected description, only GraphQL definitions support descriptions.`);switch(t.value){case`extend`:return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(I.BRACE_L))return this.node(e,{kind:F.OPERATION_DEFINITION,operation:ha.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;return this.peek(I.NAME)&&(r=this.parseName()),this.node(e,{kind:F.OPERATION_DEFINITION,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(I.NAME);switch(e.value){case`query`:return ha.QUERY;case`mutation`:return ha.MUTATION;case`subscription`:return ha.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:F.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(I.DOLLAR),this.node(e,{kind:F.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:F.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R)})}parseSelection(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(I.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:F.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,t,I.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),this.node(t,{kind:F.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(I.SPREAD);let t=this.expectOptionalKeyword(`on`);return!t&&this.peek(I.NAME)?this.node(e,{kind:F.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:F.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword(`fragment`),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:F.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:F.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case I.BRACKET_L:return this.parseList(e);case I.BRACE_L:return this.parseObject(e);case I.INT:return this.advanceLexer(),this.node(t,{kind:F.INT,value:t.value});case I.FLOAT:return this.advanceLexer(),this.node(t,{kind:F.FLOAT,value:t.value});case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:F.BOOLEAN,value:!0});case`false`:return this.node(t,{kind:F.BOOLEAN,value:!1});case`null`:return this.node(t,{kind:F.NULL});default:return this.node(t,{kind:F.ENUM,value:t.value})}case I.DOLLAR:if(e)if(this.expectToken(I.DOLLAR),this._lexer.token.kind===I.NAME){let e=this._lexer.token.value;throw ca(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:F.STRING,value:e.value,block:e.kind===I.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:F.LIST,values:this.any(I.BRACKET_L,()=>this.parseValueLiteral(e),I.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:F.OBJECT,fields:this.any(I.BRACE_L,()=>this.parseObjectField(e),I.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),this.node(t,{kind:F.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(I.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(I.AT),this.node(t,{kind:F.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(I.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(I.BRACKET_R),t=this.node(e,{kind:F.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(I.BANG)?this.node(e,{kind:F.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:F.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return this.node(e,{kind:F.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(I.COLON);let n=this.parseNamedType();return this.node(e,{kind:F.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:F.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:F.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(I.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(I.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:F.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(I.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(I.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:F.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:F.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:F.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:F.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:F.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw ca(this._lexer.source,this._lexer.token.start,`${So(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===I.NAME)switch(e.value){case`schema`:return this.parseSchemaExtension();case`scalar`:return this.parseScalarTypeExtension();case`type`:return this.parseObjectTypeExtension();case`interface`:return this.parseInterfaceTypeExtension();case`union`:return this.parseUnionTypeExtension();case`enum`:return this.parseEnumTypeExtension();case`input`:return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(I.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let a=this.parseDirectiveLocations();return this.node(e,{kind:F.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(P,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(I.AT),n=this.parseName(),r;!t&&this.expectOptionalToken(I.DOT)&&(r=this.parseName());let i;return(t||r)&&this.expectOptionalToken(I.PAREN_L)&&(i=this.parseName(),this.expectToken(I.COLON),this.expectToken(I.PAREN_R)),t?i?this.node(e,{kind:F.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:i}):this.node(e,{kind:F.DIRECTIVE_COORDINATE,name:n}):r?i?this.node(e,{kind:F.ARGUMENT_COORDINATE,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:F.MEMBER_COORDINATE,name:n,memberName:r}):this.node(e,{kind:F.TYPE_COORDINATE,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new da(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw ca(this._lexer.source,t.start,`Expected ${Co(e)}, found ${So(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===I.NAME&&t.value===e)this.advanceLexer();else throw ca(this._lexer.source,t.start,`Expected "${e}", found ${So(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===I.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return ca(this._lexer.source,t.start,`Unexpected ${So(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==I.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw ca(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}}));function Eo(e,t){let[n,r]=t?[e,t]:[void 0,e],i=` Did you mean `;n&&(i+=n+` `);let a=r.map(e=>`"${e}"`);switch(a.length){case 0:return``;case 1:return i+a[0]+`?`;case 2:return i+a[0]+` or `+a[1]+`?`}let o=a.slice(0,Do),s=o.pop();return i+o.join(`, `)+`, or `+s+`?`}var Do,Oo=n((()=>{Do=5}));function ko(e){return e}var Ao=n((()=>{}));function jo(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}var Mo=n((()=>{}));function No(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}var Po=n((()=>{}));function Fo(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}var Io=n((()=>{}));function Lo(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(Ro(i)&&Ro(a)){let o=0;do++n,o=o*10+i-zo,i=e.charCodeAt(n);while(Ro(i)&&o>0);let s=0;do++r,s=s*10+a-zo,a=t.charCodeAt(r);while(Ro(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}function Ro(e){return!isNaN(e)&&zo<=e&&e<=Bo}var zo,Bo,Vo=n((()=>{zo=48,Bo=57}));function Ho(e,t){let n=Object.create(null),r=new Wo(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?Lo(e,t):r})}function Uo(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}var Wo,Go=n((()=>{Vo(),Wo=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Uo(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=Uo(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}}}));function Ko(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}var qo=n((()=>{}));function Jo(e){return`"${e.replace(Xo,Yo)}"`}function Yo(e){return Zo[e.charCodeAt(0)]}var Xo,Zo,Qo=n((()=>{Xo=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g,Zo=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`)}));function $o(e,t,n=pa){let r=new Map;for(let e of Object.values(F))r.set(e,ts(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],p=[];do{s++;let e=s===o.length,m=e&&c.length!==0;if(e){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),m)if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let h;if(!Array.isArray(l)){if(ua(l)||Ui(!1,`Invalid AST Node: ${L(l)}.`),h=(e?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,f,p),h===rs)break;if(h===!1){if(!e){f.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!e))if(ua(h))l=h;else{f.pop();continue}}h===void 0&&m&&c.push([u,l]),e?f.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:n[l.kind]??[],s=-1,c=[],d&&p.push(d),d=l)}while(i!==void 0);return c.length===0?e:c[c.length-1][1]}function es(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(F)){let i=!1,a=Array(e.length).fill(void 0),o=Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){let{enter:n,leave:s}=ts(e[t],r);i||=n!=null||s!=null,a[t]=n,o[t]=s}i&&(n[r]={enter(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let o=a[i]?.apply(e[i],n);if(o===!1)t[i]=r;else if(o===rs)t[i]=rs;else if(o!==void 0)return o}},leave(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let r=o[i]?.apply(e[i],n);if(r===rs)t[i]=rs;else if(r!==void 0&&r!==!1)return r}else t[i]===r&&(t[i]=null)}})}return n}function ts(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function ns(e,t,n){let{enter:r,leave:i}=ts(e,t);return n?i:r}var rs,is=n((()=>{Wi(),lo(),ga(),va(),rs=Object.freeze({})}));function as(e){return $o(e,us)}function R(e,t=``){return e?.filter(e=>e).join(t)??``}function os(e){return z(`{
+`,ss(R(e,`
+`)),`
+}`)}function z(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function ss(e){return z(` `,e.replace(/\n/g,`
+ `))}function cs(e){return e?.some(e=>e.includes(`
+`))??!1}var ls,us,ds=n((()=>{ka(),Qo(),is(),ls=80,us={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>R(e.definitions,`
+
+`)},OperationDefinition:{leave(e){let t=cs(e.variableDefinitions)?z(`(
+`,R(e.variableDefinitions,`
+`),`
+)`):z(`(`,R(e.variableDefinitions,`, `),`)`),n=z(``,e.description,`
+`)+R([e.operation,R([e.name,t]),R(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>z(``,i,`
+`)+e+`: `+t+z(` = `,n)+z(` `,R(r,` `))},SelectionSet:{leave:({selections:e})=>os(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=z(``,e,`: `)+t,o=a+z(`(`,R(n,`, `),`)`);return o.length>ls&&(o=a+z(`(
+`,ss(R(n,`
+`)),`
+)`)),R([o,R(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+z(` `,R(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>R([`...`,z(`on `,e),R(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>z(``,a,`
+`)+`fragment ${e}${z(`(`,R(n,`, `),`)`)} on ${t} ${z(``,R(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Oa(e):Jo(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+R(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+R(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+z(`(`,R(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>z(``,e,`
+`)+R([`schema`,R(t,` `),os(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>z(``,e,`
+`)+R([`scalar`,t,R(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>z(``,e,`
+`)+R([`type`,t,z(`implements `,R(n,` & `)),R(r,` `),os(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>z(``,e,`
+`)+t+(cs(n)?z(`(
+`,ss(R(n,`
+`)),`
+)`):z(`(`,R(n,`, `),`)`))+`: `+r+z(` `,R(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>z(``,e,`
+`)+R([t+`: `+n,z(`= `,r),R(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>z(``,e,`
+`)+R([`interface`,t,z(`implements `,R(n,` & `)),R(r,` `),os(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>z(``,e,`
+`)+R([`union`,t,R(n,` `),z(`= `,R(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>z(``,e,`
+`)+R([`enum`,t,R(n,` `),os(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>z(``,e,`
+`)+R([t,R(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>z(``,e,`
+`)+R([`input`,t,R(n,` `),os(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>z(``,e,`
+`)+`directive @`+t+(cs(n)?z(`(
+`,ss(R(n,`
+`)),`
+)`):z(`(`,R(n,`, `),`)`))+(r?` repeatable`:``)+` on `+R(i,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>R([`extend schema`,R(e,` `),os(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>R([`extend scalar`,e,R(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>R([`extend type`,e,z(`implements `,R(t,` & `)),R(n,` `),os(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>R([`extend interface`,e,z(`implements `,R(t,` & `)),R(n,` `),os(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>R([`extend union`,e,R(t,` `),z(`= `,R(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>R([`extend enum`,e,R(t,` `),os(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>R([`extend input`,e,R(t,` `),os(n)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>R([e,z(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>R([e,z(`.`,t),z(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>R([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>R([`@`,e,z(`(`,t,`:)`)])}}}));function fs(e,t){switch(e.kind){case F.NULL:return null;case F.INT:return parseInt(e.value,10);case F.FLOAT:return parseFloat(e.value);case F.STRING:case F.ENUM:case F.BOOLEAN:return e.value;case F.LIST:return e.values.map(e=>fs(e,t));case F.OBJECT:return No(e.fields,e=>e.name.value,e=>fs(e.value,t));case F.VARIABLE:return t?.[e.name.value]}}var ps=n((()=>{Po(),va()}));function ms(e){if(e??Ui(!1,`Must provide name.`),typeof e==`string`||Ui(!1,`Expected name to be a string.`),e.length===0)throw new M(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!Ca(e.charCodeAt(t)))throw new M(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Sa(e.charCodeAt(0)))throw new M(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function hs(e){if(e===`true`||e===`false`||e===`null`)throw new M(`Enum values cannot be named: ${e}`);return ms(e)}var gs=n((()=>{Wi(),N(),wa()}));function _s(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Os(e)||As(e)||V(e)}function vs(e){if(!_s(e))throw Error(`Expected ${L(e)} to be a GraphQL type.`);return e}function ys(e){return fo(e,pc)}function bs(e){if(!ys(e))throw Error(`Expected ${L(e)} to be a GraphQL Scalar type.`);return e}function B(e){return fo(e,mc)}function xs(e){if(!B(e))throw Error(`Expected ${L(e)} to be a GraphQL Object type.`);return e}function Ss(e){return fo(e,hc)}function Cs(e){if(!Ss(e))throw Error(`Expected ${L(e)} to be a GraphQL Interface type.`);return e}function ws(e){return fo(e,gc)}function Ts(e){if(!ws(e))throw Error(`Expected ${L(e)} to be a GraphQL Union type.`);return e}function Es(e){return fo(e,_c)}function Ds(e){if(!Es(e))throw Error(`Expected ${L(e)} to be a GraphQL Enum type.`);return e}function Os(e){return fo(e,vc)}function ks(e){if(!Os(e))throw Error(`Expected ${L(e)} to be a GraphQL Input Object type.`);return e}function As(e){return fo(e,dc)}function js(e){if(!As(e))throw Error(`Expected ${L(e)} to be a GraphQL List type.`);return e}function V(e){return fo(e,fc)}function Ms(e){if(!V(e))throw Error(`Expected ${L(e)} to be a GraphQL Non-Null type.`);return e}function Ns(e){return ys(e)||Es(e)||Os(e)||Us(e)&&Ns(e.ofType)}function Ps(e){if(!Ns(e))throw Error(`Expected ${L(e)} to be a GraphQL input type.`);return e}function Fs(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Us(e)&&Fs(e.ofType)}function Is(e){if(!Fs(e))throw Error(`Expected ${L(e)} to be a GraphQL output type.`);return e}function Ls(e){return ys(e)||Es(e)}function Rs(e){if(!Ls(e))throw Error(`Expected ${L(e)} to be a GraphQL leaf type.`);return e}function zs(e){return B(e)||Ss(e)||ws(e)}function Bs(e){if(!zs(e))throw Error(`Expected ${L(e)} to be a GraphQL composite type.`);return e}function Vs(e){return Ss(e)||ws(e)}function Hs(e){if(!Vs(e))throw Error(`Expected ${L(e)} to be a GraphQL abstract type.`);return e}function Us(e){return As(e)||V(e)}function Ws(e){if(!Us(e))throw Error(`Expected ${L(e)} to be a GraphQL wrapping type.`);return e}function Gs(e){return _s(e)&&!V(e)}function Ks(e){if(!Gs(e))throw Error(`Expected ${L(e)} to be a GraphQL nullable type.`);return e}function qs(e){if(e)return V(e)?e.ofType:e}function Js(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Os(e)}function Ys(e){if(!Js(e))throw Error(`Expected ${L(e)} to be a GraphQL named type.`);return e}function Xs(e){if(e){let t=e;for(;Us(t);)t=t.ofType;return t}}function Zs(e){return typeof e==`function`?e():e}function Qs(e){return typeof e==`function`?e():e}function $s(e){let t=Zs(e.interfaces??[]);return Array.isArray(t)||Ui(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function ec(e){let t=Qs(e.fields);return nc(t)||Ui(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Fo(t,(t,n)=>{nc(t)||Ui(!1,`${e.name}.${n} field config must be an object.`),t.resolve==null||typeof t.resolve==`function`||Ui(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${L(t.resolve)}.`);let r=t.args??{};return nc(r)||Ui(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:ms(n),description:t.description,type:t.type,args:tc(r),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}})}function tc(e){return Object.entries(e).map(([e,t])=>({name:ms(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}))}function nc(e){return qi(e)&&!Array.isArray(e)}function rc(e){return Fo(e,e=>({description:e.description,type:e.type,args:ic(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ic(e){return No(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ac(e){return V(e.type)&&e.defaultValue===void 0}function oc(e){let t=Zs(e.types);return Array.isArray(t)||Ui(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}function sc(e,t){return Eo(`the enum value`,Ho(t,e.getValues().map(e=>e.name)))}function cc(e,t){return nc(t)||Ui(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(nc(n)||Ui(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${L(n)}.`),{name:hs(t),description:n.description,value:n.value===void 0?t:n.value,deprecationReason:n.deprecationReason,extensions:Ko(n.extensions),astNode:n.astNode}))}function lc(e){let t=Qs(e.fields);return nc(t)||Ui(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Fo(t,(t,n)=>(!(`resolve`in t)||Ui(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:ms(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}))}function uc(e){return V(e.type)&&e.defaultValue===void 0}var dc,fc,pc,mc,hc,gc,_c,vc,yc=n((()=>{Wi(),Oo(),Ao(),lo(),po(),Ji(),Mo(),Po(),Io(),Go(),qo(),N(),va(),ds(),ps(),gs(),dc=class{constructor(e){_s(e)||Ui(!1,`Expected ${L(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},fc=class{constructor(e){Gs(e)||Ui(!1,`Expected ${L(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLNonNull`}toString(){return String(this.ofType)+`!`}toJSON(){return this.toString()}},pc=class{constructor(e){let t=e.parseValue??ko;this.name=ms(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??ko,this.parseValue=t,this.parseLiteral=e.parseLiteral??((e,n)=>t(fs(e,n))),this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.specifiedByURL==null||typeof e.specifiedByURL==`string`||Ui(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${L(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize==`function`||Ui(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||Ui(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return`GraphQLScalarType`}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},mc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>ec(e),this._interfaces=()=>$s(e),e.isTypeOf==null||typeof e.isTypeOf==`function`||Ui(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${L(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:rc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},hc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=ec.bind(void 0,e),this._interfaces=$s.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||Ui(!1,`${this.name} must provide "resolveType" as a function, but got: ${L(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:rc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},gc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=oc.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||Ui(!1,`${this.name} must provide "resolveType" as a function, but got: ${L(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},_c=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=typeof e.values==`function`?e.values:cc(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=cc(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=jo(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(t===void 0)throw new M(`Enum "${this.name}" cannot represent value: ${L(e)}`);return t.name}parseValue(e){if(typeof e!=`string`){let t=L(e);throw new M(`Enum "${this.name}" cannot represent non-string value: ${t}.`+sc(this,t))}let t=this.getValue(e);if(t==null)throw new M(`Value "${e}" does not exist in "${this.name}" enum.`+sc(this,e));return t.value}parseLiteral(e,t){if(e.kind!==F.ENUM){let t=as(e);throw new M(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+sc(this,t),{nodes:e})}let n=this.getValue(e.value);if(n==null){let t=as(e);throw new M(`Value "${t}" does not exist in "${this.name}" enum.`+sc(this,t),{nodes:e})}return n.value}toConfig(){let e=No(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},vc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=lc.bind(void 0,e)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){let e=Fo(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}}));function bc(e,t){return e===t?!0:V(e)&&V(t)||As(e)&&As(t)?bc(e.ofType,t.ofType):!1}function xc(e,t,n){return t===n?!0:V(n)?V(t)?xc(e,t.ofType,n.ofType):!1:V(t)?xc(e,t.ofType,n):As(n)?As(t)?xc(e,t.ofType,n.ofType):!1:As(t)?!1:Vs(n)&&(Ss(t)||B(t))&&e.isSubType(n,t)}function Sc(e,t,n){return t===n?!0:Vs(t)?Vs(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):Vs(n)?e.isSubType(n,t):!1}var Cc=n((()=>{yc()}));function wc(e){return Nc.some(({name:t})=>e.name===t)}function Tc(e){if(qi(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!qi(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}var Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc=n((()=>{lo(),Ji(),N(),va(),ds(),yc(),Ec=2147483647,Dc=-2147483648,Oc=new pc({name:`Int`,description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isInteger(n))throw new M(`Int cannot represent non-integer value: ${L(t)}`);if(n>2147483647||n<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: `+L(t));return n},parseValue(e){if(typeof e!=`number`||!Number.isInteger(e))throw new M(`Int cannot represent non-integer value: ${L(e)}`);if(e>2147483647||e<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==F.INT)throw new M(`Int cannot represent non-integer value: ${as(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),kc=new pc({name:`Float`,description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isFinite(n))throw new M(`Float cannot represent non numeric value: ${L(t)}`);return n},parseValue(e){if(typeof e!=`number`||!Number.isFinite(e))throw new M(`Float cannot represent non numeric value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.FLOAT&&e.kind!==F.INT)throw new M(`Float cannot represent non numeric value: ${as(e)}`,e);return parseFloat(e.value)}}),Ac=new pc({name:`String`,description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Tc(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`&&Number.isFinite(t))return t.toString();throw new M(`String cannot represent value: ${L(e)}`)},parseValue(e){if(typeof e!=`string`)throw new M(`String cannot represent a non string value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.STRING)throw new M(`String cannot represent a non string value: ${as(e)}`,{nodes:e});return e.value}}),jc=new pc({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return t;if(Number.isFinite(t))return t!==0;throw new M(`Boolean cannot represent a non boolean value: ${L(t)}`)},parseValue(e){if(typeof e!=`boolean`)throw new M(`Boolean cannot represent a non boolean value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.BOOLEAN)throw new M(`Boolean cannot represent a non boolean value: ${as(e)}`,{nodes:e});return e.value}}),Mc=new pc({name:`ID`,description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Tc(e);if(typeof t==`string`)return t;if(Number.isInteger(t))return String(t);throw new M(`ID cannot represent value: ${L(e)}`)},parseValue(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isInteger(e))return e.toString();throw new M(`ID cannot represent value: ${L(e)}`)},parseLiteral(e){if(e.kind!==F.STRING&&e.kind!==F.INT)throw new M(`ID cannot represent a non-string and non-integer value: `+as(e),{nodes:e});return e.value}}),Nc=Object.freeze([Ac,Oc,kc,jc,Mc])}));function Fc(e){return fo(e,Rc)}function Ic(e){if(!Fc(e))throw Error(`Expected ${L(e)} to be a GraphQL directive.`);return e}function Lc(e){return Gc.some(({name:t})=>t===e.name)}var Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc=n((()=>{Wi(),lo(),po(),Ji(),qo(),_a(),gs(),yc(),Pc(),Rc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=Ko(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Ui(!1,`@${e.name} locations must be an Array.`);let t=e.args??{};qi(t)&&!Array.isArray(t)||Ui(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=tc(t)}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ic(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return`@`+this.name}toJSON(){return this.toString()}},zc=new Rc({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[P.FIELD,P.FRAGMENT_SPREAD,P.INLINE_FRAGMENT],args:{if:{type:new fc(jc),description:`Included when true.`}}}),Bc=new Rc({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[P.FIELD,P.FRAGMENT_SPREAD,P.INLINE_FRAGMENT],args:{if:{type:new fc(jc),description:`Skipped when true.`}}}),Vc=`No longer supported`,Hc=new Rc({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[P.FIELD_DEFINITION,P.ARGUMENT_DEFINITION,P.INPUT_FIELD_DEFINITION,P.ENUM_VALUE],args:{reason:{type:Ac,description:`Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).`,defaultValue:Vc}}}),Uc=new Rc({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[P.SCALAR],args:{url:{type:new fc(Ac),description:`The URL that specifies the behavior of this scalar.`}}}),Wc=new Rc({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[P.INPUT_OBJECT],args:{}}),Gc=Object.freeze([zc,Bc,Hc,Uc,Wc])}));function qc(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}var Jc=n((()=>{}));function Yc(e,t){if(V(t)){let n=Yc(e,t.ofType);return n?.kind===F.NULL?null:n}if(e===null)return{kind:F.NULL};if(e===void 0)return null;if(As(t)){let n=t.ofType;if(qc(e)){let t=[];for(let r of e){let e=Yc(r,n);e!=null&&t.push(e)}return{kind:F.LIST,values:t}}return Yc(e,n)}if(Os(t)){if(!qi(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=Yc(e[r.name],r.type);t&&n.push({kind:F.OBJECT_FIELD,name:{kind:F.NAME,value:r.name},value:t})}return{kind:F.OBJECT,fields:n}}if(Ls(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:F.BOOLEAN,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return Xc.test(e)?{kind:F.INT,value:e}:{kind:F.FLOAT,value:e}}if(typeof n==`string`)return Es(t)?{kind:F.ENUM,value:n}:t===Mc&&Xc.test(n)?{kind:F.INT,value:n}:{kind:F.STRING,value:n};throw TypeError(`Cannot convert value to AST: ${L(n)}.`)}Yi(!1,`Unexpected input type: `+L(t))}var Xc,Zc=n((()=>{lo(),Xi(),Jc(),Ji(),va(),yc(),Pc(),Xc=/^-?(?:0|[1-9][0-9]*)$/}));function Qc(e){return dl.some(({name:t})=>e.name===t)}var $c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl=n((()=>{lo(),Xi(),_a(),ds(),Zc(),yc(),Pc(),$c=new mc({name:`__Schema`,description:`A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.`,fields:()=>({description:{type:Ac,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new fc(new dc(new fc(nl))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new fc(nl),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:nl,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:nl,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new fc(new dc(new fc(el))),resolve:e=>e.getDirectives()}})}),el=new mc({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
+
+In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},isRepeatable:{type:new fc(jc),resolve:e=>e.isRepeatable},locations:{type:new fc(new dc(new fc(tl))),resolve:e=>e.locations},args:{type:new fc(new dc(new fc(il))),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}}})}),tl=new _c({name:`__DirectiveLocation`,description:`A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.`,values:{QUERY:{value:P.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:P.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:P.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:P.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:P.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:P.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:P.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:P.VARIABLE_DEFINITION,description:`Location adjacent to a variable definition.`},SCHEMA:{value:P.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:P.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:P.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:P.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:P.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:P.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:P.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:P.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:P.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:P.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:P.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`}}}),nl=new mc({name:`__Type`,description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new fc(sl),resolve(e){if(ys(e))return ol.SCALAR;if(B(e))return ol.OBJECT;if(Ss(e))return ol.INTERFACE;if(ws(e))return ol.UNION;if(Es(e))return ol.ENUM;if(Os(e))return ol.INPUT_OBJECT;if(As(e))return ol.LIST;if(V(e))return ol.NON_NULL;Yi(!1,`Unexpected type: "${L(e)}".`)}},name:{type:Ac,resolve:e=>`name`in e?e.name:void 0},description:{type:Ac,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:Ac,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new dc(new fc(rl)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(B(e)||Ss(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new dc(new fc(nl)),resolve(e){if(B(e)||Ss(e))return e.getInterfaces()}},possibleTypes:{type:new dc(new fc(nl)),resolve(e,t,n,{schema:r}){if(Vs(e))return r.getPossibleTypes(e)}},enumValues:{type:new dc(new fc(al)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Es(e)){let n=e.getValues();return t?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new dc(new fc(il)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Os(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:nl,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:jc,resolve:e=>{if(Os(e))return e.isOneOf}}})}),rl=new mc({name:`__Field`,description:`Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},args:{type:new fc(new dc(new fc(il))),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new fc(nl),resolve:e=>e.type},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),il=new mc({name:`__InputValue`,description:`Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},type:{type:new fc(nl),resolve:e=>e.type},defaultValue:{type:Ac,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let{type:t,defaultValue:n}=e,r=Yc(n,t);return r?as(r):null}},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),al=new mc({name:`__EnumValue`,description:`One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),(function(e){e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.LIST=`LIST`,e.NON_NULL=`NON_NULL`})(ol||={}),sl=new _c({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ol.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:ol.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ol.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ol.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ol.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ol.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ol.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ol.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),cl={name:`__schema`,type:new fc($c),description:`Access the current type schema of this server.`,args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ll={name:`__type`,type:nl,description:`Request the type information of a single type.`,args:[{name:`name`,description:void 0,type:new fc(Ac),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ul={name:`__typename`,type:new fc(Ac),description:`The name of the current Object type at runtime.`,args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},dl=Object.freeze([$c,el,tl,nl,rl,il,al,sl])}));function pl(e){return fo(e,gl)}function ml(e){if(!pl(e))throw Error(`Expected ${L(e)} to be a GraphQL schema.`);return e}function hl(e,t){let n=Xs(e);if(!t.has(n)){if(t.add(n),ws(n))for(let e of n.getTypes())hl(e,t);else if(B(n)||Ss(n)){for(let e of n.getInterfaces())hl(e,t);for(let e of Object.values(n.getFields())){hl(e.type,t);for(let n of e.args)hl(n.type,t)}}else if(Os(n))for(let e of Object.values(n.getFields()))hl(e.type,t)}return t}var gl,_l=n((()=>{Wi(),lo(),po(),Ji(),qo(),ga(),yc(),Kc(),fl(),gl=class{constructor(e){this.__validationErrors=e.assumeValid===!0?[]:void 0,qi(e)||Ui(!1,`Must provide configuration object.`),!e.types||Array.isArray(e.types)||Ui(!1,`"types" must be Array if provided but got: ${L(e.types)}.`),!e.directives||Array.isArray(e.directives)||Ui(!1,`"directives" must be Array if provided but got: ${L(e.directives)}.`),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Gc;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),hl(n,t);this._queryType!=null&&hl(this._queryType,t),this._mutationType!=null&&hl(this._mutationType,t),this._subscriptionType!=null&&hl(this._subscriptionType,t);for(let e of this._directives)if(Fc(e))for(let n of e.args)hl(n.type,t);hl($c,t),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(t||Ui(!1,`One of the provided types for building the Schema is missing a name.`),this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ss(e)){for(let t of e.getInterfaces())if(Ss(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(B(e)){for(let t of e.getInterfaces())if(Ss(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}}get[Symbol.toStringTag](){return`GraphQLSchema`}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ha.QUERY:return this.getQueryType();case ha.MUTATION:return this.getMutationType();case ha.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return ws(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(n===void 0){if(n=Object.create(null),ws(e))for(let t of e.getTypes())n[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)n[e.name]=!0;for(let e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return n[t.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}}));function vl(e){if(ml(e),e.__validationErrors)return e.__validationErrors;let t=new Ll(e);bl(t),Sl(t),wl(t);let n=t.getErrors();return e.__validationErrors=n,n}function yl(e){let t=vl(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
+
+`))}function bl(e){let t=e.schema,n=t.getQueryType();n?B(n)||e.reportError(`Query root type must be Object type, it cannot be ${L(n)}.`,xl(t,ha.QUERY)??n.astNode):e.reportError(`Query root type must be provided.`,t.astNode);let r=t.getMutationType();r&&!B(r)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${L(r)}.`,xl(t,ha.MUTATION)??r.astNode);let i=t.getSubscriptionType();i&&!B(i)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${L(i)}.`,xl(t,ha.SUBSCRIPTION)??i.astNode)}function xl(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function Sl(e){for(let t of e.schema.getDirectives()){if(!Fc(t)){e.reportError(`Expected directive but got: ${L(t)}.`,t?.astNode);continue}Cl(e,t),t.locations.length===0&&e.reportError(`Directive @${t.name} must include 1 or more locations.`,t.astNode);for(let n of t.args)Cl(e,n),Ns(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${L(n.type)}.`,n.astNode),ac(n)&&n.deprecationReason!=null&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[Il(n.astNode),n.astNode?.type])}}function Cl(e,t){t.name.startsWith(`__`)&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function wl(e){let t=Nl(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!Js(r)){e.reportError(`Expected GraphQL named type but got: ${L(r)}.`,r.astNode);continue}Qc(r)||Cl(e,r),B(r)||Ss(r)?(Tl(e,r),El(e,r)):ws(r)?kl(e,r):Es(r)?Al(e,r):Os(r)&&(jl(e,r),t(r))}}function Tl(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){Cl(e,r),!Fs(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${L(r.type)}.`,r.astNode?.type);for(let n of r.args){let i=n.name;Cl(e,n),!Ns(n.type)&&e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${L(n.type)}.`,n.astNode?.type),ac(n)&&n.deprecationReason!=null&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[Il(n.astNode),n.astNode?.type])}}}function El(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!Ss(r)){e.reportError(`Type ${L(t)} must only implement Interface types, it cannot implement ${L(r)}.`,Pl(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Pl(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Pl(t,r));continue}n[r.name]=!0,Ol(e,t,r),Dl(e,t,r)}}function Dl(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let a=i.name,o=r[a];if(!o){e.reportError(`Interface field ${n.name}.${a} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}xc(e.schema,o.type,i.type)||e.reportError(`Interface field ${n.name}.${a} expects type ${L(i.type)} but ${t.name}.${a} is type ${L(o.type)}.`,[i.astNode?.type,o.astNode?.type]);for(let r of i.args){let i=r.name,s=o.args.find(e=>e.name===i);if(!s){e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expected but ${t.name}.${a} does not provide it.`,[r.astNode,o.astNode]);continue}bc(r.type,s.type)||e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expects type ${L(r.type)} but ${t.name}.${a}(${i}:) is type ${L(s.type)}.`,[r.astNode?.type,s.astNode?.type])}for(let r of o.args){let o=r.name;!i.args.find(e=>e.name===o)&&ac(r)&&e.reportError(`Object field ${t.name}.${a} includes required argument ${o} that is missing from the Interface field ${n.name}.${a}.`,[r.astNode,i.astNode])}}}function Ol(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Pl(n,i),...Pl(t,n)])}function kl(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Fl(t,i.name));continue}r[i.name]=!0,B(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${L(i)}.`,Fl(t,String(i)))}}function Al(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let t of n)Cl(e,t)}function jl(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Cl(e,r),!Ns(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${L(r.type)}.`,r.astNode?.type),uc(r)&&r.deprecationReason!=null&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[Il(r.astNode),r.astNode?.type]),t.isOneOf&&Ml(t,r,e)}function Ml(e,t,n){V(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function Nl(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let t of o)if(V(t.type)&&Os(t.type.ofType)){let a=t.type.ofType,o=r[a.name];if(n.push(t),o===void 0)i(a);else{let t=n.slice(o),r=t.map(e=>e.name).join(`.`);e.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[a.name]=void 0}}function Pl(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function Fl(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function Il(e){return e?.directives?.find(e=>e.name.value===Hc.name)}var Ll,Rl=n((()=>{lo(),N(),ga(),Cc(),yc(),Kc(),fl(),_l(),Ll=class{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new M(e,{nodes:n}))}getErrors(){return this._errors}}}));function zl(e,t){switch(t.kind){case F.LIST_TYPE:{let n=zl(e,t.type);return n&&new dc(n)}case F.NON_NULL_TYPE:{let n=zl(e,t.type);return n&&new fc(n)}case F.NAMED_TYPE:return e.getType(t.name.value)}}var Bl=n((()=>{va(),yc()}));function Vl(e,t,n){let r=n.name.value;if(r===cl.name&&e.getQueryType()===t)return cl;if(r===ll.name&&e.getQueryType()===t)return ll;if(r===ul.name&&zs(t))return ul;if(B(t)||Ss(t))return t.getFields()[r]}function Hl(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=ts(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),ua(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=ts(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}var Ul,Wl=n((()=>{ga(),va(),is(),yc(),fl(),Bl(),Ul=class{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Vl,t&&(Ns(t)&&this._inputTypeStack.push(t),zs(t)&&this._parentTypeStack.push(t),Fs(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return`TypeInfo`}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case F.SELECTION_SET:{let e=Xs(this.getType());this._parentTypeStack.push(zs(e)?e:void 0);break}case F.FIELD:{let n=this.getParentType(),r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Fs(i)?i:void 0);break}case F.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case F.OPERATION_DEFINITION:{let n=t.getRootType(e.operation);this._typeStack.push(B(n)?n:void 0);break}case F.INLINE_FRAGMENT:case F.FRAGMENT_DEFINITION:{let n=e.typeCondition,r=n?zl(t,n):Xs(this.getType());this._typeStack.push(Fs(r)?r:void 0);break}case F.VARIABLE_DEFINITION:{let n=zl(t,e.type);this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.ARGUMENT:{let t,n,r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.LIST:{let e=qs(this.getInputType()),t=As(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Ns(t)?t:void 0);break}case F.OBJECT_FIELD:{let t=Xs(this.getInputType()),n,r;Os(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.ENUM:{let t=Xs(this.getInputType()),n;Es(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}default:}}leave(e){switch(e.kind){case F.SELECTION_SET:this._parentTypeStack.pop();break;case F.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case F.DIRECTIVE:this._directive=null;break;case F.OPERATION_DEFINITION:case F.INLINE_FRAGMENT:case F.FRAGMENT_DEFINITION:this._typeStack.pop();break;case F.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case F.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case F.LIST:case F.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case F.ENUM:this._enumValue=null;break;default:}}}}));function Gl(e){return Kl(e)||Zl(e)||$l(e)}function Kl(e){return e.kind===F.OPERATION_DEFINITION||e.kind===F.FRAGMENT_DEFINITION}function ql(e){return e.kind===F.FIELD||e.kind===F.FRAGMENT_SPREAD||e.kind===F.INLINE_FRAGMENT}function Jl(e){return e.kind===F.VARIABLE||e.kind===F.INT||e.kind===F.FLOAT||e.kind===F.STRING||e.kind===F.BOOLEAN||e.kind===F.NULL||e.kind===F.ENUM||e.kind===F.LIST||e.kind===F.OBJECT}function Yl(e){return Jl(e)&&(e.kind===F.LIST?e.values.some(Yl):e.kind===F.OBJECT?e.fields.some(e=>Yl(e.value)):e.kind!==F.VARIABLE)}function Xl(e){return e.kind===F.NAMED_TYPE||e.kind===F.LIST_TYPE||e.kind===F.NON_NULL_TYPE}function Zl(e){return e.kind===F.SCHEMA_DEFINITION||Ql(e)||e.kind===F.DIRECTIVE_DEFINITION}function Ql(e){return e.kind===F.SCALAR_TYPE_DEFINITION||e.kind===F.OBJECT_TYPE_DEFINITION||e.kind===F.INTERFACE_TYPE_DEFINITION||e.kind===F.UNION_TYPE_DEFINITION||e.kind===F.ENUM_TYPE_DEFINITION||e.kind===F.INPUT_OBJECT_TYPE_DEFINITION}function $l(e){return e.kind===F.SCHEMA_EXTENSION||eu(e)}function eu(e){return e.kind===F.SCALAR_TYPE_EXTENSION||e.kind===F.OBJECT_TYPE_EXTENSION||e.kind===F.INTERFACE_TYPE_EXTENSION||e.kind===F.UNION_TYPE_EXTENSION||e.kind===F.ENUM_TYPE_EXTENSION||e.kind===F.INPUT_OBJECT_TYPE_EXTENSION}function tu(e){return e.kind===F.TYPE_COORDINATE||e.kind===F.MEMBER_COORDINATE||e.kind===F.ARGUMENT_COORDINATE||e.kind===F.DIRECTIVE_COORDINATE||e.kind===F.DIRECTIVE_ARGUMENT_COORDINATE}var nu=n((()=>{va()}));function ru(e){return{Document(t){for(let n of t.definitions)if(!Kl(n)){let t=n.kind===F.SCHEMA_DEFINITION||n.kind===F.SCHEMA_EXTENSION?`schema`:`"`+n.name.value+`"`;e.reportError(new M(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}var iu=n((()=>{N(),va(),nu()}));function au(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),i=t.name.value,a=Eo(`to use an inline fragment on`,ou(r,n,i));a===``&&(a=Eo(su(n,i))),e.reportError(new M(`Cannot query field "${i}" on type "${n.name}".`+a,{nodes:t}))}}}}function ou(e,t,n){if(!Vs(t))return[];let r=new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(let e of a.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{let r=i[n.name]-i[t.name];return r===0?Ss(t)&&e.isSubType(t,n)?-1:Ss(n)&&e.isSubType(n,t)?1:Lo(t.name,n.name):r}).map(e=>e.name)}function su(e,t){return B(e)||Ss(e)?Ho(t,Object.keys(e.getFields())):[]}var cu=n((()=>{Oo(),Vo(),Go(),N(),yc()}));function lu(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let t=zl(e.getSchema(),n);if(t&&!zs(t)){let t=as(n);e.reportError(new M(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){let n=zl(e.getSchema(),t.typeCondition);if(n&&!zs(n)){let n=as(t.typeCondition);e.reportError(new M(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}var uu=n((()=>{N(),ds(),yc(),Bl()}));function du(e){return{...fu(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let n=t.name.value,a=Ho(n,r.args.map(e=>e.name));e.reportError(new M(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+Eo(a),{nodes:t}))}}}}function fu(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=e.args.map(e=>e.name);let i=e.getDocument().definitions;for(let e of i)if(e.kind===F.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){let r=n.name.value,i=t[r];if(n.arguments&&i)for(let t of n.arguments){let n=t.name.value;if(!i.includes(n)){let a=Ho(n,i);e.reportError(new M(`Unknown argument "${n}" on directive "@${r}".`+Eo(a),{nodes:t}))}}return!1}}}var pu=n((()=>{Oo(),Go(),N(),va(),Kc()}));function mu(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=e.locations;let i=e.getDocument().definitions;for(let e of i)e.kind===F.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,a,o){let s=n.name.value,c=t[s];if(!c){e.reportError(new M(`Unknown directive "@${s}".`,{nodes:n}));return}let l=hu(o);l&&!c.includes(l)&&e.reportError(new M(`Directive "@${s}" may not be used on ${l}.`,{nodes:n}))}}}function hu(e){let t=e[e.length-1];switch(`kind`in t||Yi(!1),t.kind){case F.OPERATION_DEFINITION:return gu(t.operation);case F.FIELD:return P.FIELD;case F.FRAGMENT_SPREAD:return P.FRAGMENT_SPREAD;case F.INLINE_FRAGMENT:return P.INLINE_FRAGMENT;case F.FRAGMENT_DEFINITION:return P.FRAGMENT_DEFINITION;case F.VARIABLE_DEFINITION:return P.VARIABLE_DEFINITION;case F.SCHEMA_DEFINITION:case F.SCHEMA_EXTENSION:return P.SCHEMA;case F.SCALAR_TYPE_DEFINITION:case F.SCALAR_TYPE_EXTENSION:return P.SCALAR;case F.OBJECT_TYPE_DEFINITION:case F.OBJECT_TYPE_EXTENSION:return P.OBJECT;case F.FIELD_DEFINITION:return P.FIELD_DEFINITION;case F.INTERFACE_TYPE_DEFINITION:case F.INTERFACE_TYPE_EXTENSION:return P.INTERFACE;case F.UNION_TYPE_DEFINITION:case F.UNION_TYPE_EXTENSION:return P.UNION;case F.ENUM_TYPE_DEFINITION:case F.ENUM_TYPE_EXTENSION:return P.ENUM;case F.ENUM_VALUE_DEFINITION:return P.ENUM_VALUE;case F.INPUT_OBJECT_TYPE_DEFINITION:case F.INPUT_OBJECT_TYPE_EXTENSION:return P.INPUT_OBJECT;case F.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return`kind`in t||Yi(!1),t.kind===F.INPUT_OBJECT_TYPE_DEFINITION?P.INPUT_FIELD_DEFINITION:P.ARGUMENT_DEFINITION}default:Yi(!1,`Unexpected kind: `+L(t.kind))}}function gu(e){switch(e){case ha.QUERY:return P.QUERY;case ha.MUTATION:return P.MUTATION;case ha.SUBSCRIPTION:return P.SUBSCRIPTION}}var _u=n((()=>{lo(),Xi(),N(),ga(),_a(),va(),Kc()}));function vu(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new M(`Unknown fragment "${n}".`,{nodes:t.name}))}}}var yu=n((()=>{N()}));function bu(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)Ql(t)&&(r[t.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,a,o,s,c){let l=t.name.value;if(!n[l]&&!r[l]){let n=c[2]??o,r=n!=null&&xu(n);if(r&&Su.includes(l))return;let a=Ho(l,r?Su.concat(i):i);e.reportError(new M(`Unknown type "${l}".`+Eo(a),{nodes:t}))}}}}function xu(e){return`kind`in e&&(Zl(e)||$l(e))}var Su,Cu=n((()=>{Oo(),Go(),N(),nu(),fl(),Pc(),Su=[...Nc,...dl].map(e=>e.name)}));function wu(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===F.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new M(`This anonymous operation must be the only defined operation.`,{nodes:n}))}}}var Tu=n((()=>{N(),va()}));function Eu(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(t){if(n){e.reportError(new M(`Cannot define a new schema within a schema extension.`,{nodes:t}));return}r>0&&e.reportError(new M(`Must provide only one schema definition.`,{nodes:t})),++r}}}var Du=n((()=>{N()}));function Ou(e){function t(n,r=Object.create(null),i=0){if(n.kind===F.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===F.FIELD&&(n.name.value===`fields`||n.name.value===`interfaces`||n.name.value===`possibleTypes`||n.name.value===`inputFields`)&&(i++,i>=ku))return!0;if(`selectionSet`in n&&n.selectionSet){for(let e of n.selectionSet.selections)if(t(e,r,i))return!0}return!1}return{Field(n){if((n.name.value===`__schema`||n.name.value===`__type`)&&t(n))return e.reportError(new M(`Maximum introspection depth exceeded`,{nodes:[n]})),!1}}}var ku,Au=n((()=>{N(),va(),ku=3}));function ju(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return i(e),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let s=e.getFragmentSpreads(a.selectionSet);if(s.length!==0){r[o]=n.length;for(let t of s){let a=t.name.value,o=r[a];if(n.push(t),o===void 0){let t=e.getFragment(a);t&&i(t)}else{let t=n.slice(o),r=t.slice(0,-1).map(e=>`"`+e.name.value+`"`).join(`, `);e.reportError(new M(`Cannot spread fragment "${a}" within itself`+(r===``?`.`:` via ${r}.`),{nodes:t}))}n.pop()}r[o]=void 0}}}var Mu=n((()=>{N()}));function Nu(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let r=i.name.value;t[r]!==!0&&e.reportError(new M(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}var Pu=n((()=>{N()}));function Fu(e){let t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){let r=Object.create(null);for(let n of t)for(let t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(let t of n){let n=t.name.value;r[n]!==!0&&e.reportError(new M(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}var Iu=n((()=>{N()}));function Lu(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:e}of i)r[e.name.value]=!0;for(let i of t){let t=i.variable.name.value;r[t]!==!0&&e.reportError(new M(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}var Ru=n((()=>{N()}));function zu(e){switch(e.kind){case F.OBJECT:return{...e,fields:Bu(e.fields)};case F.LIST:return{...e,values:e.values.map(zu)};case F.INT:case F.FLOAT:case F.STRING:case F.BOOLEAN:case F.NULL:case F.ENUM:case F.VARIABLE:return e}}function Bu(e){return e.map(e=>({...e,value:zu(e.value)})).sort((e,t)=>Lo(e.name.value,t.name.value))}var Vu=n((()=>{Vo(),va()}));function Hu(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+Hu(t)).join(` and `):e}function Uu(e){let t=new id,n=new ad,r=new Map;return{SelectionSet(i){let a=Wu(e,r,t,n,e.getParentType(),i);for(let[[t,n],r,i]of a){let a=Hu(n);e.reportError(new M(`Fields "${t}" conflict because ${a}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function Wu(e,t,n,r,i,a){let o=[],[s,c]=ed(e,t,i,a);if(Ju(e,o,t,n,r,s),c.length!==0)for(let i=0;i<c.length;i++){Gu(e,o,t,n,r,!1,s,c[i]);for(let a=i+1;a<c.length;a++)Ku(e,o,t,n,r,!1,c[i],c[a])}return o}function Gu(e,t,n,r,i,a,o,s){if(r.has(o,s,a))return;r.add(o,s,a);let c=e.getFragment(s);if(!c)return;let[l,u]=td(e,n,c);if(o!==l){Yu(e,t,n,r,i,a,o,l);for(let s of u)Gu(e,t,n,r,i,a,o,s)}}function Ku(e,t,n,r,i,a,o,s){if(o===s||i.has(o,s,a))return;i.add(o,s,a);let c=e.getFragment(o),l=e.getFragment(s);if(!c||!l)return;let[u,d]=td(e,n,c),[f,p]=td(e,n,l);Yu(e,t,n,r,i,a,u,f);for(let s of p)Ku(e,t,n,r,i,a,o,s);for(let o of d)Ku(e,t,n,r,i,a,o,s)}function qu(e,t,n,r,i,a,o,s,c){let l=[],[u,d]=ed(e,t,a,o),[f,p]=ed(e,t,s,c);Yu(e,l,t,n,r,i,u,f);for(let a of p)Gu(e,l,t,n,r,i,u,a);for(let a of d)Gu(e,l,t,n,r,i,f,a);for(let a of d)for(let o of p)Ku(e,l,t,n,r,i,a,o);return l}function Ju(e,t,n,r,i,a){for(let[o,s]of Object.entries(a))if(s.length>1)for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=Xu(e,n,r,i,!1,o,s[a],s[c]);l&&t.push(l)}}function Yu(e,t,n,r,i,a,o,s){for(let[c,l]of Object.entries(o)){let o=s[c];if(o)for(let s of l)for(let l of o){let o=Xu(e,n,r,i,a,c,s,l);o&&t.push(o)}}}function Xu(e,t,n,r,i,a,o,s){let[c,l,u]=o,[d,f,p]=s,m=i||c!==d&&B(c)&&B(d);if(!m){let e=l.name.value,t=f.name.value;if(e!==t)return[[a,`"${e}" and "${t}" are different fields`],[l],[f]];if(!Zu(l,f))return[[a,`they have differing arguments`],[l],[f]]}let h=u?.type,g=p?.type;if(h&&g&&$u(h,g))return[[a,`they return conflicting types "${L(h)}" and "${L(g)}"`],[l],[f]];let _=l.selectionSet,v=f.selectionSet;if(_&&v)return rd(qu(e,t,n,r,m,Xs(h),_,Xs(g),v),a,l,f)}function Zu(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{let t=e.value,n=i.get(e.name.value);return n===void 0?!1:Qu(t)===Qu(n)})}function Qu(e){return as(zu(e))}function $u(e,t){return As(e)?As(t)?$u(e.ofType,t.ofType):!0:As(t)?!0:V(e)?V(t)?$u(e.ofType,t.ofType):!0:V(t)?!0:Ls(e)||Ls(t)?e!==t:!1}function ed(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);nd(e,n,r,a,o);let s=[a,Object.keys(o)];return t.set(r,s),s}function td(e,t,n){return t.get(n.selectionSet)||ed(e,t,zl(e.getSchema(),n.typeCondition),n.selectionSet)}function nd(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case F.FIELD:{let e=a.name.value,n;(B(t)||Ss(t))&&(n=t.getFields()[e]);let i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case F.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case F.INLINE_FRAGMENT:{let n=a.typeCondition;nd(e,n?zl(e.getSchema(),n):t,a.selectionSet,r,i);break}}}function rd(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}var id,ad,od=n((()=>{lo(),N(),va(),ds(),yc(),Vu(),Bl(),id=class{constructor(){this._data=new Map}has(e,t,n){let r=this._data.get(e)?.get(t);return r===void 0?!1:n?!0:n===r}add(e,t,n){let r=this._data.get(e);r===void 0?this._data.set(e,new Map([[t,n]])):r.set(t,n)}},ad=class{constructor(){this._orderedPairSet=new id}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}}}));function sd(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(zs(n)&&zs(r)&&!Sc(e.getSchema(),n,r)){let i=L(r),a=L(n);e.reportError(new M(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=cd(e,n),i=e.getParentType();if(r&&i&&!Sc(e.getSchema(),r,i)){let a=L(i),o=L(r);e.reportError(new M(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function cd(e,t){let n=e.getFragment(t);if(n){let t=zl(e.getSchema(),n.typeCondition);if(zs(t))return t}}var ld=n((()=>{lo(),N(),yc(),Cc(),Bl()}));function ud(e){let t=e.getSchema(),n=Object.create(null);for(let t of e.getDocument().definitions)Ql(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){let i=r.name.value,a=n[i],o=t?.getType(i),s;if(a?s=pd[a.kind]:o&&(s=dd(o)),s){if(s!==r.kind){let t=fd(r.kind);e.reportError(new M(`Cannot extend non-${t} type "${i}".`,{nodes:a?[a,r]:r}))}}else{let a=Ho(i,Object.keys({...n,...t?.getTypeMap()}));e.reportError(new M(`Cannot extend type "${i}" because it is not defined.`+Eo(a),{nodes:r.name}))}}}function dd(e){if(ys(e))return F.SCALAR_TYPE_EXTENSION;if(B(e))return F.OBJECT_TYPE_EXTENSION;if(Ss(e))return F.INTERFACE_TYPE_EXTENSION;if(ws(e))return F.UNION_TYPE_EXTENSION;if(Es(e))return F.ENUM_TYPE_EXTENSION;if(Os(e))return F.INPUT_OBJECT_TYPE_EXTENSION;Yi(!1,`Unexpected type: `+L(e))}function fd(e){switch(e){case F.SCALAR_TYPE_EXTENSION:return`scalar`;case F.OBJECT_TYPE_EXTENSION:return`object`;case F.INTERFACE_TYPE_EXTENSION:return`interface`;case F.UNION_TYPE_EXTENSION:return`union`;case F.ENUM_TYPE_EXTENSION:return`enum`;case F.INPUT_OBJECT_TYPE_EXTENSION:return`input object`;default:Yi(!1,`Unexpected kind: `+L(e))}}var pd,md=n((()=>{Oo(),lo(),Xi(),Go(),N(),va(),nu(),yc(),pd={[F.SCALAR_TYPE_DEFINITION]:F.SCALAR_TYPE_EXTENSION,[F.OBJECT_TYPE_DEFINITION]:F.OBJECT_TYPE_EXTENSION,[F.INTERFACE_TYPE_DEFINITION]:F.INTERFACE_TYPE_EXTENSION,[F.UNION_TYPE_DEFINITION]:F.UNION_TYPE_EXTENSION,[F.ENUM_TYPE_DEFINITION]:F.ENUM_TYPE_EXTENSION,[F.INPUT_OBJECT_TYPE_DEFINITION]:F.INPUT_OBJECT_TYPE_EXTENSION}}));function hd(e){return{...gd(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map(e=>e.name.value));for(let i of n.args)if(!r.has(i.name)&&ac(i)){let r=L(i.type);e.reportError(new M(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}function gd(e){let t=Object.create(null),n=e.getSchema()?.getDirectives()??Gc;for(let e of n)t[e.name]=jo(e.args.filter(ac),e=>e.name);let r=e.getDocument().definitions;for(let e of r)if(e.kind===F.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=jo(n.filter(_d),e=>e.name.value)}return{Directive:{leave(n){let r=n.name.value,i=t[r];if(i){let t=n.arguments??[],a=new Set(t.map(e=>e.name.value));for(let[t,o]of Object.entries(i))if(!a.has(t)){let i=_s(o.type)?L(o.type):as(o.type);e.reportError(new M(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function _d(e){return e.type.kind===F.NON_NULL_TYPE&&e.defaultValue==null}var vd=n((()=>{lo(),Mo(),N(),va(),ds(),yc(),Kc()}));function yd(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(Ls(Xs(n))){if(r){let i=t.name.value,a=L(n);e.reportError(new M(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let r=t.name.value,i=L(n);e.reportError(new M(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let r=t.name.value,i=L(n);e.reportError(new M(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}}}}var bd=n((()=>{lo(),N(),yc()}));function xd(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}var Sd=n((()=>{}));function Cd(e,t,n){return{prev:e,key:t,typename:n}}function wd(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}var Td=n((()=>{}));function Ed(e,t,n=Dd){return Od(e,t,n,void 0)}function Dd(e,t,n){let r=`Invalid value `+L(t);throw e.length>0&&(r+=` at "value${xd(e)}"`),n.message=r+`: `+n.message,n}function Od(e,t,n,r){if(V(t)){if(e!=null)return Od(e,t.ofType,n,r);n(wd(r),e,new M(`Expected non-nullable type "${L(t)}" not to be null.`));return}if(e==null)return null;if(As(t)){let i=t.ofType;return qc(e)?Array.from(e,(e,t)=>Od(e,i,n,Cd(r,t,void 0))):[Od(e,i,n,r)]}if(Os(t)){if(!qi(e)||Array.isArray(e)){n(wd(r),e,new M(`Expected type "${t.name}" to be an object.`));return}let i=Object.create(null),a=t.getFields();for(let o of Object.values(a)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(V(o.type)){let t=L(o.type);n(wd(r),e,new M(`Field "${o.name}" of required type "${t}" was not provided.`))}continue}i[o.name]=Od(a,o.type,n,Cd(r,o.name,t.name))}for(let i of Object.keys(e))if(!a[i]){let a=Ho(i,Object.keys(t.getFields()));n(wd(r),e,new M(`Field "${i}" is not defined by type "${t.name}".`+Eo(a)))}if(t.isOneOf){let a=Object.keys(i);a.length!==1&&n(wd(r),e,new M(`Exactly one key must be specified for OneOf type "${t.name}".`));let o=a[0],s=i[o];s===null&&n(wd(r).concat(o),s,new M(`Field "${o}" must be non-null.`))}return{...i}}if(Ls(t)){let i;try{i=t.parseValue(e)}catch(i){i instanceof M?n(wd(r),e,i):n(wd(r),e,new M(`Expected type "${t.name}". `+i.message,{originalError:i}));return}return i===void 0&&n(wd(r),e,new M(`Expected type "${t.name}".`)),i}Yi(!1,`Unexpected input type: `+L(t))}var kd=n((()=>{Oo(),lo(),Xi(),Jc(),Ji(),Td(),Sd(),Go(),N(),yc()}));function Ad(e,t,n){if(e){if(e.kind===F.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&V(t)?void 0:i}if(V(t))return e.kind===F.NULL?void 0:Ad(e,t.ofType,n);if(e.kind===F.NULL)return null;if(As(t)){let r=t.ofType;if(e.kind===F.LIST){let t=[];for(let i of e.values)if(jd(i,n)){if(V(r))return;t.push(null)}else{let e=Ad(i,r,n);if(e===void 0)return;t.push(e)}return t}let i=Ad(e,r,n);return i===void 0?void 0:[i]}if(Os(t)){if(e.kind!==F.OBJECT)return;let r=Object.create(null),i=jo(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||jd(t.value,n)){if(e.defaultValue!==void 0)r[e.name]=e.defaultValue;else if(V(e.type))return;continue}let a=Ad(t.value,e.type,n);if(a===void 0)return;r[e.name]=a}if(t.isOneOf){let e=Object.keys(r);if(e.length!==1||r[e[0]]===null)return}return r}if(Ls(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}Yi(!1,`Unexpected input type: `+L(t))}}function jd(e,t){return e.kind===F.VARIABLE&&(t==null||t[e.name.value]===void 0)}var Md=n((()=>{lo(),Xi(),Mo(),va(),yc()}));function Nd(e,t,n,r){let i=[],a=r?.maxErrors;try{let r=Pd(e,t,n,e=>{if(a!=null&&i.length>=a)throw new M(`Too many errors processing variables, error limit reached. Execution aborted.`);i.push(e)});if(i.length===0)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function Pd(e,t,n,r){let i=Object.create(null);for(let a of t){let t=a.variable.name.value,o=zl(e,a.type);if(!Ns(o)){r(new M(`Variable "$${t}" expected value of type "${as(a.type)}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!Ld(n,t)){a.defaultValue?i[t]=Ad(a.defaultValue,o):V(o)&&r(new M(`Variable "$${t}" of required type "${L(o)}" was not provided.`,{nodes:a}));continue}let s=n[t];if(s===null&&V(o)){r(new M(`Variable "$${t}" of non-null type "${L(o)}" must not be null.`,{nodes:a}));continue}i[t]=Ed(s,o,(e,n,i)=>{let o=`Variable "$${t}" got invalid value `+L(n);e.length>0&&(o+=` at "${t}${xd(e)}"`),r(new M(o+`; `+i.message,{nodes:a,originalError:i}))})}return{...i}}function Fd(e,t,n){let r=Object.create(null),i=jo(t.arguments??[],e=>e.name.value);for(let a of e.args){let e=a.name,o=a.type,s=i[e];if(!s){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(V(o))throw new M(`Argument "${e}" of required type "${L(o)}" was not provided.`,{nodes:t});continue}let c=s.value,l=c.kind===F.NULL;if(c.kind===F.VARIABLE){let t=c.name.value;if(n==null||!Ld(n,t)){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(V(o))throw new M(`Argument "${e}" of required type "${L(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}l=n[t]==null}if(l&&V(o))throw new M(`Argument "${e}" of non-null type "${L(o)}" must not be null.`,{nodes:c});let u=Ad(c,o,n);if(u===void 0)throw new M(`Argument "${e}" has invalid value ${as(c)}.`,{nodes:c});r[e]=u}return{...r}}function Id(e,t,n){let r=t.directives?.find(t=>t.name.value===e.name);if(r)return Fd(e,r,n)}function Ld(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Rd=n((()=>{lo(),Mo(),Sd(),N(),va(),ds(),yc(),kd(),Bl(),Md()}));function zd(e,t,n,r,i){let a=new Map;return Vd(e,t,n,r,i,a,new Set),a}function Bd(e,t,n,r,i){let a=new Map,o=new Set;for(let s of i)s.selectionSet&&Vd(e,t,n,r,s.selectionSet,a,o);return a}function Vd(e,t,n,r,i,a,o){for(let s of i.selections)switch(s.kind){case F.FIELD:{if(!Hd(n,s))continue;let e=Wd(s),t=a.get(e);t===void 0?a.set(e,[s]):t.push(s);break}case F.INLINE_FRAGMENT:if(!Hd(n,s)||!Ud(e,s,r))continue;Vd(e,t,n,r,s.selectionSet,a,o);break;case F.FRAGMENT_SPREAD:{let i=s.name.value;if(o.has(i)||!Hd(n,s))continue;o.add(i);let c=t[i];if(!c||!Ud(e,c,r))continue;Vd(e,t,n,r,c.selectionSet,a,o);break}}}function Hd(e,t){return Id(Bc,t,e)?.if===!0?!1:Id(zc,t,e)?.if!==!1}function Ud(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=zl(e,r);return i===n?!0:Vs(i)?e.isSubType(i,n):!1}function Wd(e){return e.alias?e.alias.value:e.name.value}var Gd=n((()=>{va(),yc(),Kc(),Bl(),Rd()}));function Kd(e){return{OperationDefinition(t){if(t.operation===`subscription`){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===F.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let c=zd(n,s,a,r,t.selectionSet);if(c.size>1){let t=[...c.values()].slice(1).flat();e.reportError(new M(i==null?`Anonymous Subscription must select only one top level field.`:`Subscription "${i}" must select only one top level field.`,{nodes:t}))}for(let t of c.values())t[0].name.value.startsWith(`__`)&&e.reportError(new M(i==null?`Anonymous Subscription must not select an introspection top level field.`:`Subscription "${i}" must not select an introspection top level field.`,{nodes:t}))}}}}}var qd=n((()=>{N(),va(),Gd()}));function Jd(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}var Yd=n((()=>{}));function Xd(e){return{DirectiveDefinition(e){let t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){let t=e.name.value,r=e.fields??[];for(let e of r){let r=e.name.value,i=e.arguments??[];n(`${t}.${r}`,i)}return!1}function n(t,n){let r=Jd(n,e=>e.name.value);for(let[n,i]of r)i.length>1&&e.reportError(new M(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}var Zd=n((()=>{Yd(),N()}));function Qd(e){return{Field:t,Directive:t};function t(t){let n=Jd(t.arguments??[],e=>e.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new M(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}var $d=n((()=>{Yd(),N()}));function ef(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new M(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new M(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}var tf=n((()=>{N()}));function nf(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=!e.isRepeatable;let i=e.getDocument().definitions;for(let e of i)e.kind===F.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);let a=Object.create(null),o=Object.create(null);return{enter(n){if(!(`directives`in n)||!n.directives)return;let r;if(n.kind===F.SCHEMA_DEFINITION||n.kind===F.SCHEMA_EXTENSION)r=a;else if(Ql(n)||eu(n)){let e=n.name.value;r=o[e],r===void 0&&(o[e]=r=Object.create(null))}else r=Object.create(null);for(let i of n.directives){let n=i.name.value;t[n]&&(r[n]?e.reportError(new M(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}var rf=n((()=>{N(),va(),nu(),Kc()}));function af(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.values??[],o=r[i];for(let t of a){let r=t.name.value,a=n[i];Es(a)&&a.getValue(r)?e.reportError(new M(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new M(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}var of=n((()=>{N(),yc()}));function sf(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.fields??[],o=r[i];for(let t of a){let r=t.name.value;cf(n[i],r)?e.reportError(new M(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new M(`Field "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function cf(e,t){return B(e)||Ss(e)||Os(e)?e.getFields()[t]!=null:!1}var lf=n((()=>{N(),yc()}));function uf(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new M(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}var df=n((()=>{N()}));function ff(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let e=t.pop();e||Yi(!1),n=e}},ObjectField(t){let r=t.name.value;n[r]?e.reportError(new M(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}var pf=n((()=>{Xi(),N()}));function mf(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new M(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}var hf=n((()=>{N()}));function gf(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){let i=t.operationTypes??[];for(let t of i){let i=t.operation,a=n[i];r[i]?e.reportError(new M(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new M(`There can be only one ${i} type in schema.`,{nodes:[a,t]})):n[i]=t}return!1}}var _f=n((()=>{N()}));function vf(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;if(n!=null&&n.getType(i)){e.reportError(new M(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}return t[i]?e.reportError(new M(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}var yf=n((()=>{N()}));function bf(e){return{OperationDefinition(t){let n=Jd(t.variableDefinitions??[],e=>e.variable.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new M(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}}var xf=n((()=>{Yd(),N()}));function Sf(e){return{ListValue(t){if(!As(qs(e.getParentInputType())))return Cf(e,t),!1},ObjectValue(t){let n=Xs(e.getInputType());if(!Os(n))return Cf(e,t),!1;let r=jo(t.fields,e=>e.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&uc(i)){let r=L(i.type);e.reportError(new M(`Field "${n.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}n.isOneOf&&wf(e,t,n,r)},ObjectField(t){let n=Xs(e.getParentInputType());if(!e.getInputType()&&Os(n)){let r=Ho(t.name.value,Object.keys(n.getFields()));e.reportError(new M(`Field "${t.name.value}" is not defined by type "${n.name}".`+Eo(r),{nodes:t}))}},NullValue(t){let n=e.getInputType();V(n)&&e.reportError(new M(`Expected value of type "${L(n)}", found ${as(t)}.`,{nodes:t}))},EnumValue:t=>Cf(e,t),IntValue:t=>Cf(e,t),FloatValue:t=>Cf(e,t),StringValue:t=>Cf(e,t),BooleanValue:t=>Cf(e,t)}}function Cf(e,t){let n=e.getInputType();if(!n)return;let r=Xs(n);if(!Ls(r)){let r=L(n);e.reportError(new M(`Expected value of type "${r}", found ${as(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let r=L(n);e.reportError(new M(`Expected value of type "${r}", found ${as(t)}.`,{nodes:t}))}}catch(r){let i=L(n);r instanceof M?e.reportError(r):e.reportError(new M(`Expected value of type "${i}", found ${as(t)}; `+r.message,{nodes:t,originalError:r}))}}function wf(e,t,n,r){let i=Object.keys(r);if(i.length!==1){e.reportError(new M(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=r[i[0]]?.value;(!a||a.kind===F.NULL)&&e.reportError(new M(`Field "${n.name}.${i[0]}" must be non-null.`,{nodes:[t]}))}var Tf=n((()=>{Oo(),lo(),Mo(),Go(),N(),va(),ds(),yc()}));function Ef(e){return{VariableDefinition(t){let n=zl(e.getSchema(),t.type);if(n!==void 0&&!Ns(n)){let n=t.variable.name.value,r=as(t.type);e.reportError(new M(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}var Df=n((()=>{N(),ds(),yc(),Bl()}));function Of(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:n,type:i,defaultValue:a,parentType:o}of r){let r=n.name.value,s=t[r];if(s&&i){let t=e.getSchema(),c=zl(t,s.type);if(c&&!kf(t,c,s.defaultValue,i,a)){let t=L(c),a=L(i);e.reportError(new M(`Variable "$${r}" of type "${t}" used in position expecting type "${a}".`,{nodes:[s,n]}))}Os(o)&&o.isOneOf&&Gs(c)&&e.reportError(new M(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function kf(e,t,n,r,i){if(V(r)&&!V(t)){if(!(n!=null&&n.kind!==F.NULL)&&i===void 0)return!1;let a=r.ofType;return xc(e,t,a)}return xc(e,t,r)}var Af=n((()=>{lo(),N(),va(),yc(),Cc(),Bl()})),jf,Mf,Nf,Pf=n((()=>{iu(),cu(),uu(),pu(),_u(),yu(),Cu(),Tu(),Du(),Au(),Mu(),Pu(),Iu(),Ru(),od(),ld(),md(),vd(),bd(),qd(),Zd(),$d(),tf(),rf(),of(),lf(),df(),pf(),hf(),_f(),yf(),xf(),Tf(),Df(),Af(),jf=Object.freeze([Ou]),Mf=Object.freeze([ru,mf,wu,Kd,bu,lu,Ef,yd,au,uf,vu,Fu,sd,ju,bf,Nu,Lu,mu,nf,du,Qd,Sf,hd,Of,Uu,ff,...jf]),Nf=Object.freeze([Eu,gf,vf,af,sf,Xd,ef,bu,mu,nf,ud,fu,Qd,ff,gd])})),Ff,If,Lf,Rf=n((()=>{va(),is(),Wl(),Ff=class{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return`ASTValidationContext`}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let e of this.getDocument().definitions)e.kind===F.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;for(;r=n.pop();)for(let e of r.selections)e.kind===F.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=Object.create(null),r=[e.selectionSet],i;for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(n[i]!==!0){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}},If=class extends Ff{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return`SDLValidationContext`}getSchema(){return this._schema}},Lf=class extends Ff{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return`ValidationContext`}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new Ul(this._schema);$o(e,Hl(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}}));function zf(e,t,n=Mf,r,i=new Ul(e)){let a=r?.maxErrors??100;t||Ui(!1,`Must provide document.`),yl(e);let o=Object.freeze({}),s=[],c=new Lf(e,t,i,e=>{if(s.length>=a)throw s.push(new M(`Too many validation errors, error limit reached. Validation aborted.`)),o;s.push(e)}),l=es(n.map(e=>e(c)));try{$o(t,Hl(i,l),Uf)}catch(e){if(e!==o)throw e}return s}function Bf(e,t,n=Nf){let r=[],i=new If(e,t,e=>{r.push(e)});return $o(e,es(n.map(e=>e(i)))),r}function Vf(e){let t=Bf(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
+
+`))}function Hf(e,t){let n=Bf(e,t);if(n.length!==0)throw Error(n.map(e=>e.message).join(`
+
+`))}var Uf,Wf=n((()=>{Wi(),Io(),N(),ga(),is(),Rl(),Wl(),Pf(),Rf(),Uf=Fo(pa,e=>e.filter(e=>e!==`description`))}));function Gf(e){let t;return function(n,r,i){t===void 0&&(t=new WeakMap);let a=t.get(n);a===void 0&&(a=new WeakMap,t.set(n,a));let o=a.get(r);o===void 0&&(o=new WeakMap,a.set(r,o));let s=o.get(i);return s===void 0&&(s=e(n,r,i),o.set(i,s)),s}}var Kf=n((()=>{}));function qf(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}var Jf=n((()=>{}));function Yf(e,t,n){let r=n;for(let n of e)r=Gi(r)?r.then(e=>t(e,n)):t(r,n);return r}var Xf=n((()=>{Ki()}));function Zf(e){return e instanceof Error?e:new Qf(e)}var Qf,$f=n((()=>{lo(),Qf=class extends Error{constructor(e){super(`Unexpected error value: `+L(e)),this.name=`NonErrorThrown`,this.thrownValue=e}}}));function ep(e,t,n){let r=Zf(e);return tp(r)?r:new M(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function tp(e){return Array.isArray(e.path)}var np=n((()=>{$f(),N()}));function rp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let{schema:t,document:n,variableValues:r,rootValue:i}=e;op(t,n,r);let a=sp(e);if(!(`schema`in a))return{errors:a};try{let{operation:e}=a,t=cp(a,e,i);return Gi(t)?t.then(e=>ap(e,a.collectedErrors.errors),e=>(a.collectedErrors.add(e,void 0),ap(null,a.collectedErrors.errors))):ap(t,a.collectedErrors.errors)}catch(e){return a.collectedErrors.add(e,void 0),ap(null,a.collectedErrors.errors)}}function ip(e){let t=rp(e);if(Gi(t))throw Error(`GraphQL execution failed to complete synchronously.`);return t}function ap(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function op(e,t,n){t||Ui(!1,`Must provide document.`),yl(e),n==null||qi(n)||Ui(!1,`Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.`)}function sp(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c,subscribeFieldResolver:l,options:u}=e,d,f=Object.create(null);for(let e of n.definitions)switch(e.kind){case F.OPERATION_DEFINITION:if(o==null){if(d!==void 0)return[new M(`Must provide operation name if query contains multiple operations.`)];d=e}else e.name?.value===o&&(d=e);break;case F.FRAGMENT_DEFINITION:f[e.name.value]=e;break;default:}if(!d)return o==null?[new M(`Must provide an operation.`)]:[new M(`Unknown operation named "${o}".`)];let p=Nd(t,d.variableDefinitions??[],a??{},{maxErrors:u?.maxCoercionErrors??50});return p.errors?p.errors:{schema:t,fragments:f,rootValue:r,contextValue:i,operation:d,variableValues:p.coerced,fieldResolver:s??Tp,typeResolver:c??wp,subscribeFieldResolver:l??Tp,collectedErrors:new Cp}}function cp(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new M(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=zd(e.schema,e.fragments,e.variableValues,r,t.selectionSet);switch(t.operation){case ha.QUERY:return up(e,r,n,void 0,i);case ha.MUTATION:return lp(e,r,n,void 0,i);case ha.SUBSCRIPTION:return up(e,r,n,void 0,i)}}function lp(e,t,n,r,i){return Yf(i.entries(),(i,[a,o])=>{let s=dp(e,t,n,o,Cd(r,a,t.name));return s===void 0?i:Gi(s)?s.then(e=>(i[a]=e,i)):(i[a]=s,i)},Object.create(null))}function up(e,t,n,r,i){let a=Object.create(null),o=!1;try{for(let[s,c]of i.entries()){let i=dp(e,t,n,c,Cd(r,s,t.name));i!==void 0&&(a[s]=i,Gi(i)&&(o=!0))}}catch(e){if(o)return qf(a).finally(()=>{throw e});throw e}return o?qf(a):a}function dp(e,t,n,r,i){let a=xp(e.schema,t,r[0]);if(!a)return;let o=a.type,s=a.resolve??e.fieldResolver,c=fp(e,a,r,t,i);try{let t=Fd(a,r[0],e.variableValues),l=e.contextValue,u=s(n,t,l,c),d;return d=Gi(u)?u.then(t=>mp(e,o,r,c,i,t)):mp(e,o,r,c,i,u),Gi(d)?d.then(void 0,t=>pp(ep(t,r,wd(i)),o,i,e)):d}catch(t){return pp(ep(t,r,wd(i)),o,i,e)}}function fp(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function pp(e,t,n,r){if(V(t))throw e;return r.collectedErrors.add(e,n),null}function mp(e,t,n,r,i,a){if(a instanceof Error)throw a;if(V(t)){let o=mp(e,t.ofType,n,r,i,a);if(o===null)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(a==null)return null;if(As(t))return hp(e,t,n,r,i,a);if(Ls(t))return gp(t,a);if(Vs(t))return _p(e,t,n,r,i,a);if(B(t))return yp(e,t,n,r,i,a);Yi(!1,`Cannot complete value of unexpected output type: `+L(t))}function hp(e,t,n,r,i,a){if(!qc(a))throw new M(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let o=t.ofType,s=!1,c=Array.from(a,(t,a)=>{let c=Cd(i,a,void 0);try{let i;return i=Gi(t)?t.then(t=>mp(e,o,n,r,c,t)):mp(e,o,n,r,c,t),Gi(i)?(s=!0,i.then(void 0,t=>pp(ep(t,n,wd(c)),o,c,e))):i}catch(t){return pp(ep(t,n,wd(c)),o,c,e)}});return s?Promise.all(c):c}function gp(e,t){let n=e.serialize(t);if(n==null)throw Error(`Expected \`${L(e)}.serialize(${L(t)})\` to return non-nullable value, returned: ${L(n)}`);return n}function _p(e,t,n,r,i,a){let o=t.resolveType??e.typeResolver,s=e.contextValue,c=o(a,s,r,t);return Gi(c)?c.then(o=>yp(e,vp(o,e,t,n,r,a),n,r,i,a)):yp(e,vp(c,e,t,n,r,a),n,r,i,a)}function vp(e,t,n,r,i,a){if(e==null)throw new M(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(B(e))throw new M(`Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.`);if(typeof e!=`string`)throw new M(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${L(a)}, received "${L(e)}".`);let o=t.schema.getType(e);if(o==null)throw new M(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!B(o))throw new M(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new M(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function yp(e,t,n,r,i,a){let o=Sp(e,t,n);if(t.isTypeOf){let s=t.isTypeOf(a,e.contextValue,r);if(Gi(s))return s.then(r=>{if(!r)throw bp(t,a,n);return up(e,t,a,i,o)});if(!s)throw bp(t,a,n)}return up(e,t,a,i,o)}function bp(e,t,n){return new M(`Expected value of type "${e.name}" but got: ${L(t)}.`,{nodes:n})}function xp(e,t,n){let r=n.name.value;return r===cl.name&&e.getQueryType()===t?cl:r===ll.name&&e.getQueryType()===t?ll:r===ul.name?ul:t.getFields()[r]}var Sp,Cp,wp,Tp,Ep=n((()=>{Wi(),lo(),Xi(),Jc(),Ji(),Ki(),Kf(),Td(),Jf(),Xf(),N(),np(),ga(),va(),yc(),fl(),Rl(),Gd(),Rd(),Sp=Gf((e,t,n)=>Bd(e.schema,e.fragments,e.variableValues,t,n)),Cp=class{constructor(){this._errorPositions=new Set,this._errors=[]}get errors(){return this._errors}add(e,t){this._hasNulledPosition(t)||(this._errorPositions.add(t),this._errors.push(e))}_hasNulledPosition(e){let t=e;for(;t!==void 0;){if(this._errorPositions.has(t))return!0;t=t.prev}return this._errorPositions.has(void 0)}},wp=function(e,t,n,r){if(qi(e)&&typeof e.__typename==`string`)return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let r=0;r<i.length;r++){let o=i[r];if(o.isTypeOf){let i=o.isTypeOf(e,t,n);if(Gi(i))a[r]=i;else if(i)return a.length&&Promise.allSettled(a).catch(()=>{}),o.name}}if(a.length)return Promise.all(a).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},Tp=function(e,t,n,r){if(qi(e)||typeof e==`function`){let i=e[r.fieldName];return typeof i==`function`?e[r.fieldName](t,n,r):i}}}));function Dp(e){return new Promise(t=>t(kp(e)))}function Op(e){let t=kp(e);if(Gi(t))throw Error(`GraphQL execution failed to complete synchronously.`);return t}function kp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c}=e,l=vl(t);if(l.length>0)return{errors:l};let u;try{u=_o(n)}catch(e){return{errors:[e]}}let d=zf(t,u);return d.length>0?{errors:d}:rp({schema:t,document:u,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c})}var Ap=n((()=>{Wi(),Ki(),To(),Rl(),Wf(),Ep()})),jp=n((()=>{_l(),yc(),Kc(),Pc(),fl(),Rl(),gs()})),Mp=n((()=>{go(),$i(),ra(),va(),Aa(),Za(),To(),ds(),is(),ga(),nu(),_a()}));function Np(e){return typeof e?.[Symbol.asyncIterator]==`function`}var Pp=n((()=>{}));function Fp(e,t){let n=e[Symbol.asyncIterator]();async function r(e){if(e.done)return e;try{return{value:await t(e.value),done:!1}}catch(e){if(typeof n.return==`function`)try{await n.return()}catch{}throw e}}return{async next(){return r(await n.next())},async return(){return typeof n.return==`function`?r(await n.return()):{value:void 0,done:!0}},async throw(e){if(typeof n.throw==`function`)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}var Ip=n((()=>{}));async function Lp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let t=await zp(e);return Np(t)?Fp(t,t=>rp({...e,rootValue:t})):t}function Rp(e){let t=e[0];return t&&`document`in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function zp(...e){let t=Rp(e),{schema:n,document:r,variableValues:i}=t;op(n,r,i);let a=sp(t);if(!(`schema`in a))return{errors:a};try{let e=await Bp(a);if(!Np(e))throw Error(`Subscription field must return Async Iterable. Received: ${L(e)}.`);return e}catch(e){if(e instanceof M)return{errors:[e]};throw e}}async function Bp(e){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw new M(`Schema is not configured to execute subscription operation.`,{nodes:r});let[s,c]=[...zd(t,n,i,o,r.selectionSet).entries()][0],l=xp(t,o,c[0]);if(!l){let e=c[0].name.value;throw new M(`The subscription field "${e}" is not defined.`,{nodes:c})}let u=Cd(void 0,s,o.name),d=fp(e,l,c,o,u);try{let t=Fd(l,c[0],i),n=e.contextValue,r=await(l.subscribe??e.subscribeFieldResolver)(a,t,n,d);if(r instanceof Error)throw r;return r}catch(e){throw ep(e,c,wd(u))}}var Vp=n((()=>{Wi(),lo(),Pp(),Td(),N(),np(),Gd(),Ep(),Ip(),Rd()})),Hp=n((()=>{Td(),Ep(),Vp(),Rd()}));function Up(e){return{Field(t){let n=e.getFieldDef(),r=n?.deprecationReason;if(n&&r!=null){let i=e.getParentType();i??Yi(!1),e.reportError(new M(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n?.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new M(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let i=e.getParentType(),a=e.getFieldDef();i!=null&&a!=null||Yi(!1),e.reportError(new M(`Field "${i.name}.${a.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=Xs(e.getParentInputType());if(Os(n)){let r=n.getFields()[t.name.value],i=r?.deprecationReason;i!=null&&e.reportError(new M(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n?.deprecationReason;if(n&&r!=null){let i=Xs(e.getInputType());i??Yi(!1),e.reportError(new M(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}var Wp=n((()=>{Xi(),N(),yc()}));function Gp(e){return{Field(t){let n=Xs(e.getType());n&&Qc(n)&&e.reportError(new M(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var Kp=n((()=>{N(),yc(),fl()})),qp=n((()=>{Wf(),Rf(),Pf(),iu(),cu(),uu(),pu(),_u(),yu(),Cu(),Tu(),Mu(),Pu(),Iu(),Ru(),od(),ld(),vd(),bd(),qd(),$d(),rf(),df(),pf(),hf(),xf(),Tf(),Df(),Af(),Au(),Du(),_f(),yf(),of(),lf(),Zd(),tf(),md(),Wp(),Kp()})),Jp=n((()=>{N(),la(),np()}));function Yp(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?`description`:``,r=t.specifiedByUrl?`specifiedByURL`:``,i=t.directiveIsRepeatable?`isRepeatable`:``,a=t.schemaDescription?n:``;function o(e){return t.inputValueDeprecation?e:``}let s=t.oneOf?`isOneOf`:``;return`
+ query IntrospectionQuery {
+ __schema {
+ ${a}
+ queryType { name kind }
+ mutationType { name kind }
+ subscriptionType { name kind }
+ types {
+ ...FullType
+ }
+ directives {
+ name
+ ${n}
+ ${i}
+ locations
+ args${o(`(includeDeprecated: true)`)} {
+ ...InputValue
+ }
+ }
+ }
+ }
+
+ fragment FullType on __Type {
+ kind
+ name
+ ${n}
+ ${r}
+ ${s}
+ fields(includeDeprecated: true) {
+ name
+ ${n}
+ args${o(`(includeDeprecated: true)`)} {
+ ...InputValue
+ }
+ type {
+ ...TypeRef
+ }
+ isDeprecated
+ deprecationReason
+ }
+ inputFields${o(`(includeDeprecated: true)`)} {
+ ...InputValue
+ }
+ interfaces {
+ ...TypeRef
+ }
+ enumValues(includeDeprecated: true) {
+ name
+ ${n}
+ isDeprecated
+ deprecationReason
+ }
+ possibleTypes {
+ ...TypeRef
+ }
+ }
+
+ fragment InputValue on __InputValue {
+ name
+ ${n}
+ type { ...TypeRef }
+ defaultValue
+ ${o(`isDeprecated`)}
+ ${o(`deprecationReason`)}
+ }
+
+ fragment TypeRef on __Type {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ ofType {
+ kind
+ name
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ `}var Xp=n((()=>{}));function Zp(e,t){let n=null;for(let r of e.definitions)if(r.kind===F.OPERATION_DEFINITION){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}var Qp=n((()=>{va()}));function $p(e,t){if(t.operation===`query`){let n=e.getQueryType();if(!n)throw new M(`Schema does not define the required query root type.`,{nodes:t});return n}if(t.operation===`mutation`){let n=e.getMutationType();if(!n)throw new M(`Schema is not configured for mutations.`,{nodes:t});return n}if(t.operation===`subscription`){let n=e.getSubscriptionType();if(!n)throw new M(`Schema is not configured for subscriptions.`,{nodes:t});return n}throw new M(`Can only have query, mutation and subscription operations.`,{nodes:t})}var em=n((()=>{N()}));function tm(e,t){let n=ip({schema:e,document:_o(Yp({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t}))});return!n.errors&&n.data||Yi(!1),n.data}var nm=n((()=>{Xi(),To(),Ep(),Xp()}));function rm(e,t){qi(e)&&qi(e.__schema)||Ui(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${L(e)}.`);let n=e.__schema,r=No(n.types,e=>e.name,e=>f(e));for(let e of[...Nc,...dl])r[e.name]&&(r[e.name]=e);let i=n.queryType?u(n.queryType):null,a=n.mutationType?u(n.mutationType):null,o=n.subscriptionType?u(n.subscriptionType):null,s=n.directives?n.directives.map(C):[];return new gl({description:n.description,query:i,mutation:a,subscription:o,types:Object.values(r),directives:s,assumeValid:t?.assumeValid});function c(e){if(e.kind===ol.LIST){let t=e.ofType;if(!t)throw Error(`Decorated type deeper than introspection query.`);return new dc(c(t))}if(e.kind===ol.NON_NULL){let t=e.ofType;if(!t)throw Error(`Decorated type deeper than introspection query.`);return new fc(Ks(c(t)))}return l(e)}function l(e){let t=e.name;if(!t)throw Error(`Unknown type reference: ${L(e)}.`);let n=r[t];if(!n)throw Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function u(e){return xs(l(e))}function d(e){return Cs(l(e))}function f(e){if(e!=null&&e.name!=null&&e.kind!=null)switch(e.kind){case ol.SCALAR:return p(e);case ol.OBJECT:return h(e);case ol.INTERFACE:return g(e);case ol.UNION:return _(e);case ol.ENUM:return v(e);case ol.INPUT_OBJECT:return y(e)}let t=L(e);throw Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${t}.`)}function p(e){return new pc({name:e.name,description:e.description,specifiedByURL:e.specifiedByURL})}function m(e){if(e.interfaces===null&&e.kind===ol.INTERFACE)return[];if(!e.interfaces){let t=L(e);throw Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function h(e){return new mc({name:e.name,description:e.description,interfaces:()=>m(e),fields:()=>b(e)})}function g(e){return new hc({name:e.name,description:e.description,interfaces:()=>m(e),fields:()=>b(e)})}function _(e){if(!e.possibleTypes){let t=L(e);throw Error(`Introspection result missing possibleTypes: ${t}.`)}return new gc({name:e.name,description:e.description,types:()=>e.possibleTypes.map(u)})}function v(e){if(!e.enumValues){let t=L(e);throw Error(`Introspection result missing enumValues: ${t}.`)}return new _c({name:e.name,description:e.description,values:No(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}function y(e){if(!e.inputFields){let t=L(e);throw Error(`Introspection result missing inputFields: ${t}.`)}return new vc({name:e.name,description:e.description,fields:()=>S(e.inputFields),isOneOf:e.isOneOf})}function b(e){if(!e.fields)throw Error(`Introspection result missing fields: ${L(e)}.`);return No(e.fields,e=>e.name,x)}function x(e){let t=c(e.type);if(!Fs(t)){let e=L(t);throw Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){let t=L(e);throw Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:S(e.args)}}function S(e){return No(e,e=>e.name,ee)}function ee(e){let t=c(e.type);if(!Ns(t)){let e=L(t);throw Error(`Introspection must provide input type for arguments, but received: ${e}.`)}let n=e.defaultValue==null?void 0:Ad(vo(e.defaultValue),t);return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}function C(e){if(!e.args){let t=L(e);throw Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){let t=L(e);throw Error(`Introspection result missing directive locations: ${t}.`)}return new Rc({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:S(e.args)})}}var im=n((()=>{Wi(),lo(),Ji(),Po(),To(),yc(),Kc(),fl(),Pc(),_l(),Md()}));function am(e,t,n){ml(e),t!=null&&t.kind===F.DOCUMENT||Ui(!1,`Must provide valid Document AST.`),n?.assumeValid!==!0&&n?.assumeValidSDL!==!0&&Hf(t,e);let r=e.toConfig(),i=om(r,t,n);return r===i?e:new gl(i)}function om(e,t,n){let r=[],i=Object.create(null),a=[],o,s=[];for(let e of t.definitions)if(e.kind===F.SCHEMA_DEFINITION)o=e;else if(e.kind===F.SCHEMA_EXTENSION)s.push(e);else if(Ql(e))r.push(e);else if(eu(e)){let t=e.name.value,n=i[t];i[t]=n?n.concat([e]):[e]}else e.kind===F.DIRECTIVE_DEFINITION&&a.push(e);if(Object.keys(i).length===0&&r.length===0&&a.length===0&&s.length===0&&o==null)return e;let c=Object.create(null);for(let t of e.types)c[t.name]=p(t);for(let e of r){let t=e.name.value;c[t]=um[t]??ce(e)}let l={query:e.query&&d(e.query),mutation:e.mutation&&d(e.mutation),subscription:e.subscription&&d(e.subscription),...o&&S([o]),...S(s)};return{description:o?.description?.value,...l,types:Object.values(c),directives:[...e.directives.map(f),...a.map(te)],extensions:Object.create(null),astNode:o??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(s),assumeValid:n?.assumeValid??!1};function u(e){return As(e)?new dc(u(e.ofType)):V(e)?new fc(u(e.ofType)):d(e)}function d(e){return c[e.name]}function f(e){let t=e.toConfig();return new Rc({...t,args:Fo(t.args,x)})}function p(e){if(Qc(e)||wc(e))return e;if(ys(e))return g(e);if(B(e))return _(e);if(Ss(e))return v(e);if(ws(e))return y(e);if(Es(e))return h(e);if(Os(e))return m(e);Yi(!1,`Unexpected type: `+L(e))}function m(e){let t=e.toConfig(),n=i[t.name]??[];return new vc({...t,fields:()=>({...Fo(t.fields,e=>({...e,type:u(e.type)})),...ie(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function h(e){let t=e.toConfig(),n=i[e.name]??[];return new _c({...t,values:{...t.values,...ae(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}function g(e){let t=e.toConfig(),n=i[t.name]??[],r=t.specifiedByURL;for(let e of n)r=cm(e)??r;return new pc({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}function _(e){let t=e.toConfig(),n=i[t.name]??[];return new mc({...t,interfaces:()=>[...e.getInterfaces().map(d),...oe(n)],fields:()=>({...Fo(t.fields,b),...ne(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function v(e){let t=e.toConfig(),n=i[t.name]??[];return new hc({...t,interfaces:()=>[...e.getInterfaces().map(d),...oe(n)],fields:()=>({...Fo(t.fields,b),...ne(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function y(e){let t=e.toConfig(),n=i[t.name]??[];return new gc({...t,types:()=>[...e.getTypes().map(d),...se(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}function b(e){return{...e,type:u(e.type),args:e.args&&Fo(e.args,x)}}function x(e){return{...e,type:u(e.type)}}function S(e){let t={};for(let n of e){let e=n.operationTypes??[];for(let n of e)t[n.operation]=ee(n.type)}return t}function ee(e){let t=e.name.value,n=um[t]??c[t];if(n===void 0)throw Error(`Unknown type: "${t}".`);return n}function C(e){return e.kind===F.LIST_TYPE?new dc(C(e.type)):e.kind===F.NON_NULL_TYPE?new fc(C(e.type)):ee(e)}function te(e){return new Rc({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:re(e.arguments),astNode:e})}function ne(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e)t[n.name.value]={type:C(n.type),description:n.description?.value,args:re(n.arguments),deprecationReason:sm(n),astNode:n}}return t}function re(e){let t=e??[],n=Object.create(null);for(let e of t){let t=C(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Ad(e.defaultValue,t),deprecationReason:sm(e),astNode:e}}return n}function ie(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e){let e=C(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Ad(n.defaultValue,e),deprecationReason:sm(n),astNode:n}}}return t}function ae(e){let t=Object.create(null);for(let n of e){let e=n.values??[];for(let n of e)t[n.name.value]={description:n.description?.value,deprecationReason:sm(n),astNode:n}}return t}function oe(e){return e.flatMap(e=>e.interfaces?.map(ee)??[])}function se(e){return e.flatMap(e=>e.types?.map(ee)??[])}function ce(e){let t=e.name.value,n=i[t]??[];switch(e.kind){case F.OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new mc({name:t,description:e.description?.value,interfaces:()=>oe(r),fields:()=>ne(r),astNode:e,extensionASTNodes:n})}case F.INTERFACE_TYPE_DEFINITION:{let r=[e,...n];return new hc({name:t,description:e.description?.value,interfaces:()=>oe(r),fields:()=>ne(r),astNode:e,extensionASTNodes:n})}case F.ENUM_TYPE_DEFINITION:{let r=[e,...n];return new _c({name:t,description:e.description?.value,values:ae(r),astNode:e,extensionASTNodes:n})}case F.UNION_TYPE_DEFINITION:{let r=[e,...n];return new gc({name:t,description:e.description?.value,types:()=>se(r),astNode:e,extensionASTNodes:n})}case F.SCALAR_TYPE_DEFINITION:return new pc({name:t,description:e.description?.value,specifiedByURL:cm(e),astNode:e,extensionASTNodes:n});case F.INPUT_OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new vc({name:t,description:e.description?.value,fields:()=>ie(r),astNode:e,extensionASTNodes:n,isOneOf:lm(e)})}}}}function sm(e){return Id(Hc,e)?.reason}function cm(e){return Id(Uc,e)?.url}function lm(e){return!!Id(Wc,e)}var um,dm=n((()=>{Wi(),lo(),Xi(),Mo(),Io(),va(),nu(),yc(),Kc(),fl(),Pc(),_l(),Wf(),Rd(),Md(),um=jo([...Nc,...dl],e=>e.name)}));function fm(e,t){e!=null&&e.kind===F.DOCUMENT||Ui(!1,`Must provide valid Document AST.`),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&Vf(e);let n=om({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(n.astNode==null)for(let e of n.types)switch(e.name){case`Query`:n.query=e;break;case`Mutation`:n.mutation=e;break;case`Subscription`:n.subscription=e;break}let r=[...n.directives,...Gc.filter(e=>n.directives.every(t=>t.name!==e.name))];return new gl({...n,directives:r})}function pm(e,t){return fm(_o(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables}),{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}var mm=n((()=>{Wi(),va(),To(),Kc(),_l(),Wf(),dm()}));function hm(e){let t=e.toConfig(),n=No(_m(t.types),e=>e.name,d);return new gl({...t,types:Object.values(n),directives:_m(t.directives).map(o),query:a(t.query),mutation:a(t.mutation),subscription:a(t.subscription)});function r(e){return As(e)?new dc(r(e.ofType)):V(e)?new fc(r(e.ofType)):i(e)}function i(e){return n[e.name]}function a(e){return e&&i(e)}function o(e){let t=e.toConfig();return new Rc({...t,locations:vm(t.locations,e=>e),args:s(t.args)})}function s(e){return gm(e,e=>({...e,type:r(e.type)}))}function c(e){return gm(e,e=>({...e,type:r(e.type),args:e.args&&s(e.args)}))}function l(e){return gm(e,e=>({...e,type:r(e.type)}))}function u(e){return _m(e).map(i)}function d(e){if(ys(e)||Qc(e))return e;if(B(e)){let t=e.toConfig();return new mc({...t,interfaces:()=>u(t.interfaces),fields:()=>c(t.fields)})}if(Ss(e)){let t=e.toConfig();return new hc({...t,interfaces:()=>u(t.interfaces),fields:()=>c(t.fields)})}if(ws(e)){let t=e.toConfig();return new gc({...t,types:()=>u(t.types)})}if(Es(e)){let t=e.toConfig();return new _c({...t,values:gm(t.values,e=>e)})}if(Os(e)){let t=e.toConfig();return new vc({...t,fields:()=>l(t.fields)})}Yi(!1,`Unexpected type: `+L(e))}}function gm(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(Lo))n[r]=t(e[r]);return n}function _m(e){return vm(e,e=>e.name)}function vm(e,t){return e.slice().sort((e,n)=>Lo(t(e),t(n)))}var ym=n((()=>{lo(),Xi(),Po(),Vo(),yc(),Kc(),fl(),_l()}));function bm(e){return Cm(e,e=>!Lc(e),Sm)}function xm(e){return Cm(e,Lc,Qc)}function Sm(e){return!wc(e)&&!Qc(e)}function Cm(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[wm(e),...r.map(e=>Rm(e)),...i.map(e=>Em(e))].filter(Boolean).join(`
+
+`)}function wm(e){if(e.description==null&&Tm(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Vm(e)+`schema {\n${t.join(`
+`)}\n}`}function Tm(e){let t=e.getQueryType();if(t&&t.name!==`Query`)return!1;let n=e.getMutationType();if(n&&n.name!==`Mutation`)return!1;let r=e.getSubscriptionType();return!(r&&r.name!==`Subscription`)}function Em(e){if(ys(e))return Dm(e);if(B(e))return km(e);if(Ss(e))return Am(e);if(ws(e))return jm(e);if(Es(e))return Mm(e);if(Os(e))return Nm(e);Yi(!1,`Unexpected type: `+L(e))}function Dm(e){return Vm(e)+`scalar ${e.name}`+Bm(e)}function Om(e){let t=e.getInterfaces();return t.length?` implements `+t.map(e=>e.name).join(` & `):``}function km(e){return Vm(e)+`type ${e.name}`+Om(e)+Pm(e)}function Am(e){return Vm(e)+`interface ${e.name}`+Om(e)+Pm(e)}function jm(e){let t=e.getTypes(),n=t.length?` = `+t.join(` | `):``;return Vm(e)+`union `+e.name+n}function Mm(e){let t=e.getValues().map((e,t)=>Vm(e,` `,!t)+` `+e.name+zm(e.deprecationReason));return Vm(e)+`enum ${e.name}`+Fm(t)}function Nm(e){let t=Object.values(e.getFields()).map((e,t)=>Vm(e,` `,!t)+` `+Lm(e));return Vm(e)+`input ${e.name}`+(e.isOneOf?` @oneOf`:``)+Fm(t)}function Pm(e){return Fm(Object.values(e.getFields()).map((e,t)=>Vm(e,` `,!t)+` `+e.name+Im(e.args,` `)+`: `+String(e.type)+zm(e.deprecationReason)))}function Fm(e){return e.length===0?``:` {
+`+e.join(`
+`)+`
+}`}function Im(e,t=``){return e.length===0?``:e.every(e=>!e.description)?`(`+e.map(Lm).join(`, `)+`)`:`(
+`+e.map((e,n)=>Vm(e,` `+t,!n)+` `+t+Lm(e)).join(`
+`)+`
+`+t+`)`}function Lm(e){let t=Yc(e.defaultValue,e.type),n=e.name+`: `+String(e.type);return t&&(n+=` = ${as(t)}`),n+zm(e.deprecationReason)}function Rm(e){return Vm(e)+`directive @`+e.name+Im(e.args)+(e.isRepeatable?` repeatable`:``)+` on `+e.locations.join(` | `)}function zm(e){return e==null?``:e===`No longer supported`?` @deprecated`:` @deprecated(reason: ${as({kind:F.STRING,value:e})})`}function Bm(e){return e.specifiedByURL==null?``:` @specifiedBy(url: ${as({kind:F.STRING,value:e.specifiedByURL})})`}function Vm(e,t=``,n=!0){let{description:r}=e;if(r==null)return``;let i=as({kind:F.STRING,value:r,block:Da(r)});return(t&&!n?`
+`+t:t)+i.replace(/\n/g,`
+`+t)+`
+`}var Hm=n((()=>{lo(),Xi(),ka(),va(),ds(),yc(),Kc(),fl(),Pc(),Zc()}));function Um(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:F.DOCUMENT,definitions:t}}var Wm=n((()=>{va()}));function Gm(e){let t=[],n=Object.create(null);for(let r of e.definitions)switch(r.kind){case F.OPERATION_DEFINITION:t.push(r);break;case F.FRAGMENT_DEFINITION:n[r.name.value]=qm(r.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let t=new Set;for(let e of qm(i.selectionSet))Km(t,n,e);let a=i.name?i.name.value:``;r[a]={kind:F.DOCUMENT,definitions:e.definitions.filter(e=>e===i||e.kind===F.FRAGMENT_DEFINITION&&t.has(e.name.value))}}return r}function Km(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let n of r)Km(e,t,n)}}function qm(e){let t=[];return $o(e,{FragmentSpread(e){t.push(e.name.value)}}),t}var Jm=n((()=>{va(),is()}));function Ym(e){let t=mo(e)?e:new ho(e),n=t.body,r=new Xa(t),i=``,a=!1;for(;r.advance().kind!==I.EOF;){let e=r.token,t=e.kind,o=!ja(e.kind);a&&(o||e.kind===I.SPREAD)&&(i+=` `);let s=n.slice(e.start,e.end);t===I.BLOCK_STRING?i+=Oa(e.value,{minimize:!0}):i+=s,a=o}return i}var Xm=n((()=>{ka(),Za(),go(),Aa()}));function Zm(e){let t=Qm(e);if(t)throw t;return e}function Qm(e){if(typeof e==`string`||Ui(!1,`Expected name to be a string.`),e.startsWith(`__`))return new M(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{ms(e)}catch(e){return e}}var $m=n((()=>{Wi(),N(),gs()}));function eh(e,t){return nh(e,t).filter(e=>e.type in gh)}function th(e,t){return nh(e,t).filter(e=>e.type in _h)}function nh(e,t){return[...ih(e,t),...rh(e,t)]}function rh(e,t){let n=[],r=hh(e.getDirectives(),t.getDirectives());for(let e of r.removed)n.push({type:gh.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(let[e,t]of r.persisted){let r=hh(e.args,t.args);for(let t of r.added)ac(t)&&n.push({type:gh.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(let t of r.removed)n.push({type:gh.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:gh.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(let r of e.locations)t.locations.includes(r)||n.push({type:gh.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function ih(e,t){let n=[],r=hh(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let e of r.removed)n.push({type:gh.TYPE_REMOVED,description:wc(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(let[e,t]of r.persisted)Es(e)&&Es(t)?n.push(...sh(e,t)):ws(e)&&ws(t)?n.push(...oh(e,t)):Os(e)&&Os(t)?n.push(...ah(e,t)):B(e)&&B(t)||Ss(e)&&Ss(t)?n.push(...lh(e,t),...ch(e,t)):e.constructor!==t.constructor&&n.push({type:gh.TYPE_CHANGED_KIND,description:`${e.name} changed from ${ph(e)} to ${ph(t)}.`});return n}function ah(e,t){let n=[],r=hh(Object.values(e.getFields()),Object.values(t.getFields()));for(let t of r.added)uc(t)?n.push({type:gh.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:_h.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(let t of r.removed)n.push({type:gh.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(let[t,i]of r.persisted)fh(t.type,i.type)||n.push({type:gh.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function oh(e,t){let n=[],r=hh(e.getTypes(),t.getTypes());for(let t of r.added)n.push({type:_h.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(let t of r.removed)n.push({type:gh.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function sh(e,t){let n=[],r=hh(e.getValues(),t.getValues());for(let t of r.added)n.push({type:_h.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(let t of r.removed)n.push({type:gh.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function ch(e,t){let n=[],r=hh(e.getInterfaces(),t.getInterfaces());for(let t of r.added)n.push({type:_h.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(let t of r.removed)n.push({type:gh.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function lh(e,t){let n=[],r=hh(Object.values(e.getFields()),Object.values(t.getFields()));for(let t of r.removed)n.push({type:gh.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(let[t,i]of r.persisted)n.push(...uh(e,t,i)),dh(t.type,i.type)||n.push({type:gh.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function uh(e,t,n){let r=[],i=hh(t.args,n.args);for(let n of i.removed)r.push({type:gh.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(let[n,a]of i.persisted)if(!fh(n.type,a.type))r.push({type:gh.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(a.type)}.`});else if(n.defaultValue!==void 0)if(a.defaultValue===void 0)r.push({type:_h.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{let i=mh(n.defaultValue,n.type),o=mh(a.defaultValue,a.type);i!==o&&r.push({type:_h.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${o}.`})}for(let n of i.added)ac(n)?r.push({type:gh.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:_h.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function dh(e,t){return As(e)?As(t)&&dh(e.ofType,t.ofType)||V(t)&&dh(e,t.ofType):V(e)?V(t)&&dh(e.ofType,t.ofType):Js(t)&&e.name===t.name||V(t)&&dh(e,t.ofType)}function fh(e,t){return As(e)?As(t)&&fh(e.ofType,t.ofType):V(e)?V(t)&&fh(e.ofType,t.ofType)||!V(t)&&fh(e.ofType,t):Js(t)&&e.name===t.name}function ph(e){if(ys(e))return`a Scalar type`;if(B(e))return`an Object type`;if(Ss(e))return`an Interface type`;if(ws(e))return`a Union type`;if(Es(e))return`an Enum type`;if(Os(e))return`an Input type`;Yi(!1,`Unexpected type: `+L(e))}function mh(e,t){let n=Yc(e,t);return n??Yi(!1),as(zu(n))}function hh(e,t){let n=[],r=[],i=[],a=jo(e,({name:e})=>e),o=jo(t,({name:e})=>e);for(let t of e){let e=o[t.name];e===void 0?r.push(t):i.push([t,e])}for(let e of t)a[e.name]===void 0&&n.push(e);return{added:n,persisted:i,removed:r}}var gh,_h,vh=n((()=>{lo(),Xi(),Mo(),ds(),yc(),Pc(),Zc(),Vu(),(function(e){e.TYPE_REMOVED=`TYPE_REMOVED`,e.TYPE_CHANGED_KIND=`TYPE_CHANGED_KIND`,e.TYPE_REMOVED_FROM_UNION=`TYPE_REMOVED_FROM_UNION`,e.VALUE_REMOVED_FROM_ENUM=`VALUE_REMOVED_FROM_ENUM`,e.REQUIRED_INPUT_FIELD_ADDED=`REQUIRED_INPUT_FIELD_ADDED`,e.IMPLEMENTED_INTERFACE_REMOVED=`IMPLEMENTED_INTERFACE_REMOVED`,e.FIELD_REMOVED=`FIELD_REMOVED`,e.FIELD_CHANGED_KIND=`FIELD_CHANGED_KIND`,e.REQUIRED_ARG_ADDED=`REQUIRED_ARG_ADDED`,e.ARG_REMOVED=`ARG_REMOVED`,e.ARG_CHANGED_KIND=`ARG_CHANGED_KIND`,e.DIRECTIVE_REMOVED=`DIRECTIVE_REMOVED`,e.DIRECTIVE_ARG_REMOVED=`DIRECTIVE_ARG_REMOVED`,e.REQUIRED_DIRECTIVE_ARG_ADDED=`REQUIRED_DIRECTIVE_ARG_ADDED`,e.DIRECTIVE_REPEATABLE_REMOVED=`DIRECTIVE_REPEATABLE_REMOVED`,e.DIRECTIVE_LOCATION_REMOVED=`DIRECTIVE_LOCATION_REMOVED`})(gh||={}),(function(e){e.VALUE_ADDED_TO_ENUM=`VALUE_ADDED_TO_ENUM`,e.TYPE_ADDED_TO_UNION=`TYPE_ADDED_TO_UNION`,e.OPTIONAL_INPUT_FIELD_ADDED=`OPTIONAL_INPUT_FIELD_ADDED`,e.OPTIONAL_ARG_ADDED=`OPTIONAL_ARG_ADDED`,e.IMPLEMENTED_INTERFACE_ADDED=`IMPLEMENTED_INTERFACE_ADDED`,e.ARG_DEFAULT_VALUE_CHANGE=`ARG_DEFAULT_VALUE_CHANGE`})(_h||={})}));function yh(e,t){return Th(e,xo(t))}function bh(e,t){let n=t.name.value,r=e.getType(n);if(r!=null)return{kind:`NamedType`,type:r}}function xh(e,t){let n=t.name.value,r=e.getType(n);if(!r)throw Error(`Expected ${L(n)} to be defined as a type in the schema.`);if(!Es(r)&&!Os(r)&&!B(r)&&!Ss(r))throw Error(`Expected ${L(n)} to be an Enum, Input Object, Object or Interface type.`);if(Es(r)){let e=t.memberName.value,n=r.getValue(e);return n==null?void 0:{kind:`EnumValue`,type:r,enumValue:n}}if(Os(r)){let e=t.memberName.value,n=r.getFields()[e];return n==null?void 0:{kind:`InputField`,type:r,inputField:n}}let i=t.memberName.value,a=r.getFields()[i];if(a!=null)return{kind:`Field`,type:r,field:a}}function Sh(e,t){let n=t.name.value,r=e.getType(n);if(r==null)throw Error(`Expected ${L(n)} to be defined as a type in the schema.`);if(!B(r)&&!Ss(r))throw Error(`Expected ${L(n)} to be an object type or interface type.`);let i=t.fieldName.value,a=r.getFields()[i];if(a==null)throw Error(`Expected ${L(i)} to exist as a field of type ${L(n)} in the schema.`);let o=t.argumentName.value,s=a.args.find(e=>e.name===o);if(s!=null)return{kind:`FieldArgument`,type:r,field:a,fieldArgument:s}}function Ch(e,t){let n=t.name.value,r=e.getDirective(n);if(r)return{kind:`Directive`,directive:r}}function wh(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)throw Error(`Expected ${L(n)} to be defined as a directive in the schema.`);let{argumentName:{value:i}}=t,a=r.args.find(e=>e.name===i);if(a)return{kind:`DirectiveArgument`,directive:r,directiveArgument:a}}function Th(e,t){switch(t.kind){case F.TYPE_COORDINATE:return bh(e,t);case F.MEMBER_COORDINATE:return xh(e,t);case F.ARGUMENT_COORDINATE:return Sh(e,t);case F.DIRECTIVE_COORDINATE:return Ch(e,t);case F.DIRECTIVE_ARGUMENT_COORDINATE:return wh(e,t)}}var Eh=n((()=>{lo(),va(),To(),yc()})),Dh=n((()=>{Xp(),Qp(),em(),nm(),im(),mm(),dm(),ym(),Hm(),Bl(),Md(),ps(),Zc(),Wl(),kd(),Wm(),Jm(),Xm(),Cc(),$m(),vh(),Eh()})),Oh=i({BREAK:()=>rs,BreakingChangeType:()=>gh,DEFAULT_DEPRECATION_REASON:()=>Vc,DangerousChangeType:()=>_h,DirectiveLocation:()=>P,ExecutableDefinitionsRule:()=>ru,FieldsOnCorrectTypeRule:()=>au,FragmentsOnCompositeTypesRule:()=>lu,GRAPHQL_MAX_INT:()=>Ec,GRAPHQL_MIN_INT:()=>Dc,GraphQLBoolean:()=>jc,GraphQLDeprecatedDirective:()=>Hc,GraphQLDirective:()=>Rc,GraphQLEnumType:()=>_c,GraphQLError:()=>M,GraphQLFloat:()=>kc,GraphQLID:()=>Mc,GraphQLIncludeDirective:()=>zc,GraphQLInputObjectType:()=>vc,GraphQLInt:()=>Oc,GraphQLInterfaceType:()=>hc,GraphQLList:()=>dc,GraphQLNonNull:()=>fc,GraphQLObjectType:()=>mc,GraphQLOneOfDirective:()=>Wc,GraphQLScalarType:()=>pc,GraphQLSchema:()=>gl,GraphQLSkipDirective:()=>Bc,GraphQLSpecifiedByDirective:()=>Uc,GraphQLString:()=>Ac,GraphQLUnionType:()=>gc,Kind:()=>F,KnownArgumentNamesRule:()=>du,KnownDirectivesRule:()=>mu,KnownFragmentNamesRule:()=>vu,KnownTypeNamesRule:()=>bu,Lexer:()=>Xa,Location:()=>da,LoneAnonymousOperationRule:()=>wu,LoneSchemaDefinitionRule:()=>Eu,MaxIntrospectionDepthRule:()=>Ou,NoDeprecatedCustomRule:()=>Up,NoFragmentCyclesRule:()=>ju,NoSchemaIntrospectionCustomRule:()=>Gp,NoUndefinedVariablesRule:()=>Nu,NoUnusedFragmentsRule:()=>Fu,NoUnusedVariablesRule:()=>Lu,OperationTypeNode:()=>ha,OverlappingFieldsCanBeMergedRule:()=>Uu,PossibleFragmentSpreadsRule:()=>sd,PossibleTypeExtensionsRule:()=>ud,ProvidedRequiredArgumentsRule:()=>hd,ScalarLeafsRule:()=>yd,SchemaMetaFieldDef:()=>cl,SingleFieldSubscriptionsRule:()=>Kd,Source:()=>ho,Token:()=>fa,TokenKind:()=>I,TypeInfo:()=>Ul,TypeKind:()=>ol,TypeMetaFieldDef:()=>ll,TypeNameMetaFieldDef:()=>ul,UniqueArgumentDefinitionNamesRule:()=>Xd,UniqueArgumentNamesRule:()=>Qd,UniqueDirectiveNamesRule:()=>ef,UniqueDirectivesPerLocationRule:()=>nf,UniqueEnumValueNamesRule:()=>af,UniqueFieldDefinitionNamesRule:()=>sf,UniqueFragmentNamesRule:()=>uf,UniqueInputFieldNamesRule:()=>ff,UniqueOperationNamesRule:()=>mf,UniqueOperationTypesRule:()=>gf,UniqueTypeNamesRule:()=>vf,UniqueVariableNamesRule:()=>bf,ValidationContext:()=>Lf,ValuesOfCorrectTypeRule:()=>Sf,VariablesAreInputTypesRule:()=>Ef,VariablesInAllowedPositionRule:()=>Of,__Directive:()=>el,__DirectiveLocation:()=>tl,__EnumValue:()=>al,__Field:()=>rl,__InputValue:()=>il,__Schema:()=>$c,__Type:()=>nl,__TypeKind:()=>sl,assertAbstractType:()=>Hs,assertCompositeType:()=>Bs,assertDirective:()=>Ic,assertEnumType:()=>Ds,assertEnumValueName:()=>hs,assertInputObjectType:()=>ks,assertInputType:()=>Ps,assertInterfaceType:()=>Cs,assertLeafType:()=>Rs,assertListType:()=>js,assertName:()=>ms,assertNamedType:()=>Ys,assertNonNullType:()=>Ms,assertNullableType:()=>Ks,assertObjectType:()=>xs,assertOutputType:()=>Is,assertScalarType:()=>bs,assertSchema:()=>ml,assertType:()=>vs,assertUnionType:()=>Ts,assertValidName:()=>Zm,assertValidSchema:()=>yl,assertWrappingType:()=>Ws,astFromValue:()=>Yc,buildASTSchema:()=>fm,buildClientSchema:()=>rm,buildSchema:()=>pm,coerceInputValue:()=>Ed,concatAST:()=>Um,createSourceEventStream:()=>zp,defaultFieldResolver:()=>Tp,defaultTypeResolver:()=>wp,doTypesOverlap:()=>Sc,execute:()=>rp,executeSync:()=>ip,extendSchema:()=>am,findBreakingChanges:()=>eh,findDangerousChanges:()=>th,formatError:()=>sa,getArgumentValues:()=>Fd,getDirectiveValues:()=>Id,getEnterLeaveForKind:()=>ts,getIntrospectionQuery:()=>Yp,getLocation:()=>Zi,getNamedType:()=>Xs,getNullableType:()=>qs,getOperationAST:()=>Zp,getOperationRootType:()=>$p,getVariableValues:()=>Nd,getVisitFn:()=>ns,graphql:()=>Dp,graphqlSync:()=>Op,introspectionFromSchema:()=>tm,introspectionTypes:()=>dl,isAbstractType:()=>Vs,isCompositeType:()=>zs,isConstValueNode:()=>Yl,isDefinitionNode:()=>Gl,isDirective:()=>Fc,isEnumType:()=>Es,isEqualType:()=>bc,isExecutableDefinitionNode:()=>Kl,isInputObjectType:()=>Os,isInputType:()=>Ns,isInterfaceType:()=>Ss,isIntrospectionType:()=>Qc,isLeafType:()=>Ls,isListType:()=>As,isNamedType:()=>Js,isNonNullType:()=>V,isNullableType:()=>Gs,isObjectType:()=>B,isOutputType:()=>Fs,isRequiredArgument:()=>ac,isRequiredInputField:()=>uc,isScalarType:()=>ys,isSchema:()=>pl,isSchemaCoordinateNode:()=>tu,isSelectionNode:()=>ql,isSpecifiedDirective:()=>Lc,isSpecifiedScalarType:()=>wc,isType:()=>_s,isTypeDefinitionNode:()=>Ql,isTypeExtensionNode:()=>eu,isTypeNode:()=>Xl,isTypeSubTypeOf:()=>xc,isTypeSystemDefinitionNode:()=>Zl,isTypeSystemExtensionNode:()=>$l,isUnionType:()=>ws,isValidNameError:()=>Qm,isValueNode:()=>Jl,isWrappingType:()=>Us,lexicographicSortSchema:()=>hm,locatedError:()=>ep,parse:()=>_o,parseConstValue:()=>yo,parseSchemaCoordinate:()=>xo,parseType:()=>bo,parseValue:()=>vo,print:()=>as,printError:()=>oa,printIntrospectionSchema:()=>xm,printLocation:()=>ea,printSchema:()=>bm,printSourceLocation:()=>ta,printType:()=>Em,recommendedRules:()=>jf,resolveASTSchemaCoordinate:()=>Th,resolveObjMapThunk:()=>Qs,resolveReadonlyArrayThunk:()=>Zs,resolveSchemaCoordinate:()=>yh,responsePathAsArray:()=>wd,separateOperations:()=>Gm,specifiedDirectives:()=>Gc,specifiedRules:()=>Mf,specifiedScalarTypes:()=>Nc,stripIgnoredCharacters:()=>Ym,subscribe:()=>Lp,syntaxError:()=>ca,typeFromAST:()=>zl,validate:()=>zf,validateSchema:()=>vl,valueFromAST:()=>Ad,valueFromASTUntyped:()=>fs,version:()=>Bi,versionInfo:()=>Vi,visit:()=>$o,visitInParallel:()=>es,visitWithTypeInfo:()=>Hl}),kh=n((()=>{Hi(),Ap(),jp(),Mp(),Hp(),qp(),Jp(),Dh()}));kh();function Ah(e){let t=[],n=/`([^`]+)`/g,r=/\s*\[(\w+)\]\s+<([^>]+)>$/gm,i=new Map,a=e.replace(n,(e,n)=>{let r=t.length;return t.push(n),`<!--INLINE:CODE:${r}-->`});for(let e of a.matchAll(r)){let[,t,n]=e;i.set(t,n)}a=a.replace(/\[([^\]]+)\]\(([^)]+)\)/g,`<a href="$2" target="_blank">$1</a>`).replace(/(\*\*|__)(.*?)\1/g,`<strong style="white-space: nowrap;">$2</strong>`).replace(/'/g,`’`).replace(/(\.\.\.)/g,`…`).replace(/---/g,`<hr/>`);for(let e in t)a=a.replace(`<!--INLINE:CODE:${e}-->`,`<code>${jh(t[e])}</code>`);return a.trimEnd()}function jh(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var Mh=A(`<button class="link svelte-1lzwyfl"> </button>`);function Nh(e,t){Xe(t,!0);function n(e){return V(e)?`${n(e.ofType)}!`:As(e)?`[${n(e.ofType)}]`:e.name}let r=Wt(()=>Xs(t.type)),i=Wt(()=>n(t.type));var a=Mh(),o=D(a,!0);T(a),zn(()=>qr(o,k(i))),Ir(`click`,a,()=>t.onNavigate(k(r).name)),j(e,a),Ze()}Lr([`click`]);var Ph=A(`<div class="description svelte-1ckn7ri"></div>`),Fh=A(`<div class="arg-description svelte-1ckn7ri"></div>`),Ih=A(`<div class="arg svelte-1ckn7ri"><span class="arg-name"> </span>: <!> <!></div>`),Lh=A(`<div><div class="section-label svelte-1ckn7ri">Arguments</div> <div class="args svelte-1ckn7ri"></div></div>`),Rh=A(`<div class="field svelte-1ckn7ri"><div class="heading svelte-1ckn7ri"> </div> <!> <div><div class="section-label svelte-1ckn7ri">Type</div> <!></div> <!></div>`);function zh(e,t){Xe(t,!0);let n=Wt(()=>`args`in t.field?t.field.args:[]);var r=Rh(),i=D(r),a=D(i,!0);T(i);var o=O(i,2),s=e=>{var n=Ph();di(n,()=>Ah(t.field.description),!0),T(n),j(e,n)};ei(o,e=>{t.field.description&&e(s)});var c=O(o,2);Nh(O(D(c),2),{get onNavigate(){return t.onNavigate},get type(){return t.field.type}}),T(c);var l=O(c,2),u=e=>{var r=Lh(),i=O(D(r),2);ai(i,21,()=>k(n),ti,(e,n)=>{var r=Ih(),i=D(r),a=D(i,!0);T(i);var o=O(i,2);Nh(o,{get onNavigate(){return t.onNavigate},get type(){return k(n).type}});var s=O(o,2),c=e=>{var t=Fh();di(t,()=>Ah(k(n).description),!0),T(t),j(e,t)};ei(s,e=>{k(n).description&&e(c)}),T(r),zn(()=>qr(a,k(n).name)),j(e,r)}),T(i),T(r),j(e,r)};ei(l,e=>{k(n).length>0&&e(u)}),T(r),zn(()=>qr(a,t.field.name)),j(e,r),Ze()}kh();var Bh=A(`<span class="kind svelte-1lfer34"> </span>`),Vh=A(`<div class="description svelte-1lfer34"></div>`),Hh=A(`<div class="entry svelte-1lfer34"><!></div>`),Uh=A(`<div><div class="section-label svelte-1lfer34">Implements</div> <div class="list svelte-1lfer34"></div></div>`),Wh=A(`<div class="entry-description svelte-1lfer34"></div>`),Gh=A(`<div class="entry svelte-1lfer34"><button class="field-button svelte-1lfer34"> </button>: <!> <!></div>`),Kh=A(`<div><div class="section-label svelte-1lfer34">Fields</div> <div class="list svelte-1lfer34"></div></div>`),qh=A(`<div class="entry svelte-1lfer34"><!></div>`),Jh=A(`<div><div class="section-label svelte-1lfer34">Members</div> <div class="list svelte-1lfer34"></div></div>`),Yh=A(`<div class="entry-description svelte-1lfer34"></div>`),Xh=A(`<div class="entry svelte-1lfer34"><span> </span> <!></div>`),Zh=A(`<div><div class="section-label svelte-1lfer34">Values</div> <div class="list svelte-1lfer34"></div></div>`),Qh=A(`<div class="type svelte-1lfer34"><div class="heading svelte-1lfer34"><!> </div> <!> <!> <!> <!> <!></div>`);function $h(e,t){Xe(t,!0);let n=Wt(()=>B(t.type)||Ss(t.type)||Os(t.type)?Object.values(t.type.getFields()):[]),r=Wt(()=>B(t.type)||Ss(t.type)?t.type.getInterfaces():[]),i=Wt(()=>ws(t.type)?t.type.getTypes():[]),a=Wt(()=>Es(t.type)?t.type.getValues():[]),o=Wt(()=>B(t.type)?`type`:Ss(t.type)?`interface`:ws(t.type)?`union`:Es(t.type)?`enum`:Os(t.type)?`input`:ys(t.type)?`scalar`:``);var s=Qh(),c=D(s),l=D(c),u=e=>{var t=Bh(),n=D(t,!0);T(t),zn(()=>qr(n,k(o))),j(e,t)};ei(l,e=>{k(o)&&e(u)});var d=O(l,1,!0);T(c);var f=O(c,2),p=e=>{var n=Vh();di(n,()=>Ah(t.type.description),!0),T(n),j(e,n)};ei(f,e=>{t.type.description&&e(p)});var m=O(f,2),h=e=>{var n=Uh(),i=O(D(n),2);ai(i,21,()=>k(r),ti,(e,n)=>{var r=Hh();Nh(D(r),{get onNavigate(){return t.onNavigateType},get type(){return k(n)}}),T(r),j(e,r)}),T(i),T(n),j(e,n)};ei(m,e=>{k(r).length>0&&e(h)});var g=O(m,2),_=e=>{var r=Kh(),i=O(D(r),2);ai(i,21,()=>k(n),ti,(e,n)=>{var r=Gh(),i=D(r),a=D(i,!0);T(i);var o=O(i,2);Nh(o,{get onNavigate(){return t.onNavigateType},get type(){return k(n).type}});var s=O(o,2),c=e=>{var t=Wh();di(t,()=>Ah(k(n).description),!0),T(t),j(e,t)};ei(s,e=>{k(n).description&&e(c)}),T(r),zn(()=>qr(a,k(n).name)),Ir(`click`,i,()=>t.onNavigateField(k(n).name)),j(e,r)}),T(i),T(r),j(e,r)};ei(g,e=>{k(n).length>0&&e(_)});var v=O(g,2),y=e=>{var n=Jh(),r=O(D(n),2);ai(r,21,()=>k(i),ti,(e,n)=>{var r=qh();Nh(D(r),{get onNavigate(){return t.onNavigateType},get type(){return k(n)}}),T(r),j(e,r)}),T(r),T(n),j(e,n)};ei(v,e=>{k(i).length>0&&e(y)});var b=O(v,2),x=e=>{var t=Zh(),n=O(D(t),2);ai(n,21,()=>k(a),ti,(e,t)=>{var n=Xh(),r=D(n),i=D(r,!0);T(r);var a=O(r,2),o=e=>{var n=Yh();di(n,()=>Ah(k(t).description),!0),T(n),j(e,n)};ei(a,e=>{k(t).description&&e(o)}),T(n),zn(()=>qr(i,k(t).name)),j(e,n)}),T(n),T(t),j(e,t)};ei(b,e=>{k(a).length>0&&e(x)}),T(s),zn(()=>qr(d,t.type.name)),j(e,s),Ze()}Lr([`click`]),kh();var eg=A(`<span class="separator svelte-1qhgkss">/</span> <button> </button>`,1),tg=A(`<button class="root-link svelte-1qhgkss"> </button>`),ng=A(`<div class="root svelte-1qhgkss"><div class="section-label svelte-1qhgkss">Root Types</div> <div class="root-list svelte-1qhgkss"></div></div>`),rg=A(`<div class="empty svelte-1qhgkss">Type not found in schema.</div>`),ig=A(`<div class="explorer svelte-1qhgkss"><div class="breadcrumbs svelte-1qhgkss"><button>Docs</button> <!></div> <div class="body svelte-1qhgkss"><!></div></div>`);function ag(e,t){Xe(t,!0);let n=tn(cn([])),r=Wt(()=>k(n).length>0?k(n)[k(n).length-1]:null),i=Wt(()=>{let e=[],n=t.schema.getQueryType(),r=t.schema.getMutationType(),i=t.schema.getSubscriptionType();return n&&e.push({label:`Query`,type:n}),r&&e.push({label:`Mutation`,type:r}),i&&e.push({label:`Subscription`,type:i}),e}),a=Wt(()=>{if(!k(r))return null;let e=k(r).kind===`type`?k(r).name:k(r).typeName;return t.schema.getType(e)??null}),o=Wt(()=>!k(r)||k(r).kind!==`field`||!k(a)?null:B(k(a))||Ss(k(a))||Os(k(a))?k(a).getFields()[k(r).fieldName]??null:null);function s(e){return e.kind===`type`?e.name:e.fieldName}function c(e){E(n,k(n).slice(0,e+1),!0)}function l(){E(n,[],!0)}function u(e){let t=k(r)?.kind===`type`?k(r).name:null;t&&E(n,[...k(n),{fieldName:e,kind:`field`,typeName:t}],!0)}function d(e){t.schema.getType(e)&&E(n,[...k(n),{kind:`type`,name:e}],!0)}var f=ig(),p=D(f),m=D(p);let h;ai(O(m,2),17,()=>k(n),ti,(e,t,r)=>{var i=eg(),a=O(yn(i),2);let o;var l=D(a,!0);T(a),zn(e=>{o=vi(a,1,`crumb svelte-1qhgkss`,null,o,{current:r===k(n).length-1}),qr(l,e)},[()=>s(k(t))]),Ir(`click`,a,()=>c(r)),j(e,i)}),T(p);var g=O(p,2),_=D(g),v=e=>{var t=ng(),n=O(D(t),2);ai(n,21,()=>k(i),ti,(e,t)=>{var n=tg(),r=D(n);T(n),zn(()=>qr(r,`${k(t).label??``}: ${k(t).type.name??``}`)),Ir(`click`,n,()=>d(k(t).type.name)),j(e,n)}),T(n),T(t),j(e,t)},y=e=>{zh(e,{get field(){return k(o)},onNavigate:d})},b=e=>{$h(e,{onNavigateField:u,onNavigateType:d,get type(){return k(a)}})},x=e=>{j(e,rg())};ei(_,e=>{k(n).length===0?e(v):k(o)?e(y,1):k(a)?e(b,2):e(x,-1)}),T(g),T(f),zn(()=>h=vi(m,1,`crumb svelte-1qhgkss`,null,h,{current:k(n).length===0})),Ir(`click`,m,l),j(e,f),Ze()}Lr([`click`]);var H={blue:{1:`89.66% 0.046 260.67`,2:`80.17% 0.091 258.88`,3:`70.94% 0.136 258.06`,4:`62.39% 0.181 258.33`,5:`54.87% 0.222 260.33`,6:`51.15% 0.204 260.17`,7:`47.36% 0.185 259.89`,8:`43.48% 0.17 260.2`,9:`39.53% 0.15 259.87`},gray:{1:`95.57% 0.003 286.35`,2:`92.04% 0.002 197.12`,3:`88.28% 0.003 286.34`,4:`84.68% 0.002 197.12`,5:`80.73% 0.002 247.84`,6:`75.03% 0.002 247.85`,7:`69.01% 0.003 286.32`,8:`63.12% 0.004 219.55`,9:`56.82% 0.004 247.89`},green:{1:`93.96% 0.05 148.74`,2:`88.77% 0.096 147.71`,3:`83.74% 0.139 146.57`,4:`79.33% 0.179 145.62`,5:`75.23% 0.209 144.64`,6:`70.03% 0.194 144.71`,7:`64.24% 0.175 144.92`,8:`58.83% 0.158 145.05`,9:`52.77% 0.138 145.41`},orange:{1:`93.83% 0.037 56.93`,2:`88.37% 0.072 55.8`,3:`83.56% 0.107 56.49`,4:`78.75% 0.141 54.32`,5:`74.61% 0.171 51.56`,6:`69.33% 0.157 52.18`,7:`63.8% 0.142 52.1`,8:`58.28% 0.128 52.2`,9:`52.49% 0.113 51.98`},pink:{1:`95.8% 0.023 354.27`,2:`92.14% 0.046 352.31`,3:`88.9% 0.066 354.39`,4:`85.43% 0.09 354.1`,5:`82.23% 0.112 355.33`,6:`76.37% 0.101 355.37`,7:`70.23% 0.092 354.96`,8:`64.11% 0.084 353.91`,9:`57.68% 0.074 353.14`},purple:{1:`89.1% 0.046 305.24`,2:`78.68% 0.091 305`,3:`68.5% 0.136 303.78`,4:`58.47% 0.181 302.06`,5:`49.39% 0.215 298.31`,6:`46.11% 0.198 298.4`,7:`42.77% 0.181 298.49`,8:`39.46% 0.164 298.29`,9:`36.01% 0.145 298.35`},red:{1:`88.98% 0.052 3.28`,2:`78.78% 0.109 4.54`,3:`69.86% 0.162 7.82`,4:`62.73% 0.209 12.37`,5:`58.63% 0.231 19.6`,6:`54.41% 0.214 19.06`,7:`49.95% 0.195 18.34`,8:`45.8% 0.177 17.7`,9:`41.17% 0.157 16.58`},yellow:{1:`97.05% 0.039 91.2`,2:`95% 0.07 92.39`,3:`92.76% 0.098 92.58`,4:`90.92% 0.125 92.56`,5:`89% 0.146 91.5`,6:`82.39% 0.133 91.5`,7:`75.84% 0.122 92.21`,8:`69.14% 0.109 91.04`,9:`62.29% 0.097 91.9`},yin:{1:`91.87% 0.003 264.54`,2:`84.61% 0.004 286.31`,3:`76.89% 0.004 247.87`,4:`69.17% 0.004 247.88`,5:`61.01% 0.005 271.34`,6:`52.79% 0.005 271.32`,7:`43.87% 0.005 271.3`,8:`35.02% 0.005 236.66`,9:`25.11% 0.006 258.36`}},og={blue:{1:`oklch(${H.blue[1]})`,2:`oklch(${H.blue[2]})`,3:`oklch(${H.blue[3]})`,4:`oklch(${H.blue[4]})`,5:`oklch(${H.blue[5]})`,6:`oklch(${H.blue[6]})`,7:`oklch(${H.blue[7]})`,8:`oklch(${H.blue[8]})`,9:`oklch(${H.blue[9]})`},gray:{1:`oklch(${H.gray[1]})`,2:`oklch(${H.gray[2]})`,3:`oklch(${H.gray[3]})`,4:`oklch(${H.gray[4]})`,5:`oklch(${H.gray[5]})`,6:`oklch(${H.gray[6]})`,7:`oklch(${H.gray[7]})`,8:`oklch(${H.gray[8]})`,9:`oklch(${H.gray[9]})`},green:{1:`oklch(${H.green[1]})`,2:`oklch(${H.green[2]})`,3:`oklch(${H.green[3]})`,4:`oklch(${H.green[4]})`,5:`oklch(${H.green[5]})`,6:`oklch(${H.green[6]})`,7:`oklch(${H.green[7]})`,8:`oklch(${H.green[8]})`,9:`oklch(${H.green[9]})`},orange:{1:`oklch(${H.orange[1]})`,2:`oklch(${H.orange[2]})`,3:`oklch(${H.orange[3]})`,4:`oklch(${H.orange[4]})`,5:`oklch(${H.orange[5]})`,6:`oklch(${H.orange[6]})`,7:`oklch(${H.orange[7]})`,8:`oklch(${H.orange[8]})`,9:`oklch(${H.orange[9]})`},pink:{1:`oklch(${H.pink[1]})`,2:`oklch(${H.pink[2]})`,3:`oklch(${H.pink[3]})`,4:`oklch(${H.pink[4]})`,5:`oklch(${H.pink[5]})`,6:`oklch(${H.pink[6]})`,7:`oklch(${H.pink[7]})`,8:`oklch(${H.pink[8]})`,9:`oklch(${H.pink[9]})`},purple:{1:`oklch(${H.purple[1]})`,2:`oklch(${H.purple[2]})`,3:`oklch(${H.purple[3]})`,4:`oklch(${H.purple[4]})`,5:`oklch(${H.purple[5]})`,6:`oklch(${H.purple[6]})`,7:`oklch(${H.purple[7]})`,8:`oklch(${H.purple[8]})`,9:`oklch(${H.purple[9]})`},red:{1:`oklch(${H.red[1]})`,2:`oklch(${H.red[2]})`,3:`oklch(${H.red[3]})`,4:`oklch(${H.red[4]})`,5:`oklch(${H.red[5]})`,6:`oklch(${H.red[6]})`,7:`oklch(${H.red[7]})`,8:`oklch(${H.red[8]})`,9:`oklch(${H.red[9]})`},yellow:{1:`oklch(${H.yellow[1]})`,2:`oklch(${H.yellow[2]})`,3:`oklch(${H.yellow[3]})`,4:`oklch(${H.yellow[4]})`,5:`oklch(${H.yellow[5]})`,6:`oklch(${H.yellow[6]})`,7:`oklch(${H.yellow[7]})`,8:`oklch(${H.yellow[8]})`,9:`oklch(${H.yellow[9]})`},yin:{1:`oklch(${H.yin[1]})`,2:`oklch(${H.yin[2]})`,3:`oklch(${H.yin[3]})`,4:`oklch(${H.yin[4]})`,5:`oklch(${H.yin[5]})`,6:`oklch(${H.yin[6]})`,7:`oklch(${H.yin[7]})`,8:`oklch(${H.yin[8]})`,9:`oklch(${H.yin[9]})`}},sg=`oklch(99.4% 0 0)`,cg=(e,t)=>og[e][t];og.blue[1],og.blue[4],og.blue[8],og.gray[1],og.gray[4],og.gray[8],og.green[1],og.green[4],og.green[8],og.orange[1],og.orange[4],og.orange[8],og.pink[1],og.pink[4],og.pink[8],og.purple[1],og.purple[4],og.purple[8],og.red[1],og.red[4],og.red[8],og.yellow[1],og.yellow[4],og.yellow[8],og.yin[1];function lg(e){if(e<768)return!1;for(let t=0,n=vg.length;;){let r=t+n>>1;if(e<vg[r])n=r;else if(e>=yg[r])t=r+1;else return!0;if(t==n)return!1}}function ug(e){return e>=127462&&e<=127487}function dg(e,t,n=!0,r=!0){return(n?fg:pg)(e,t,r)}function fg(e,t,n){if(t==e.length)return t;t&&hg(e.charCodeAt(t))&&gg(e.charCodeAt(t-1))&&t--;let r=mg(e,t);for(t+=_g(r);t<e.length;){let i=mg(e,t);if(r==bg||i==bg||n&&lg(i))t+=_g(i),r=i;else if(ug(i)){let n=0,r=t-2;for(;r>=0&&ug(mg(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function pg(e,t,n){for(;t>0;){let r=fg(e,t-2,n);if(r<t)return r;t--}return 0}function mg(e,t){let n=e.charCodeAt(t);if(!gg(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return hg(r)?(n-55296<<10)+(r-56320)+65536:n}function hg(e){return e>=56320&&e<57344}function gg(e){return e>=55296&&e<56320}function _g(e){return e<65536?1:2}var vg,yg,bg,xg=n((()=>{vg=[],yg=[],(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?yg:vg).push(n+=e[t])})(),bg=8205})),Sg=i({Annotation:()=>G_,AnnotationType:()=>K_,ChangeDesc:()=>w_,ChangeSet:()=>T_,CharCategory:()=>X_,Compartment:()=>F_,EditorSelection:()=>U,EditorState:()=>$_,Facet:()=>W,Line:()=>x_,MapMode:()=>C_,Prec:()=>N_,Range:()=>tv,RangeSet:()=>rv,RangeSetBuilder:()=>iv,RangeValue:()=>ev,SelectionRange:()=>D_,StateEffect:()=>G,StateEffectType:()=>q_,StateField:()=>j_,Text:()=>h_,Transaction:()=>J_,codePointAt:()=>Ag,codePointSize:()=>Mg,combineConfig:()=>n_,countColumn:()=>p_,findClusterBreak:()=>Dg,findColumn:()=>m_,fromCodePoint:()=>jg});function Cg(e){let t=-1;for(let n of e)t+=n.length+1;return t}function wg(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Tg(e,t,n){return wg(e,[``],t,n)}function Eg(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Dg(e,t,n=!0,r=!0){return dg(e,t,n,r)}function Og(e){return e>=56320&&e<57344}function kg(e){return e>=55296&&e<56320}function Ag(e,t){let n=e.charCodeAt(t);if(!kg(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Og(r)?(n-55296<<10)+(r-56320)+65536:n}function jg(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Mg(e){return e<65536?1:2}function Ng(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Pg(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(h_.empty);e.push(n)}}function Fg(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=h_.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Ig(e,t,n,r=!1){let i=[],a=r?[]:null,o=new E_(e),s=new E_(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);Ng(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(Ng(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(Ng(i,0,o.ins),a&&Pg(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;Ng(i,t,e<o.i?o.ins:0),a&&e<o.i&&Pg(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?T_.createSet(i,a):w_.create(i);else throw Error(`Mismatched change set lengths`)}function Lg(e,t,n=!1){let r=[],i=n?[]:null,a=new E_(e),o=new E_(t);for(let e=!1;;)if(a.done&&o.done)return i?T_.createSet(r,i):w_.create(r);else if(a.ins==0)Ng(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)Ng(r,0,o.ins,e),i&&Pg(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;Ng(r,t,n,e),i&&n&&Pg(i,r,o.text)}else o.ins==-1?(Ng(r,a.off?0:a.len,t,e),i&&Pg(i,r,a.textBit(t))):(Ng(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Pg(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}function Rg(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}function zg(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}function Bg(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Vg(e,t){let n=!1;for(let r of t)Gg(e,r)&1&&(n=!0);return n}function Hg(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Kg(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Gg(e,t);return e.values[o]=s(e),1},update(e,n){if(!Vg(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=Vg(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&zg(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}function Ug(e){return t=>new P_(t,e)}function Wg(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof I_&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof I_){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof P_)a(e.inner,e.prec);else if(e instanceof j_)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof k_)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,M_.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,M_.default),r.reduce((e,t)=>e.concat(t))}function Gg(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Kg(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}function qg(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Jg(e,t,n){let r,i,a;return n?(r=t.changes,i=T_.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:G.mapEffects(e.effects,r).concat(G.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Yg(e,t,n){let r=t.selection,i=$g(t.annotations);return t.userEvent&&(i=i.concat(J_.userEvent.of(t.userEvent))),{changes:t.changes instanceof T_?t.changes:T_.of(t.changes||[],n,e.facet(B_)),selection:r&&(r instanceof U?r:U.single(r.anchor,r.head)),effects:$g(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Xg(e,t,n){let r=Yg(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Jg(r,Yg(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=J_.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Qg(n?Zg(i):i)}function Zg(e){let t=e.startState,n=!0;for(let r of t.facet(V_)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:qg(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=T_.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=J_.create(t,r,e.selection&&e.selection.map(i),G.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(H_);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof J_?i:Array.isArray(i)&&i.length==1&&i[0]instanceof J_?i[0]:Xg(t,$g(i),!1)}return e}function Qg(e){let t=e.startState,n=t.facet(U_),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Jg(r,Yg(t,a,e.changes.newLength),!0))}return r==e?e:J_.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}function $g(e){return e==null?Y_:Array.isArray(e)?e:[e]}function e_(e){if(Q_)return Q_.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||Z_.test(n)))return!0}return!1}function t_(e){return t=>{if(!/\S/.test(t))return X_.Space;if(e_(t))return X_.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return X_.Word;return X_.Other}}function n_(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}function r_(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}function i_(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}function a_(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(i_(t,r)>0)return e.slice().sort(i_);t=r}return e}function o_(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}function s_(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}function c_(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&r_(e.point,n.point)&&l_(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!l_(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function l_(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!r_(e[n],t[n]))return!1;return!0}function u_(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function d_(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function f_(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function p_(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Dg(e,i));return r}function m_(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=Dg(e,r)}return r===!0?-1:e.length}var h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,U,O_,W,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,G,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv=n((()=>{xg(),h_=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Eg(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),__.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Eg(this,e,t);let n=[];return this.decompose(e,t,n,0),__.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new v_(this),i=new v_(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new v_(this,e)}iterRange(e,t=this.length){return new y_(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new b_(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new g_(t):__.from(g_.split(t,[]))}},g_=class e extends h_{constructor(e,t=Cg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new x_(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Tg(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=wg(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Eg(this,t,n);let i=wg(this.text,wg(r.text,Tg(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):__.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
+`){[e,t]=Eg(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},__=class e extends h_{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=Eg(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
+`){[e,t]=Eg(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new g_(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof g_&&c&&(n=u[u.length-1])instanceof g_&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new g_(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},h_.empty=new g_([``],0),v_=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof g_?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof g_?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
+`,this;e--}else if(r instanceof g_){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof g_?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},y_=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new v_(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},b_=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(h_.prototype[Symbol.iterator]=function(){return this.iter()},v_.prototype[Symbol.iterator]=y_.prototype[Symbol.iterator]=b_.prototype[Symbol.iterator]=function(){return this}),x_=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},S_=/\r\n?|\n/,C_=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(C_||={}),w_=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){Fg(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:Lg(this,e)}mapDesc(e,t=!1){return e.empty?this:Ig(this,e,t)}mapPos(e,t=-1,n=C_.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=C_.Simple&&c>=e&&(n==C_.TrackDel&&r<e&&c>e||n==C_.TrackBefore&&r<e||n==C_.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},T_=class e extends w_{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Fg(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Ig(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(h_.empty);r.push(a?t.slice(i,i+a):h_.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:Lg(this,e,!0)}map(e,t=!1){return e.empty?this:Ig(this,e,t,!0)}iterChanges(e,t=!1){Fg(this,e,t)}get desc(){return w_.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new E_(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);Ng(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;Ng(n,e,t),t>0&&Pg(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);Ng(n,e,-1),Ng(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:w_.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&Ng(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?h_.of(l.split(r||S_)):l:h_.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&Ng(i,e-o,-1),Ng(i,s-e,d),Pg(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(h_.empty);r[e]=h_.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}},E_=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?h_.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?h_.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},D_=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return U.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return U.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return U.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},U=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>D_.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return D_.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?D_.create(t,e,48|a):D_.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}},O_=0,W=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=O_++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:zg),!!t.static,t.enables)}of(e){return new k_([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new k_(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new k_(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}},k_=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=O_++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||Vg(e,c)){let r=t(e);if(a?!Bg(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Kg(o,c);if(this.dependencies.every(t=>t instanceof W?o.facet(t)===e.facet(t):t instanceof j_?o.field(t,!1)==e.field(t,!1):!0)||(a?Bg(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}},A_=W.define({static:!0}),j_=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(O_++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(A_).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(A_),i=n.facet(A_),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,A_.of({field:this,create:e})]}get extension(){return this}},M_={lowest:4,low:3,default:2,high:1,highest:0},N_={highest:Ug(M_.highest),high:Ug(M_.high),default:Ug(M_.default),low:Ug(M_.low),lowest:Ug(M_.lowest)},P_=class{constructor(e,t){this.inner=e,this.prec=t}},F_=class e{of(e){return new I_(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},I_=class{constructor(e,t){this.compartment=e,this.inner=t}},L_=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Wg(t,n,o))e instanceof j_?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,zg(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Hg(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}},R_=W.define(),z_=W.define({combine:e=>e.some(e=>e),static:!0}),B_=W.define({combine:e=>e.length?e[0]:void 0,static:!0}),V_=W.define(),H_=W.define(),U_=W.define(),W_=W.define({combine:e=>e.length?e[0]:!1}),G_=class{constructor(e,t){this.type=e,this.value=t}static define(){return new K_}},K_=class{of(e){return new G_(this,e)}},q_=class{constructor(e){this.map=e}of(e){return new G(this,e)}},G=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new q_(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}},G.reconfigure=G.define(),G.appendConfig=G.define(),J_=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Rg(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}},J_.time=G_.define(),J_.userEvent=G_.define(),J_.addToHistory=G_.define(),J_.remote=G_.define(),Y_=[],X_=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(X_||={}),Z_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Q_=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}$_=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Gg(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Gg(this,n),Kg(this,n)}update(...e){return Xg(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(F_.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(G.reconfigure)?(n=null,r=e.value):e.is(G.appendConfig)&&(n=null,r=$g(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=L_.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(z_)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:U.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=$g(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=G.mapEffects(a,c).concat(G.mapEffects($g(o.effects),l))}return{changes:r,selection:U.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof T_?t:T_.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return h_.of(t.split(this.facet(e.lineSeparator)||S_))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Gg(this,t),Kg(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof j_&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:U.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=L_.resolve(t.extensions||[],new Map),r=t.doc instanceof h_?t.doc:h_.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||S_)),i=t.selection?t.selection instanceof U?t.selection:U.single(t.selection.anchor,t.selection.head):U.single(0);return Rg(i,r.length),n.staticFacet(z_)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
+`}get readOnly(){return this.facet(W_)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(R_))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return t_(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=Dg(t,a,!1);if(i(t.slice(e,a))!=X_.Word)break;a=e}for(;o<r;){let e=Dg(t,o);if(i(t.slice(o,e))!=X_.Word)break;o=e}return a==o?null:U.range(a+n,o+n)}},$_.allowMultipleSelections=z_,$_.tabSize=W.define({combine:e=>e.length?e[0]:4}),$_.lineSeparator=B_,$_.readOnly=W_,$_.phrases=W.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),$_.languageData=R_,$_.changeFilter=V_,$_.transactionFilter=H_,$_.transactionExtender=U_,F_.reconfigure=G.define(),ev=class{eq(e){return this==e}range(e,t=e){return tv.create(e,t,this)}},ev.prototype.startSide=ev.prototype.endSide=0,ev.prototype.point=!1,ev.prototype.mapMode=C_.TrackDel,tv=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},nv=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},rv=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(i_)),this.isEmpty)return n.length?e.of(n):this;let s=new av(this,null,-1).goto(0),c=0,l=[],u=new iv;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(tv.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return ov.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ov.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=o_(a,o,n),c=new sv(a,s,i),l=new sv(o,s,i);n.iterGaps((e,t,n)=>c_(c,e,l,t,n,r)),n.empty&&n.length==0&&c_(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=o_(i,a),s=new sv(i,o,0).goto(n),c=new sv(a,o,0).goto(n);for(;;){if(s.to!=c.to||!l_(s.active,c.active)||s.point&&(!c.point||!r_(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new sv(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new iv;for(let r of e instanceof tv?[e]:t?a_(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}},rv.empty=new rv([],[],null,-1),rv.empty.nextLayer=rv.empty,iv=class e{finishChunk(e){this.chunks.push(new nv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(rv.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=rv.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}},av=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},ov=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new av(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)s_(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)s_(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),s_(this.heap,0)}}},sv=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ov.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){u_(this.active,e),u_(this.activeTo,e),u_(this.activeRank,e),this.minActive=f_(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;d_(this.active,t,n),d_(this.activeTo,t,r),d_(this.activeRank,t,i),e&&d_(e,t,this.cursor.from),this.minActive=f_(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&u_(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}})),lv,uv,dv,fv,pv,mv,hv,gv=n((()=>{lv=`ͼ`,uv=typeof Symbol>`u`?`__`+lv:Symbol.for(lv),dv=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),fv=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},pv=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
+`)}static newName(){let e=fv[uv]||1;return fv[uv]=e+1,lv+e.toString(36)}static mount(e,t,n){let r=e[dv],i=n&&n.nonce;r?i&&r.setNonce(i):r=new hv(e,i),r.mount(Array.isArray(t)?t:[t],e)}},mv=new Map,hv=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=mv.get(n);if(t)return e[dv]=t;this.sheet=new r.CSSStyleSheet,mv.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[dv]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
+`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function _v(e){var t=!(bv&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||xv&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?yv:vv)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var vv,yv,bv,xv,Sv,Cv=n((()=>{for(vv={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},yv={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},bv=typeof navigator<`u`&&/Mac/.test(navigator.platform),xv=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Sv=0;Sv<10;Sv++)vv[48+Sv]=vv[96+Sv]=String(Sv);for(Sv=1;Sv<=24;Sv++)vv[Sv+111]=`F`+Sv;for(Sv=65;Sv<=90;Sv++)vv[Sv]=String.fromCharCode(Sv+32),yv[Sv]=String.fromCharCode(Sv);for(var e in vv)yv.hasOwnProperty(e)||(yv[e]=vv[e])}));function wv(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)Tv(e,arguments[t]);return e}function Tv(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)Tv(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var Ev=n((()=>{})),Dv=i({BidiSpan:()=>SS,BlockInfo:()=>QC,BlockType:()=>aS,BlockWrapper:()=>lS,Decoration:()=>q,Direction:()=>mS,EditorView:()=>J,GutterMarker:()=>MT,MatchDecorator:()=>qw,RectangleMarker:()=>Lw,ViewPlugin:()=>US,ViewUpdate:()=>tC,WidgetType:()=>iS,__test:()=>$T,closeHoverTooltips:()=>wT,crosshairCursor:()=>vx,drawSelection:()=>$b,dropCursor:()=>rx,getDialog:()=>Mx,getDrawSelectionConfig:()=>ex,getPanel:()=>kx,getTooltip:()=>Tx,gutter:()=>Px,gutterLineClass:()=>NT,gutterWidgetClass:()=>PT,gutters:()=>Fx,hasHoverTooltips:()=>Ex,highlightActiveLine:()=>dx,highlightActiveLineGutter:()=>Hx,highlightSpecialChars:()=>sx,highlightTrailingWhitespace:()=>Gx,highlightWhitespace:()=>Wx,hoverTooltip:()=>wx,keymap:()=>Mw,layer:()=>Qb,lineNumberMarkers:()=>HT,lineNumberWidgetMarker:()=>UT,lineNumbers:()=>Bx,logException:()=>gy,panels:()=>Ox,placeholder:()=>fx,rectangularSelection:()=>_x,repositionTooltips:()=>Dx,runScopeHandlers:()=>Gb,scrollPastEnd:()=>ux,showDialog:()=>jx,showPanel:()=>OT,showTooltip:()=>_T,tooltips:()=>yx});function Ov(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}function kv(e,t,n){if(e==t)return!0;e||=rS,t||=rS;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Av(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function jv(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Mv(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}function Nv(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Pv(e,t){return e==t||!!(e&&t&&e.compare(t))}function Fv(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}function Iv(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Lv(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Rv(e,t){if(!t.anchorNode)return!1;try{return Lv(e,t.anchorNode)}catch{return!1}}function zv(e){return e.nodeType==3?Zv(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Bv(e,t,n,r){return n?Uv(e,t,n,r,-1)||Uv(e,t,n,r,1):!1}function Vv(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Hv(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Uv(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Wv(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=Vv(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?Wv(e):0}else return!1}}function Wv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Gv(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Kv(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qv(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Jv(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=Kv(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=qv(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Yv(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}function Xv(e){if(e.setActive)return e.setActive();if(dS)return e.focus(dS);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(dS==null?{get preventScroll(){return dS={preventScroll:!0},!0}}:void 0),!dS){dS=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function Zv(e,t,n=t){let r=fS||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function Qv(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function $v(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function ey(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Wv(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=Wv(n))}else if(n==e)return!0;else r=Vv(n),n=n.parentNode}function ty(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function ny(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=Wv(n)}else if(n.parentNode&&!Hv(n))r=Vv(n),n=n.parentNode;else return null}function ry(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Hv(n))r=Vv(n)+1,n=n.parentNode;else return null}function iy(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}function ay(e){return e<=247?_S[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?vS[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}function oy(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!oy(r.inner,i.inner))return!1}return!0}function sy(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=ay(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),CS[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=CS[e];if(i==128)e<s-1&&t==CS[e+1]&&t&24?i=CS[e]=t:CS[e]=256;else if(i==64){let i=e+1;for(;i<s&&CS[i]==64;)i++;let a=e&&t==8||i<n&&CS[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)CS[t]=a;e=i-1}else i==8&&r==1&&(CS[e]=1);t=i,i&7&&(r=i)}}}function cy(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=yS[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(bS[e+1]==-r){let n=bS[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(CS[t]=CS[bS[e]]=r),s=e;break}}else if(bS.length==189)break;else bS[s++]=t,bS[s++]=n,bS[s++]=c;else if((o=CS[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=bS[t+2];if(n&2)break;if(e)bS[t+2]|=2;else{if(n&4)break;bS[t+2]|=4}}}}}function ly(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=CS[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(CS[o]==256)o++;else break;let l=a==1,u=l==((o<t?CS[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),CS[--t]=u;c=o}else a=o,c++}}}function uy(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=CS[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(CS[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new SS(c,m.from,f)),dy(e,m.direction==hS==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?CS[p]!=s:CS[p]==s))break;else p++;d?uy(e,c,p,r+1,i,d,o):c<p&&o.push(new SS(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=CS[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(CS[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new SS(m.to,c,f)),dy(e,m.direction==hS==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?CS[p-1]!=s:CS[p-1]==s))break;else p--;d?uy(e,p,c,r+1,i,d,o):p<c&&o.push(new SS(p,c,f)),c=p}}function dy(e,t,n,r,i,a,o){let s=t%2?2:1;sy(e,i,a,r,s),cy(e,i,a,r,s),ly(i,a,r,s),uy(e,i,a,t,n,r,o)}function fy(e,t,n){if(!e)return[new SS(0,0,+(t==gS))];if(t==hS&&!n.length&&!xS.test(e))return py(e.length);if(n.length)for(;e.length>CS.length;)CS[CS.length]=256;let r=[],i=t==hS?0:1;return dy(e,i,i,n,0,e.length,r),r}function py(e){return[new SS(0,e,0)]}function my(e,t,n,r,i){let a=r.head-e.from,o=SS.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=Dg(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),wS=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?U.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):U.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function hy(e,t,n){for(let r=t;r<n;r++){let t=ay(e.charCodeAt(r));if(t==1)return hS;if(t==2||t==4)return gS}return hS}function gy(e,t,n){let r=e.facet(OS);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}function _y(e,t){let n=e.state.facet(ZS);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return rv.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=hy(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}function vy(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(QS)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}function yy(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function by(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=zv(t);return n[n.length-1]||null}function xy(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}function Sy(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function Cy(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}function wy(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Ov(n,e),r&&(e.class+=` `+r),e)}function Ty(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof cC&&t.push(r.mark)}return t}function Ey(e){let t=rC.get(e);return t&&t.setDOM(e.cloneNode()),e}function Dy(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)Dy(n,t)}}function Oy(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function ky(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=ny(n.focusNode,n.focusOffset),i=ry(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=rC.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=rC.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function Ay(e,t,n){let r=ky(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new eC(c.mapPos(a),c.mapPos(o),a,o),text:i}}function jy(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}function My(e,t,n){let r=new CC;return rv.compare(e,t,n,r),r.changes}function Ny(e,t,n){let r=new wC;return rv.compare(e,t,n,r),r.changes}function Py(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function Fy(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}function Iy(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return U.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=Dg(i.text,a,!1):s=Dg(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=Dg(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=Dg(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return U.range(o+i.from,s+i.from)}function Ly(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+m_(o,a,e.state.tabSize)}function Ry(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==aS.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function zy(e,t,n,r){let i=Ry(e,t.head,t.assoc||-1),a=!r||i.type!=aS.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==mS.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return U.cursor(o,n?-1:1)}return U.cursor(n?i.to:i.from,n?-1:1)}function By(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=my(i,a,o,s,n),l=wS;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
+`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function Vy(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==X_.Space&&(i=t),i==t}}function Hy(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return U.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Ky(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return U.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return U.cursor(i.pos,i.assoc,void 0,o)}}function Uy(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Wy(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Uy(e,i.from,0);t!=i.from&&(a=U.cursor(t,-1))}else{let t=Uy(e,i.from,-1),n=Uy(e,i.to,1);(t!=i.from||n!=i.to)&&(a=U.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?U.create(n,t.mainIndex):t}function Gy(e,t,n){let r=Uy(e.state.facet(XS).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:U.cursor(r,r<n.from?1:-1)}function Ky(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new EC(0,1);if(c>e.viewState.docHeight)return new EC(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==aS.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==aS.Text){let t=Ly(e,i,l,o,s);return new EC(t,t==l.from?1:-1)}}if(l.type!=aS.Text)return c<(l.top+l.bottom)/2?new EC(l.from,1):new EC(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new DC(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}function qy(e,t,n){for(;;){if(!t||n<Wv(t))return!1;if(t==e)return!0;n=Vv(t)+1,t=t.parentNode}}function Jy(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=rC.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function Yy(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Yy(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function Xy(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||K.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,OC),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:h_.of(t.text.slice(a.from-e,u).split(OC))}:(d=$y(l,t.text,s-e,c))&&(K.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==OC+OC&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:h_.of(t.text.slice(d.from,d.toB).split(OC))})}else r&&(!e.hasFocus&&i.facet(BS)||nb(r,a))&&(r=null);if(!n&&!r)return!1;if((K.mac||K.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=U.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:h_.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:K.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
+ `&&e.lineWrapping&&(r&&=U.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:h_.of([` `])}),n)return Zy(e,n,r,o);if(r&&!nb(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Wy(i.facet(XS).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function Zy(e,t,n,r=-1){if(K.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(K.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&Qv(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Qv(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Qv(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Qy(e,t,n);return e.state.facet(AS).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Qy(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Uy(i.facet(XS).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:U.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&ky(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?U.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function $y(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function eb(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new AC(n,r)),(i!=n||a!=r)&&t.push(new AC(i,a))),t}function tb(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?U.single(n+t,r+t):null}function nb(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}function rb(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){gy(n.state,e)}}}function ib(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(rb(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(rb(t.value,r))}}for(let e in RC)n(e).handlers.push(RC[e]);for(let e in zC)n(e).observers.push(zC[e]);return t}function ab(e){return Math.max(0,e)*.7+8}function ob(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function sb(e,t){let n=e.state.facet(TS);return n.length?n[0](t):K.mac?t.metaKey:t.ctrlKey}function cb(e,t){let n=e.state.facet(ES);return n.length?n[0](t):K.mac?!t.altKey:!t.ctrlKey}function lb(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Iv(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function ub(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=rC.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}function db(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),pb(e,n.value)},50)}function fb(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function pb(e,t){t=fb(e.state,MS,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(GC!=null&&n.selection.ranges.every(e=>e.empty)&&GC==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:U.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:U.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}function mb(e,t,n,r){if(r==1)return U.cursor(t,n);if(r==2)return Iy(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,U.range(a,o)}}function hb(e){if(!VC)return e.detail;let t=HC,n=WC;return HC=e,WC=Date.now(),UC=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(UC+1)%3:1}function gb(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=hb(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=mb(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=mb(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?U.range(i,a,l.assoc):U.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=_b(i,s.pos))?c:o?i.addRange(l):U.create([l])}}}function _b(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return U.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}function vb(e,t,n,r){if(n=fb(e.state,MS,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&cb(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}function yb(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function bb(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:fb(e,NS,t.join(e.lineBreak)),ranges:n,linewise:r}}function xb(e,t){let n=[];for(let r of e.facet(jS)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:KC.of(!0)}):null}function Sb(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=xb(e.state,t);n?e.dispatch(n):e.update([])}},10)}function Cb(e){qC.has(e)||(qC.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}function wb(){YC=!1}function Tb(e,t){return e==t?e:(e.constructor!=t.constructor&&(YC=!0),t)}function Eb(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof aw&&(r=e[t+1])instanceof aw&&e.splice(t-1,3,new aw(n.length+1+r.length))}function Db(e,t,n){let r=new lw;return rv.compare(e,t,n,r,0),r.changes}function Ob(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function kb(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function Ab(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}function jb(e,t,n){let r=[],i=e,a=0;return rv.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Mb({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function Nb(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function Pb(e,t){for(let n of e)if(t(n))return n}function Fb(e){let t=e.facet(qS).filter(e=>typeof e!=`function`),n=e.facet(YS).filter(e=>typeof e!=`function`);return n.length&&t.push(rv.join(n)),t}function Ib(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new QC(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Ib(e,t)):e._content)}function Lb(e,t,n){return new pv(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}function Rb(e,t,n){for(;t;){let r=rC.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function zb(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return Bv(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Bb(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return zb(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?zb(e,n):null}function Vb(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Ov(a,n)}return n}function Hb(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function Ub(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}function Wb(e){let t=e.facet(Mw),n=Nw.get(t);return n||Nw.set(t,n=Kb(t.reduce((e,t)=>e.concat(t),[]))),n}function Gb(e,t,n){return qb(Wb(e.state),t,e,n)}function Kb(e,t=Aw){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>Hb(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Pw={view:t,prefix:n,scope:e};return setTimeout(()=>{Pw==r&&(Pw=null)},Fw),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Iw))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}function qb(e,t,n,r){Iw=t;let i=_v(t),a=Mg(Ag(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Pw&&Pw.view==n&&Pw.scope==r&&(o=Pw.prefix+` `,FC.indexOf(t.keyCode)<0&&(c=!0,Pw=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+Ub(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(K.windows&&t.ctrlKey&&t.altKey)&&!(K.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=vv[t.keyCode])&&p!=i?(d(f[o+Ub(p,t,!0)])||t.shiftKey&&(m=yv[t.keyCode])!=i&&m!=p&&d(f[o+Ub(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Ub(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Iw=null,s}function Jb(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==mS.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Yb(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Xb(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==mS.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=Jb(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=Ry(e,r,1),m=Ry(e,i,-1),h=p.type==aS.Text?p:null,g=m.type==aS.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Yb(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Yb(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==aS.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new Lw(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==mS.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function Zb(e,t){return e.constructor==t.constructor&&e.eq(t)}function Qb(e){return[US.define(t=>new Rw(t,e)),zw.of(e)]}function $b(e={}){return[Bw.of(e),Vw,Hw,Uw,FS.of(!0)]}function ex(e){return e.facet(Bw)}function tx(e){return e.startState.facet(Bw)!=e.state.facet(Bw)}function nx(e,t){t.style.animationDuration=e.facet(Bw).cursorBlinkRate+`ms`}function rx(){return[Gw,Kw]}function ix(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function ax(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}function ox(){if(Zw==null&&typeof document<`u`&&document.body){let e=document.body.style;Zw=(e.tabSize??e.MozTabSize)!=null}return Zw||!1}function sx(e={}){return[Qw.of(e),cx()]}function cx(){return $w||=US.fromClass(class{constructor(e){this.view=e,this.decorations=q.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Qw)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new qw({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=Ag(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=p_(e.text,t,r-e.from);return q.replace({widget:new nT((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=q.replace({widget:new tT(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Qw);e.startState.facet(Qw)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}function lx(e){return e>=32?eT:e==10?`␤`:String.fromCharCode(9216+e)}function ux(){return[rT,KS.of(e=>e.plugin(rT)?.attrs||null)]}function dx(){return aT}function fx(e){let t=US.fromClass(class{constructor(t){this.view=t,this.placeholder=e?q.set([q.widget({widget:new oT(e),side:1}).range(0)]):q.none}get decorations(){return this.view.state.doc.length?q.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,J.contentAttributes.of({"aria-placeholder":e})]:t}function px(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>sT||n.off>sT||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(U.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=m_(n.text,o,e.tabSize,!0);if(r<0)a.push(U.cursor(n.to));else{let t=m_(n.text,s,e.tabSize);a.push(U.range(n.from+r,n.from+t))}}}return a}function mx(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function hx(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>sT?-1:i==r.length?mx(e,t.clientX):p_(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function gx(e,t){let n=hx(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=hx(e,t);if(!o)return r;let s=px(e.state,n,o);return s.length?a?U.create(s.concat(r.ranges)):U.create(s):r}}:null}function _x(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return J.mouseSelectionStyle.of((e,n)=>t(n)?gx(e,n):null)}function vx(e={}){let[t,n]=cT[e.key||`Alt`],r=US.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,J.contentAttributes.of(e=>e.plugin(r)?.isDown?lT:null)]}function yx(e={}){return fT.of(e)}function bx(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}function xx(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}function Sx(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-ST&&t.clientX<=r+ST&&t.clientY>=i-ST&&t.clientY<=a+ST}function Cx(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function wx(e,t={}){let n=G.define(),r=j_.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,C_.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(CT)&&(e=[]);return e},provide:e=>vT.from(e)});return{active:r,extension:[r,US.define(i=>new xT(i,e,r,n,t.hoverTime||300)),bT]}}function Tx(e,t){let n=e.plugin(mT);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}function Ex(e){return e.facet(vT).some(e=>e)}function Dx(e){let t=e.plugin(mT);t&&t.maybeMeasure()}function Ox(e){return e?[TT.of(e)]:[]}function kx(e,t){let n=e.plugin(ET),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}function Ax(e){let t=e.nextSibling;return e.remove(),t}function jx(e,t){let n,r=new Promise(e=>n=e),i=e=>Nx(e,t,n);e.state.field(kT,!1)?e.dispatch({effects:AT.of(i)}):e.dispatch({effects:G.appendConfig.of(kT.init(()=>[i]))});let a=jT.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(kT).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}function Mx(e,t){let n=e.state.field(kT,!1)||[];for(let r of n){let n=kx(e,r);if(n&&n.dom.classList.contains(t))return n}return null}function Nx(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=wv(`form`),t.input){let e=wv(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(wv(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(wv(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=wv(`div`,r,wv(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}function Px(e){return[Fx(),IT.of({...FT,...e})]}function Fx(e){let t=[RT];return e&&e.fixed===!1&&t.push(LT.of(!0)),t}function Ix(e){return Array.isArray(e)?e:[e]}function Lx(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}function Rx(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}function zx(e,t){return e.state.facet(WT).formatNumber(t,e.state)}function Bx(e={}){return[WT.of(e),Fx(),KT]}function Vx(e){let t=9;for(;t<e;)t=t*10+9;return t}function Hx(){return JT}function Ux(e){return US.define(t=>({decorations:e.createDeco(t),update(t){this.decorations=e.updateDeco(t,this.decorations)}}),{decorations:e=>e.decorations})}function Wx(){return ZT}function Gx(){return QT}var Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,K,rS,iS,aS,q,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,J,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT,ST,CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE=n((()=>{cv(),gv(),Cv(),Ev(),Kx=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},qx=typeof document<`u`?document:{documentElement:{style:{}}},Jx=/Edge\/(\d+)/.exec(Kx.userAgent),Yx=/MSIE \d/.test(Kx.userAgent),Xx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kx.userAgent),Zx=!!(Yx||Xx||Jx),Qx=!Zx&&/gecko\/(\d+)/i.test(Kx.userAgent),$x=!Zx&&/Chrome\/(\d+)/.exec(Kx.userAgent),eS=`webkitFontSmoothing`in qx.documentElement.style,tS=!Zx&&/Apple Computer/.test(Kx.vendor),nS=tS&&(/Mobile\/\w+/.test(Kx.userAgent)||Kx.maxTouchPoints>2),K={mac:nS||/Mac/.test(Kx.platform),windows:/Win/.test(Kx.platform),linux:/Linux|X11/.test(Kx.platform),ie:Zx,ie_version:Yx?qx.documentMode||6:Xx?+Xx[1]:Jx?+Jx[1]:0,gecko:Qx,gecko_version:Qx?+(/Firefox\/(\d+)/.exec(Kx.userAgent)||[0,0])[1]:0,chrome:!!$x,chrome_version:$x?+$x[1]:0,ios:nS,android:/Android\b/.test(Kx.userAgent),webkit:eS,webkit_version:eS?+(/\bAppleWebKit\/(\d+)/.exec(Kx.userAgent)||[0,0])[1]:0,safari:tS,safari_version:tS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kx.userAgent)||[0,0])[1]:0,tabSize:qx.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`},rS=Object.create(null),iS=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},aS=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(aS||={}),q=class extends ev{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new oS(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new cS(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Nv(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new cS(e,n,r,t,e.widget||null,!0)}static line(e){return new sS(e)}static set(e,t=!1){return rv.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}},q.none=rv.empty,oS=class e extends q{constructor(e){let{start:t,end:n}=Nv(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Ov(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||rS}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&kv(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}},oS.prototype.point=!1,sS=class e extends q{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&kv(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}},sS.prototype.mapMode=C_.TrackBefore,sS.prototype.point=!0,cS=class e extends q{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?C_.TrackBefore:C_.TrackAfter:C_.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?aS.WidgetBefore:aS.WidgetAfter:aS.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Pv(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}},cS.prototype.point=!0,lS=class e extends ev{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&kv(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||rS)}static set(e,t=!1){return rv.of(e,t)}},lS.prototype.startSide=lS.prototype.endSide=-1,uS=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Wv(t):0),n,Math.min(e.focusOffset,n?Wv(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},dS=null,K.safari&&K.safari_version>=26&&(dS=!1),pS=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,Vv(t),n)}static after(t,n){return new e(t.parentNode,Vv(t)+1,n)}},mS=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(mS||={}),hS=mS.LTR,gS=mS.RTL,_S=iy(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),vS=iy(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),yS=Object.create(null),bS=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);yS[t]=n,yS[n]=-t}xS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,SS=class{get dir(){return this.level%2?gS:hS}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}},CS=[],wS=``,TS=W.define(),ES=W.define(),DS=W.define(),OS=W.define(),kS=W.define(),AS=W.define(),jS=W.define(),MS=W.define(),NS=W.define(),PS=W.define({combine:e=>e.some(e=>e)}),FS=W.define({combine:e=>e.some(e=>e)}),IS=W.define(),LS=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(U.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},RS=G.define({map:(e,t)=>e.map(t)}),zS=G.define(),BS=W.define({combine:e=>e.length?e[0]:!0}),VS=0,HS=W.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),US=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(HS.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(HS.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(VS++,t,r,i,e=>{let t=[];return o&&t.push(qS.of(t=>{let n=t.plugin(e);return n?o(n):q.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},WS=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){gy(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(gy(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){gy(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},GS=W.define(),KS=W.define(),qS=W.define(),JS=W.define(),YS=W.define(),XS=W.define(),ZS=W.define(),QS=W.define(),$S=W.define(),eC=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},tC=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=T_.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new eC(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},nC=[],rC=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return nC}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Av(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=Vv(this.dom),r=this.length?e>0:t>0;return new pS(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof aC)return e;return null}static get(e){return e.cmTile}},iC=class extends rC{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=yy(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=yy(r);this.length=a}},aC=class extends iC{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=rC.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof oC)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},oC=class e extends iC{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},sC=class e extends iC{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&xy(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):by(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new pS(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new pS(e.dom,0);e==n.tile&&(a=!0)}}return new pS(this.dom,0)}},cC=class e extends iC{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},lC=class e extends rC{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?K.chrome||K.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=Zv(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return K.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?Gv(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},uC=class e extends rC{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Gv(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return Gv(n,!r)}}get overrideDOMText(){if(!this.length)return h_.empty;let{root:e}=this;if(!e)return h_.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},dC=class extends rC{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return h_.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},fC=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},pC=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},mC=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new lC(a.dom,a.text+e);t.parent=i}else i.append(r||lC.of(e,this.cache.find(lC)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Ey(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof cC&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Ey(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=rC.get(n.dom);e&&e.setDOM(Ey(n.dom))}let e=cC.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=rC.get(e.text);i&&this.cache.reused.set(i,2);let a=new lC(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=yC;let n=sC.start(e,t||this.cache.find(sC)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof cC&&a.mark.eq(i))n=a,t--;else{let e=cC.of(i,this.cache.find(cC,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Sy(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(K.ios&&Sy(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(xC,0,32)||new uC(xC.toDOM(),0,xC,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new pC(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof oC&&n.wrapper.eq(t.wrapper))e=n;else{let n=oC.of(t.wrapper,this.cache.find(oC,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(dC,void 0,1);return n&&(n.flags=t),n||new dC(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},hC=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},gC=[uC,sC,lC,cC,dC,oC,aC];for(let e=0;e<gC.length;e++)gC[e].bucket=e;_C=class{constructor(e){this.view=e,this.buckets=gC.map(()=>[]),this.index=gC.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new uC(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},vC=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new _C(e),this.text=new hC(e.state.doc),this.builder=new mC(this.cache,new aC(e,e.contentDOM),rv.iter(n)),this.cache.reused.set(t,2),this.old=new fC(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=Ty(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?uC.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof dC)this.cache.add(e);else if(e instanceof cC)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof cC&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof cC&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=rv.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof cS){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?bC.block:bC.inline),c=Cy(a),l=this.cache.findWidget(i,t-e,c)||uC.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=wy(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=rC.get(r);if(r==this.view.contentDOM)break;e instanceof cC?t.push(e):e?.isLine()?n=e:e instanceof oC||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new sC(r,yC):n||t.push(cC.of(new oS({tagName:r.nodeName.toLowerCase(),attributes:Mv(r)}),r)))}return{line:n,marks:t}}},yC={class:`cm-line`},bC=class extends iS{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}},bC.inline=new bC(`span`),bC.block=new bC(`div`),xC=new class extends iS{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},SC=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=q.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new aC(e,e.contentDOM),this.updateInner([new eC(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!Fy(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?Ay(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new eC(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(K.ie||K.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=My(i,this.decorations,e.changes);o.length&&(t=eC.extendWithRanges(t,o));let s=Ny(a,this.blockWrappers,e.changes);return s.length&&(t=eC.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new vC(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&rC.get(t.text)&&r.cache.reused.set(rC.get(t.text),2),this.tile=r.run(e,t),Dy(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=K.chrome||K.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof TC&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(zS)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(BS)||n.tabIndex>-1)&&Rv(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),K.gecko&&s.empty&&!this.hasComposition&&Oy(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new pS(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!Bv(c.node,c.offset,u.anchorNode,u.anchorOffset)||!Bv(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{K.android&&K.chrome&&n.contains(u.focusNode)&&Py(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Iv(this.view.root);if(e)if(s.empty){if(K.gecko){let e=jy(c.node,c.offset);if(e&&e!=3){let t=(e==1?ny:ry)(c.node,c.offset);t&&(c=new pS(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new pS(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new pS(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Bv(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Iv(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=Wv(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!rC.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof TC?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=Dg(e.text,t);if(n==t)return null;let r=Zv(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==mS.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof oC)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?zv(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?mS.RTL:mS.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=zv(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=zv(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(q.replace({widget:new TC(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return q.set(e)}updateDeco(){let e=1,t=this.view.state.facet(qS).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(YS).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(rv.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(JS).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(IS))try{if(t(this.view,e.range,e))return!0}catch(e){gy(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=vy(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(Jv(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==mS.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Dy(this.tile)}},CC=class{constructor(){this.changes=[]}compareRange(e,t){Fv(e,t,this.changes)}comparePoint(e,t){Fv(e,t,this.changes)}boundChange(e){Fv(e,e,this.changes)}},wC=class{constructor(){this.changes=[]}compareRange(e,t){Fv(e,t,this.changes)}comparePoint(){}boundChange(e){Fv(e,e,this.changes)}},TC=class extends iS{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},EC=class{constructor(e,t){this.pos=e,this.assoc=t}},DC=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[SS.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[SS.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,i=new Set,a=this.bidiIn(e[0],e[r]),o,s,c=-1,l=1e9,u;search:for(;n<r;){let d=r-n,f=n+r>>1;adjust:if(i.has(f)){let e=n+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!i.has(e)){f=e;break adjust}e++,e==r&&(e=n)}break search}i.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let i=p[t],d=0;if(!(i.width==0&&p.length>1)){if(i.bottom<this.y)(!o||o.bottom<i.bottom)&&(o=i),d=1;else if(i.top>this.y)(!s||s.top>i.top)&&(s=i),d=-1;else{let e=i.left>this.x?this.x-i.left:i.right<this.x?this.x-i.right:0,t=Math.abs(e);t<l&&(c=f,l=t,u=i),e&&(d=e<0==(this.baseDir==mS.LTR)?-1:1)}d==-1&&(!a||this.baseDirAt(e[f],1))?r=f:d==1&&(!a||this.baseDirAt(e[f+1],-1))&&(n=f+1)}}}if(!u){let n=o&&(!s||this.y-o.bottom<s.top-this.y)?o:s;return this.y=(n.top+n.bottom)/2,this.scan(e,t)}if(l){let{top:n,bottom:r}=u;if(o&&o.bottom>(n+n+r)/3)return this.y=o.bottom-1,this.scan(e,t);if(s&&s.top<(n+r+r)/3)return this.y=s.top+1,this.scan(e,t)}let d=(a?this.dirAt(e[c],1):this.baseDir)==mS.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=Dg(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return Zv(e.dom,i,a).getClientRects()});return r.after?new EC(n[r.i+1],-1):new EC(n[r.i],1)}scanTile(e,t){if(!e.length)return new EC(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:Zv(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new EC(n[r.i+1],-1):new EC(a,1)}},OC=`￿`,kC=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet($_.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=OC}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=rC.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=rC.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:Hv(r))||Hv(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!Jy(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=rC.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(qy(e,n.node,n.offset)?t:0))}},AC=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},jC=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Yy(e.docView.tile,t,n,0))){let t=i||a?[]:eb(e),n=new kC(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=tb(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Lv(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Lv(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((K.ios||K.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(U.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=U.create([U.cursor(n,r)])}else this.newSel=U.single(r,n)}}},MC=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,K.safari&&e.contentDOM.addEventListener(`input`,()=>null),K.gecko&&Cb(e.contentDOM.ownerDocument)}handleEvent(e){!ub(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=ib(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&FC.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),K.android&&K.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return K.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=NC.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||PC.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Qv(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:K.safari&&!K.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}},NC=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],PC=`dthko`,FC=[16,17,18,20,91,92,224,225],IC=6,LC=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Yv(e.contentDOM),this.atoms=e.state.facet(XS).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet($_.allowMultipleSelections)&&sb(e,t),this.dragging=lb(e,t)&&hb(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&ob(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=vy(this.view);e.clientX-s.left<=r+IC?t=-ab(r-e.clientX):e.clientX+s.right>=a-IC&&(t=ab(e.clientX-a)),e.clientY-s.top<=i+IC?n=-ab(i-e.clientY):e.clientY+s.bottom>=o-IC&&(n=ab(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Wy(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}},RC=Object.create(null),zC=Object.create(null),BC=K.ie&&K.ie_version<15||K.ios&&K.webkit_version<604,zC.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},zC.wheel=zC.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},RC.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),zC.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},zC.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},RC.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(DS))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=gb(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new LC(e,t,n,r)),r&&e.observer.ignore(()=>{Xv(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1},VC=K.ie&&K.ie_version<=11,HC=null,UC=0,WC=0,RC.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=U.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,fb(e.state,NS,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},RC.dragend=e=>(e.inputState.draggedContent=null,!1),RC.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&vb(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return vb(e,t,n,!0),!0}return!1},RC.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=BC?null:t.clipboardData;return n?(pb(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(db(e),!1)},GC=null,RC.copy=RC.cut=(e,t)=>{if(!Rv(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=bb(e.state);if(!n&&!i)return!1;GC=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=BC?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(yb(e,n),!1)},KC=G_.define(),zC.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Sb(e)},zC.blur=e=>{e.observer.clearSelectionRange(),Sb(e)},zC.compositionstart=zC.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},zC.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,K.chrome&&K.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},zC.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},RC.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Zy(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(K.chrome&&K.android&&(n=NC.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return K.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),K.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>zC.compositionend(e,t),20),!1},qC=new Set,JC=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],YC=!1,XC=class{constructor(e){this.lineWrapping=e,this.doc=h_.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JC.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=JC.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},ZC=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},QC=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?aS.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof cS?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},$C=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})($C||={}),ew=.001,tw=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ew&&(YC=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,$C.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,$C.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,$C.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=cw.build(n.setDoc(a),e,l,u);i=Tb(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new iw(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new ow(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}},tw.prototype.size=1,nw=q.replace({}),rw=class extends tw{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new QC(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new QC(r,0,n,this.spaceAbove,nw):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,$C.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},iw=class e extends rw{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new QC(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof aw&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof aw?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):tw.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},aw=class e extends tw{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new QC(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new QC(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==$C.ByHeight)return this.blockAt(e,n,r,i);if(t==$C.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new QC(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new QC(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new QC(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return tw.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=ew&&(s=-2);let c=new iw(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=tw.of(r);return(s<0||Math.abs(c.height-this.height)>=ew||Math.abs(s-this.heightMetrics(t,n).perLine)>=ew)&&(YC=!0),Tb(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},ow=class extends tw{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==$C.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==$C.ByPosNoHeight?$C.ByPosNoHeight:$C.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,$C.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Eb(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Eb(i,e)}return tw.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?tw.of(this.break?[e,null,t]:[e,t]):(this.left=Tb(this.left,e),this.right=Tb(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}},sw=5,cw=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof iw?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new iw(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new rw(a,r,n)):(a||i||r>=sw)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new iw(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new aw(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof iw)return e;let t=new iw(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof iw)&&!this.isCovered?this.nodes.push(new iw(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof iw&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return rv.spans(n,r,i,a,0),a.finish(r)}},lw=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Fv(e,t,this.changes,5)}},uw=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return q.replace({widget:new dw(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},dw=class extends iS{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},fw=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=mw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mS.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(KS).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new XC(n),this.stateDeco=Fb(t),this.heightMap=tw.empty().applyChanges(this.stateDeco,h_.empty,this.heightOracle.setDoc(t.doc),[new eC(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=q.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new pw(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?mw:new hw(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ib(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Fb(this.state);let r=e.changedRanges,i=eC.extendWithRanges(r,Db(n,this.stateDeco,e?e.changes:T_.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);wb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||YC)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(FS)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?mS.RTL:mS.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=qv(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=Yv(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ty(this.scrollParent||e.win);let m=(this.printing?Ab:Ob)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!kb(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),wb();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?tw.empty().applyChanges(this.stateDeco,h_.empty,this.heightOracle,[new eC(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new ZC(n.from,i))}YC&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new pw(r.lineAt(a-n*1e3,$C.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,$C.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,$C.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new pw(r.lineAt(o-1e3/2,$C.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,$C.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new pw(this.heightMap.lineAt(n,$C.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,$C.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,$C.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,$C.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new uw(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=mS.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=Pb(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(U.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new uw(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=aS.Text)return;let i=jb(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=Nb(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=Mb(i,n),l=Mb(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=Nb(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=Mb(i,f),l=Mb(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=Nb(r,n)-Nb(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){uw.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=q.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];rv.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ib(this.heightMap.lineAt(e,$C.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ib(this.heightMap.lineAt(this.scaler.fromDOM(e),$C.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ib(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},pw=class{constructor(e,t){this.from=e,this.to=t}},mw={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}},hw=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,$C.ByPos,e,0,0).top,o=t.lineAt(i,$C.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}},gw=W.define({combine:e=>e.join(` `)}),_w=W.define({combine:e=>e.indexOf(!0)>-1}),vw=pv.newName(),yw=pv.newName(),bw=pv.newName(),xw={"&light":`.`+yw,"&dark":`.`+bw},Sw=Lb(`.`+vw,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},xw),Cw={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ww=K.ie&&K.ie_version<=11,Tw=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uS,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(K.ie&&K.ie_version<=11||K.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&K.android&&e.constructor.EDIT_CONTEXT!==!1&&!(K.chrome&&K.chrome_version<126)&&(this.editContext=new Ew(e),e.state.facet(BS)&&(e.contentDOM.editContext=this.editContext.editContext)),ww&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(BS)?n.root.activeElement!=this.dom:!Rv(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(K.ie&&K.ie_version<=11||K.android&&K.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Bv(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Iv(e.root);if(!t)return!1;let n=K.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Bb(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Rv(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ey(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,Cw),ww&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ww&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Qv(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Rv(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new jC(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Xy(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!nb(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=Rb(t,e.previousSibling||e.target.previousSibling,-1),r=Rb(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(BS)!=e.state.facet(BS)&&(e.view.contentDOM.editContext=e.state.facet(BS)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}},Ew=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=$y(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=U.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));nb(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:h_.of(n.text.slice(l.from,l.toB).split(`
+`))};if((K.mac||K.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:h_.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Zy(e,u,U.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(q.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:zS.of(q.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=Iv(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},J=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||$v(e.parent)||document,this.viewState=new fw(this,e.state||$_.create(e)),e.scrollTo&&e.scrollTo.is(RS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(HS).map(e=>new WS(e));for(let e of this.plugins)e.update(this);this.observer=new Tw(this),this.inputState=new MC(this),this.inputState.ensureHandlers(this.plugins),this.docView=new SC(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof J_?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(KC))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=xb(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet($_.phrases)!=this.state.facet($_.phrases))return this.setState(a);i=tC.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new LS(t.empty?t:U.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(RS)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=kw.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet($S)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(gw)!=i.state.facet(gw)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(kS))try{e(i)}catch(e){gy(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!Xy(this,u)&&l.force&&Qv(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new fw(this,e),this.plugins=e.facet(HS).map(e=>new WS(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new SC(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(HS),n=e.state.facet(HS);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new WS(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){gy(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(ty(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return gy(this.state,e),Ow}}),l=tC.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Ow)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){gy(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(kS))e(t)}get themeClasses(){return vw+` `+(this.state.facet(_w)?bw:yw)+` `+this.state.facet(gw)}updateAttrs(){let e=Vb(this,GS,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(BS)?`true`:`false`,class:`cm-content`,style:`${K.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Vb(this,KS,t);let n=this.observer.ignore(()=>{let n=jv(this.contentDOM,this.contentAttrs,t),r=jv(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet($S);let t=this.state.facet(e.cspNonce);pv.mount(this.root,this.styleModules.concat(Sw).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Gy(this,e,By(this,e,t,n))}moveByGroup(e,t){return Gy(this,e,By(this,e,t,t=>Vy(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return U.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return zy(this,e,t,n)}moveVertically(e,t,n){return Gy(this,e,Hy(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Ky(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ky(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[SS.find(i,e-r.from,-1,t)];return Gv(n,a.dir==mS.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(PS)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Dw)return py(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||oy(r.isolates,n=_y(this,e))))return r.order;n||=_y(this,e);let r=fy(e.text,t,n);return this.bidiCache.push(new kw(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||K.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Xv(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return RS.of(new LS(typeof e==`number`?U.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return RS.of(new LS(U.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return US.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return US.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=pv.newName(),r=[gw.of(n),$S.of(Lb(`.${n}`,e))];return t&&t.dark&&r.push(_w.of(!0)),r}static baseTheme(e){return N_.lowest($S.of(Lb(`.`+vw,e,xw)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&rC.get(t)||rC.get(e))?.root?.view||null}},J.styleModule=$S,J.inputHandler=AS,J.clipboardInputFilter=MS,J.clipboardOutputFilter=NS,J.scrollHandler=IS,J.focusChangeEffect=jS,J.perLineTextDirection=PS,J.exceptionSink=OS,J.updateListener=kS,J.editable=BS,J.mouseSelectionStyle=DS,J.dragMovesSelection=ES,J.clickAddsSelectionRange=TS,J.decorations=qS,J.blockWrappers=JS,J.outerDecorations=YS,J.atomicRanges=XS,J.bidiIsolatedRanges=ZS,J.cursorScrollMargin=W.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),J.scrollMargins=QS,J.darkTheme=_w,J.cspNonce=W.define({combine:e=>e.length?e[0]:``}),J.contentAttributes=KS,J.editorAttributes=GS,J.lineWrapping=J.contentAttributes.of({class:`cm-lineWrapping`}),J.announce=G.define(),Dw=4096,Ow={},kw=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:mS.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}},Aw=K.mac?`mac`:K.windows?`win`:K.linux?`linux`:`key`,jw=N_.default(J.domEventHandlers({keydown(e,t){return qb(Wb(t.state),e,t,`editor`)}})),Mw=W.define({enables:jw}),Nw=new WeakMap,Pw=null,Fw=4e3,Iw=null,Lw=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className?(this.adjust(e),!0):!1}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=Jb(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Xb(t,n,r)}},Rw=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(zw)!=e.state.facet(zw)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(zw);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!Zb(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,K.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},zw=W.define(),Bw=W.define({combine(e){return n_(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}}),Vw=Qb({above:!0,markers(e){let{state:t}=e,n=t.facet(Bw),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&K.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:U.cursor(i.head,i.assoc);for(let i of Lw.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=tx(e);return n&&nx(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){nx(t.state,e)},class:`cm-cursorLayer`}),Hw=Qb({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Lw.forRange(e,`cm-selectionBackground`,n))t.push(r);if(K.ios&&!n.empty&&e.state.facet(Bw).iosSelectionHandles){for(let r of Lw.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,U.cursor(n.from,1)))t.push(r);for(let r of Lw.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,U.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||tx(e)},class:`cm-selectionLayer`}),Uw=N_.highest(J.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),Ww=G.define({map(e,t){return e==null?null:t.mapPos(e)}}),Gw=j_.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(Ww)?t.value:e,e)}}),Kw=US.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Gw);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(Gw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Gw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Gw)!=e&&this.view.dispatch({effects:Ww.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}}),qw=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new iv,n=t.add.bind(t);for(let{from:t,to:r}of ax(e,this.maxLength))ix(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else ix(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},Jw=/x/.unicode==null?`g`:`gu`,Yw=RegExp(`[\0-\b
+--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,Jw),Xw={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},Zw=null,Qw=W.define({combine(e){let t=n_(e,{render:null,specialChars:Yw,addSpecialChars:null});return(t.replaceTabs=!ox())&&(t.specialChars=RegExp(` |`+t.specialChars.source,Jw)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,Jw)),t}}),$w=null,eT=`•`,tT=class extends iS{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=lx(this.code),n=e.state.phrase(`Control character`)+` `+(Xw[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},nT=class extends iS{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},rT=US.fromClass(class{constructor(){this.height=1e3,this.attrs={style:`padding-bottom: 1000px`}}update(e){let{view:t}=e,n=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;n>=0&&n!=this.height&&(this.height=n,this.attrs={style:`padding-bottom: ${n}px`})}}),iT=q.line({class:`cm-activeLine`}),aT=US.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(iT.range(i.from)),t=i.from)}return q.set(n)}},{decorations:e=>e.decorations}),oT=class extends iS{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?zv(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=Gv(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},sT=2e3,cT={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},lT={style:`cursor: crosshair`},uT=`-10000px`,dT=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},fT=W.define({combine:e=>({position:K.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||bx})}),pT=new WeakMap,mT=US.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(fT);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new dT(e,_T,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(fT);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=uT,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(K.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=vy(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(fT).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=uT;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=pT.get(c)??d.bottom-d.top,g=c.offset||gT,_=this.view.textDirection==mS.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=uT;continue}pT.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,xx(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,xx(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=uT}},{eventObservers:{scroll(){this.maybeMeasure()}}}),hT=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),gT={x:0,y:0},_T=W.define({enables:[mT,hT]}),vT=W.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),yT=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new dT(e,vT,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},bT=_T.compute([vT],e=>{let t=e.facet(vT);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:yT.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),xT=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==mS.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>gy(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(mT),t=e?e.manager.tooltips.findIndex(e=>e.create==yT.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&n&&!Sx(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!Cx(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},ST=4,CT=G.define(),wT=CT.of(null),TT=W.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}}),ET=US.fromClass(class{constructor(e){this.input=e.state.facet(OT),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(TT);this.top=new DT(e,!0,t.topContainer),this.bottom=new DT(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(TT);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new DT(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new DT(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(OT);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>J.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),DT=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Ax(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ax(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}},OT=W.define({enables:ET}),kT=j_.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(AT)?e=[n.value].concat(e):n.is(jT)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>OT.computeN([e],t=>t.field(e))}),AT=G.define(),jT=G.define(),MT=class extends ev{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}},MT.prototype.elementClass=``,MT.prototype.toDOM=void 0,MT.prototype.mapMode=C_.TrackBefore,MT.prototype.startSide=MT.prototype.endSide=-1,MT.prototype.point=!0,NT=W.define(),PT=W.define(),FT={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>rv.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},IT=W.define(),LT=W.define({combine:e=>e.some(e=>e)}),RT=US.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(IT).map(t=>new BT(e,t)),this.fixed=!e.state.facet(LT);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(LT)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=rv.iter(this.view.state.facet(NT),this.view.viewport.from),r=[],i=this.gutters.map(e=>new zT(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==aS.Text&&t){Lx(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==aS.Text){Lx(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(IT),n=e.state.facet(IT),r=e.docChanged||e.heightChanged||e.viewportChanged||!rv.eq(e.startState.facet(NT),e.state.facet(NT),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new BT(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>J.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==mS.LTR?{left:r,right:i}:{right:r,left:i}})}),zT=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=rv.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new VT(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Lx(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(PT)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},BT=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Ix(t.markers(e)),t.initialSpacer&&(this.spacer=new VT(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Ix(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!rv.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},VT=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Rx(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}},HT=W.define(),UT=W.define(),WT=W.define({combine(e){return n_(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),GT=class extends MT{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}},KT=IT.compute([WT],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(HT)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new GT(zx(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(UT)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(WT)!=e.state.facet(WT),initialSpacer(e){return new GT(zx(e,Vx(e.state.doc.lines)))},updateSpacer(e,t){let n=zx(t.view,Vx(t.view.state.doc.lines));return n==e.number?e:new GT(n)},domEventHandlers:e.facet(WT).domEventHandlers,side:`before`})),qT=new class extends MT{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},JT=NT.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(qT.range(i)))}return rv.of(t)}),YT=q.mark({class:`cm-highlightTab`}),XT=q.mark({class:`cm-highlightSpace`}),ZT=Ux(new qw({regexp:/\t| /g,decoration:e=>e[0]==` `?YT:XT,boundary:/\S/})),QT=Ux(new qw({regexp:/\s+$/g,decoration:q.mark({class:`cm-trailingSpace`})})),$T={HeightMap:tw,HeightOracle:XC,MeasuredHeights:ZC,QueryType:$C,ChangedRange:eC,computeOrder:fy,moveVisually:my,clearHeightChangeFlag:wb,getHeightChangeFlag:()=>YC}}));function tE(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function nE(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof EE&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:xE.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof EE&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}function rE(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function iE(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}function aE(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof EE&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new kE(i,n)}function oE(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof EE?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=hE.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new EE(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(nE(o,t,n,!1))}}return i?aE(i):r}function sE(e){return e.children.some(e=>e instanceof wE||!e.type.isAnonymous||sE(e))}function cE(e){let{buffer:t,nodeSet:n,maxBufferLength:r=dE,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new CE(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:C}=o,te=l,ne=c;if(C<0)if(o.next(),C==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(C==-3){c=x;return}else if(C==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${C}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new wE(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-C;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,te,ne),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,te,ne),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,ne);ie=uE(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,te-ee,ne)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new wE(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof SE){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(mE.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[mE.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[mE.lookAhead,i];o=o?[e].concat(o):[e]}return new SE(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new SE(s[e.topID],_.reverse(),v.reverse(),y)}function lE(e,t){if(!e.isAnonymous||t instanceof wE||t.type!=e)return 1;let n=jE.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof SE)){n=1;break}n+=lE(e,r)}jE.set(t,n)}return n}function uE(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=lE(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=lE(e,t[s]);for(s++;s<i;s++){let n=lE(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(uE(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE=n((()=>{dE=1024,fE=0,pE=class{constructor(e,t){this.from=e,this.to=t}},mE=class{constructor(e={}){this.id=fE++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=_E.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}},mE.closedBy=new mE({deserialize:e=>e.split(` `)}),mE.openedBy=new mE({deserialize:e=>e.split(` `)}),mE.group=new mE({deserialize:e=>e.split(` `)}),mE.isolate=new mE({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),mE.contextHash=new mE({perNode:!0}),mE.lookAhead=new mE({perNode:!0}),mE.mounted=new mE({perNode:!0}),hE=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[mE.mounted.id]}},gE=Object.create(null),_E=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):gE,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(mE.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(mE.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}},_E.none=new _E(``,Object.create(null),0,8),vE=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new _E(e.name,r,e.id,e.flags):e)}return new e(n)}},yE=new WeakMap,bE=new WeakMap,(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(xE||={}),SE=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=hE.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new AE(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new AE(yE.get(this)||this.topNode);return r.moveTo(e,t),yE.set(this,r._tree),r}get topNode(){return new EE(this,0,0,null)}resolve(e,t=0){let n=nE(yE.get(this)||this.topNode,e,t,!1);return yE.set(this,n),n}resolveInner(e,t=0){let n=nE(bE.get(this)||this.topNode,e,t,!0);return bE.set(this,n),n}resolveStack(e,t=0){return oE(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&xE.IncludeAnonymous)>0;for(let e=this.cursor(a|xE.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:uE(_E.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(_E.none,t,n,r)))}static build(e){return cE(e)}},SE.empty=new SE(_E.none,[],[],0),CE=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},wE=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return _E.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(tE(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}},TE=class{cursor(e=0){return new AE(this,e)}getChild(e,t=null,n=null){let r=rE(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return rE(this,e,t,n)}resolve(e,t=0){return nE(this,e,t,!1)}resolveInner(e,t=0){return nE(this,e,t,!0)}matchContext(e){return iE(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},EE=class e extends TE{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&xE.EnterBracketed&&l instanceof SE&&(d=hE.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!tE(i,r,u,u+l.length))){if(l instanceof wE){if(a&xE.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new OE(new DE(o,l,t,u),null,e)}else if(a&xE.IncludeAnonymous||!l.type.isAnonymous||sE(l)){let s;if(!(a&xE.IgnoreMounts)&&(s=hE.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&xE.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&xE.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&xE.IgnoreOverlays)&&(i=hE.get(this._tree))&&i.overlay){let a=t-this.from,o=r&xE.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}},DE=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},OE=class e extends TE{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&xE.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new SE(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}},kE=class{constructor(e,t){this.heads=e,this.node=t}get next(){return aE(this.heads)}},AE=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~xE.EnterBracketed,e instanceof EE)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof EE?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xE.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xE.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xE.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&xE.IncludeAnonymous||e instanceof wE||!e.type.isAnonymous||sE(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new OE(this.buffer,t,this.stack[e]);return this.bufferNode=new OE(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return iE(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return iE(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}},jE=new WeakMap,ME=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},NE=class{startParse(e,t,n){return typeof e==`string`&&(e=new PE(e)),n=n?n.length?n.map(e=>new pE(e.from,e.to)):[new pE(0,0)]:[new pE(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},PE=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}},new mE({perNode:!0})}));function IE(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function LE(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function RE(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new JE(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return qE.add(t)}function zE(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function BE(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function VE(e,t,n,r=0,i=e.length){let a=new YE(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}function HE(e){let t=e.type.prop(qE);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var UE,WE,GE,KE,qE,JE,YE,Y,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD,lD,X,uD=n((()=>{FE(),UE=0,WE=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=UE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new KE(e);return e=>e.modified.indexOf(t)>-1?e:KE.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},GE=0,KE=class e{constructor(e){this.name=e,this.instances=[],this.id=GE++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&IE(n,e.modified));if(r)return r;let i=[],a=new WE(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=LE(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}},qE=new mE({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new JE(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),JE=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}},JE.empty=new JE([],2,null),YE=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=HE(e)||JE.empty,u=BE(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(mE.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}},Y=WE.define,XE=Y(),ZE=Y(),QE=Y(ZE),$E=Y(ZE),eD=Y(),tD=Y(eD),nD=Y(eD),rD=Y(),iD=Y(rD),aD=Y(),oD=Y(),sD=Y(),cD=Y(sD),lD=Y(),X={comment:XE,lineComment:Y(XE),blockComment:Y(XE),docComment:Y(XE),name:ZE,variableName:Y(ZE),typeName:QE,tagName:Y(QE),propertyName:$E,attributeName:Y($E),className:Y(ZE),labelName:Y(ZE),namespace:Y(ZE),macroName:Y(ZE),literal:eD,string:tD,docString:Y(tD),character:Y(tD),attributeValue:Y(tD),number:nD,integer:Y(nD),float:Y(nD),bool:Y(eD),regexp:Y(eD),escape:Y(eD),color:Y(eD),url:Y(eD),keyword:aD,self:Y(aD),null:Y(aD),atom:Y(aD),unit:Y(aD),modifier:Y(aD),operatorKeyword:Y(aD),controlKeyword:Y(aD),definitionKeyword:Y(aD),moduleKeyword:Y(aD),operator:oD,derefOperator:Y(oD),arithmeticOperator:Y(oD),logicOperator:Y(oD),bitwiseOperator:Y(oD),compareOperator:Y(oD),updateOperator:Y(oD),definitionOperator:Y(oD),typeOperator:Y(oD),controlOperator:Y(oD),punctuation:sD,separator:Y(sD),bracket:cD,angleBracket:Y(cD),squareBracket:Y(cD),paren:Y(cD),brace:Y(cD),content:rD,heading:iD,heading1:Y(iD),heading2:Y(iD),heading3:Y(iD),heading4:Y(iD),heading5:Y(iD),heading6:Y(iD),contentSeparator:Y(rD),list:Y(rD),quote:Y(rD),emphasis:Y(rD),strong:Y(rD),link:Y(rD),monospace:Y(rD),strikethrough:Y(rD),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:lD,documentMeta:Y(lD),annotation:Y(lD),processingInstruction:Y(lD),definition:WE.defineModifier(`definition`),constant:WE.defineModifier(`constant`),function:WE.defineModifier(`function`),standard:WE.defineModifier(`standard`),local:WE.defineModifier(`local`),special:WE.defineModifier(`special`)};for(let e in X){let t=X[e];t instanceof WE&&(t.name=e)}zE([{tag:X.link,class:`tok-link`},{tag:X.heading,class:`tok-heading`},{tag:X.emphasis,class:`tok-emphasis`},{tag:X.strong,class:`tok-strong`},{tag:X.keyword,class:`tok-keyword`},{tag:X.atom,class:`tok-atom`},{tag:X.bool,class:`tok-bool`},{tag:X.url,class:`tok-url`},{tag:X.labelName,class:`tok-labelName`},{tag:X.inserted,class:`tok-inserted`},{tag:X.deleted,class:`tok-deleted`},{tag:X.literal,class:`tok-literal`},{tag:X.string,class:`tok-string`},{tag:X.number,class:`tok-number`},{tag:[X.regexp,X.escape,X.special(X.string)],class:`tok-string2`},{tag:X.variableName,class:`tok-variableName`},{tag:X.local(X.variableName),class:`tok-variableName tok-local`},{tag:X.definition(X.variableName),class:`tok-variableName tok-definition`},{tag:X.special(X.variableName),class:`tok-variableName2`},{tag:X.definition(X.propertyName),class:`tok-propertyName tok-definition`},{tag:X.typeName,class:`tok-typeName`},{tag:X.namespace,class:`tok-namespace`},{tag:X.className,class:`tok-className`},{tag:X.macroName,class:`tok-macroName`},{tag:X.propertyName,class:`tok-propertyName`},{tag:X.operator,class:`tok-operator`},{tag:X.comment,class:`tok-comment`},{tag:X.meta,class:`tok-meta`},{tag:X.invalid,class:`tok-invalid`},{tag:X.punctuation,class:`tok-punctuation`}])})),dD=i({DocInput:()=>OO,HighlightStyle:()=>lk,IndentContext:()=>BO,LRLanguage:()=>DO,Language:()=>EO,LanguageDescription:()=>LO,LanguageSupport:()=>IO,ParseContext:()=>AO,StreamLanguage:()=>Tk,StringStream:()=>Ck,TreeIndentContext:()=>HO,bidiIsolates:()=>xO,bracketMatching:()=>nO,bracketMatchingHandle:()=>Sk,codeFolding:()=>JD,continuedIndent:()=>ND,defaultHighlightStyle:()=>mk,defineLanguageFacet:()=>fD,delimitedIndent:()=>jD,ensureSyntaxTree:()=>hD,flatIndent:()=>UO,foldAll:()=>QO,foldCode:()=>XO,foldEffect:()=>qO,foldGutter:()=>XD,foldInside:()=>FD,foldKeymap:()=>tk,foldNodeProp:()=>KO,foldService:()=>GO,foldState:()=>YO,foldable:()=>RD,foldedRanges:()=>HD,forceParsing:()=>_D,getIndentUnit:()=>bD,getIndentation:()=>SD,highlightingFor:()=>$D,indentNodeProp:()=>VO,indentOnInput:()=>PD,indentRange:()=>CD,indentService:()=>RO,indentString:()=>xD,indentUnit:()=>zO,language:()=>FO,languageDataProp:()=>wO,matchBrackets:()=>aO,sublanguageProp:()=>TO,syntaxHighlighting:()=>QD,syntaxParserRunning:()=>vD,syntaxTree:()=>mD,syntaxTreeAvailable:()=>gD,toggleFold:()=>ek,unfoldAll:()=>$O,unfoldCode:()=>ZO,unfoldEffect:()=>JO});function fD(e){return W.define({combine:e?t=>t.concat(e):void 0})}function pD(e,t,n){let r=e.facet(FO),i=mD(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,xE.ExcludeBuffers|xE.EnterBracketed))e.type.isTop&&(i=e);return i}function mD(e){let t=e.field(EO.state,!1);return t?t.tree:SE.empty}function hD(e,t,n=50){let r=e.field(EO.state,!1)?.context;if(!r)return null;let i=r.viewport;r.updateViewport({from:0,to:t});let a=r.isDone(t)||r.work(n,t)?r.tree:null;return r.updateViewport(i),a}function gD(e,t=e.doc.length){return e.field(EO.state,!1)?.context.isDone(t)||!1}function _D(e,t=e.viewport.to,n=100){let r=hD(e.state,t,n);return r!=mD(e.state)&&e.dispatch({}),!!r}function vD(e){return e.plugin(PO)?.isWorking()||!1}function yD(e,t,n){return ME.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}function bD(e){let t=e.facet(zO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function xD(e,t){let n=``,r=e.tabSize,i=e.facet(zO)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function SD(e,t){e instanceof $_&&(e=new BO(e));for(let n of e.state.facet(RO)){let r=n(e,t);if(r!==void 0)return r}let n=mD(e.state);return n.length>=t?wD(e,n,t):null}function CD(e,t,n){let r=Object.create(null),i=new BO(e,{overrideIndentation:e=>r[e]??-1}),a=[];for(let o=t;o<=n;){let t=e.doc.lineAt(o);o=t.to+1;let n=SD(i,t.from);if(n==null)continue;/\S/.test(t.text)||(n=0);let s=/^\s*/.exec(t.text)[0],c=xD(e,n);s!=c&&(r[t.from]=n,a.push({from:t.from,to:t.from+s.length,insert:c}))}return e.changes(a)}function wD(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return TD(r,e,n)}function TD(e,t,n){for(let r=e;r;r=r.next){let e=DD(r.node);if(e)return e(HO.create(t,n,r))}return 0}function ED(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function DD(e){let t=e.type.prop(VO);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(mE.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>MD(e,!0,1,void 0,n&&!ED(e)?t.from:void 0)}return e.parent==null?OD:null}function OD(){return 0}function kD(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function AD(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function jD({closing:e,align:t=!0,units:n=1}){return r=>MD(r,t,n,e)}function MD(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?AD(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function ND({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}function PD(){return $_.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+WO)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=SD(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=xD(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}function FD(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function ID(e,t,n){let r=mD(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(KO);if(s&&(i.to<r.length-50||r.length==e.doc.length||!LD(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function LD(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function RD(e,t,n){for(let r of e.facet(GO)){let i=r(e,t,n);if(i)return i}return ID(e,t,n)}function zD(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}function BD(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}function VD(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function HD(e){return e.field(YO,!1)||rv.empty}function UD(e,t,n){var r;let i=null;return(r=e.field(YO,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function WD(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function GD(e,t){return e.field(YO,!1)?t:t.concat(G.appendConfig.of(JD()))}function KD(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return J.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}function qD(e,t){for(let n=t;;){let r=RD(e.state,n.from,n.to);if(r&&r.to>t.from)return r;if(!n.from)return null;n=e.lineBlockAt(n.from-1)}}function JD(e){let t=[YO,ck];return e&&t.push(rk.of(e)),t}function YD(e,t){let{state:n}=e,r=n.facet(rk),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=UD(e.state,n.from,n.to);r&&e.dispatch({effects:JO.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}function XD(e={}){let t={...ok,...e},n=new sk(t,!0),r=new sk(t,!1),i=US.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(FO)!=e.state.facet(FO)||e.startState.field(YO,!1)!=e.state.field(YO,!1)||mD(e.startState)!=mD(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new iv;for(let i of e.viewportLineBlocks){let a=UD(e.state,i.from,i.to)?r:RD(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,Px({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||rv.empty},initialSpacer(){return new sk(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=UD(e.state,t.from,t.to);if(r)return e.dispatch({effects:JO.of(r)}),!0;let i=RD(e.state,t.from,t.to);return i?(e.dispatch({effects:qO.of(i)}),!0):!1}}}),JD()]}function ZD(e){let t=e.facet(uk);return t.length?t:e.facet(dk)}function QD(e,t){let n=[pk],r;return e instanceof lk&&(e.module&&n.push(J.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(dk.of(e)):r?n.push(uk.computeN([J.darkTheme],t=>t.facet(J.darkTheme)==(r==`dark`)?[e]:[])):n.push(uk.of(e)),n}function $D(e,t,n){let r=ZD(e),i=null;if(r){for(let e of r)if(!e.scope||n&&e.scope(n)){let n=e.style(t);n&&(i=i?i+` `+n:n)}}return i}function eO(e){let t=[],n=e.matched?yk:bk;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function tO(e){let t=[],n=e.facet(vk);for(let r of e.selection.ranges){if(!r.empty)continue;let i=aO(e,r.head,-1,n)||r.head>0&&aO(e,r.head-1,1,n)||n.afterCursor&&(aO(e,r.head,1,n)||r.head<e.doc.length&&aO(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return q.set(t,!0)}function nO(e={}){return[vk.of(e),xk]}function rO(e,t,n){let r=e.prop(t<0?mE.openedBy:mE.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function iO(e){let t=e.type.prop(Sk);return t?t(e.node):e}function aO(e,t,n,r={}){let i=r.maxScanDistance||gk,a=r.brackets||_k,o=mD(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=rO(r.type,n,a);if(i&&r.from<r.to){let o=iO(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return oO(e,t,n,r,o,i,a)}}return sO(e,t,n,o,s.type,i,a)}function oO(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=iO(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(rO(u.type,n,o))l++;else if(rO(u.type,-n,o)){if(l==0){let e=iO(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function sO(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}function cO(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}function lO(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||uO,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||Dk,mergeTokens:e.mergeTokens!==!1}}function uO(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}function dO(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof SE&&s<i&&dO(e,o,s,r,i);if(c)return c}return null}function fO(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof SE){if(!(c=fO(e,s,n-o,r-o,i)))break;return i?new SE(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function pO(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&dO(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=fO(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?bD(i):4),tree:SE.empty}}function mO(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}function hO(e,t){Ak.indexOf(e)>-1||(Ak.push(e),console.warn(t))}function gO(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||X[n];r?typeof r==`function`?t.length?t=t.map(r):hO(n,`Modifier ${n} used at start of tag`):t.length?hO(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:hO(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=jk[i];if(a)return a.id;let o=jk[i]=_E.define({id:Ok.length,name:r,props:[RE({[r]:n})]});return Ok.push(o),o.id}function _O(e,t){let n=_E.define({id:Ok.length,name:`Document`,props:[wO.add(()=>e),VO.add(()=>e=>t.getIndent(e))],top:!0});return Ok.push(n),n}function vO(e){return e.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(e)}function yO(e){for(let t=e.iter();!t.next().done;)if(vO(t.value))return!0;return!1}function bO(e){let t=!1;return e.iterChanges((e,n,r,i,a)=>{!t&&yO(a)&&(t=!0)}),t}function xO(e={}){let t=[Ik];return e.alwaysIsolate&&t.push(Fk.of(!0)),t}function SO(e,t,n){let r=new iv,i=e.visibleRanges;n||(i=CO(i,e.state.doc));for(let{from:e,to:n}of i)t.iterate({enter:e=>{let t=e.type.prop(mE.isolate);t&&r.add(e.from,e.to,Lk[t])},from:e,to:n});return r.finish()}function CO(e,t){let n=t.iter(),r=0,i=[],a=null;for(let{from:t,to:o}of e)if(!(a&&a.to>t&&(t=a.to,t>=o)))for(r+n.value.length<t&&(n.next(t-(r+n.value.length)),r=t);;){let e=r,t=r+n.value.length;if(!n.lineBreak&&vO(n.value)&&(a&&a.to>e-10?a.to=Math.min(o,t):i.push(a={from:e,to:Math.min(o,t)})),t>=o)break;r=t,n.next()}return i}var wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok,sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok,kk,Ak,jk,Mk,Nk,Pk,Fk,Ik,Lk,Rk=n((()=>{FE(),cv(),eE(),uD(),gv(),wO=new mE,TO=new mE,EO=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,$_.prototype.hasOwnProperty(`tree`)||Object.defineProperty($_.prototype,`tree`,{get(){return mD(this)}}),this.parser=t,this.extension=[FO.of(this),$_.languageData.of((e,t,n)=>{let r=pD(e,t,n),i=r.type.prop(wO);if(!i)return[];let a=e.facet(i),o=r.type.prop(TO);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return pD(e,t,n).type.prop(wO)==this.data}findRegions(e){let t=e.facet(FO);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(wO)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(mE.mounted);if(i){if(i.tree.prop(wO)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof SE&&r(i,e.positions[n]+t)}};return r(mD(e),0),n}get allowsNesting(){return!0}},EO.setState=G.define(),DO=class e extends EO{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=fD(t.languageData);return new e(n,t.parser.configure({props:[wO.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}},OO=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},kO=null,AO=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],SE.empty,0,r,[],null)}startParse(){return this.parser.startParse(new OO(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=SE.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(ME.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ME.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=kO;kO=this;try{return e()}finally{kO=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=yD(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=ME.applyChanges(r,e),i=SE.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=yD(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends NE{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=kO;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new SE(_E.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return kO}},jO=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=AO.create(t.facet(FO).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}},EO.state=j_.define({create:jO.init,update(e,t){for(let e of t.effects)if(e.is(EO.setState))return e.value;return t.startState.facet(FO)==t.state.facet(FO)?e.apply(t):jO.init(t.state)}}),MO=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)},typeof requestIdleCallback<`u`&&(MO=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)}),NO=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,PO=US.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(EO.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(EO.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=MO(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(EO.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!NO?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>NO&&NO()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:EO.setState.of(new jO(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>gy(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),FO=W.define({combine(e){return e.length?e[0]:null},enables:e=>[EO.state,PO,J.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),IO=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},LO=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},RO=W.define(),zO=W.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}}),BO=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=bD(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return p_(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},VO=new mE,HO=class e extends BO{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(kD(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return TD(this.context.next,this.base,this.pos)}},UO=e=>e.baseIndent,WO=200,GO=W.define(),KO=new mE,qO=G.define({map:zD}),JO=G.define({map:zD}),YO=j_.define({create(){return q.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=VD(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(qO)&&!WD(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(rk),i=r?q.replace({widget:new ak(r(t.state,n.value))}):ik;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(JO)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=VD(e,t.selection.main.head)),e},provide:e=>J.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(ik.range(r,i))}return q.set(t,!0)}}),XO=e=>{for(let t of BD(e)){let n=RD(e.state,t.from,t.to);if(n)return e.dispatch({effects:GD(e.state,[qO.of(n),KD(e,n)])}),!0}return!1},ZO=e=>{if(!e.state.field(YO,!1))return!1;let t=[];for(let n of BD(e)){let r=UD(e.state,n.from,n.to);r&&t.push(JO.of(r),KD(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0},QO=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=RD(t,i.from,i.to);a&&n.push(qO.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:GD(e.state,n)}),!!n.length},$O=e=>{let t=e.state.field(YO,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(JO.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},ek=e=>{let t=[];for(let n of BD(e)){let r=UD(e.state,n.from,n.to);if(r)t.push(JO.of(r),KD(e,r,!1));else{let r=qD(e,n);r&&t.push(qO.of(r),KD(e,r))}}return t.length>0&&e.dispatch({effects:GD(e.state,t)}),!!t.length},tk=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:XO},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:ZO},{key:`Ctrl-Alt-[`,run:QO},{key:`Ctrl-Alt-]`,run:$O}],nk={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},rk=W.define({combine(e){return n_(e,nk)}}),ik=q.replace({widget:new class extends iS{toDOM(e){return YD(e,null)}}}),ak=class extends iS{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return YD(e,this.value)}},ok={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},sk=class extends MT{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}},ck=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),lk=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=pv.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof EO?e=>e.prop(wO)==a.data:a?e=>e==a:void 0,this.style=zE(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new pv(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},uk=W.define(),dk=W.define({combine(e){return e.length?[e[0]]:null}}),fk=class{constructor(e){this.markCache=Object.create(null),this.tree=mD(e.state),this.decorations=this.buildDeco(e,ZD(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=mD(e.state),n=ZD(e.state),r=n!=ZD(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return q.none;let n=new iv;for(let{from:r,to:i}of e.visibleRanges)VE(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=q.mark({class:r})))},r,i);return n.finish()}},pk=N_.high(US.fromClass(fk,{decorations:e=>e.decorations})),mk=lk.define([{tag:X.meta,color:`#404740`},{tag:X.link,textDecoration:`underline`},{tag:X.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:X.emphasis,fontStyle:`italic`},{tag:X.strong,fontWeight:`bold`},{tag:X.strikethrough,textDecoration:`line-through`},{tag:X.keyword,color:`#708`},{tag:[X.atom,X.bool,X.url,X.contentSeparator,X.labelName],color:`#219`},{tag:[X.literal,X.inserted],color:`#164`},{tag:[X.string,X.deleted],color:`#a11`},{tag:[X.regexp,X.escape,X.special(X.string)],color:`#e40`},{tag:X.definition(X.variableName),color:`#00f`},{tag:X.local(X.variableName),color:`#30a`},{tag:[X.typeName,X.namespace],color:`#085`},{tag:X.className,color:`#167`},{tag:[X.special(X.variableName),X.macroName],color:`#256`},{tag:X.definition(X.propertyName),color:`#00c`},{tag:X.comment,color:`#940`},{tag:X.invalid,color:`#f00`}]),hk=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),gk=1e4,_k=`()[]{}`,vk=W.define({combine(e){return n_(e,{afterCursor:!0,brackets:_k,maxScanDistance:gk,renderMatch:eO})}}),yk=q.mark({class:`cm-matchingBracket`}),bk=q.mark({class:`cm-nonmatchingBracket`}),xk=[US.fromClass(class{constructor(e){this.paused=!1,this.decorations=tO(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=tO(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),hk],Sk=new mE,Ck=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=cO(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??cO(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}},wk=new WeakMap,Tk=class e extends EO{constructor(e){let t=fD(e.languageData),n=lO(e),r,i=new class extends NE{createParse(e,t,n){return new Ek(r,e,t,n)}};super(t,i,[],e.name),this.topNode=_O(t,this),r=this,this.streamParser=n,this.stateAfter=new mE({perNode:!0}),this.tokenTable=e.tokenTable?new Nk(n.tokenTable):Pk}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=wk.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=dO(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new Ck(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)mO(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&wk.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}},Ek=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=AO.get(),a=r[0].from,{state:o,tree:s}=pO(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(bD(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=AO.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
+`&&(t=``);else{let e=t.indexOf(`
+`);e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new Ck(t,e?e.state.tabSize:4,e?bD(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=mO(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=SE.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:kk,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new SE(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new SE(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}},Dk=Object.create(null),Ok=[_E.none],kk=new vE(Ok),Ak=[],jk=Object.create(null),Mk=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])Mk[e]=gO(Dk,t);Nk=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Mk)}resolve(e){return e?this.table[e]||(this.table[e]=gO(this.extra,e)):0}},Pk=new Nk(Dk),Fk=W.define({combine:e=>e.some(e=>e)}),Ik=US.fromClass(class{constructor(e){this.always=e.state.facet(Fk)||e.textDirection!=mS.LTR||e.state.facet(J.perLineTextDirection),this.hasRTL=!this.always&&yO(e.state.doc),this.tree=mD(e.state),this.decorations=this.always||this.hasRTL?SO(e,this.tree,this.always):q.none}update(e){let t=e.state.facet(Fk)||e.view.textDirection!=mS.LTR||e.state.facet(J.perLineTextDirection);if(!t&&!this.hasRTL&&bO(e.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let n=mD(e.state);(t!=this.always||n!=this.tree||e.docChanged||e.viewportChanged)&&(this.tree=n,this.always=t,this.decorations=SO(e.view,n,t))}},{provide:e=>{function t(t){return t.plugin(e)?.decorations??q.none}return[J.outerDecorations.of(t),N_.lowest(J.bidiIsolatedRanges.of(t))]}}),Lk={rtl:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`rtl`},bidiIsolate:mS.RTL}),ltr:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`ltr`},bidiIsolate:mS.LTR}),auto:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`auto`},bidiIsolate:null})}}));eE(),Rk(),uD();var zk=sg,Bk=cg(`gray`,1),Vk=cg(`yin`,3),Hk=cg(`gray`,1),Uk=cg(`gray`,6),Wk=cg(`yellow`,1),Gk=J.theme({"&":{backgroundColor:zk,color:Vk},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-matchingBracket":{backgroundColor:cg(`gray`,1)},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:Wk},".cm-activeLine":{backgroundColor:cg(`gray`,1)},".cm-activeLineGutter":{backgroundColor:`transparent`,color:Vk},".cm-content":{padding:0},".cm-gutters":{backgroundColor:Hk,border:`none`,borderRight:`1px solid ${Bk}`,color:Uk},".cm-lineNumbers .cm-gutterElement":{padding:`0 5px 0 15px`},".cm-lintPoint::after":{borderBottomColor:cg(`red`,5)},".cm-matchingBracket":{backgroundColor:cg(`gray`,1),color:cg(`yin`,8),outline:`none`},".cm-scroller":{fontSize:`0.8rem`,lineHeight:1.3},".cm-selectionBackground, &.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{backgroundColor:Wk}},{dark:!1}),Kk=J.theme({"&":{caretColor:`transparent`},"& .cm-cursor":{borderLeftColor:cg(`blue`,5),borderLeftStyle:`solid`,borderLeftWidth:`1ch`,marginLeft:`0`},"& .cm-cursorLayer":{mixBlendMode:`hard-light`,zIndex:`auto`},"& .cm-scroller":{isolation:`isolate`}}),qk=lk.define([{color:cg(`yin`,8),tag:[X.atom,X.attributeName,X.bool,X.character,X.className,X.comment,X.deleted,X.documentMeta,X.keyword,X.heading,X.labelName,X.link,X.macroName,X.meta,X.name,X.null,X.operator,X.operatorKeyword,X.propertyName,X.tagName,X.typeName,X.variableName]},{backgroundColor:cg(`green`,1),color:cg(`green`,9),tag:[X.string,X.special(X.string)]},{color:cg(`purple`,4),tag:[X.number]},{fontStyle:`italic`,tag:[X.comment,X.emphasis]},{fontWeight:`bold`,tag:[X.strong]},{tag:X.strikethrough,textDecoration:`line-through`}]),Jk=[$b(),Gk,QD(qk),Kk],Yk=i({addCursorAbove:()=>EM,addCursorBelow:()=>DM,blockComment:()=>QA,blockUncomment:()=>$A,copyLineDown:()=>qM,copyLineUp:()=>KM,cursorCharBackward:()=>Cj,cursorCharBackwardLogical:()=>Tj,cursorCharForward:()=>Sj,cursorCharForwardLogical:()=>wj,cursorCharLeft:()=>bj,cursorCharRight:()=>xj,cursorDocEnd:()=>bM,cursorDocStart:()=>yM,cursorGroupBackward:()=>kj,cursorGroupForward:()=>Oj,cursorGroupForwardWin:()=>Aj,cursorGroupLeft:()=>Ej,cursorGroupRight:()=>Dj,cursorLineBoundaryBackward:()=>Vj,cursorLineBoundaryForward:()=>Bj,cursorLineBoundaryLeft:()=>Hj,cursorLineBoundaryRight:()=>Uj,cursorLineDown:()=>Lj,cursorLineEnd:()=>Gj,cursorLineStart:()=>Wj,cursorLineUp:()=>Ij,cursorMatchingBracket:()=>Kj,cursorPageDown:()=>zj,cursorPageUp:()=>Rj,cursorSubwordBackward:()=>Nj,cursorSubwordForward:()=>Mj,cursorSyntaxLeft:()=>Pj,cursorSyntaxRight:()=>Fj,defaultKeymap:()=>sN,deleteCharBackward:()=>AM,deleteCharBackwardStrict:()=>jM,deleteCharForward:()=>MM,deleteGroupBackward:()=>PM,deleteGroupForward:()=>FM,deleteGroupForwardWin:()=>IM,deleteLine:()=>JM,deleteLineBoundaryBackward:()=>zM,deleteLineBoundaryForward:()=>BM,deleteToLineEnd:()=>LM,deleteToLineStart:()=>RM,deleteTrailingWhitespace:()=>VM,emacsStyleKeymap:()=>aN,history:()=>nA,historyField:()=>sj,historyKeymap:()=>yj,indentLess:()=>tN,indentMore:()=>eN,indentSelection:()=>$M,indentWithTab:()=>cN,insertBlankLine:()=>QM,insertNewline:()=>YM,insertNewlineAndIndent:()=>ZM,insertNewlineKeepIndent:()=>XM,insertTab:()=>iN,invertedEffects:()=>ij,isolateHistory:()=>rj,lineComment:()=>YA,lineUncomment:()=>XA,moveLineDown:()=>GM,moveLineUp:()=>WM,redo:()=>lj,redoDepth:()=>pj,redoSelection:()=>dj,selectAll:()=>CM,selectCharBackward:()=>Zj,selectCharBackwardLogical:()=>$j,selectCharForward:()=>Xj,selectCharForwardLogical:()=>Qj,selectCharLeft:()=>Jj,selectCharRight:()=>Yj,selectDocEnd:()=>SM,selectDocStart:()=>xM,selectGroupBackward:()=>rM,selectGroupForward:()=>nM,selectGroupForwardWin:()=>iM,selectGroupLeft:()=>eM,selectGroupRight:()=>tM,selectLine:()=>wM,selectLineBoundaryBackward:()=>mM,selectLineBoundaryForward:()=>pM,selectLineBoundaryLeft:()=>hM,selectLineBoundaryRight:()=>gM,selectLineDown:()=>uM,selectLineEnd:()=>vM,selectLineStart:()=>_M,selectLineUp:()=>lM,selectMatchingBracket:()=>qj,selectPageDown:()=>fM,selectPageUp:()=>dM,selectParentSyntax:()=>TM,selectSubwordBackward:()=>oM,selectSubwordForward:()=>aM,selectSyntaxLeft:()=>sM,selectSyntaxRight:()=>cM,simplifySelection:()=>OM,splitLine:()=>HM,standardKeymap:()=>oN,temporarilySetTabFocusMode:()=>rN,toggleBlockComment:()=>ZA,toggleBlockCommentByLine:()=>ej,toggleComment:()=>qA,toggleLineComment:()=>JA,toggleTabFocusMode:()=>nN,transposeChars:()=>UM,undo:()=>cj,undoDepth:()=>fj,undoSelection:()=>uj});function Xk(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}function Zk(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}function Qk(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-tj,r),o=e.sliceDoc(i,i+tj),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*tj?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+tj),d=e.sliceDoc(i-tj,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function $k(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function eA(e,t,n=t.selection.ranges){let r=n.map(e=>Zk(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Qk(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function tA(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Zk(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}function nA(e={}){return[oj,aj.of(e),J.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?cj:e.inputType==`historyRedo`?lj:null;return n?(e.preventDefault(),n(t)):!1}})]}function rA(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(oj,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}function iA(e){return function(t){let n=t.field(oj,!1);if(!n)return 0;let r=e==0?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}function aA(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function oA(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function sA(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function cA(e,t){return e.length?t.length?e.concat(t):e:t}function lA(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gj));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),aA(e,e.length-1,1e9,n.setSelAfter(r)))}else return[mj.selection([t])]}function uA(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function dA(e,t){if(!e.length)return e;let n=e.length,r=hj;for(;n;){let i=fA(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[mj.selection(r)]:hj}function fA(e,t,n){let r=cA(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):hj,n);if(!e.changes)return mj.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new mj(i,G.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}function pA(e,t){return U.create(e.ranges.map(t),e.mainIndex)}function mA(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function hA({state:e,dispatch:t},n){let r=pA(e.selection,n);return r.eq(e.selection,!0)?!1:(t(mA(e,r)),!0)}function gA(e,t){return U.cursor(t?e.to:e.from)}function _A(e,t){return hA(e,n=>n.empty?e.moveByChar(n,t):gA(n,t))}function vA(e){return e.textDirectionAt(e.state.selection.main.head)==mS.LTR}function yA(e,t,n){let r=t.head,i=e.doc.lineAt(r);return r=r==(n?i.to:i.from)?n?Math.min(e.doc.length,i.to+1):Math.max(0,i.from-1):i.from+Dg(i.text,r-i.from,n),U.cursor(r,n?-1:1)}function bA(e,t){return hA(e,n=>n.empty?yA(e.state,n,t):gA(n,t))}function xA(e,t){return hA(e,n=>n.empty?e.moveByGroup(n,t):gA(n,t))}function SA(e,t,n){let r=e.state.charCategorizer(t),i=r(n),a=i!=X_.Space;return e=>{let t=r(e);return t==X_.Space?(a=!1,!0):a&&t==i}}function CA(e,t,n){let r=e.state.charCategorizer(t.from),i=X_.Space,a=t.from,o=0,s=!1,c=!1,l=!1,u=t=>{if(s)return!1;a+=n?t.length:-t.length;let u=r(t),d;if(u==X_.Word&&t.charCodeAt(0)<128&&/[\W_]/.test(t)&&(u=-1),i==X_.Space&&(i=u),i!=u)return!1;if(i==X_.Word)if(t.toLowerCase()==t){if(!n&&c)return!1;l=!0}else if(l){if(n)return!1;s=!0}else{if(c&&n&&r(d=e.state.sliceDoc(a,a+1))==X_.Word&&d.toLowerCase()==d)return!1;c=!0}return o++,!0},d=e.moveByChar(t,n,e=>(u(e),u));if(jj&&i==X_.Word&&d.from==t.from+o*(n?1:-1)){let r=Math.min(t.head,d.head),i=Math.max(t.head,d.head),a=e.state.sliceDoc(r,i);if(a.length>1&&/[\u4E00-\uffff]/.test(a)){let e=Array.from(jj.segment(a));if(e.length>1)return n?U.cursor(t.head+e[1].index,-1):U.cursor(d.head+e[e.length-1].index,1)}}return d}function wA(e,t){return hA(e,n=>n.empty?CA(e,n,t):gA(n,t))}function TA(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function EA(e,t,n){let r=mD(e).resolveInner(t.head),i=n?mE.closedBy:mE.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;TA(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?aO(e,r.from,1):aO(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,U.cursor(s,n?-1:1)}function DA(e,t){return hA(e,n=>{if(!n.empty)return gA(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}function OA(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(J.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function kA(e,t){let n=OA(e),{state:r}=e,i=pA(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):gA(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=J.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(mA(r,i),{effects:a}),!0}function AA(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=U.cursor(r.from+n))}return i}function jA(e,t,n){let r=!1,i=pA(e.selection,t=>{let i=aO(e,t.head,-1)||aO(e,t.head,1)||t.head>0&&aO(e,t.head-1,1)||t.head<e.doc.length&&aO(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?U.range(t.anchor,a):U.cursor(a)});return r?(t(mA(e,i)),!0):!1}function MA(e,t){let n=pA(e.state.selection,e=>{let n=t(e);return U.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(mA(e.state,n)),!0)}function NA(e,t){return MA(e,n=>e.moveByChar(n,t))}function PA(e,t){return MA(e,n=>e.moveByGroup(n,t))}function FA(e,t){return MA(e,n=>CA(e,n,t))}function IA(e,t){return MA(e,n=>e.moveVertically(n,t))}function LA(e,t){return MA(e,n=>e.moveVertically(n,t,OA(e).height))}function RA(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(mA(n,U.create(i,i.length-1))),!0)}function zA(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=BA(e,o,!1)):o>i&&(n=`delete.forward`,o=BA(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=BA(e,i,!1),a=BA(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:U.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?J.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function BA(e,t,n){if(e instanceof J)for(let r of e.state.facet(J.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}function VA(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function HA(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of VA(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(U.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(U.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:U.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}function UA(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of VA(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}function WA(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=mD(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(mE.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}function GA(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&WA(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new BO(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=SD(s,r);for(c??=p_(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,xD(t,c)];return o&&l.push(xD(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:h_.of(l)},range:U.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function KA(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:U.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM,tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,tN,nN,rN,iN,aN,oN,sN,cN,lN=n((()=>{cv(),eE(),Rk(),FE(),qA=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Zk(e.state,n.from);return r.line?JA(e):r.block?ej(e):!1},JA=Xk(tA,0),YA=Xk(tA,1),XA=Xk(tA,2),ZA=Xk(eA,0),QA=Xk(eA,1),$A=Xk(eA,2),ej=Xk((e,t)=>eA(e,t,$k(t)),0),tj=50,nj=G_.define(),rj=G_.define(),ij=W.define(),aj=W.define({combine(e){return n_(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),oj=j_.define({create(){return vj.empty},update(e,t){let n=t.state.facet(aj),r=t.annotation(nj);if(r){let i=mj.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?aA(o,o.length,n.minDepth,i):lA(o,t.startState.selection),new vj(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(rj);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(J_.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=mj.fromTransaction(t),o=t.annotation(J_.time),s=t.annotation(J_.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new vj(e.done.map(mj.fromJSON),e.undone.map(mj.fromJSON))}}),sj=oj,cj=rA(0,!1),lj=rA(1,!1),uj=rA(0,!0),dj=rA(1,!0),fj=iA(0),pj=iA(1),mj=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&T_.fromJSON(t.changes),[],t.mapped&&w_.fromJSON(t.mapped),t.startSelection&&U.fromJSON(t.startSelection),t.selectionsAfter.map(U.fromJSON))}static fromTransaction(t,n){let r=hj;for(let e of t.startState.facet(ij)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,hj)}static selection(t){return new e(void 0,hj,void 0,void 0,t)}},hj=[],gj=200,_j=/^(input\.type|delete)($|\.)/,vj=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||_j.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,oA(s.changes,t.changes))||r==`input.type.compose`)?aA(o,o.length-1,i.minDepth,new mj(t.changes.compose(s.changes),cA(G.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,hj)):aA(o,o.length,i.minDepth,t),new e(o,hj,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:hj;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&sA(a[a.length-1],t)?this:new e(lA(this.done,t),this.undone,n,r)}addMapping(t){return new e(dA(this.done,t),dA(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:nj.of({side:e,rest:uA(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?hj:r.slice(0,r.length-1);return i.mapped&&(n=dA(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:nj.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}},vj.empty=new vj(hj,hj),yj=[{key:`Mod-z`,run:cj,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:lj,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:lj,preventDefault:!0},{key:`Mod-u`,run:uj,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:dj,preventDefault:!0}],bj=e=>_A(e,!vA(e)),xj=e=>_A(e,vA(e)),Sj=e=>_A(e,!0),Cj=e=>_A(e,!1),wj=e=>bA(e,!0),Tj=e=>bA(e,!1),Ej=e=>xA(e,!vA(e)),Dj=e=>xA(e,vA(e)),Oj=e=>xA(e,!0),kj=e=>xA(e,!1),Aj=e=>hA(e,t=>t.empty?e.moveByChar(t,!0,n=>SA(e,t.head,n)):gA(t,!0)),jj=typeof Intl<`u`&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:`word`}):null,Mj=e=>wA(e,!0),Nj=e=>wA(e,!1),Pj=e=>hA(e,t=>EA(e.state,t,!vA(e))),Fj=e=>hA(e,t=>EA(e.state,t,vA(e))),Ij=e=>DA(e,!1),Lj=e=>DA(e,!0),Rj=e=>kA(e,!1),zj=e=>kA(e,!0),Bj=e=>hA(e,t=>AA(e,t,!0)),Vj=e=>hA(e,t=>AA(e,t,!1)),Hj=e=>hA(e,t=>AA(e,t,!vA(e))),Uj=e=>hA(e,t=>AA(e,t,vA(e))),Wj=e=>hA(e,t=>U.cursor(e.lineBlockAt(t.head).from,1)),Gj=e=>hA(e,t=>U.cursor(e.lineBlockAt(t.head).to,-1)),Kj=({state:e,dispatch:t})=>jA(e,t,!1),qj=({state:e,dispatch:t})=>jA(e,t,!0),Jj=e=>NA(e,!vA(e)),Yj=e=>NA(e,vA(e)),Xj=e=>NA(e,!0),Zj=e=>NA(e,!1),Qj=e=>MA(e,t=>yA(e.state,t,!0)),$j=e=>MA(e,t=>yA(e.state,t,!1)),eM=e=>PA(e,!vA(e)),tM=e=>PA(e,vA(e)),nM=e=>PA(e,!0),rM=e=>PA(e,!1),iM=e=>MA(e,t=>e.moveByChar(t,!0,n=>SA(e,t.head,n))),aM=e=>FA(e,!0),oM=e=>FA(e,!1),sM=e=>MA(e,t=>EA(e.state,t,!vA(e))),cM=e=>MA(e,t=>EA(e.state,t,vA(e))),lM=e=>IA(e,!1),uM=e=>IA(e,!0),dM=e=>LA(e,!1),fM=e=>LA(e,!0),pM=e=>MA(e,t=>AA(e,t,!0)),mM=e=>MA(e,t=>AA(e,t,!1)),hM=e=>MA(e,t=>AA(e,t,!vA(e))),gM=e=>MA(e,t=>AA(e,t,vA(e))),_M=e=>MA(e,t=>U.cursor(e.lineBlockAt(t.head).from)),vM=e=>MA(e,t=>U.cursor(e.lineBlockAt(t.head).to)),yM=({state:e,dispatch:t})=>(t(mA(e,{anchor:0})),!0),bM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.doc.length})),!0),xM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.selection.main.anchor,head:0})),!0),SM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),CM=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),wM=({state:e,dispatch:t})=>{let n=VA(e).map(({from:t,to:n})=>U.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:U.create(n),userEvent:`select`})),!0},TM=({state:e,dispatch:t})=>{let n=pA(e.selection,t=>{let n=mD(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return U.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(mA(e,n)),!0)},EM=e=>RA(e,!1),DM=e=>RA(e,!0),OM=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=U.create([n.main]):n.main.empty||(r=U.create([U.cursor(n.main.head)])),r?(t(mA(e,r)),!0):!1},kM=(e,t,n)=>zA(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=p_(s,a.tabSize)%bD(a)||bD(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Dg(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Dg(o.text,c-o.from,!1,!1)+o.from);return c}),AM=e=>kM(e,!1,!0),jM=e=>kM(e,!1,!1),MM=e=>kM(e,!0,!1),NM=(e,t)=>zA(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Dg(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),PM=e=>NM(e,!1),FM=e=>NM(e,!0),IM=e=>zA(e,t=>e.moveByChar(t,!0,n=>SA(e,t.head,n)).head),LM=e=>zA(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),RM=e=>zA(e,t=>{let n=e.lineBlockAt(t.head).from;return t.head>n?n:Math.max(0,t.head-1)}),zM=e=>zA(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),BM=e=>zA(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),VM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let t=0,r=``,i=e.doc.iter();;){if(i.next(),i.lineBreak||i.done){let e=r.search(/\s+$/);if(e>-1&&n.push({from:t-(r.length-e),to:t}),i.done)break;r=``}else r=i.value;t+=i.value.length}return n.length?(t(e.update({changes:n,userEvent:`delete`})),!0):!1},HM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:h_.of([``,``])},range:U.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},UM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Dg(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Dg(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:U.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)},WM=({state:e,dispatch:t})=>HA(e,t,!1),GM=({state:e,dispatch:t})=>HA(e,t,!0),KM=({state:e,dispatch:t})=>UA(e,t,!1),qM=({state:e,dispatch:t})=>UA(e,t,!0),JM=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(VA(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=pA(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0},YM=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:`input`})),!0),XM=({state:e,dispatch:t})=>(t(e.update(e.changeByRange(t=>{let n=/^\s*/.exec(e.doc.lineAt(t.from).text)[0];return{changes:{from:t.from,to:t.to,insert:e.lineBreak+n},range:U.cursor(t.from+n.length+1)}}),{scrollIntoView:!0,userEvent:`input`})),!0),ZM=GA(!1),QM=GA(!0),$M=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new BO(e,{overrideIndentation:e=>n[e]??-1}),i=KA(e,(t,i,a)=>{let o=SD(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=xD(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},eN=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(KA(e,(t,n)=>{n.push({from:t.from,insert:e.facet(zO)})}),{userEvent:`input.indent`})),!0),tN=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(KA(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=p_(r,e.tabSize),a=0,o=xD(e,Math.max(0,i-bD(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),nN=e=>(e.setTabFocusMode(),!0),rN=e=>(e.setTabFocusMode(2e3),!0),iN=({state:e,dispatch:t})=>e.selection.ranges.some(e=>!e.empty)?eN({state:e,dispatch:t}):(t(e.update(e.replaceSelection(` `),{scrollIntoView:!0,userEvent:`input`})),!0),aN=[{key:`Ctrl-b`,run:bj,shift:Jj,preventDefault:!0},{key:`Ctrl-f`,run:xj,shift:Yj},{key:`Ctrl-p`,run:Ij,shift:lM},{key:`Ctrl-n`,run:Lj,shift:uM},{key:`Ctrl-a`,run:Wj,shift:_M},{key:`Ctrl-e`,run:Gj,shift:vM},{key:`Ctrl-d`,run:MM},{key:`Ctrl-h`,run:AM},{key:`Ctrl-k`,run:LM},{key:`Ctrl-Alt-h`,run:PM},{key:`Ctrl-o`,run:HM},{key:`Ctrl-t`,run:UM},{key:`Ctrl-v`,run:zj}],oN=[{key:`ArrowLeft`,run:bj,shift:Jj,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Ej,shift:eM,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Hj,shift:hM,preventDefault:!0},{key:`ArrowRight`,run:xj,shift:Yj,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Dj,shift:tM,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Uj,shift:gM,preventDefault:!0},{key:`ArrowUp`,run:Ij,shift:lM,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:yM,shift:xM},{mac:`Ctrl-ArrowUp`,run:Rj,shift:dM},{key:`ArrowDown`,run:Lj,shift:uM,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:bM,shift:SM},{mac:`Ctrl-ArrowDown`,run:zj,shift:fM},{key:`PageUp`,run:Rj,shift:dM},{key:`PageDown`,run:zj,shift:fM},{key:`Home`,run:Vj,shift:mM,preventDefault:!0},{key:`Mod-Home`,run:yM,shift:xM},{key:`End`,run:Bj,shift:pM,preventDefault:!0},{key:`Mod-End`,run:bM,shift:SM},{key:`Enter`,run:ZM,shift:ZM},{key:`Mod-a`,run:CM},{key:`Backspace`,run:AM,shift:AM,preventDefault:!0},{key:`Delete`,run:MM,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:PM,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:FM,preventDefault:!0},{mac:`Mod-Backspace`,run:zM,preventDefault:!0},{mac:`Mod-Delete`,run:BM,preventDefault:!0}].concat(aN.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),sN=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Pj,shift:sM},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Fj,shift:cM},{key:`Alt-ArrowUp`,run:WM},{key:`Shift-Alt-ArrowUp`,run:KM},{key:`Alt-ArrowDown`,run:GM},{key:`Shift-Alt-ArrowDown`,run:qM},{key:`Mod-Alt-ArrowUp`,run:EM},{key:`Mod-Alt-ArrowDown`,run:DM},{key:`Escape`,run:OM},{key:`Mod-Enter`,run:QM},{key:`Alt-l`,mac:`Ctrl-l`,run:wM},{key:`Mod-i`,run:TM,preventDefault:!0},{key:`Mod-[`,run:tN},{key:`Mod-]`,run:eN},{key:`Mod-Alt-\\`,run:$M},{key:`Shift-Mod-k`,run:JM},{key:`Shift-Mod-\\`,run:Kj},{key:`Mod-/`,run:qA},{key:`Alt-A`,run:ZA},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:nN}].concat(oN),cN={key:`Tab`,run:eN,shift:tN}})),uN=i({CompletionContext:()=>uP,acceptCompletion:()=>jP,autocompletion:()=>iP,clearSnippet:()=>XP,closeBrackets:()=>GN,closeBracketsKeymap:()=>pF,closeCompletion:()=>NP,completeAnyWord:()=>iF,completeFromList:()=>pN,completionKeymap:()=>mF,completionStatus:()=>aP,currentCompletions:()=>oP,deleteBracketPair:()=>fF,hasNextSnippetField:()=>LN,hasPrevSnippetField:()=>RN,ifIn:()=>mN,ifNotIn:()=>hN,insertBracket:()=>JN,insertCompletionText:()=>vN,moveCompletionSelection:()=>NN,nextSnippetField:()=>ZP,pickedCompletion:()=>fP,prevSnippetField:()=>QP,selectedCompletion:()=>sP,selectedCompletionIndex:()=>cP,setSelectedCompletion:()=>lP,snippet:()=>FN,snippetCompletion:()=>zN,snippetKeymap:()=>eF,startCompletion:()=>MP});function dN(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function fN(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=dN(t)+dN(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function pN(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:fN(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function mN(e,t){return n=>{for(let r=mD(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(e.indexOf(r.name)>-1)return t(n);if(r.type.isTop)break}return null}}function hN(e,t){return n=>{for(let t=mD(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}function gN(e){return e.selection.main.from}function _N(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}function vN(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:U.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}function yN(e){if(!Array.isArray(e))return e;let t=pP.get(e);return t||pP.set(e,t=pN(e)),t}function bN(e,t){return e?t?e+` `+t:e:t}function xN(e,t,n,r,i,a){let o=e.textDirection==mS.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}function SN(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function CN(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}function wN(e,t){return n=>new bP(n,e,t)}function TN(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function EN(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function DN(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(vP);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new dP(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new _P(n):new gP(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new dP(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):EN(e.completion)>EN(c)&&(s[s.length-1]=e),c=e.completion}return s}function ON(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}function kN(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}function AN(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(fP);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}function jN(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):_N(e,!0).test(i)}function MN(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(kP).active.find(e=>e.source==t.source);return r instanceof DP?(typeof n==`string`?e.dispatch({...vN(e.state,n,r.from,r.to),annotations:fP.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}function NN(e,t=`option`){return n=>{let r=n.state.field(kP,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(vP).interactionDelay)return!1;let i=1,a;t==`page`&&(a=Tx(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:yP.of(s)}),!0}}function PN(e,t){return U.create(e.filter(e=>e.field==t).map(e=>U.range(e.from,e.to)))}function FN(e){let t=UP.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:h_.of(a)},scrollIntoView:!0,annotations:n?[fP.of(n),J_.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=PN(o,0)),o.some(e=>e.field>0)){let t=new KP(o,0),n=c.effects=[qP.of(t)];e.state.field(YP,!1)===void 0&&n.push(G.appendConfig.of([YP,tF,nF,BP]))}e.dispatch(e.state.update(c))}}function IN(e){return({state:t,dispatch:n})=>{let r=t.field(YP,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:PN(r.ranges,i),effects:qP.of(a?null:new KP(r.ranges,i)),scrollIntoView:!0})),!0}}function LN(e){let t=e.field(YP,!1);return!!(t&&t.ranges.some(e=>e.field==t.active+1))}function RN(e){let t=e.field(YP,!1);return!!(t&&t.active>0)}function zN(e,t){return{...t,apply:FN(e)}}function BN(e){let t=e.replace(/[\]\-\\]/g,`\\$&`);try{return RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,`ug`)}catch{return RegExp(`[\w${t}]`,`g`)}}function VN(e,t){return new RegExp(t(e.source),e.unicode?`u`:``)}function HN(e){return rF[e]||(rF[e]=new WeakMap)}function UN(e,t,n,r,i){for(let a=e.iterLines(),o=0;!a.next().done;){let{value:e}=a,s;for(t.lastIndex=0;s=t.exec(e);)if(!r[s[0]]&&o+s.index!=i&&(n.push({type:`text`,label:s[0]}),r[s[0]]=!0,n.length>=2e3))return;o+=e.length+1}}function WN(e,t,n,r,i){let a=e.length>=1e3,o=a&&t.get(e);if(o)return o;let s=[],c=Object.create(null);if(e.children){let a=0;for(let o of e.children){if(o.length>=1e3)for(let e of WN(o,t,n,r-a,i-a))c[e.label]||(c[e.label]=!0,s.push(e));else UN(o,n,s,c,i-a);a+=o.length+1}}else UN(e,n,s,c,i);return a&&s.length<2e3&&t.set(e,s),s}function GN(){return[dF,cF]}function KN(e){for(let t=0;t<16;t+=2)if(lF.charCodeAt(t)==e)return lF.charAt(t+1);return jg(e<128?e:e+1)}function qN(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||aF}function JN(e,t){let n=qN(e,e.selection.main.head),r=n.brackets||aF.brackets;for(let i of r){let a=KN(Ag(i,0));if(t==i)return a==i?eP(e,i,r.indexOf(i+i+i)>-1,n):QN(e,i,a,n.before||aF.before);if(t==a&&YN(e,e.selection.main.from))return $N(e,i,a)}return null}function YN(e,t){let n=!1;return e.field(cF).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function XN(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Mg(Ag(n,0)))}function ZN(e,t){let n=e.sliceString(t-2,t);return Mg(Ag(n,0))==n.length?n:n.slice(1)}function QN(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:oF.of(a.to+t.length),range:U.range(a.anchor+t.length,a.head+t.length)};let o=XN(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:oF.of(a.head+t.length),range:U.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function $N(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&XN(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:U.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function eP(e,t,n,r){let i=r.stringPrefixes||aF.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:oF.of(r.to+t.length),range:U.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=XN(e.doc,o),c;if(s==t){if(tP(e,o))return{changes:{insert:t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};if(YN(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:U.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=rP(e,o-2*t.length,i))>-1&&tP(e,c))return{changes:{insert:t+t+t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=X_.Word&&rP(e,o,i)>-1&&!nP(e,o,t,i))return{changes:{insert:t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function tP(e,t){let n=mD(e).resolveInner(t+1);return n.parent&&n.from==t}function nP(e,t,n,r){let i=mD(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function rP(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=X_.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=X_.Word)return n}return-1}function iP(e={}){return[zP,kP,vP.of(e),LP,hF,BP]}function aP(e){let t=e.field(kP,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}function oP(e){let t=e.field(kP,!1)?.open;if(!t||t.disabled)return[];let n=gF.get(t.options);return n||gF.set(t.options,n=t.options.map(e=>e.completion)),n}function sP(e){let t=e.field(kP,!1)?.open;return t&&!t.disabled&&t.selected>=0?t.options[t.selected].completion:null}function cP(e){let t=e.field(kP,!1)?.open;return t&&!t.disabled&&t.selected>=0?t.selected:null}function lP(e){return yP.of(e)}var uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F=n((()=>{cv(),eE(),Rk(),uP=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=mD(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(_N(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}},dP=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}},fP=G_.define(),pP=new WeakMap,mP=G.define(),hP=G.define(),gP=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Ag(e,t),r=Mg(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(Ag(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=Ag(e,0),i=Mg(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=Ag(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=Mg(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=Ag(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=jg(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=Mg(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?Mg(Ag(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},_P=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},vP=W.define({combine(e){return n_(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:xN,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>bN(e(n),t(n)),optionClass:(e,t)=>n=>bN(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}}),yP=G.define(),bP=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(vP);this.optionContent=SN(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=CN(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:yP.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(vP).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:hP.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=CN(r.length,i,e.state.facet(vP).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=CN(t.options.length,t.selected,this.view.state.facet(vP).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>gy(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&TN(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(vP).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}},xP=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,kN(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=DN(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(vP).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,kN(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:AP,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},SP=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(TP,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(vP),i=(r.override||n.languageDataAt(`autocomplete`,gN(n)).map(yN)).map(e=>(this.active.find(t=>t.source==e)||new EP(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(OP));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!ON(i,this.active)||o?a=xP.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new EP(e.source,0):e));for(let e of t.effects)e.is(yP)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?CP:wP}},CP={"aria-autocomplete":`list`},wP={},TP=[],EP=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=AN(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(mP))i=new e(i.source,1,n.value);else if(n.is(hP))i=new e(i.source,0);else if(n.is(OP))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(gN(e.state))}},DP=class e extends EP{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=gN(t.state);if(o>a||!r||n&2&&(gN(t.startState)==this.from||o<this.limit))return new EP(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return jN(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new uP(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??gN(t.state)):new EP(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new EP(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}},OP=G.define({map(e,t){return e.map(e=>e.map(t))}}),kP=j_.define({create(){return SP.start()},update(e,t){return e.update(t)},provide:e=>[_T.from(e,e=>e.tooltip),J.contentAttributes.from(e,e=>e.attrs)]}),AP=wN(kP,MN),jP=e=>{let t=e.state.field(kP,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(vP).interactionDelay?!1:MN(e,t.open.options[t.open.selected])},MP=e=>e.state.field(kP,!1)?(e.dispatch({effects:mP.of(!0)}),!0):!1,NP=e=>{let t=e.state.field(kP,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:hP.of(null)}),!0)},PP=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},FP=50,IP=1e3,LP=US.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(kP).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(kP),n=e.state.facet(vP);if(!e.selectionSet&&!e.docChanged&&e.startState.field(kP)==t)return;let r=e.transactions.some(e=>{let t=AN(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>FP&&Date.now()-n.time>IP){for(let e of n.context.abortListeners)try{e()}catch(e){gy(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(mP)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(kP);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vP).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new uP(t,gN(t),e.explicit,this.view),r=new PP(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:hP.of(null)}),gy(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vP).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(vP),n=this.view.state.field(kP);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=gN(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new DP(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new EP(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:OP.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(kP,!1);if(t&&t.tooltip&&this.view.state.facet(vP).closeOnBlur){let n=t.open&&Tx(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:hP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mP.of(!1)}),20),this.composing=0}}}),RP=typeof navigator==`object`&&/Win/.test(navigator.platform),zP=N_.highest(J.domEventHandlers({keydown(e,t){let n=t.state.field(kP,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(RP&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&MN(t,r),!1}})),BP=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),VP=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},HP=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,C_.TrackDel),r=t.mapPos(this.to,1,C_.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},UP=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(zO);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new HP(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new VP(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},WP=q.widget({widget:new class extends iS{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),GP=q.mark({class:`cm-snippetField`}),KP=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=q.set(e.map(e=>(e.from==e.to?WP:GP).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},qP=G.define({map(e,t){return e&&e.map(t)}}),JP=G.define(),YP=j_.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(qP))return n.value;if(n.is(JP)&&e)return new KP(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>J.decorations.from(e,e=>e?e.deco:q.none)}),XP=({state:e,dispatch:t})=>e.field(YP,!1)?(t(e.update({effects:qP.of(null)})),!0):!1,ZP=IN(1),QP=IN(-1),$P=[{key:`Tab`,run:ZP,shift:QP},{key:`Escape`,run:XP}],eF=W.define({combine(e){return e.length?e[0]:$P}}),tF=N_.highest(Mw.compute([eF],e=>e.facet(eF))),nF=J.domEventHandlers({mousedown(e,t){let n=t.state.field(YP,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:PN(n.ranges,i.field),effects:qP.of(n.ranges.some(e=>e.field>i.field)?new KP(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),rF=Object.create(null),iF=e=>{let t=e.state.languageDataAt(`wordChars`,e.pos)[0]??``,n=BN(t),r=e.matchBefore(VN(n,e=>e+`$`));if(!r&&!e.explicit)return null;let i=r?r.from:e.pos;return{from:i,options:WN(e.state.doc,HN(t),n,5e4,i),validFor:VN(n,e=>`^`+e)}},aF={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},oF=G.define({map(e,t){return t.mapPos(e,-1,C_.TrackAfter)??void 0}}),sF=new class extends ev{},sF.startSide=1,sF.endSide=-1,cF=j_.define({create(){return rv.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(oF)&&(e=e.update({add:[sF.range(n.value,n.value+1)]}));return e}}),lF=`()[]{}<>«»»«[]{}`,uF=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),dF=J.inputHandler.of((e,t,n,r)=>{if((uF?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Mg(Ag(r,0))==1||t!=i.from||n!=i.to)return!1;let a=JN(e.state,r);return a?(e.dispatch(a),!0):!1}),fF=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=qN(e,e.selection.main.head).brackets||aF.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=ZN(e.doc,t.head);for(let i of n)if(i==r&&XN(e.doc,t.head)==KN(Ag(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:U.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r},pF=[{key:`Backspace`,run:fF}],mF=[{key:`Ctrl-Space`,run:MP},{mac:"Alt-`",run:MP},{mac:`Alt-i`,run:MP},{key:`Escape`,run:NP},{key:`ArrowDown`,run:NN(!0)},{key:`ArrowUp`,run:NN(!1)},{key:`PageDown`,run:NN(!0,`page`)},{key:`PageUp`,run:NN(!1,`page`)},{key:`Enter`,run:jP}],hF=N_.highest(Mw.computeN([vP],e=>e.facet(vP).defaultKeymap?[mF]:[])),gF=new WeakMap}));function vF(e){let t=Object.keys(e),n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function yF(e,t){return bF(t,SF(e.string))}function bF(e,t){return!t||t.trim()===``||t.trim()===`:`||t.trim()===`{`?xF(e,e=>!e.isDeprecated):xF(xF(e.map(e=>({proximity:CF(SF(e.label),t),entry:e})),e=>e.proximity<=2),e=>!e.entry.isDeprecated).sort((e,t)=>!!e.entry.isDeprecated-+!!t.entry.isDeprecated||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length).map(e=>e.entry)}function xF(e,t){let n=e.filter(t);return n.length===0?e:n}function SF(e){return e.toLowerCase().replaceAll(/\W/g,``)}function CF(e,t){let n=wF(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=e.indexOf(t)===0?0:.5),n}function wF(e,t){let n,r,i=[],a=e.length,o=t.length;for(n=0;n<=a;n++)i[n]=[n];for(r=1;r<=o;r++)i[0][r]=r;for(n=1;n<=a;n++)for(r=1;r<=o;r++){let a=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+a),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+a))}return i[a][o]}var TF,EF,DF,OF,kF=n((()=>{kh(),TF=e=>` {\n $${e??1}\n}`,EF=(e,t,n)=>{if(!t)return n??e;let r=Xs(t);return B(r)||Os(r)||As(r)||Vs(r)?e+TF():n??e},DF=(e,t,n)=>As(t)?e+`[${EF(``,Xs(t.ofType),`$1`)}]`:EF(e,t,n),OF=e=>{let t=e.args.filter(e=>e.type.toString().endsWith(`!`));if(t.length)return e.name+`(${t.map((e,t)=>`${e.name}: $${t+1}`)}) ${EF(``,e.type,`
+`)}`}})),AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,Z,nL=n((()=>{(function(e){function t(e){return typeof e==`string`}e.is=t})(AF||={}),(function(e){function t(e){return typeof e==`string`}e.is=t})(jF||={}),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(MF||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(NF||={}),(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=NF.MAX_VALUE),t===Number.MAX_VALUE&&(t=NF.MAX_VALUE),{line:e,character:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.uinteger(t.line)&&Z.uinteger(t.character)}e.is=n})(PF||={}),(function(e){function t(e,t,n,r){if(Z.uinteger(e)&&Z.uinteger(t)&&Z.uinteger(n)&&Z.uinteger(r))return{start:PF.create(e,t),end:PF.create(n,r)};if(PF.is(e)&&PF.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&PF.is(t.start)&&PF.is(t.end)}e.is=n})(FF||={}),(function(e){function t(e,t){return{uri:e,range:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.range)&&(Z.string(t.uri)||Z.undefined(t.uri))}e.is=n})(IF||={}),(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.targetRange)&&Z.string(t.targetUri)&&FF.is(t.targetSelectionRange)&&(FF.is(t.originSelectionRange)||Z.undefined(t.originSelectionRange))}e.is=n})(LF||={}),(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.numberRange(t.red,0,1)&&Z.numberRange(t.green,0,1)&&Z.numberRange(t.blue,0,1)&&Z.numberRange(t.alpha,0,1)}e.is=n})(RF||={}),(function(e){function t(e,t){return{range:e,color:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.range)&&RF.is(t.color)}e.is=n})(zF||={}),(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.label)&&(Z.undefined(t.textEdit)||YF.is(t))&&(Z.undefined(t.additionalTextEdits)||Z.typedArray(t.additionalTextEdits,YF.is))}e.is=n})(BF||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(VF||={}),(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return Z.defined(n)&&(o.startCharacter=n),Z.defined(r)&&(o.endCharacter=r),Z.defined(i)&&(o.kind=i),Z.defined(a)&&(o.collapsedText=a),o}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.uinteger(t.startLine)&&Z.uinteger(t.startLine)&&(Z.undefined(t.startCharacter)||Z.uinteger(t.startCharacter))&&(Z.undefined(t.endCharacter)||Z.uinteger(t.endCharacter))&&(Z.undefined(t.kind)||Z.string(t.kind))}e.is=n})(HF||={}),(function(e){function t(e,t){return{location:e,message:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&IF.is(t.location)&&Z.string(t.message)}e.is=n})(UF||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(WF||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(GF||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.href)}e.is=t})(KF||={}),(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return Z.defined(n)&&(o.severity=n),Z.defined(r)&&(o.code=r),Z.defined(i)&&(o.source=i),Z.defined(a)&&(o.relatedInformation=a),o}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&Z.string(t.message)&&(Z.number(t.severity)||Z.undefined(t.severity))&&(Z.integer(t.code)||Z.string(t.code)||Z.undefined(t.code))&&(Z.undefined(t.codeDescription)||Z.string(t.codeDescription?.href))&&(Z.string(t.source)||Z.undefined(t.source))&&(Z.undefined(t.relatedInformation)||Z.typedArray(t.relatedInformation,UF.is))}e.is=n})(qF||={}),(function(e){function t(e,t,...n){let r={title:e,command:t};return Z.defined(n)&&n.length>0&&(r.arguments=n),r}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.title)&&Z.string(t.command)}e.is=n})(JF||={}),(function(e){function t(e,t){return{range:e,newText:t}}e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}e.insert=n;function r(e){return{range:e,newText:``}}e.del=r;function i(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.newText)&&FF.is(t.range)}e.is=i})(YF||={}),(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.label)&&(Z.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(Z.string(t.description)||t.description===void 0)}e.is=n})(XF||={}),(function(e){function t(e){let t=e;return Z.string(t)}e.is=t})(ZF||={}),(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}e.del=r;function i(e){let t=e;return YF.is(t)&&(XF.is(t.annotationId)||ZF.is(t.annotationId))}e.is=i})(QF||={}),(function(e){function t(e,t){return{textDocument:e,edits:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&oI.is(t.textDocument)&&Array.isArray(t.edits)}e.is=n})($F||={}),(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&Z.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||Z.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Z.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(eI||={}),(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&Z.string(t.oldUri)&&Z.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||Z.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Z.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(tI||={}),(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&Z.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||Z.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||Z.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(nI||={}),(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>Z.string(e.kind)?eI.is(e)||tI.is(e)||nI.is(e):$F.is(e)))}e.is=t})(rI||={}),(function(e){function t(e){return{uri:e}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)}e.is=n})(iI||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.integer(t.version)}e.is=n})(aI||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&(t.version===null||Z.integer(t.version))}e.is=n})(oI||={}),(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.string(t.languageId)&&Z.integer(t.version)&&Z.string(t.text)}e.is=n})(sI||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}e.is=t})(cI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(e)&&cI.is(t.kind)&&Z.string(t.value)}e.is=t})(lI||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(uI||={}),(function(e){e.PlainText=1,e.Snippet=2})(dI||={}),(function(e){e.Deprecated=1})(fI||={}),(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}e.create=t;function n(e){let t=e;return t&&Z.string(t.newText)&&FF.is(t.insert)&&FF.is(t.replace)}e.is=n})(pI||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(mI||={}),(function(e){function t(e){let t=e;return t&&(Z.string(t.detail)||t.detail===void 0)&&(Z.string(t.description)||t.description===void 0)}e.is=t})(hI||={}),(function(e){function t(e){return{label:e}}e.create=t})(gI||={}),(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t})(_I||={}),(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}e.fromPlainText=t;function n(e){let t=e;return Z.string(t)||Z.objectLiteral(t)&&Z.string(t.language)&&Z.string(t.value)}e.is=n})(vI||={}),(function(e){function t(e){let t=e;return!!t&&Z.objectLiteral(t)&&(lI.is(t.contents)||vI.is(t.contents)||Z.typedArray(t.contents,vI.is))&&(e.range===void 0||FF.is(e.range))}e.is=t})(yI||={}),(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t})(bI||={}),(function(e){function t(e,t,...n){let r={label:e};return Z.defined(t)&&(r.documentation=t),Z.defined(n)?r.parameters=n:r.parameters=[],r}e.create=t})(xI||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(SI||={}),(function(e){function t(e,t){let n={range:e};return Z.number(t)&&(n.kind=t),n}e.create=t})(CI||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(wI||={}),(function(e){e.Deprecated=1})(TI||={}),(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}e.create=t})(EI||={}),(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}e.create=t})(DI||={}),(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}e.create=t;function n(e){let t=e;return t&&Z.string(t.name)&&Z.number(t.kind)&&FF.is(t.range)&&FF.is(t.selectionRange)&&(t.detail===void 0||Z.string(t.detail))&&(t.deprecated===void 0||Z.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=n})(OI||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(kI||={}),(function(e){e.Invoked=1,e.Automatic=2})(AI||={}),(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.typedArray(t.diagnostics,qF.is)&&(t.only===void 0||Z.typedArray(t.only,Z.string))&&(t.triggerKind===void 0||t.triggerKind===AI.Invoked||t.triggerKind===AI.Automatic)}e.is=n})(jI||={}),(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):JF.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return t&&Z.string(t.title)&&(t.diagnostics===void 0||Z.typedArray(t.diagnostics,qF.is))&&(t.kind===void 0||Z.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||JF.is(t.command))&&(t.isPreferred===void 0||Z.boolean(t.isPreferred))&&(t.edit===void 0||rI.is(t.edit))}e.is=n})(MI||={}),(function(e){function t(e,t){let n={range:e};return Z.defined(t)&&(n.data=t),n}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&(Z.undefined(t.command)||JF.is(t.command))}e.is=n})(NI||={}),(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.uinteger(t.tabSize)&&Z.boolean(t.insertSpaces)}e.is=n})(PI||={}),(function(e){function t(e,t,n){return{range:e,target:t,data:n}}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&(Z.undefined(t.target)||Z.string(t.target))}e.is=n})(FI||={}),(function(e){function t(e,t){return{range:e,parent:t}}e.create=t;function n(t){let n=t;return Z.objectLiteral(n)&&FF.is(n.range)&&(n.parent===void 0||e.is(n.parent))}e.is=n})(II||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(LI||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(RI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}e.is=t})(zI||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&Z.string(t.text)}e.is=n})(BI||={}),(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&Z.boolean(t.caseSensitiveLookup)&&(Z.string(t.variableName)||t.variableName===void 0)}e.is=n})(VI||={}),(function(e){function t(e,t){return{range:e,expression:t}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&(Z.string(t.expression)||t.expression===void 0)}e.is=n})(HI||={}),(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(e.stoppedLocation)}e.is=n})(UI||={}),(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}e.is=t})(WI||={}),(function(e){function t(e){return{value:e}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&(t.tooltip===void 0||Z.string(t.tooltip)||lI.is(t.tooltip))&&(t.location===void 0||IF.is(t.location))&&(t.command===void 0||JF.is(t.command))}e.is=n})(GI||={}),(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&PF.is(t.position)&&(Z.string(t.label)||Z.typedArray(t.label,GI.is))&&(t.kind===void 0||WI.is(t.kind))&&t.textEdits===void 0||Z.typedArray(t.textEdits,YF.is)&&(t.tooltip===void 0||Z.string(t.tooltip)||lI.is(t.tooltip))&&(t.paddingLeft===void 0||Z.boolean(t.paddingLeft))&&(t.paddingRight===void 0||Z.boolean(t.paddingRight))}e.is=n})(KI||={}),(function(e){function t(e){return{kind:`snippet`,value:e}}e.createSnippet=t})(qI||={}),(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}e.create=t})(JI||={}),(function(e){function t(e){return{items:e}}e.create=t})(YI||={}),(function(e){e.Invoked=0,e.Automatic=1})(XI||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t})(ZI||={}),(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}e.create=t})(QI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&jF.is(t.uri)&&Z.string(t.name)}e.is=t})($I||={}),(function(e){function t(e,t,n,r){return new tL(e,t,n,r)}e.create=t;function n(e){let t=e;return!!(Z.defined(t)&&Z.string(t.uri)&&(Z.undefined(t.languageId)||Z.string(t.languageId))&&Z.uinteger(t.lineCount)&&Z.func(t.getText)&&Z.func(t.positionAt)&&Z.func(t.offsetAt))}e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,c=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[c++]=r[o++]:e[c++]=a[s++];for(;o<r.length;)e[c++]=r[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(eL||={}),tL=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
+`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
+`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return PF.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return PF.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(e){return e!==void 0}e.defined=n;function r(e){return e===void 0}e.undefined=r;function i(e){return e===!0||e===!1}e.boolean=i;function a(e){return t.call(e)===`[object String]`}e.string=a;function o(e){return t.call(e)===`[object Number]`}e.number=o;function s(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}e.numberRange=s;function c(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}e.integer=c;function l(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}e.uinteger=l;function u(e){return t.call(e)===`[object Function]`}e.func=u;function d(e){return typeof e==`object`&&!!e}e.objectLiteral=d;function f(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=f})(Z||={})})),rL,iL=n((()=>{rL=class{constructor(e){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{let e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let r=null,i=null;return typeof e==`string`?(i=new RegExp(e,n?`i`:`g`).test(this._sourceText.slice(this._pos,this._pos+e.length)),r=e):e instanceof RegExp&&(i=this._sourceText.slice(this._pos).match(e),r=i?.[0]),i!=null&&(typeof e==`string`||i instanceof Array&&this._sourceText.startsWith(i[0],this._pos))?(t&&(this._start=this._pos,r&&r.length&&(this._pos+=r.length)),i):!1},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{let e=this._sourceText.match(/\s*/),t=0;if(e&&e.length!==0){let n=e[0],r=0;for(;n.length>r;)n.charCodeAt(r)===9?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=e}_testNextCharacter(e){let t=this._sourceText.charAt(this._pos),n=!1;return n=typeof e==`string`?t===e:e instanceof RegExp?e.test(t):e(t),n}}}));function aL(e){return{ofRule:e}}function oL(e,t){return{ofRule:e,isList:!0,separator:t}}function sL(e,t){let n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every(t=>t.match&&!t.match(e))},e}function cL(e,t){return{style:t,match:t=>t.kind===e}}function Q(e,t){return{style:t||`punctuation`,match:t=>t.kind===`Punctuation`&&t.value===e}}var lL=n((()=>{}));function uL(e){return{style:`keyword`,match:t=>t.kind===`Name`&&t.value===e}}function dL(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.name=t.value}}}function fL(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.prevState?.prevState&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}var pL,mL,hL,gL=n((()=>{lL(),kh(),pL=e=>e===` `||e===` `||e===`,`||e===`
+`||e===`\r`||e===``||e===`\xA0`,mL={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},hL={Document:[oL(`Definition`)],Definition(e){switch(e.value){case`{`:return`ShortQuery`;case`query`:return`Query`;case`mutation`:return`Mutation`;case`subscription`:return`Subscription`;case`fragment`:return F.FRAGMENT_DEFINITION;case`schema`:return`SchemaDef`;case`scalar`:return`ScalarDef`;case`type`:return`ObjectTypeDef`;case`interface`:return`InterfaceDef`;case`union`:return`UnionDef`;case`enum`:return`EnumDef`;case`input`:return`InputDef`;case`extend`:return`ExtendDef`;case`directive`:return`DirectiveDef`}},ShortQuery:[`SelectionSet`],Query:[uL(`query`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],Mutation:[uL(`mutation`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],Subscription:[uL(`subscription`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],VariableDefinitions:[Q(`(`),oL(`VariableDefinition`),Q(`)`)],VariableDefinition:[`Variable`,Q(`:`),`Type`,aL(`DefaultValue`)],Variable:[Q(`$`,`variable`),dL(`variable`)],DefaultValue:[Q(`=`),`Value`],SelectionSet:[Q(`{`),oL(`Selection`),Q(`}`)],Selection(e,t){return e.value===`...`?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?`InlineFragment`:`FragmentSpread`:t.match(/[\s\u00a0,]*:/,!1)?`AliasedField`:`Field`},AliasedField:[dL(`property`),Q(`:`),dL(`qualifier`),aL(`Arguments`),oL(`Directive`),aL(`SelectionSet`)],Field:[dL(`property`),aL(`Arguments`),oL(`Directive`),aL(`SelectionSet`)],Arguments:[Q(`(`),oL(`Argument`),Q(`)`)],Argument:[dL(`attribute`),Q(`:`),`Value`],FragmentSpread:[Q(`...`),dL(`def`),oL(`Directive`)],InlineFragment:[Q(`...`),aL(`TypeCondition`),oL(`Directive`),`SelectionSet`],FragmentDefinition:[uL(`fragment`),aL(sL(dL(`def`),[uL(`on`)])),`TypeCondition`,oL(`Directive`),`SelectionSet`],TypeCondition:[uL(`on`),`NamedType`],Value(e){switch(e.kind){case`Number`:return`NumberValue`;case`String`:return`StringValue`;case`Punctuation`:switch(e.value){case`[`:return`ListValue`;case`{`:return`ObjectValue`;case`$`:return`Variable`;case`&`:return`NamedType`}return null;case`Name`:switch(e.value){case`true`:case`false`:return`BooleanValue`}return e.value===`null`?`NullValue`:`EnumValue`}},NumberValue:[cL(`Number`,`number`)],StringValue:[{style:`string`,match:e=>e.kind===`String`,update(e,t){t.value.startsWith(`"""`)&&(e.inBlockstring=!t.value.slice(3).endsWith(`"""`))}}],BooleanValue:[cL(`Name`,`builtin`)],NullValue:[cL(`Name`,`keyword`)],EnumValue:[dL(`string-2`)],ListValue:[Q(`[`),oL(`Value`),Q(`]`)],ObjectValue:[Q(`{`),oL(`ObjectField`),Q(`}`)],ObjectField:[dL(`attribute`),Q(`:`),`Value`],Type(e){return e.value===`[`?`ListType`:`NonNullType`},ListType:[Q(`[`),`Type`,Q(`]`),aL(Q(`!`))],NonNullType:[`NamedType`,aL(Q(`!`))],NamedType:[fL(`atom`)],Directive:[Q(`@`,`meta`),dL(`meta`),aL(`Arguments`)],DirectiveDef:[uL(`directive`),Q(`@`,`meta`),dL(`meta`),aL(`ArgumentsDef`),uL(`on`),oL(`DirectiveLocation`,Q(`|`))],InterfaceDef:[uL(`interface`),dL(`atom`),aL(`Implements`),oL(`Directive`),Q(`{`),oL(`FieldDef`),Q(`}`)],Implements:[uL(`implements`),oL(`NamedType`,Q(`&`))],DirectiveLocation:[dL(`string-2`)],SchemaDef:[uL(`schema`),oL(`Directive`),Q(`{`),oL(`OperationTypeDef`),Q(`}`)],OperationTypeDef:[dL(`keyword`),Q(`:`),dL(`atom`)],ScalarDef:[uL(`scalar`),dL(`atom`),oL(`Directive`)],ObjectTypeDef:[uL(`type`),dL(`atom`),aL(`Implements`),oL(`Directive`),Q(`{`),oL(`FieldDef`),Q(`}`)],FieldDef:[dL(`property`),aL(`ArgumentsDef`),Q(`:`),`Type`,oL(`Directive`)],ArgumentsDef:[Q(`(`),oL(`InputValueDef`),Q(`)`)],InputValueDef:[dL(`attribute`),Q(`:`),`Type`,aL(`DefaultValue`),oL(`Directive`)],UnionDef:[uL(`union`),dL(`atom`),oL(`Directive`),Q(`=`),oL(`UnionMember`,Q(`|`))],UnionMember:[`NamedType`],EnumDef:[uL(`enum`),dL(`atom`),oL(`Directive`),Q(`{`),oL(`EnumValueDef`),Q(`}`)],EnumValueDef:[dL(`string-2`),oL(`Directive`)],InputDef:[uL(`input`),dL(`atom`),oL(`Directive`),Q(`{`),oL(`InputValueDef`),Q(`}`)],ExtendDef:[uL(`extend`),`ExtensionDefinition`],ExtensionDefinition(e){switch(e.value){case`schema`:return F.SCHEMA_EXTENSION;case`scalar`:return F.SCALAR_TYPE_EXTENSION;case`type`:return F.OBJECT_TYPE_EXTENSION;case`interface`:return F.INTERFACE_TYPE_EXTENSION;case`union`:return F.UNION_TYPE_EXTENSION;case`enum`:return F.ENUM_TYPE_EXTENSION;case`input`:return F.INPUT_OBJECT_TYPE_EXTENSION}},[F.SCHEMA_EXTENSION]:[`SchemaDef`],[F.SCALAR_TYPE_EXTENSION]:[`ScalarDef`],[F.OBJECT_TYPE_EXTENSION]:[`ObjectTypeDef`],[F.INTERFACE_TYPE_EXTENSION]:[`InterfaceDef`],[F.UNION_TYPE_EXTENSION]:[`UnionDef`],[F.ENUM_TYPE_EXTENSION]:[`EnumDef`],[F.INPUT_OBJECT_TYPE_EXTENSION]:[`InputDef`]}}));function _L(e={eatWhitespace:e=>e.eatWhile(pL),lexRules:mL,parseRules:hL,editorConfig:{}}){return{startState(){let t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return bL(e.parseRules,t,F.DOCUMENT),t},token(t,n){return vL(t,n,e)}}}function vL(e,t,n){if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,`string`):(e.skipToEnd(),`string`);let{lexRules:r,parseRules:i,eatWhitespace:a,editorConfig:o}=n;if(t.rule&&t.rule.length===0?xL(t):t.needsAdvance&&(t.needsAdvance=!1,SL(t,!0)),e.sol()){let n=o?.tabSize||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return`ws`;let s=TL(r,e);if(!s)return e.match(/\S+/)||e.match(/\s/),bL(EL,t,`Invalid`),`invalidchar`;if(s.kind===`Comment`)return bL(EL,t,`Comment`),`comment`;let c=yL({},t);if(s.kind===`Punctuation`){if(/^[{([]/.test(s.value))t.indentLevel!==void 0&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(s.value)){let e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e.at(-1)<t.indentLevel&&(t.indentLevel=e.at(-1))}}for(;t.rule;){let n=typeof t.rule==`function`?t.step===0?t.rule(s,e):null:t.rule[t.step];if(t.needsSeparator&&(n=n?.separator),n){if(n.ofRule&&(n=n.ofRule),typeof n==`string`){bL(i,t,n);continue}if(n.match?.call(n,s))return n.update&&n.update(t,s),s.kind===`Punctuation`?SL(t,!0):t.needsAdvance=!0,n.style}wL(t)}return yL(t,c),bL(EL,t,`Invalid`),`invalidchar`}function yL(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}function bL(e,t,n){if(!e[n])throw TypeError(`Unknown rule: `+n);t.prevState=Object.assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeparator=!1}function xL(e){e.prevState&&=(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState.prevState)}function SL(e,t){if(CL(e)&&e.rule){let n=e.rule[e.step];if(n.separator){let{separator:t}=n;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&t.ofRule)return}if(t)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)xL(e),e.rule&&(CL(e)?e.rule?.[e.step].separator&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}function CL(e){let t=Array.isArray(e.rule)&&typeof e.rule[e.step]!=`string`&&e.rule[e.step];return t&&t.isList}function wL(e){for(;e.rule&&!(Array.isArray(e.rule)&&e.rule[e.step].ofRule);)xL(e);e.rule&&SL(e,!1)}function TL(e,t){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=t.match(e[n[r]]);if(i&&i instanceof Array)return{kind:n[r],value:i[0]}}}var EL,DL=n((()=>{gL(),kh(),EL={Invalid:[],Comment:[]}}));function OL(e,t){let n=e.split(`
+`),r=_L(),i=r.startState(),a=``,o=new rL(``);for(let e=0;e<n.length;e++){for(o=new rL(n[e]);!o.eol()&&(a=r.token(o,i),t(o,i,a,e)!==`BREAK`););t(o,i,a,e),i.kind||(i=r.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:i,style:a}}function kL(e,t){return t?.endsWith(`.graphqls`)?ML.TYPE_SYSTEM:PL(e)}function AL(e,t,n=0){let r=null,i=null,a=null,o=OL(e,(e,o,s,c)=>{if(!(c!==t.line||e.getCurrentPosition()+n<t.character+1))return r=s,i=Object.assign({},o),a=e.current(),`BREAK`});return{start:o.start,end:o.end,string:a||o.string,state:i||o.state,style:r||o.style}}function jL(e,t,n,r,i){let a=r||AL(e,t,1);if(!a)return null;let o=a.state.kind===`Invalid`?a.state.prevState:a.state;return o?{token:a,state:o,typeInfo:zL(n,a.state),mode:i?.mode||kL(e,i?.uri)}:null}var ML,NL,PL,FL=n((()=>{UL(),kh(),(function(e){e.TYPE_SYSTEM=`TYPE_SYSTEM`,e.EXECUTABLE=`EXECUTABLE`,e.UNKNOWN=`UNKNOWN`})(ML||={}),NL=[F.SCHEMA_DEFINITION,F.OPERATION_TYPE_DEFINITION,F.SCALAR_TYPE_DEFINITION,F.OBJECT_TYPE_DEFINITION,F.INTERFACE_TYPE_DEFINITION,F.UNION_TYPE_DEFINITION,F.ENUM_TYPE_DEFINITION,F.INPUT_OBJECT_TYPE_DEFINITION,F.DIRECTIVE_DEFINITION,F.SCHEMA_EXTENSION,F.SCALAR_TYPE_EXTENSION,F.OBJECT_TYPE_EXTENSION,F.INTERFACE_TYPE_EXTENSION,F.UNION_TYPE_EXTENSION,F.ENUM_TYPE_EXTENSION,F.INPUT_OBJECT_TYPE_EXTENSION],PL=e=>{let t=ML.UNKNOWN;if(e)try{$o(_o(e),{enter(e){if(e.kind===`Document`){t=ML.EXECUTABLE;return}return NL.includes(e.kind)?(t=ML.TYPE_SYSTEM,rs):!1}})}catch{return t}return t}}));function IL(e,t,n){return n===cl.name&&e.getQueryType()===t?cl:n===ll.name&&e.getQueryType()===t?ll:n===ul.name&&zs(t)?ul:`getFields`in t?t.getFields()[n]:null}function LL(e,t){let n=[],r=e;for(;r?.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function RL(e){let t;return LL(e,e=>{switch(e.kind){case`Query`:case`ShortQuery`:case`Mutation`:case`Subscription`:case`FragmentDefinition`:t=e;break}}),t}function zL(e,t){let n,r,i,a,o,s,c,l,u,d,f;return LL(t,t=>{switch(t.kind){case $.QUERY:case`ShortQuery`:d=e.getQueryType();break;case $.MUTATION:d=e.getMutationType();break;case $.SUBSCRIPTION:d=e.getSubscriptionType();break;case $.INLINE_FRAGMENT:case $.FRAGMENT_DEFINITION:t.type&&(d=e.getType(t.type));break;case $.FIELD:case $.ALIASED_FIELD:!d||!t.name?o=null:(o=u?IL(e,u,t.name):null,d=o?o.type:null);break;case $.SELECTION_SET:u=Xs(d);break;case $.DIRECTIVE:i=t.name?e.getDirective(t.name):null;break;case $.INTERFACE_DEF:t.name&&(c=null,f=new hc({name:t.name,interfaces:[],fields:{}}));break;case $.OBJECT_TYPE_DEF:t.name&&(f=null,c=new mc({name:t.name,interfaces:[],fields:{}}));break;case $.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case $.FIELD:r=o&&o.args;break;case $.DIRECTIVE:r=i&&i.args;break;case $.ALIASED_FIELD:{let n=t.prevState?.name;if(!n){r=null;break}let i=u?IL(e,u,n):null;if(!i){r=null;break}r=i.args;break}default:r=null;break}else r=null;break;case $.ARGUMENT:if(r){for(let e=0;e<r.length;e++)if(r[e].name===t.name){n=r[e];break}}s=n?.type;break;case $.VARIABLE_DEFINITION:case $.VARIABLE:d=s;break;case $.ENUM_VALUE:let p=Xs(s);a=p instanceof _c?p.getValues().find(e=>e.value===t.name):null;break;case $.LIST_VALUE:let m=qs(s);s=m instanceof dc?m.ofType:null;break;case $.OBJECT_VALUE:let h=Xs(s);l=h instanceof vc?h.getFields():null;break;case $.OBJECT_FIELD:let g=t.name&&l?l[t.name]:null;s=g?.type,o=g,d=o?o.type:null;break;case $.NAMED_TYPE:t.name&&(d=e.getType(t.name));break}}),{argDef:n,argDefs:r,directiveDef:i,enumValue:a,fieldDef:o,inputType:s,objectFieldDefs:l,parentType:u,type:d,interfaceDef:f,objectTypeDef:c}}var BL=n((()=>{kh(),UL()})),VL,$,HL=n((()=>{kh(),VL={ALIASED_FIELD:`AliasedField`,ARGUMENTS:`Arguments`,SHORT_QUERY:`ShortQuery`,QUERY:`Query`,MUTATION:`Mutation`,SUBSCRIPTION:`Subscription`,TYPE_CONDITION:`TypeCondition`,INVALID:`Invalid`,COMMENT:`Comment`,SCHEMA_DEF:`SchemaDef`,SCALAR_DEF:`ScalarDef`,OBJECT_TYPE_DEF:`ObjectTypeDef`,OBJECT_VALUE:`ObjectValue`,LIST_VALUE:`ListValue`,INTERFACE_DEF:`InterfaceDef`,UNION_DEF:`UnionDef`,ENUM_DEF:`EnumDef`,ENUM_VALUE:`EnumValue`,FIELD_DEF:`FieldDef`,INPUT_DEF:`InputDef`,INPUT_VALUE_DEF:`InputValueDef`,ARGUMENTS_DEF:`ArgumentsDef`,EXTEND_DEF:`ExtendDef`,EXTENSION_DEFINITION:`ExtensionDefinition`,DIRECTIVE_DEF:`DirectiveDef`,IMPLEMENTS:`Implements`,VARIABLE_DEFINITIONS:`VariableDefinitions`,TYPE:`Type`,VARIABLE:`Variable`},$=Object.assign(Object.assign({},F),VL)})),UL=n((()=>{iL(),gL(),lL(),DL(),FL(),BL(),HL()})),WL,GL=n((()=>{nL(),UL(),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(WL||={})}));function KL(e,t,n,r,i,a){let o=Object.assign(Object.assign({},a),{schema:e}),s=jL(t,n,e,r,a);if(!s)return[];let{state:c,typeInfo:l,mode:u,token:d}=s,{kind:f,step:p,prevState:m}=c;if(f===$.DOCUMENT)return u===ML.TYPE_SYSTEM?qL(d):u===ML.EXECUTABLE?JL(d):YL(d);if(f===$.EXTEND_DEF)return XL(d);if(m?.prevState?.kind===$.EXTENSION_DEFINITION&&c.name)return yF(d,[]);if(m?.kind===F.SCALAR_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(ys).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.OBJECT_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(e=>B(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.INTERFACE_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(Ss).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.UNION_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(ws).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.ENUM_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(e=>Es(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.INPUT_OBJECT_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(Os).map(e=>({label:e.name,kind:WL.Function})));if(f===$.IMPLEMENTS||f===$.NAMED_TYPE&&m?.kind===$.IMPLEMENTS)return $L(d,c,e,t,l);if(f===$.SELECTION_SET||f===$.FIELD||f===$.ALIASED_FIELD)return ZL(d,l,o);if(f===$.ARGUMENTS||f===$.ARGUMENT&&p===0){let{argDefs:e}=l;if(e)return yF(d,e.map(e=>({label:e.name,insertText:DF(e.name+`: `,e.type),insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet,command:lR,labelDetails:{detail:` `+String(e.type)},documentation:e.description??void 0,kind:WL.Variable,type:e.type})))}if((f===$.OBJECT_VALUE||f===$.OBJECT_FIELD&&p===0)&&l.objectFieldDefs){let e=vF(l.objectFieldDefs),t=f===$.OBJECT_VALUE?WL.Value:WL.Field;return yF(d,e.map(e=>({label:e.name,detail:String(e.type),documentation:e?.description??void 0,kind:t,type:e.type,insertText:DF(e.name+`: `,e.type),insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet,command:lR})))}if(f===$.ENUM_VALUE||f===$.LIST_VALUE&&p===1||f===$.OBJECT_FIELD&&p===2||f===$.ARGUMENT&&p===2)return QL(d,l,t,e);if(f===$.VARIABLE&&p===1){let n=Xs(l.inputType);return yF(d,nR(t,e,d).filter(e=>e.detail===n?.name))}if(f===$.TYPE_CONDITION&&p===1||f===$.NAMED_TYPE&&m!=null&&m.kind===$.TYPE_CONDITION)return eR(d,l,e,f);if(f===$.FRAGMENT_SPREAD&&p===1)return tR(d,l,e,t,Array.isArray(i)?i:uR(i));let h=cR(c);return h.kind===$.FIELD_DEF?yF(d,Object.values(e.getTypeMap()).filter(e=>Fs(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function,insertText:a?.fillLeafsOnComplete?e.name+`
+`:e.name,insertTextMode:mI.adjustIndentation}))):h.kind===$.INPUT_VALUE_DEF&&p===2?yF(d,Object.values(e.getTypeMap()).filter(e=>Ns(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function,insertText:a?.fillLeafsOnComplete?e.name+`
+$1`:e.name,insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet}))):f===$.VARIABLE_DEFINITION&&p===2||f===$.LIST_TYPE&&p===1||f===$.NAMED_TYPE&&m&&(m.kind===$.VARIABLE_DEFINITION||m.kind===$.LIST_TYPE||m.kind===$.NON_NULL_TYPE)?iR(d,e,f):f===$.DIRECTIVE?aR(d,c,e,f):f===$.DIRECTIVE_DEF?oR(d,c,e,f):[]}function qL(e){return yF(e,[{label:`extend`,kind:WL.Function},...dR])}function JL(e){return yF(e,fR)}function YL(e){return yF(e,[{label:`extend`,kind:WL.Function},...fR,...dR])}function XL(e){return yF(e,dR)}function ZL(e,t,n){if(t.parentType){let{parentType:r}=t,i=[];return`getFields`in r&&(i=vF(r.getFields())),zs(r)&&i.push(ul),r===(n?.schema)?.getQueryType()&&i.push(cl,ll),yF(e,i.map((t,r)=>{let i={sortText:String(r)+t.name,label:t.name,detail:String(t.type),documentation:t.description??void 0,deprecated:!!t.deprecationReason,isDeprecated:!!t.deprecationReason,deprecationReason:t.deprecationReason,kind:WL.Field,labelDetails:{detail:` `+t.type.toString()},type:t.type};return n?.fillLeafsOnComplete&&(i.insertText=OF(t),i.insertText||=EF(t.name,t.type,t.name+(e.state.needsAdvance?``:`
+`)),i.insertText&&(i.insertTextFormat=dI.Snippet,i.insertTextMode=mI.adjustIndentation,i.command=lR)),i}))}return[]}function QL(e,t,n,r){let i=Xs(t.inputType),a=nR(n,r,e).filter(e=>e.detail===i?.name);return i instanceof _c?yF(e,i.getValues().map(e=>({label:e.name,detail:String(i),documentation:e.description??void 0,deprecated:!!e.deprecationReason,isDeprecated:!!e.deprecationReason,deprecationReason:e.deprecationReason,kind:WL.EnumMember,type:i})).concat(a)):i===jc?yF(e,a.concat([{label:`true`,detail:String(jc),documentation:`Not false.`,kind:WL.Variable,type:jc},{label:`false`,detail:String(jc),documentation:`Not true.`,kind:WL.Variable,type:jc}])):a}function $L(e,t,n,r,i){if(t.needsSeparator)return[];let a=vF(n.getTypeMap()).filter(Ss),o=a.map(({name:e})=>e),s=new Set;OL(r,(e,t)=>{if(t.name&&(t.kind===$.INTERFACE_DEF&&!o.includes(t.name)&&s.add(t.name),t.kind===$.NAMED_TYPE&&t.prevState?.kind===$.IMPLEMENTS)){if(i.interfaceDef){if(i.interfaceDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.interfaceDef?.toConfig();i.interfaceDef=new hc(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new hc({name:t.name,fields:{}})]}))}else if(i.objectTypeDef){if(i.objectTypeDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.objectTypeDef?.toConfig();i.objectTypeDef=new mc(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new hc({name:t.name,fields:{}})]}))}}});let c=i.interfaceDef||i.objectTypeDef,l=(c?.getInterfaces()||[]).map(({name:e})=>e);return yF(e,a.concat([...s].map(e=>({name:e}))).filter(({name:e})=>e!==c?.name&&!l.includes(e)).map(e=>{let t={label:e.name,kind:WL.Interface,type:e};return e?.description&&(t.documentation=e.description),t}))}function eR(e,t,n,r){let i;if(t.parentType)if(Vs(t.parentType)){let e=Hs(t.parentType),r=n.getPossibleTypes(e),a=Object.create(null);for(let e of r)for(let t of e.getInterfaces())a[t.name]=t;i=r.concat(vF(a))}else i=[t.parentType];else i=vF(n.getTypeMap()).filter(e=>zs(e)&&!e.name.startsWith(`__`));return yF(e,i.map(e=>{let t=Xs(e);return{label:String(e),documentation:t?.description||``,kind:WL.Field}}))}function tR(e,t,n,r,i){if(!r)return[];let a=n.getTypeMap(),o=RL(e.state),s=rR(r);return i&&i.length>0&&s.push(...i),yF(e,s.filter(e=>a[e.typeCondition.name.value]&&!(o&&o.kind===$.FRAGMENT_DEFINITION&&o.name===e.name.value)&&zs(t.parentType)&&zs(a[e.typeCondition.name.value])&&Sc(n,t.parentType,a[e.typeCondition.name.value])).map(e=>({label:e.name.value,detail:String(a[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,labelDetails:{detail:`fragment ${e.name.value} on ${e.typeCondition.name.value}`},kind:WL.Field,type:a[e.typeCondition.name.value]})))}function nR(e,t,n){let r=null,i,a=Object.create({});return OL(e,(e,o)=>{if(o?.kind===$.VARIABLE&&o.name&&(r=o.name),o?.kind===$.NAMED_TYPE&&r){let e=pR(o,$.TYPE);e?.type&&(i=t.getType(e?.type))}if(r&&i&&!a[r]){let e=n.string===`$`||n?.state?.kind===`Variable`?r:`$`+r;a[r]={detail:i.toString(),insertText:e,label:`$`+r,rawInsert:e,type:i,kind:WL.Variable},r=null,i=null}}),vF(a)}function rR(e){let t=[];return OL(e,(e,n)=>{n.kind===$.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:$.FRAGMENT_DEFINITION,name:{kind:F.NAME,value:n.name},selectionSet:{kind:$.SELECTION_SET,selections:[]},typeCondition:{kind:$.NAMED_TYPE,name:{kind:F.NAME,value:n.type}}})}),t}function iR(e,t,n){return yF(e,vF(t.getTypeMap()).filter(Ns).map(e=>({label:e.name,documentation:e?.description||``,kind:WL.Variable})))}function aR(e,t,n,r){return t.prevState?.kind?yF(e,n.getDirectives().filter(e=>sR(t.prevState,e)).map(e=>({label:e.name,documentation:e?.description||``,kind:WL.Function}))):[]}function oR(e,t,n,r){return yF(e,n.getDirectives().find(e=>e.name===t.name)?.args.map(e=>({label:e.name,documentation:e.description||``,kind:WL.Field}))||[])}function sR(e,t){if(!e?.kind)return!1;let{kind:n,prevState:r}=e,{locations:i}=t;switch(n){case $.QUERY:return i.includes(P.QUERY);case $.MUTATION:return i.includes(P.MUTATION);case $.SUBSCRIPTION:return i.includes(P.SUBSCRIPTION);case $.FIELD:case $.ALIASED_FIELD:return i.includes(P.FIELD);case $.FRAGMENT_DEFINITION:return i.includes(P.FRAGMENT_DEFINITION);case $.FRAGMENT_SPREAD:return i.includes(P.FRAGMENT_SPREAD);case $.INLINE_FRAGMENT:return i.includes(P.INLINE_FRAGMENT);case $.SCHEMA_DEF:return i.includes(P.SCHEMA);case $.SCALAR_DEF:return i.includes(P.SCALAR);case $.OBJECT_TYPE_DEF:return i.includes(P.OBJECT);case $.FIELD_DEF:return i.includes(P.FIELD_DEFINITION);case $.INTERFACE_DEF:return i.includes(P.INTERFACE);case $.UNION_DEF:return i.includes(P.UNION);case $.ENUM_DEF:return i.includes(P.ENUM);case $.ENUM_VALUE:return i.includes(P.ENUM_VALUE);case $.INPUT_DEF:return i.includes(P.INPUT_OBJECT);case $.INPUT_VALUE_DEF:switch(r?.kind){case $.ARGUMENTS_DEF:return i.includes(P.ARGUMENT_DEFINITION);case $.INPUT_DEF:return i.includes(P.INPUT_FIELD_DEFINITION)}}return!1}function cR(e){return e.prevState&&e.kind&&[$.NAMED_TYPE,$.LIST_TYPE,$.TYPE,$.NON_NULL_TYPE].includes(e.kind)?cR(e.prevState):e}var lR,uR,dR,fR,pR,mR=n((()=>{kh(),GL(),UL(),kF(),nL(),lR={command:`editor.action.triggerSuggest`,title:`Suggestions`},uR=e=>{let t=[];if(e)try{$o(_o(e),{FragmentDefinition(e){t.push(e)}})}catch{return[]}return t},dR=[{label:`type`,kind:WL.Function},{label:`interface`,kind:WL.Function},{label:`union`,kind:WL.Function},{label:`input`,kind:WL.Function},{label:`scalar`,kind:WL.Function},{label:`schema`,kind:WL.Function}],fR=[{label:`query`,kind:WL.Function},{label:`mutation`,kind:WL.Function},{label:`subscription`,kind:WL.Function},{label:`fragment`,kind:WL.Function},{label:`{`,kind:WL.Constructor}],pR=(e,t)=>{if(e.prevState?.kind===t)return e.prevState;if(e.prevState?.prevState?.kind===t)return e.prevState.prevState;if(e.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState;if(e.prevState?.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState.prevState}})),hR=r(((e,t)=>{function n(e,t){if(e!=null)return e;var n=Error(t===void 0?`Got unexpected `+e:t);throw n.framesToPop=1,n}t.exports=n,t.exports.default=n,Object.defineProperty(t.exports,`__esModule`,{value:!0})})),gR=n((()=>{hR()})),_R,vR,yR=n((()=>{_R=class{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new vR(e,t)}setEnd(e,t){this.end=new vR(e,t)}},vR=class{constructor(e,t){this.lessThanOrEqualTo=e=>this.line<e.line||this.line===e.line&&this.character<=e.character,this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}}}));function bR(e,t,n,r,i){let a=Mf.filter(e=>!(e===Fu||e===ru||r&&e===vu));return n&&Array.prototype.push.apply(a,n),i&&Array.prototype.push.apply(a,xR),zf(e,t,a).filter(e=>{if(e.message.includes(`Unknown directive`)&&e.nodes){let t=e.nodes[0];if(t&&t.kind===F.DIRECTIVE){let e=t.name.value;if(e===`arguments`||e===`argumentDefinitions`)return!1}}return!0})}var xR,SR=n((()=>{kh(),xR=[Eu,gf,vf,af,sf,ef,bu,mu,nf,ud,Qd,ff,bf,lu,hd]})),CR=n((()=>{gR(),kh(),yR(),SR()})),wR=n((()=>{CR()}));function TR(e,t=null,n,r,i){let a=null,o=``;i&&(o=typeof i==`string`?i:i.reduce((e,t)=>e+as(t)+`
+
+`,``));let s=o?`${e}\n\n${o}`:e;try{a=_o(s)}catch(e){if(e instanceof M){let t=OR(e.locations?.[0]??{line:0,column:0},s);return[{severity:jR.Error,message:e.message,source:`GraphQL: Syntax`,range:t}]}throw e}return ER(a,t,n,r)}function ER(e,t=null,n,r){if(!t)return[];let i=bR(t,e,n,r).flatMap(e=>DR(e,jR.Error,`Validation`)),a=zf(t,e,[Up]).flatMap(e=>DR(e,jR.Warning,`Deprecation`));return i.concat(a)}function DR(e,t,n){if(!e.nodes)return[];let r=[];for(let[i,a]of e.nodes.entries()){let o=a.kind!==`Variable`&&`name`in a&&a.name!==void 0?a.name:`variable`in a&&a.variable!==void 0?a.variable:a;if(o){MR(e.locations,`GraphQL validation error requires locations.`);let a=e.locations[i],s=kR(o),c=a.column+(s.end-s.start);r.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new _R(new vR(a.line-1,a.column-1),new vR(a.line-1,c))})}}return r}function OR(e,t){let n=_L(),r=n.startState(),i=t.split(`
+`);MR(i.length>=e.line,`Query text must have more lines than where the error happened`);let a=null;for(let t=0;t<e.line;t++)for(a=new rL(i[t]);!a.eol()&&n.token(a,r)!==`invalidchar`;);MR(a,`Expected Parser stream to be available.`);let o=e.line-1,s=a.getStartOfToken(),c=a.getCurrentPosition();return new _R(new vR(o,s),new vR(o,c))}function kR(e){let t=e.loc;return MR(t,`Expected ASTNode to have a location.`),t}var AR,jR,MR,NR=n((()=>{kh(),UL(),CR(),AR={Error:`Error`,Warning:`Warning`,Information:`Information`,Hint:`Hint`},jR={[AR.Error]:1,[AR.Warning]:2,[AR.Information]:3,[AR.Hint]:4},MR=(e,t)=>{if(!e)throw Error(t)}})),PR=n((()=>{CR()})),FR=n((()=>{UL()})),IR=n((()=>{kF(),mR(),wR(),NR(),PR(),FR()})),LR=n((()=>{IR(),UL(),GL(),CR()}));function RR(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}function zR(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||VR(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function BR(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function VR(e,t,n,r){let i=BR(n,r,t);return i<0||BR(n,r,e)<i}function HR(e,t,n){let r=e.cursor(xE.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}function UR(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}function WR(e,t){return e[t]|e[t+1]<<16}function GR(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function KR(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz=n((()=>{FE(),qR=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new JR(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new YR(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new JR(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},JR=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},YR=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},XR=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}},ZR=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},QR=new ZR,$R=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=QR,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=QR,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},ez=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;zR(this.data,e,t,this.id,n.data,n.tokenPrecTable)}},ez.prototype.contextual=ez.prototype.fallback=ez.prototype.extend=!1,tz=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?RR(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(zR(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}},tz.prototype.contextual=ez.prototype.fallback=ez.prototype.extend=!1,nz=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG),rz=null,iz=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?HR(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?HR(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof SE){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(mE.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},az=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new ZR)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new ZR,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ZR,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=WR(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(WR(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(WR(o,s+1),t,n,r))}return r}},oz=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new $R(t,r),this.tokens=new az(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[qR.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new iz(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&GR(r);if(e)return nz&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw nz&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return nz&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=nz?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(mE.contextHash)||0)==n))return e.useNode(o,r),nz&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof SE)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof SE&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),nz&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),nz&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return UR(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=nz?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),nz&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(nz&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)nz&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))nz&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nz&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),UR(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),SE.build({buffer:XR.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(rz||=new WeakMap).get(e);return t||rz.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}},sz=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},cz=class e extends NE{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=mE[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new vE(t.map((t,i)=>_E.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=dE;let a=RR(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(KR),this.states=RR(e.states,Uint32Array),this.data=RR(e.stateData),this.goto=RR(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new ez(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new oz(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=WR(n,i+2)];else if(n[i+1]==2)return WR(n,i+2);else break;if(a==t||a==0)return WR(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=WR(this.data,n+2);else break;r=t(WR(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=WR(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=KR(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new sz(e,n,r)}static deserialize(t){return new e(t)}}}));function uz(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new Tz(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new Tz(r.from,n,r.diagnostic)}),r}function dz(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Pz).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Dz))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function fz(e,t){return e.field(Az,!1)?t:t.concat(G.appendConfig.of(zz))}function pz(e,t){return{effects:fz(e,[Dz.of(t)])}}function mz(e,t,n){let{diagnostics:r}=e.state.field(Az),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Pz).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:hz(e,i)}}}:null}function hz(e,t){return wv(`ul`,{class:`cm-tooltip-lint`},t.map(t=>bz(e,t,!1)))}function gz(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}function _z(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function vz(e,t={}){return[Pz.of({source:e,config:t}),Nz,zz]}function yz(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function bz(e,t,n){let r=n?yz(t.actions):[];return wv(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},wv(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=uz(e.state.field(Az).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),wv(`u`,s.slice(c,c+1)),s.slice(c+1)];return wv(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&wv(`div`,{class:`cm-diagnosticSource`},t.source))}function xz(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Sz(e){return xz(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}function Cz(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function wz(e){let t=`hint`,n=1;for(let r of e){let e=Cz(r.severity);e>n&&(n=e,t=r.severity)}return t}var Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz,zz,Bz=n((()=>{eE(),cv(),Ev(),Tz=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Ez=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Pz).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new iv,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=wz(s);if(i)o.add(n,n,q.widget({widget:new Fz(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,q.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,uz(f))}},Dz=G.define(),Oz=G.define(),kz=G.define(),Az=j_.define({create(){return new Ez(q.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=uz(n,e.selected.diagnostic,i)||uz(n,null,i)}!n.size&&i&&t.state.facet(Pz).autoPanel&&(i=null),e=new Ez(n,i,r)}for(let n of t.effects)if(n.is(Dz)){let r=t.state.facet(Pz).autoPanel?n.value.length?Lz.open:null:e.panel;e=Ez.init(n.value,r,t.state)}else n.is(Oz)?e=new Ez(e.diagnostics,n.value?Lz.open:null,e.selected):n.is(kz)&&(e=new Ez(e.diagnostics,e.panel,n.value));return e},provide:e=>[OT.from(e,e=>e.panel),J.decorations.from(e,e=>e.diagnostics)]}),jz=q.mark({class:`cm-lintRange cm-lintRange-active`}),Mz=e=>{let t=e.state.field(Az,!1);return!t||!t.panel?!1:(e.dispatch({effects:Oz.of(!1)}),!0)},Nz=US.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Pz);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Pz);t.length&&gz(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(pz(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{gy(this.view.state,e)})}}update(e){let t=e.state.facet(Pz);(e.docChanged||t!=e.startState.facet(Pz)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Pz=W.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...n_(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:_z,tooltipFilter:_z,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}}),Fz=class extends iS{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return wv(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Iz=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=bz(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Lz=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)Mz(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=yz(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=uz(this.view.state.field(Az).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=wv(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=wv(`div`,{class:`cm-panel-lint`},this.list,wv(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>Mz(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(Az).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Az),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Iz(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Iz(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=uz(this.view.state.field(Az).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:kz.of(t)})}static open(t){return new e(t)}},Rz=J.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Sz(`#d11`)},".cm-lintRange-warning":{backgroundImage:Sz(`orange`)},".cm-lintRange-info":{backgroundImage:Sz(`#999`)},".cm-lintRange-hint":{backgroundImage:Sz(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}}),zz=[Az,J.decorations.compute([Az],e=>{let{selected:t,panel:n}=e.field(Az);return!t||!n||t.from==t.to?q.none:q.set([jz.range(t.from,t.to)])}),wx(mz,{hideOn:dz}),Rz]})),Vz=i({Position:()=>Kz,completion:()=>mB,fillAllFieldsCommands:()=>aB,getOpts:()=>nB,getSchema:()=>tB,graphql:()=>Gz,graphqlLanguage:()=>fB,graphqlLanguageSupport:()=>Wz,isMetaKeyPressed:()=>Jz,jump:()=>hB,lint:()=>_B,offsetToPos:()=>Uz,optionsStateField:()=>Qz,posToOffset:()=>Hz,schemaStateField:()=>Xz,showInDocsCommand:()=>oB,stateExtensions:()=>iB,updateOpts:()=>eB,updateSchema:()=>$z});function Hz(e,t){return e.line(t.line+1).from+t.character}function Uz(e,t){let n=e.lineAt(t);return new Kz(n.number-1,t-n.from)}function Wz(){return new IO(fB)}function Gz(e,t){return[Wz(),mB,_B,hB,iB(e,t)]}var Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB=n((()=>{LR(),cv(),lz(),Rk(),uD(),eE(),Bz(),kh(),Kz=class{constructor(e,t){this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}lessThanOrEqualTo(e){return this.line<e.line||this.line===e.line&&this.character<=e.character}},qz=()=>navigator.userAgent.includes(`Mac`),Jz=e=>qz()?e.metaKey:e.ctrlKey,Yz=G.define(),Xz=j_.define({create(){},update(e,t){for(let e of t.effects)if(e.is(Yz))return e.value;return e}}),Zz=G.define(),Qz=j_.define({create(){},update(e,t){for(let e of t.effects)if(e.is(Zz))return e.value;return e}}),$z=(e,t)=>{e.dispatch({effects:Yz.of(t)})},eB=(e,t)=>{e.dispatch({effects:Zz.of(t)})},tB=e=>e.field(Xz),nB=e=>e.field(Qz),rB={showErrorOnInvalidSchema:!0},iB=(e,t)=>[Xz.init(()=>e),Qz.init(()=>Object.assign(Object.assign({},rB),t))],aB=e=>{let t=tB(e.state);if(!t)return!0;let n=nB(e.state),r=e.state.selection.main.head,i=Uz(e.state.doc,r),a=AL(e.state.doc.toString(),i);return t&&n?.onFillAllFields&&n.onFillAllFields(e,t,e.state.doc.toString(),i,a),!0},oB=e=>{let t=tB(e.state);if(!t)return!0;let n=nB(e.state),r=e.state.selection.main.head,i=Uz(e.state.doc,r),a=AL(e.state.doc.toString(),i);if(t&&n?.onShowInDocs){let e=zL(t,a.state);n.onShowInDocs(e.fieldDef?.name,e.type?.toString(),e.parentType?.toString())}return!0},sB={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},cB=cz.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:`⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension`,maxTerm:156,nodeProps:[[`openedBy`,6,`(`,12,`[`,24,`{`],[`closedBy`,7,`)`,13,`]`,25,`}`]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!Q!['k!c!i'k#T#Z'k~'nR!Q!['w!c!i'w#T#Z'w~'zR!Q![(T!c!i(T#T#Z(T~(WR!Q![&Q!c!i&Q#T#Z&Q~(fPc~rs(i~(lXOY(iYZ(iZ](i]^)X^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![0h![!c(i!c!i0h!i#O(i#O#P)w#P#T(i#T#Z0h#Z~(i~0k_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![1j![!c(i!c!i1j!i#O(i#O#P)w#P#T(i#T#Z1j#Z~(i~1m_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![2l![!c(i!c!i2l!i#O(i#O#P)w#P#T(i#T#Z2l#Z~(i~2o_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:e=>sB[e]||-1}],tokenPrec:2989}),lB=`RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }`,uB=`scalar type interface union enum input implements fragment extend schema directive on repeatable`,dB=`( ) { } : [ ]`,fB=DO.define({parser:cB.configure({props:[RE({Variable:X.variableName,BooleanValue:X.bool,Description:X.string,StringValue:X.string,Comment:X.lineComment,IntValue:X.integer,FloatValue:X.float,EnumValue:X.special(X.name),NullValue:X.null,DirectiveName:X.modifier,[uB]:X.keyword,OperationType:X.definitionKeyword,FieldName:X.propertyName,Field:X.propertyName,ArgumentAttributeName:X.attributeName,Name:X.atom,"( )":X.paren,"{ }":X.brace,",":X.separator,[dB]:X.punctuation}),VO.add({[lB]:jD({closing:`}`,align:!0})}),KO.add({[lB]:FD})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*(\{|\})$/}}),pB=/^[a-zA-Z0-9_@(]$/,mB=fB.data.of({autocomplete(e){let t=tB(e.state),n=nB(e.state);if(!t)return null;let r=e.matchBefore(/\w*/);if(!r)return null;let i=r.text.split(``).pop();if(!pB.test(i)&&!e.explicit)return null;let a=KL(t,e.state.doc.toString(),Uz(e.state.doc,e.pos),void 0,void 0,n?.autocompleteOptions);return a.length===0?null:{from:r.from,options:a.map(t=>({label:t.label,detail:t.detail||``,info(r){if(n?.onCompletionInfoRender)return n.onCompletionInfoRender(t,e,r);if(t.documentation||t.isDeprecated&&t.deprecationReason){let e=document.createElement(`div`);return e.textContent=t.documentation||t.deprecationReason||``,e}}}))}}}),hB=J.domEventHandlers({click(e,t){let n=tB(t.state);if(!n)return;let r=t.state.selection.main.head,i=Uz(t.state.doc,r),a=zL(n,AL(t.state.doc.toString(),i).state),o=nB(t.state);o?.onShowInDocs&&Jz(e)&&o.onShowInDocs(a.fieldDef?.name,a.type?.toString(),a.parentType?.toString())}}),gB=[`error`,`warning`,`info`],_B=vz(e=>{let t=tB(e.state),n=nB(e.state);if(!t)return[];let r=vl(t);if(r.length){if(!n?.showErrorOnInvalidSchema)return[];let t=r.map(e=>e.message);return[{from:0,to:e.state.doc.length,severity:`error`,message:t.join(`
+`),actions:[]}]}return TR(e.state.doc.toString(),t).map(t=>{if(!t.severity||!t.source)return null;let n=Hz(e.state.doc,new Kz(t.range.start.line,t.range.start.character)),r=Math.max(0,Math.min(n,e.state.doc.length)),i=Hz(e.state.doc,new Kz(t.range.end.line,t.range.end.character-1)),a=Math.min(Math.max(r+1,i),e.state.doc.length);return{from:r,to:r===a?a+1:a,severity:gB[t.severity-1],message:t.message,actions:[]}}).filter(e=>!!e)},{needsRefresh(e){return e.startState.field(Xz)!==e.state.field(Xz)||e.startState.field(Qz)!==e.state.field(Qz)}})})),yB,bB,xB=n((()=>{lz(),uD(),yB=RE({String:X.string,Number:X.number,"True False":X.bool,PropertyName:X.propertyName,Null:X.null,", :":X.separator,"[ ]":X.squareBracket,"{ }":X.brace}),bB=cz.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[yB],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0})})),SB=i({json:()=>wB,jsonLanguage:()=>EB,jsonParseLinter:()=>TB});function CB(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}function wB(){return new IO(EB)}var TB,EB,DB=n((()=>{xB(),Rk(),TB=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=CB(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]},EB=DO.define({name:`json`,parser:bB.configure({props:[VO.add({Object:ND({except:/^\s*\}/}),Array:ND({except:/^\s*\]/})}),KO.add({"Object Array":FD})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}})})),OB=A(`<div class="editor svelte-mhzyj2"></div>`);function kB(e,t){Xe(t,!0);let n=Li(t,`language`,3,`graphql`),r=Li(t,`readOnly`,3,!1),i=tn(null),a,o=tn(null),s=tn(null);Ri(()=>{if(globalThis.document===void 0)return;let e=!1;return(async()=>{let[{EditorView:c,keymap:l,lineNumbers:u,highlightActiveLine:d},{EditorState:f},{defaultKeymap:p,history:m,historyKeymap:h},{syntaxHighlighting:g,defaultHighlightStyle:_,bracketMatching:v,indentOnInput:y},{closeBrackets:b,closeBracketsKeymap:x},{graphql:S,updateSchema:ee},{json:C},{buildSchema:te}]=await Promise.all([Promise.resolve().then(()=>(eE(),Dv)),Promise.resolve().then(()=>(cv(),Sg)),Promise.resolve().then(()=>(lN(),Yk)),Promise.resolve().then(()=>(Rk(),dD)),Promise.resolve().then(()=>(_F(),uN)),Promise.resolve().then(()=>(vB(),Vz)),Promise.resolve().then(()=>(DB(),SB)),Promise.resolve().then(()=>(kh(),Oh))]);if(e)return;let ne=t.theme??Jk,re=n()===`graphql`?S(t.schema?te(t.schema):void 0):C();E(s,new c({parent:a,state:f.create({doc:t.value,extensions:[u(),d(),m(),v(),b(),y(),g(_,{fallback:!0}),l.of([...x,...p,...h]),re,ne,c.editable.of(!r()),c.updateListener.of(e=>{e.docChanged&&t.onChange(e.state.doc.toString())})]})}),!0),E(o,ee,!0),E(i,te,!0)})(),()=>{e=!0,k(s)?.destroy()}}),Nn(()=>{if(!(!k(s)||!k(o)||!k(i))&&!(n()!==`graphql`||!t.schema))try{k(o)(k(s),k(i)(t.schema))}catch{}}),Nn(()=>{k(s)&&k(s).state.doc.toString()!==t.value&&k(s).dispatch({changes:{from:0,insert:t.value,to:k(s).state.doc.length}})});var c=OB();Ii(c,e=>a=e,()=>a),j(e,c),Ze()}var AB=A(`<button class="action svelte-1x0f4yt" type="button">Export</button>`),jB=A(`<button class="action svelte-1x0f4yt" type="button">Import</button> <input accept="application/json" class="hidden-input svelte-1x0f4yt" type="file"/>`,1),MB=A(`<button class="action svelte-1x0f4yt" type="button">Clear</button>`),NB=A(`<button aria-label="Dismiss notice" class="notice-dismiss svelte-1x0f4yt" type="button">&times;</button>`),PB=A(`<div class="notice svelte-1x0f4yt"><span> </span> <!></div>`),FB=A(`<div class="empty svelte-1x0f4yt">No history yet.</div>`),IB=Gr(`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-1x0f4yt"><path d="M12 2L14.9389 7.95492L21.5106 8.90983L16.7553 13.5451L17.8779 20.0902L12 17L6.12215 20.0902L7.24472 13.5451L2.48944 8.90983L9.06108 7.95492L12 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>`),LB=Gr(`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-1x0f4yt"><path d="M12 2L14.9389 7.95492L21.5106 8.90983L16.7553 13.5451L17.8779 20.0902L12 17L6.12215 20.0902L7.24472 13.5451L2.48944 8.90983L9.06108 7.95492L12 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>`),RB=A(`<div aria-label="Load history entry" class="entry svelte-1x0f4yt" role="button" tabindex="0"><button type="button"><!></button> <div class="meta svelte-1x0f4yt"><div class="entry-title svelte-1x0f4yt"> </div> <div class="entry-time svelte-1x0f4yt"> </div></div> <button aria-label="Remove entry" class="remove svelte-1x0f4yt" type="button">&times;</button></div>`),zB=A(`<div class="panel svelte-1x0f4yt"><div class="header svelte-1x0f4yt"><span class="title svelte-1x0f4yt">History</span> <div class="actions svelte-1x0f4yt"><!> <!> <!></div></div> <!> <div class="list svelte-1x0f4yt"><!></div></div>`);function BB(e,t){Xe(t,!0);let n=Li(t,`notice`,3,null),r=tn(null),i=Wt(()=>[...t.entries].sort((e,t)=>e.favorite===t.favorite?t.timestamp-e.timestamp:e.favorite?-1:1));function a(e){return new Date(e).toLocaleString()}function o(e,n){t.onLoad(n,e.shiftKey)}function s(e,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.onLoad(n,e.shiftKey))}function c(e){let n=e.currentTarget,r=n.files?.[0];r&&t.onImport?.(r),n.value=``}function l(){k(r)?.click()}var u=zB(),d=D(u),f=O(D(d),2),p=D(f),m=e=>{var n=AB();Ir(`click`,n,function(...e){t.onExport?.apply(this,e)}),j(e,n)};ei(p,e=>{t.onExport&&e(m)});var h=O(p,2),g=e=>{var t=jB(),n=yn(t),i=O(n,2);Ii(i,e=>E(r,e),()=>k(r)),Ir(`click`,n,l),Ir(`change`,i,c),j(e,t)};ei(h,e=>{t.onImport&&e(g)});var _=O(h,2),v=e=>{var n=MB();Ir(`click`,n,function(...e){t.onClear?.apply(this,e)}),j(e,n)};ei(_,e=>{t.entries.length>0&&e(v)}),T(f),T(d);var y=O(d,2),b=e=>{var r=PB(),i=D(r),a=D(i,!0);T(i);var o=O(i,2),s=e=>{var n=NB();Ir(`click`,n,function(...e){t.onDismissNotice?.apply(this,e)}),j(e,n)};ei(o,e=>{t.onDismissNotice&&e(s)}),T(r),zn(()=>qr(a,n())),j(e,r)};ei(y,e=>{n()&&e(b)});var x=O(y,2),S=D(x),ee=e=>{j(e,FB())},C=e=>{var n=Kr();ai(yn(n),17,()=>k(i),e=>e.id,(e,n)=>{var r=RB(),i=D(r);let c;var l=D(i),u=e=>{j(e,IB())},d=e=>{j(e,LB())};ei(l,e=>{k(n).favorite?e(u):e(d,-1)}),T(i);var f=O(i,2),p=D(f),m=D(p,!0);T(p);var h=O(p,2),g=D(h,!0);T(h),T(f);var _=O(f,2);T(r),zn(e=>{Oi(i,`aria-label`,k(n).favorite?`Unfavorite`:`Favorite`),c=vi(i,1,`star svelte-1x0f4yt`,null,c,{active:k(n).favorite}),qr(m,k(n).title),qr(g,e)},[()=>a(k(n).timestamp)]),Ir(`click`,r,e=>o(e,k(n).id)),Ir(`keydown`,r,e=>s(e,k(n).id)),Ir(`click`,i,e=>{e.stopPropagation(),t.onFavorite(k(n).id)}),Ir(`click`,_,e=>{e.stopPropagation(),t.onRemove(k(n).id)}),j(e,r)}),j(e,n)};ei(S,e=>{k(i).length===0?e(ee):e(C,-1)}),T(x),T(u),j(e,u),Ze()}Lr([`click`,`change`,`keydown`]);var VB=A(`<div class="metadata svelte-1l6l2pw"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-1l6l2pw"><path d="M14 5.75L20.25 12L14 18.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M19.5 12H3.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path></svg> <!></div>`),HB=A(`<div class="footer svelte-1l6l2pw"><!></div>`),UB=A(`<div class="result svelte-1l6l2pw"><div class="label svelte-1l6l2pw">Response</div> <!> <!> <!></div>`);function WB(e,t){Xe(t,!0);let n=Li(t,`streamIntervals`,19,()=>[]),r=Li(t,`timing`,3,null),i=Wt(()=>{if(!r())return null;if(n().length>0){let e=Math.round(a(n()));return`${n().length+1} messages &middot; median ${e}ms`}return`${Math.round(r().endMs-r().startMs)}ms &middot; first byte ${Math.round(r().firstByteMs-r().startMs)}ms`});function a(e){if(e.length===0)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function o(e){}var s=UB(),c=O(D(s),2);kB(c,{language:`json`,onChange:o,readOnly:!0,get theme(){return t.theme},get value(){return t.value}});var l=O(c,2),u=e=>{var t=VB();di(O(D(t),2),()=>k(i)),T(t),j(e,t)};ei(l,e=>{k(i)&&e(u)});var d=O(l,2),f=e=>{var n=HB();fi(D(n),()=>t.footer,()=>({result:t.value})),T(n),j(e,n)};ei(d,e=>{t.footer&&e(f)}),T(s),j(e,s),Ze()}var GB=A(`<div role="separator" tabindex="0"></div>`);function KB(e,t){Xe(t,!0);let n=tn(!1),r=tn(0),i=tn(0);function a(e){t.onKeyAdjust&&(t.orientation===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),t.onKeyAdjust(-16)):e.key===`ArrowRight`&&(e.preventDefault(),t.onKeyAdjust(16)):e.key===`ArrowUp`?(e.preventDefault(),t.onKeyAdjust(-16)):e.key===`ArrowDown`&&(e.preventDefault(),t.onKeyAdjust(16)))}function o(e){e.preventDefault(),E(n,!0),E(r,e.clientX,!0),E(i,e.clientY,!0),e.currentTarget instanceof Element&&e.currentTarget.setPointerCapture(e.pointerId),t.onDragStart?.()}function s(e){k(n)&&t.onDrag(e.clientX-k(r),e.clientY-k(i))}function c(e){k(n)&&(E(n,!1),e.currentTarget instanceof Element&&e.currentTarget.releasePointerCapture(e.pointerId),t.onDragEnd?.())}var l=GB();let u;zn(()=>{Oi(l,`aria-label`,t.label),Oi(l,`aria-orientation`,t.orientation),Oi(l,`aria-valuemax`,t.max),Oi(l,`aria-valuemin`,t.min),Oi(l,`aria-valuenow`,t.value),u=vi(l,1,`splitter ${t.orientation??``}`,`svelte-1f4xp5w`,u,{dragging:k(n)})}),Ir(`keydown`,l,a),Ir(`pointerdown`,l,o),Ir(`pointermove`,l,s),Ir(`pointerup`,l,c),j(e,l),Ze()}Lr([`keydown`,`pointerdown`,`pointermove`,`pointerup`]);var qB=A(`<input class="edit svelte-1s5m1m3" type="text"/>`),JB=A(`<span class="title svelte-1s5m1m3"> </span>`),YB=A(`<div role="tab" tabindex="0"><!> <!> <button aria-label="Close tab" class="close svelte-1s5m1m3">&times;</button></div>`),XB=A(`<div class="tabbar svelte-1s5m1m3" role="tablist"><!> <button aria-label="New tab" class="add svelte-1s5m1m3">+</button></div>`);function ZB(e,t){Xe(t,!0);let n=tn(``),r=tn(null),i=tn(null);function a(){E(r,null),E(n,``)}function o(){k(r)!==null&&(t.onRename(k(r),k(n)),E(r,null),E(n,``))}function s(e,n){e.stopPropagation(),t.onClose(n)}function c(e){e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),a())}async function l(e){E(r,e.id,!0),E(n,e.title,!0),await Tr(),k(i)?.select()}var u=XB(),d=D(u);ai(d,17,()=>t.tabs,e=>e.id,(e,a)=>{var u=YB();let d;var f=D(u),p=e=>{var t=qB();Di(t),Ii(t,e=>E(i,e),()=>k(i)),Fr(`blur`,t,o),Ir(`click`,t,e=>e.stopPropagation()),Ir(`keydown`,t,c),Mi(t,()=>k(n),e=>E(n,e)),j(e,t)},m=e=>{var t=JB(),n=D(t,!0);T(t),zn(()=>qr(n,k(a).title)),j(e,t)};ei(f,e=>{k(r)===k(a).id?e(p):e(m,-1)});var h=O(f,2),g=e=>{var n=Kr();fi(yn(n),()=>t.extras,()=>({tab:k(a)})),j(e,n)};ei(h,e=>{t.extras&&e(g)});var _=O(h,2);T(u),zn(()=>{Oi(u,`aria-selected`,k(a).id===t.activeId),d=vi(u,1,`tab svelte-1s5m1m3`,null,d,{active:k(a).id===t.activeId})}),Ir(`dblclick`,u,()=>l(k(a))),Ir(`click`,u,()=>t.onSelect(k(a).id)),Ir(`keydown`,u,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.onSelect(k(a).id))}),Ir(`click`,_,e=>s(e,k(a).id)),j(e,u)});var f=O(d,2);T(u),Ir(`click`,f,function(...e){t.onAdd?.apply(this,e)}),j(e,u),Ze()}Lr([`dblclick`,`click`,`keydown`]);var QB=A(`<option> </option>`),$B=A(`<select aria-label="Operation" class="picker svelte-50ld1a"><option>Select operation…</option><!></select>`),eV=A(`<button class="toggle svelte-50ld1a" type="button"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M20.646 3.36267C20.0461 2.75178 19.7917 1.83922 19.7917 1H19.2083C19.2083 1.83575 18.9563 2.74893 18.3526 3.35264C17.7489 3.95635 16.8358 4.20833 16 4.20833V4.79167C16.8392 4.79167 17.7518 5.04611 18.3627 5.64596C18.9822 6.25433 19.2083 7.15499 19.2083 8H19.7917C19.7917 7.15156 20.0203 6.25159 20.6359 5.63594C21.2516 5.02029 22.1516 4.79167 23 4.79167V4.20833C22.155 4.20833 21.2543 3.98225 20.646 3.36267Z"></path><path d="M2 13.75C5.03345 13.75 7.04641 14.4196 8.31342 15.6866C9.58043 16.9536 10.25 18.9666 10.25 22H11.75C11.75 18.9666 12.4196 16.9536 13.6866 15.6866C14.9536 14.4196 16.9666 13.75 20 13.75V12.25C16.9666 12.25 14.9536 11.5804 13.6866 10.3134C12.4196 9.04641 11.75 7.03345 11.75 4H10.25C10.25 7.03345 9.58043 9.04641 8.31342 10.3134C7.04641 11.5804 5.03345 12.25 2 12.25V13.75Z"></path></svg> Format</button>`),tV=A(`<span class="hint svelte-50ld1a">Loading schema…</span>`),nV=A(`<button type="button"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M7 8C7 8.55228 6.55228 9 6 9C5.44772 9 5 8.55228 5 8C5 7.44772 5.44772 7 6 7C6.55228 7 7 7.44772 7 8Z"></path><path d="M10 8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8C8 7.44772 8.44772 7 9 7C9.55228 7 10 7.44772 10 8Z"></path><path d="M12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9Z"></path><path d="M2 4V20H11V18.5H3.5V5.5H20.5V9H22V4H2Z"></path><path d="M13 16.75C14.6446 16.75 15.6575 17.114 16.2718 17.7282C16.886 18.3425 17.25 19.3554 17.25 21H18.75C18.75 19.3554 19.114 18.3425 19.7282 17.7282C20.3425 17.114 21.3554 16.75 23 16.75V15.25C21.3554 15.25 20.3425 14.886 19.7282 14.2718C19.114 13.6575 18.75 12.6446 18.75 11H17.25C17.25 12.6446 16.886 13.6575 16.2718 14.2718C15.6575 14.886 14.6446 15.25 13 15.25V16.75Z"></path></svg> History</button>`),rV=A(`<button type="button"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 4V5L16.5 6.5L18 9.5H19L20.5 6.5L21 6.25V21H3V3H15.5L13.5 4ZM7 16.5H14V15H7V16.5ZM7 12.75H10.5V11.25H7V12.75ZM12 12.75H17V11.25H12V12.75ZM7 9H13V7.5H7V9Z"></path><path d="M18.5 1L19.4453 3.55468L22 4.5L19.4453 5.44532L18.5 8L17.5547 5.44532L15 4.5L17.5547 3.55468L18.5 1Z"></path></svg> Docs</button>`),iV=A(`<div class="toolbar svelte-50ld1a"><button class="run svelte-50ld1a"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M4 3.53711V20.4642L20.927 12.0006L4 3.53711Z"></path></svg> </button> <!> <!> <!> <!> <span class="spacer svelte-50ld1a"></span> <!> <!></div>`);function aV(e,t){Xe(t,!0);let n=Li(t,`docsAvailable`,3,!1),r=Li(t,`docsOpen`,3,!1),i=Li(t,`historyOpen`,3,!1),a=Li(t,`operationName`,3,null),o=Li(t,`operations`,19,()=>[]),s=Wt(()=>o().filter(e=>e.name!==null));function c(e){let n=e.currentTarget.value;t.onSelectOperation?.(n||null)}var l=iV(),u=D(l),d=O(D(u));T(u);var f=O(u,2),p=e=>{var t=$B(),n=D(t);n.value=n.__value=``,ai(O(n),17,()=>k(s),ti,(e,t)=>{var n=QB(),r=D(n);T(n);var i={};zn(()=>{qr(r,`${k(t).type??``} ${k(t).name??``}`),i!==(i=k(t).name)&&(n.value=(n.__value=k(t).name)??``)}),j(e,n)}),T(t);var r;Si(t),zn(()=>{r!==(r=a()??``)&&(t.value=(t.__value=a()??``)??``,xi(t,a()??``))}),Ir(`change`,t,c),j(e,t)};ei(f,e=>{k(s).length>1&&e(p)});var m=O(f,2),h=e=>{var n=eV();zn(()=>n.disabled=t.disabled),Ir(`click`,n,function(...e){t.onFormat?.apply(this,e)}),j(e,n)};ei(m,e=>{t.onFormat&&e(h)});var g=O(m,2),_=e=>{var n=Kr();fi(yn(n),()=>t.extras),j(e,n)};ei(g,e=>{t.extras&&e(_)});var v=O(g,2),y=e=>{j(e,tV())};ei(v,e=>{t.schemaLoading&&e(y)});var b=O(v,4),x=e=>{var n=nV();let r;zn(()=>{Oi(n,`aria-pressed`,i()),r=vi(n,1,`toggle svelte-50ld1a`,null,r,{active:i()})}),Ir(`click`,n,function(...e){t.onToggleHistory?.apply(this,e)}),j(e,n)};ei(b,e=>{t.onToggleHistory&&e(x)});var S=O(b,2),ee=e=>{var i=rV();let a;zn(()=>{Oi(i,`aria-pressed`,r()),a=vi(i,1,`toggle svelte-50ld1a`,null,a,{active:r()}),i.disabled=!n()}),Ir(`click`,i,function(...e){t.onToggleDocs?.apply(this,e)}),j(e,i)};ei(S,e=>{t.onToggleDocs&&e(ee)}),T(l),zn(()=>{u.disabled=t.disabled,qr(d,` ${t.running?`Running…`:`Run`}`)}),Ir(`click`,u,function(...e){t.onRun?.apply(this,e)}),j(e,l),Ze()}Lr([`click`,`change`]);function oV(e){let t=`${e}:`;function n(){try{return globalThis.localStorage!==void 0}catch{return!1}}return{get(e){if(!n())return null;let r=globalThis.localStorage.getItem(t+e);if(r===null)return null;try{return JSON.parse(r)}catch{return null}},remove(e){n()&&globalThis.localStorage.removeItem(t+e)},set(e,r){n()&&globalThis.localStorage.setItem(t+e,JSON.stringify(r))}}}function sV(){let e=new Map;return{get(t){let n=e.get(t);if(n===void 0)return null;try{return JSON.parse(n)}catch{return null}},remove(t){e.delete(t)},set(t,n){e.set(t,JSON.stringify(n))}}}function cV(e,t){if(e.length<=t)return e;let n=e.filter(e=>e.favorite),r=e.filter(e=>!e.favorite).slice(0,Math.max(0,t-n.length));return[...n,...r].sort((e,t)=>t.timestamp-e.timestamp)}var lV=100,uV=`history`,dV=class{#e=tn(cn([]));get entries(){return k(this.#e)}set entries(e){E(this.#e,e,!0)}#t;constructor(e){this.#t=e;let t=e.get(uV);Array.isArray(t)&&(this.entries=t.map(e=>({favorite:!!e.favorite,headers:e.headers??`{}`,id:e.id,operationName:e.operationName??null,query:e.query??``,timestamp:e.timestamp??Date.now(),title:e.title??`untitled`,variables:e.variables??`{}`})))}add(e){let t={favorite:!1,headers:e.headers,id:crypto.randomUUID(),operationName:e.operationName,query:e.query,timestamp:Date.now(),title:e.title,variables:e.variables};this.entries=[t,...this.entries],this.#n()}clear(){this.entries=this.entries.filter(e=>e.favorite)}favorite(e){let t=this.entries.find(t=>t.id===e);t&&(t.favorite=!t.favorite)}persist(){this.#t.set(uV,this.entries)}remove(e){this.entries=this.entries.filter(t=>t.id!==e)}#n(){this.entries=cV(this.entries,lV)}};function fV(e){if(!(e.metaKey||e.ctrlKey))return null;if(e.key===`Enter`)return e.shiftKey?{type:`newTab`}:e.altKey?null:{type:`run`};if(e.shiftKey&&!e.altKey){let t=e.key.toLowerCase();if(t===`w`)return{type:`closeTab`};if(t===`f`)return{type:`format`}}if(e.altKey&&!e.shiftKey){if(e.key===`ArrowRight`)return{type:`nextTab`};if(e.key===`ArrowLeft`)return{type:`prevTab`}}return null}kh();var pV=class{#e=tn(null);get error(){return k(this.#e)}set error(e){E(this.#e,e,!0)}#t=tn(!1);get loading(){return k(this.#t)}set loading(e){E(this.#t,e,!0)}#n=tn(null);get schema(){return k(this.#n)}set schema(e){E(this.#n,e,!0)}#r=tn(``);get sdl(){return k(this.#r)}set sdl(e){E(this.#r,e,!0)}async introspect(e){this.loading=!0,this.error=null;try{let t=(await e({query:Yp()})).data;this.schema=rm(t),this.sdl=bm(this.schema)}catch(e){this.error=String(e)}finally{this.loading=!1}}};kh();function mV(e){if(!e.trim())return e;try{return as(_o(e))}catch{return e}}kh();function hV(e,t){let n=t[0];if(n&&n.name)return n.name;if(n)return n.type;let r=e.trim();return r?r.slice(0,20):`untitled`}function gV(e){let t=e.trim();if(!t)return[];try{let e=_o(t),n=[];for(let t of e.definitions)t.kind===`OperationDefinition`&&n.push({name:t.name?.value??null,type:t.operation});return n}catch{return[]}}var _V=1024*1024,vV=50;function yV(e){return{headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables}}function bV(e){if(!xV(e))return{error:`not an object`};if(e.version!==1)return{error:`unsupported version: ${String(e.version)}`};if(typeof e.exportedAt!=`string`)return{error:`exportedAt: not a string`};if(!Array.isArray(e.tabs))return{error:`tabs: not an array`};if(e.tabs.length>vV)return{error:`tabs: exceeds ${vV}`};let t=[];for(let n=0;n<e.tabs.length;n++){let r=CV(e.tabs[n],n);if(typeof r==`string`)return{error:r};t.push(r)}return{exportedAt:e.exportedAt,tabs:t,version:1}}function xV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function SV(e){return e.length>_V}function CV(e,t){return xV(e)?typeof e.headers==`string`?typeof e.query==`string`?typeof e.title==`string`?typeof e.variables==`string`?e.operationName!==null&&typeof e.operationName!=`string`?`tabs[${t}].operationName: not a string or null`:SV(e.headers)?`tabs[${t}].headers: exceeds 1 MB`:SV(e.query)?`tabs[${t}].query: exceeds 1 MB`:SV(e.title)?`tabs[${t}].title: exceeds 1 MB`:SV(e.variables)?`tabs[${t}].variables: exceeds 1 MB`:typeof e.operationName==`string`&&SV(e.operationName)?`tabs[${t}].operationName: exceeds 1 MB`:{headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables}:`tabs[${t}].variables: not a string`:`tabs[${t}].title: not a string`:`tabs[${t}].query: not a string`:`tabs[${t}].headers: not a string`:`tabs[${t}]: not an object`}var wV=`session`,TV=class{#e=tn(``);get activeId(){return k(this.#e)}set activeId(e){E(this.#e,e,!0)}#t=tn(cn([]));get tabs(){return k(this.#t)}set tabs(e){E(this.#t,e,!0)}#n=Wt(()=>this.tabs.find(e=>e.id===this.activeId));get active(){return k(this.#n)}set active(e){E(this.#n,e)}#r;constructor(e){this.#r=e;let t=e.get(wV);if(t&&t.tabs.length>0)this.tabs=t.tabs.map(e=>this.#a(e)),this.activeId=this.tabs.some(e=>e.id===t.activeId)?t.activeId:this.tabs[0].id;else{let e=this.#i();this.tabs=[e],this.activeId=e.id}}addTab(e){let t=e?this.#o(e):this.#i();this.tabs.push(t),this.activeId=t.id}closeTab(e){let t=this.tabs.findIndex(t=>t.id===e);if(t!==-1){if(this.tabs.length===1){let e=this.#i();this.tabs=[e],this.activeId=e.id;return}this.tabs.splice(t,1),this.activeId===e&&(this.activeId=this.tabs[Math.max(0,t-1)].id)}}exportAll(){return{exportedAt:new Date().toISOString(),tabs:this.tabs.map(yV),version:1}}exportTab(e){let t=this.tabs.find(t=>t.id===e);return t?yV(t):null}formatActive(){let e=this.active;if(!e)return;let t=mV(e.query);t!==e.query&&(e.query=t,e.operations=gV(t),e.titleDirty||(e.title=hV(t,e.operations)))}importTabs(e,t){let n=e.tabs.slice(0,50),r=[],i=e.tabs.length-n.length;if(t.mode===`replace`){this.tabs=[];for(let e of n)this.tabs.push(this.#o(e));if(this.tabs.length===0){let e=this.#i();this.tabs=[e],this.activeId=e.id}else this.activeId=this.tabs[0].id;return{added:n.length,errors:r,skipped:i}}for(let e of n)this.tabs.push(this.#o(e));return n.length>0&&(this.activeId=this.tabs[this.tabs.length-1].id),{added:n.length,errors:r,skipped:i}}nextTab(){if(this.tabs.length<=1)return;let e=this.tabs.findIndex(e=>e.id===this.activeId);if(e===-1)return;let t=(e+1)%this.tabs.length;this.activeId=this.tabs[t].id}persist(){this.#r.set(wV,{activeId:this.activeId,tabs:this.tabs})}prevTab(){if(this.tabs.length<=1)return;let e=this.tabs.findIndex(e=>e.id===this.activeId);if(e===-1)return;let t=(e-1+this.tabs.length)%this.tabs.length;this.activeId=this.tabs[t].id}renameActive(e){this.active&&(this.active.title=e.trim()||`untitled`,this.active.titleDirty=!0)}renameTab(e,t){let n=this.tabs.find(t=>t.id===e);n&&(n.title=t.trim()||`untitled`,n.titleDirty=!0)}async run(e,t={}){let n=this.active;if(!n)return!1;let r=t.subscriptionMode??`append`,i=t.signal;n.streamIntervals=[];let a=performance.now();n.timing={endMs:a,firstByteMs:a,startMs:a};try{let t=n.headers.trim()?JSON.parse(n.headers):{},o=n.variables.trim()?JSON.parse(n.variables):{},s=await e({headers:t,operationName:n.operationName,query:n.query,variables:o});if(EV(s)){n.result=``;let e=s[Symbol.asyncIterator](),t=!1,o=a;try{for(;;){if(i?.aborted){await e.return?.();break}let a=await e.next();if(a.done)break;let s=performance.now();if(!t)t=!0,o=s,n.timing={...n.timing,endMs:s,firstByteMs:s};else{let e=s-o;o=s,n.streamIntervals.length>=500&&n.streamIntervals.shift(),n.streamIntervals=[...n.streamIntervals,e],n.timing={...n.timing,endMs:s}}let c=JSON.stringify(a.value,null,2);if(r===`append`){let e=`// ${new Date().toISOString()}\n${c}\n`;n.result=n.result?`${n.result}\n${e}`:e}else n.result=c}}finally{await e.return?.()}return!0}let c=performance.now();return n.timing={...n.timing,firstByteMs:c},n.result=JSON.stringify(s,null,2),n.timing={...n.timing,endMs:performance.now()},!0}catch(e){return n.result=JSON.stringify({error:String(e)},null,2),n.timing={...n.timing,endMs:performance.now()},!1}}overwriteActive(e){let t=this.active;if(!t)return;let n=e.query??``;t.headers=e.headers??`{}`,t.operations=gV(n),t.operationName=e.operationName??null,t.query=n,t.result=``,t.streamIntervals=[],t.timing=null,t.variables=e.variables??`{}`,e.title&&!t.titleDirty?t.title=e.title:t.titleDirty||(t.title=hV(n,t.operations))}selectOperation(e,t){let n=this.tabs.find(t=>t.id===e);n&&(n.operationName=t)}selectTab(e){this.tabs.some(t=>t.id===e)&&(this.activeId=e)}updateQuery(e,t){let n=this.tabs.find(t=>t.id===e);if(!n)return;n.query=t;let r=gV(t);n.operations=r,r.length===0?n.operationName=null:r.length===1?n.operationName=r[0].name:n.operationName&&!r.some(e=>e.name===n.operationName)&&(n.operationName=null),n.titleDirty||(n.title=hV(t,r))}#i(){return{headers:`{}`,id:crypto.randomUUID(),operationName:null,operations:[],query:``,result:``,streamIntervals:[],timing:null,title:`untitled`,titleDirty:!1,variables:`{}`}}#a(e){return{headers:e.headers??`{}`,id:e.id,operationName:e.operationName??null,operations:e.operations??gV(e.query??``),query:e.query??``,result:e.result??``,streamIntervals:[],timing:null,title:e.title??`untitled`,titleDirty:e.titleDirty??e.title!==`untitled`,variables:e.variables??`{}`}}#o(e){let t=e.query??``,n=gV(t),r=e.title??hV(t,n);return{headers:e.headers??`{}`,id:crypto.randomUUID(),operationName:e.operationName??null,operations:n,query:t,result:``,streamIntervals:[],timing:null,title:r,titleDirty:!!e.title,variables:e.variables??`{}`}}};function EV(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}var DV=A(`<!> <!>`,1),OV=A(`<!> <!>`,1),kV=A(`<div class="status svelte-pvt4yg"><span class="svelte-pvt4yg">Schema error</span> </div>`),AV=A(`<div class="graphiql svelte-pvt4yg"><!> <!> <div><!> <div class="center svelte-pvt4yg"><div class="left svelte-pvt4yg"><div class="query svelte-pvt4yg"><!></div> <!> <div class="bottom svelte-pvt4yg"><div class="switcher svelte-pvt4yg"><button>Variables</button> <button>Headers</button></div> <!></div></div> <!> <div class="right svelte-pvt4yg"><!></div></div> <!></div> <!></div>`);function jV(e,t){Xe(t,!0);let n=Li(t,`initialQuery`,3,``),r=Li(t,`namespace`,3,`eol-graphiql`),i=Li(t,`subscriptionMode`,3,`append`),a=t.storage??(globalThis.localStorage===void 0?sV():oV(r())),o=new dV(a),s=new pV,c=new TV(a);n()&&c.active&&c.active.query===``&&c.updateQuery(c.active.id,n());let l=tn(`variables`),u=tn(cn(a.get(`layout.bottomHeight`)??35)),d=tn(null),f=tn(cn(a.get(`docExplorer`)??!1)),p=tn(cn(a.get(`layout.docsWidth`)??320)),m=0,h=0,g=0,_=0,v=0,y=0,b=tn(null),x=tn(cn(a.get(`historyPanel`)??!1)),S=tn(cn(a.get(`layout.historyWidth`)??300)),ee=tn(null),C=tn(cn(a.get(`layout.leftWidth`)??50)),te=null,ne=tn(!1),re=tn(0),ie=tn(0),ae;Nn(()=>{let e=()=>{clearTimeout(ae),ae=setTimeout(()=>{E(re,globalThis.innerWidth,!0),E(ie,globalThis.innerHeight,!0)},100)};return e(),globalThis.addEventListener(`resize`,e),()=>{globalThis.removeEventListener(`resize`,e)}}),Nn(()=>{c.tabs,c.activeId;let e=setTimeout(()=>{c.persist()},300);return()=>clearTimeout(e)}),Nn(()=>{o.entries;let e=setTimeout(()=>{o.persist()},300);return()=>clearTimeout(e)}),Nn(()=>{a.set(`docExplorer`,k(f))}),Nn(()=>{a.set(`historyPanel`,k(x))}),Nn(()=>{a.set(`layout.bottomHeight`,k(u))}),Nn(()=>{a.set(`layout.docsWidth`,k(p))}),Nn(()=>{a.set(`layout.historyWidth`,k(S))}),Nn(()=>{a.set(`layout.leftWidth`,k(C))}),Ri(()=>{s.introspect(t.fetcher)});function oe(e,t,n){return Math.min(Math.max(e,t),n)}async function se(){if(k(ne)){te?.abort();return}E(ne,!0),te=new AbortController;try{let e=c.active;await c.run(t.fetcher,{signal:te.signal,subscriptionMode:i()})&&e&&o.add({headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables})}finally{te=null,E(ne,!1)}}function ce(e,t){let n=o.entries.find(t=>t.id===e);if(!n)return;let r={headers:n.headers,operationName:n.operationName,query:n.query,title:n.title,variables:n.variables};t?c.addTab(r):c.overwriteActive(r)}function le(){c.persist()}function ue(e,t){if(h===0)return;let n=t/h*100;E(u,oe(m-n,15,70),!0)}function de(){m=k(u),h=k(ee)?.getBoundingClientRect().height??0}function fe(e){E(u,oe(k(u)-e,15,70),!0)}function pe(e){E(p,oe(g-e,240,600),!0)}function me(){g=k(p)}function he(e){E(p,oe(k(p)-e,240,600),!0)}function ge(){if(globalThis.URL===void 0||globalThis.document===void 0)return;let e=c.exportAll(),t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=globalThis.document.createElement(`a`);r.download=`graphiql-session-${e.exportedAt}.json`,r.href=n,r.click(),URL.revokeObjectURL(n)}function _e(e){c.active&&(c.active.headers=e)}function ve(e){E(S,oe(_+e,300,500),!0)}function ye(){_=k(S)}function be(e){E(S,oe(k(S)+e,300,500),!0)}async function xe(e){let t;try{t=await e.text()}catch(e){E(b,`Import failed: ${String(e)}`);return}let n;try{n=JSON.parse(t)}catch(e){E(b,`Import failed: invalid JSON (${String(e)})`);return}let r=bV(n);if(`error`in r){E(b,`Import failed: ${r.error}`);return}let i=c.importTabs(r,{mode:`append`}),a=[`Imported ${i.added} tab${i.added===1?``:`s`}`];i.skipped>0&&a.push(`skipped ${i.skipped}`),i.errors.length>0&&a.push(`${i.errors.length} error${i.errors.length===1?``:`s`}`),E(b,a.join(`, `),!0)}function Se(e){let t=fV(e);if(t)switch(e.preventDefault(),t.type){case`closeTab`:c.closeTab(c.activeId);break;case`format`:c.formatActive();break;case`newTab`:c.addTab();break;case`nextTab`:c.nextTab();break;case`prevTab`:c.prevTab();break;case`run`:se();break}}function Ce(e){if(y===0)return;let t=e/y*100;E(C,oe(v+t,20,80),!0)}function we(){v=k(C),y=k(d)?.getBoundingClientRect().width??0}function Te(e){E(C,oe(k(C)+e,20,80),!0)}function Ee(e){c.active&&c.updateQuery(c.active.id,e)}function De(e){c.active&&(c.active.variables=e)}var Oe=AV();Fr(`beforeunload`,dn,le),Fr(`keydown`,dn,Se);var ke=D(Oe);{let e=Wt(()=>k(ne)||!c.active),n=Wt(()=>s.schema!==null),r=Wt(()=>c.active?.operationName??null),i=Wt(()=>c.active?.operations??[]);aV(ke,{get disabled(){return k(e)},get docsAvailable(){return k(n)},get docsOpen(){return k(f)},get extras(){return t.toolbarExtras},get historyOpen(){return k(x)},onFormat:()=>c.formatActive(),onRun:se,onSelectOperation:e=>{c.active&&c.selectOperation(c.active.id,e)},onToggleDocs:()=>E(f,!k(f)),onToggleHistory:()=>E(x,!k(x)),get operationName(){return k(r)},get operations(){return k(i)},get running(){return k(ne)},get schemaLoading(){return s.loading}})}var Ae=O(ke,2);ZB(Ae,{get activeId(){return c.activeId},get extras(){return t.tabExtras},onAdd:()=>c.addTab(),onClose:e=>c.closeTab(e),onRename:(e,t)=>c.renameTab(e,t),onSelect:e=>c.selectTab(e),get tabs(){return c.tabs}});var je=O(Ae,2);let Me;var Ne=D(je),Pe=e=>{var t=DV(),n=yn(t);BB(n,{get entries(){return o.entries},get notice(){return k(b)},onClear:()=>o.clear(),onDismissNotice:()=>E(b,null),onExport:ge,onFavorite:e=>o.favorite(e),onImport:xe,onLoad:ce,onRemove:e=>o.remove(e)}),KB(O(n,2),{onDrag:ve,onDragStart:ye,onKeyAdjust:be,orientation:`horizontal`}),j(e,t)};ei(Ne,e=>{k(x)&&e(Pe)});var Fe=O(Ne,2),w=D(Fe),Ie=D(w),Le=D(Ie);{let e=Wt(()=>c.active?.query??``);kB(Le,{language:`graphql`,onChange:Ee,get schema(){return s.sdl},get theme(){return t.theme},get value(){return k(e)}})}T(Ie);var Re=O(Ie,2);KB(Re,{onDrag:ue,onDragStart:de,onKeyAdjust:fe,orientation:`vertical`});var ze=O(Re,2),Be=D(ze),Ve=D(Be);let He;var Ue=O(Ve,2);let We;T(Be);var Ge=O(Be,2),Ke=e=>{{let n=Wt(()=>c.active?.variables??`{}`);kB(e,{language:`json`,onChange:De,get theme(){return t.theme},get value(){return k(n)}})}},qe=e=>{{let n=Wt(()=>c.active?.headers??`{}`);kB(e,{language:`json`,onChange:_e,get theme(){return t.theme},get value(){return k(n)}})}};ei(Ge,e=>{k(l)===`variables`?e(Ke):e(qe,-1)}),T(ze),T(w),Ii(w,e=>E(ee,e),()=>k(ee));var Je=O(w,2),Ye=e=>{KB(e,{onDrag:Ce,onDragStart:we,onKeyAdjust:Te,orientation:`horizontal`})};ei(Je,e=>{k(re)>=1025&&e(Ye)});var Qe=O(Je,2),$e=D(Qe);{let e=Wt(()=>c.active?.streamIntervals??[]),n=Wt(()=>c.active?.timing??null),r=Wt(()=>c.active?.result??``);WB($e,{get footer(){return t.resultFooter},get streamIntervals(){return k(e)},get theme(){return t.theme},get timing(){return k(n)},get value(){return k(r)}})}T(Qe),T(Fe),Ii(Fe,e=>E(d,e),()=>k(d));var et=O(Fe,2),tt=e=>{var t=OV(),n=yn(t);KB(n,{onDrag:pe,onDragStart:me,onKeyAdjust:he,orientation:`horizontal`}),ag(O(n,2),{get schema(){return s.schema}}),j(e,t)};ei(et,e=>{k(f)&&s.schema&&e(tt)}),T(je);var nt=O(je,2),rt=e=>{var t=kV(),n=O(D(t));T(t),zn(()=>qr(n,` ${s.error??``}`)),j(e,t)};ei(nt,e=>{s.error&&e(rt)}),T(Oe),zn(()=>{Me=vi(je,1,`panes svelte-pvt4yg`,null,Me,{"docs-open":k(f)&&s.schema,"history-open":k(x)}),bi(je,`--graphiql-history-width: ${k(S)??``}px; --graphiql-docs-width: ${k(p)??``}px;`),bi(Fe,`--graphiql-left-width: ${k(C)??``}%;`),bi(w,`--graphiql-bottom-height: ${k(u)??``}%;`),He=vi(Ve,1,`switch svelte-pvt4yg`,null,He,{active:k(l)===`variables`}),We=vi(Ue,1,`switch svelte-pvt4yg`,null,We,{active:k(l)===`headers`})}),Ir(`click`,Ve,()=>E(l,`variables`)),Ir(`click`,Ue,()=>E(l,`headers`)),j(e,Oe),Ze()}Lr([`click`]);function MV(e,t){return{"Content-Type":`application/json`,...e.headers,...t.headers}}async function NV(e,t,n,r){return await(await e(t,{body:JSON.stringify(r),headers:n,method:`POST`})).json()}function PV(e){let t=new Map,n=e.fetch??globalThis.fetch;return async r=>{let i=MV(e,r),a={persistedQuery:{sha256Hash:await FV(t,r.query),version:1}};if(e.disable===!0)return await NV(n,e.url,i,{extensions:a,operationName:r.operationName,query:r.query,variables:r.variables});let o=await NV(n,e.url,i,{extensions:a,operationName:r.operationName,variables:r.variables});return IV(o)?await NV(n,e.url,i,{extensions:a,operationName:r.operationName,query:r.query,variables:r.variables}):o}}async function FV(e,t){let n=e.get(t);if(n!==void 0)return n;let r=await LV(t);return e.set(t,r),r}function IV(e){let t=e.errors;if(!Array.isArray(t))return!1;for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;if(t.message===`PersistedQueryNotFound`)return!0;let n=t.extensions;if(typeof n==`object`&&n&&n.code===`PERSISTED_QUERY_NOT_FOUND`)return!0}return!1}async function LV(e){let t=await globalThis.crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function RV(e){let t=e.fetch??globalThis.fetch;return async n=>await NV(t,e.url,MV(e,n),{operationName:n.operationName,query:n.query,variables:n.variables})}function zV(e){return typeof e==`object`&&!!e}var BV=`x-graphql-event-stream-token`;function VV(e){if(e=e,e!==`next`&&e!==`complete`)throw Error(`Invalid stream event "${e}"`);return e}function HV(e,t){if(t)try{t=JSON.parse(t)}catch{throw Error(`Invalid stream data`)}if(e===`next`&&!t)throw Error(`Stream data must be an object for "next" events`);return t||null}var UV;(function(e){e[e.NewLine=10]=`NewLine`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.Colon=58]=`Colon`})(UV||={});function WV(){let e,t,n,r=!1,i={event:``,data:``},a=[],o=new TextDecoder;return function(s){if(e===void 0)e=s,t=0,n=-1;else{let t=new Uint8Array(e.length+s.length);t.set(e),t.set(s,e.length),e=t}let c=e.length,l=0;for(;t<c;){r&&=(e[t]===UV.NewLine&&(l=++t),!1);let s=-1;for(;t<c&&s===-1;++t)switch(e[t]){case UV.Colon:n===-1&&(n=t-l);break;case UV.CarriageReturn:r=!0;case UV.NewLine:s=t;break}if(s===-1)break;if(l===s){if(i.event||i.data){if(!i.event)throw Error(`Missing message event`);let e=VV(i.event),t=HV(e,i.data);a.push({event:e,data:t}),i={event:``,data:``}}}else if(n>0){let t=e.subarray(l,s),r=o.decode(t.subarray(0,n)),a=n+(t[n+1]===UV.Space?2:1),c=o.decode(t.subarray(a));switch(r){case`event`:i.event=c;break;case`data`:i.data=i.data?i.data+`
+`+c:c;break}}l=t,n=-1}if(l===c){e=void 0;let t=[...a];return a=[],t}else l!==0&&(e=e.subarray(l),t-=l)}}function GV(e){let{singleConnection:t=!1,lazy:n=!0,lazyCloseTimeout:r=0,onNonLazyError:i=console.error,generateID:a=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})},retryAttempts:o=5,retry:s=async function(e){let t=1e3;for(let n=0;n<e;n++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(Math.random()*2700+300)))},credentials:c=`same-origin`,referrer:l,referrerPolicy:u,onMessage:d,on:f}=e,p=e.fetchFn||fetch,m=e.abortControllerImpl||AbortController,h=(()=>{let e=!1,t=[];return{get disposed(){return e},onDispose(n){return e?(setTimeout(()=>n(),0),()=>{}):(t.push(n),()=>{t.splice(t.indexOf(n),1)})},dispose(){if(!e){e=!0;for(let e of[...t])e()}}}})(),g,_,v=0,y=null,b=0;async function x(){try{if(h.disposed)throw Error(`Client has been disposed`);return await(_??=(async()=>{var t,n;if(y){if(await s(b),g.signal.aborted)throw Error(`Connection aborted by the client`);b++}(t=f?.connecting)==null||t.call(f,!!y),g=new m;let r=h.onDispose(()=>g.abort());g.signal.addEventListener(`abort`,()=>{r(),_=void 0});let i=e,a=typeof i.url==`function`?await i.url(void 0):i.url;if(g.signal.aborted)throw Error(`Connection aborted by the client`);let o=typeof i.headers==`function`?await i.headers(void 0):i.headers??{};if(g.signal.aborted)throw Error(`Connection aborted by the client`);let v;try{v=await p(a,{signal:g.signal,method:`PUT`,credentials:c,referrer:l,referrerPolicy:u,headers:o})}catch(e){throw new KV(e)}if(v.status!==201)throw new KV(v);o[BV]=await v.text();let x=await JV({signal:g.signal,headers:o,credentials:c,referrer:l,referrerPolicy:u,url:a,fetchFn:p,onMessage:e=>{var t;(t=f?.message)==null||t.call(f,e),d?.(e)}});return(n=f?.connected)==null||n.call(f,!!y),x.waitForThrow().catch(()=>_=void 0),x})())}catch(e){throw _=void 0,e}}t&&!n&&(async()=>{for(v++;;)try{let{waitForThrow:e}=await x();await e()}catch(e){if(h.disposed)return;if(!(e instanceof KV)||(_=void 0,!o||b>=o))return i?.(e);y=e}})();function S(i,S,ee){if(!t){let t=new m,n=h.onDispose(()=>{n(),t.abort()});return(async()=>{var n,r,a,m;let h=null,g=0;for(;;)try{if(h){if(await s(g),t.signal.aborted)throw Error(`Connection aborted by the client`);g++}(n=f?.connecting)==null||n.call(f,!!h),(r=ee?.connecting)==null||r.call(ee,!!h);let o=e,_=typeof o.url==`function`?await o.url(i):o.url;if(t.signal.aborted)throw Error(`Connection aborted by the client`);let v=typeof o.headers==`function`?await o.headers(i):o.headers??{};if(t.signal.aborted)throw Error(`Connection aborted by the client`);let{getResults:y}=await JV({signal:t.signal,headers:{...v,"content-type":`application/json; charset=utf-8`},credentials:c,referrer:l,referrerPolicy:u,url:_,body:JSON.stringify(i),fetchFn:p,onMessage:e=>{var t,n;(t=f?.message)==null||t.call(f,e),(n=ee?.message)==null||n.call(ee,e),d?.(e)}});(a=f?.connected)==null||a.call(f,!!h),(m=ee?.connected)==null||m.call(ee,!!h);for await(let e of y())h=null,g=0,S.next(e);return t.abort()}catch(e){if(t.signal.aborted)return;if(!(e instanceof KV)||!o||g>=o)throw e;h=e}})().then(()=>S.complete()).catch(e=>S.error(e)),()=>t.abort()}v++;let C=new m,te=h.onDispose(()=>{te(),C.abort()});return(async()=>{let e=a();i={...i,extensions:{...i.extensions,operationId:e}};let t=null;for(;;){t=null;try{let{url:n,headers:r,getResults:a}=await x(),o;try{o=await p(n,{signal:C.signal,method:`POST`,credentials:c,referrer:l,referrerPolicy:u,headers:{...r,"content-type":`application/json; charset=utf-8`},body:JSON.stringify(i)})}catch(e){throw new KV(e)}if(o.status!==202)throw new KV(o);t=async()=>{let t;try{let i=new m,a=h.onDispose(()=>{a(),i.abort()});t=await p(n+`?operationId=`+e,{signal:i.signal,method:`DELETE`,credentials:c,referrer:l,referrerPolicy:u,headers:r})}catch(e){throw new KV(e)}if(t.status!==200)throw new KV(t)};for await(let t of a({signal:C.signal,operationId:e}))y=null,b=0,S.next(t);return t=null,C.abort()}catch(e){if(C.signal.aborted)return await t?.();if(!(e instanceof KV)||(n&&(_=void 0),!o||b>=o))throw C.abort(),e;y=e}finally{C.signal.aborted&&--v===0&&(isFinite(r)&&r>0?setTimeout(()=>{v||g.abort()},r):g.abort())}}})().then(()=>S.complete()).catch(e=>S.error(e)),()=>C.abort()}return{subscribe:S,iterate(e,t){let n=[],r={done:!1,error:null,resolve:()=>{}},i=S(e,{next(e){n.push(e),r.resolve()},error(e){r.done=!0,r.error=e,r.resolve()},complete(){r.done=!0,r.resolve()}},t),a=(async function*(){for(;;){for(n.length||await new Promise(e=>r.resolve=e);n.length;)yield n.shift();if(r.error)throw r.error;if(r.done)return}})();return a.throw=async e=>(r.done||(r.done=!0,r.error=e,r.resolve()),{done:!0,value:void 0}),a.return=async()=>(i(),{done:!0,value:void 0}),a},dispose(){h.dispose()}}}var KV=class extends Error{constructor(e){let t,n;qV(e)?(n=e,t=`Server responded with `+e.status+`: `+e.statusText):t=e instanceof Error?e.message:String(e),super(t),this.name=this.constructor.name,this.response=n}};function qV(e){return zV(e)&&typeof e.ok==`boolean`&&typeof e.status==`number`&&typeof e.statusText==`string`}async function JV(e){let{signal:t,url:n,credentials:r,headers:i,body:a,referrer:o,referrerPolicy:s,fetchFn:c,onMessage:l}=e,u={},d={},f;try{f=await c(n,{signal:t,method:a?`POST`:`GET`,credentials:r,referrer:o,referrerPolicy:s,headers:{...i,accept:`text/event-stream`},body:a})}catch(e){throw new KV(e)}if(!f.ok)throw new KV(f);if(!f.body)throw Error(`Missing response body`);let p=null,m;return(async()=>{var e;try{let t=WV();for await(let n of YV(f.body)){if(typeof n==`string`)throw p=Error(`Unexpected string chunk "${n}"`);let r;try{r=t(n)}catch(e){throw p=e}if(r)for(let t of r){try{l?.(t)}catch(e){throw p=e}let n=t.data&&`id`in t.data?t.data.id:``;switch(n in d||(d[n]=[]),t.event){case`next`:n?d[n].push(t.data.payload):d[n].push(t.data);break;case`complete`:d[n].push(`complete`);break;default:throw p=Error(`Unexpected message event "${t.event}"`)}(e=u[n])==null||e.proceed()}}if(Object.keys(u).length)throw Error(`Connection closed while having active streams`)}catch(e){p=!p&&Object.keys(u).length?new KV(e):e,m?.(p)}finally{Object.values(u).forEach(({proceed:e})=>e())}})(),{url:n,headers:i,waitForThrow:()=>new Promise((e,t)=>{if(p)return t(p);m=t}),async*getResults(e){let{signal:t,operationId:n=``}=e??{};try{for(;;){for(;d[n]?.length;){let e=d[n].shift();if(e===`complete`)return;yield e}if(p)throw p;if(t?.aborted)throw Error(`Getting results aborted by the client`);await new Promise(e=>{let r=()=>{t?.removeEventListener(`abort`,r),delete u[n],e()};t?.addEventListener(`abort`,r),u[n]={proceed:r}})}}finally{delete d[n]}}}}function YV(e){return typeof Object(e)[Symbol.asyncIterator]==`function`?(e=e,e):(async function*(){let t=e.getReader(),n;do n=await t.read(),n.value!==void 0&&(yield n.value);while(!n.done)})()}function XV(e){let t=GV({fetchFn:e.fetch,headers:e.headers,url:e.url,...e.client});return e=>({[Symbol.asyncIterator](){let n=[],r=[],i=!1,a=null,o=t.subscribe({extensions:e.headers,operationName:e.operationName??void 0,query:e.query,variables:e.variables},{complete(){i=!0,s()},error(e){a=e,i=!0,s()},next(e){n.push(e),s()}});function s(){for(;r.length>0&&(n.length>0||i);){let e=r.shift();if(!e)break;n.length>0?e({done:!1,value:n.shift()}):e({done:!0,value:void 0})}}return{next(){if(a){let e=a;return a=null,Promise.reject(e)}return n.length>0?Promise.resolve({done:!1,value:n.shift()}):i?Promise.resolve({done:!0,value:void 0}):new Promise(e=>{r.push(e)})},return(){return o(),i=!0,s(),Promise.resolve({done:!0,value:void 0})}}}})}function ZV(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function QV(e){return ZV(e)===`object`}function $V(e){return Array.isArray(e)&&e.length>0&&e.every(e=>`message`in e)}function eH(e,t){return e.length<124?e:t}var tH=(e=>(e[e.InternalServerError=4500]=`InternalServerError`,e[e.InternalClientError=4005]=`InternalClientError`,e[e.BadRequest=4400]=`BadRequest`,e[e.BadResponse=4004]=`BadResponse`,e[e.Unauthorized=4401]=`Unauthorized`,e[e.Forbidden=4403]=`Forbidden`,e[e.SubprotocolNotAcceptable=4406]=`SubprotocolNotAcceptable`,e[e.ConnectionInitialisationTimeout=4408]=`ConnectionInitialisationTimeout`,e[e.ConnectionAcknowledgementTimeout=4504]=`ConnectionAcknowledgementTimeout`,e[e.SubscriberAlreadyExists=4409]=`SubscriberAlreadyExists`,e[e.TooManyInitialisationRequests=4429]=`TooManyInitialisationRequests`,e))(tH||{}),nH=(e=>(e.ConnectionInit=`connection_init`,e.ConnectionAck=`connection_ack`,e.Ping=`ping`,e.Pong=`pong`,e.Subscribe=`subscribe`,e.Next=`next`,e.Error=`error`,e.Complete=`complete`,e))(nH||{});function rH(e){if(!QV(e))throw Error(`Message is expected to be an object, but got ${ZV(e)}`);if(!e.type)throw Error(`Message is missing the 'type' property`);if(typeof e.type!=`string`)throw Error(`Message is expects the 'type' property to be a string, but got ${ZV(e.type)}`);switch(e.type){case`connection_init`:case`connection_ack`:case`ping`:case`pong`:if(e.payload!=null&&!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case`subscribe`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ZV(e.payload)}`);if(typeof e.payload.query!=`string`)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${ZV(e.payload.query)}`);if(e.payload.variables!=null&&!QV(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ZV(e.payload.variables)}`);if(e.payload.operationName!=null&&ZV(e.payload.operationName)!==`string`)throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ZV(e.payload.operationName)}`);if(e.payload.extensions!=null&&!QV(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ZV(e.payload.extensions)}`);break;case`next`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ZV(e.payload)}`);break;case`error`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$V(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case`complete`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function iH(e,t){return rH(typeof e==`string`?JSON.parse(e,t):e)}function aH(e,t){return rH(e),JSON.stringify(e,t)}function oH(e){let{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:l=5,retryWait:u=async function(e){let t=2**e;await new Promise(e=>setTimeout(e,t*1e3+Math.floor(Math.random()*2700+300)))},shouldRetry:d=cH,on:f,webSocketImpl:p,generateID:m=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})},jsonMessageReplacer:h,jsonMessageReviver:g}=e,_;if(p){if(!uH(p))throw Error(`Invalid WebSocket implementation provided`);_=p}else typeof WebSocket<`u`?_=WebSocket:typeof global<`u`?_=global.WebSocket||global.MozWebSocket:typeof window<`u`&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=_,y=(()=>{let e=(()=>{let e={};return{on(t,n){return e[t]=n,()=>{delete e[t]}},emit(t){`id`in t&&e[t.id]?.(t)}}})(),t={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[e.emit,f.message]:[e.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:e.on,on(e,n){let r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(let r of[...t[e]])r(...n)}}})();function b(e){let t=[y.on(`error`,n=>{t.forEach(e=>e()),e(n)}),y.on(`closed`,n=>{t.forEach(e=>e()),e(n)})]}let x,S=0,ee,C=!1,te=0,ne=!1;async function re(){clearTimeout(ee);let[e,r]=await(x??=new Promise((e,r)=>(async()=>{if(C){if(await u(te),!S)return x=void 0,r({code:1e3,reason:`All Subscriptions Gone`});te++}y.emit(`connecting`,C);let i=new v(typeof t==`function`?await t():t,`graphql-transport-ws`),a,l;function d(){isFinite(o)&&o>0&&(clearTimeout(l),l=setTimeout(()=>{i.readyState===v.OPEN&&(i.send(aH({type:nH.Ping})),y.emit(`ping`,!1,void 0))},o))}b(e=>{x=void 0,clearTimeout(a),clearTimeout(l),r(e),e instanceof sH&&(i.close(4499,`Terminated`),i.onerror=null,i.onclose=null)}),i.onerror=e=>y.emit(`error`,e),i.onclose=e=>y.emit(`closed`,e),i.onopen=async()=>{try{y.emit(`opened`,i);let e=typeof n==`function`?await n():n;if(i.readyState!==v.OPEN)return;i.send(aH(e?{type:nH.ConnectionInit,payload:e}:{type:nH.ConnectionInit},h)),isFinite(c)&&c>0&&(a=setTimeout(()=>{i.close(tH.ConnectionAcknowledgementTimeout,`Connection acknowledgement timeout`)},c)),d()}catch(e){y.emit(`error`,e),i.close(tH.InternalClientError,eH(e instanceof Error?e.message:String(e),`Internal client error`))}};let f=!1;i.onmessage=({data:t})=>{try{let n=iH(t,g);if(y.emit(`message`,n),n.type===`ping`||n.type===`pong`){y.emit(n.type,!0,n.payload),n.type===`pong`?d():s||(i.send(aH(n.payload?{type:nH.Pong,payload:n.payload}:{type:nH.Pong})),y.emit(`pong`,!1,n.payload));return}if(f)return;if(n.type!==nH.ConnectionAck)throw Error(`First message cannot be of type ${n.type}`);clearTimeout(a),f=!0,y.emit(`connected`,i,n.payload,C),C=!1,te=0,e([i,new Promise((e,t)=>b(t))])}catch(e){i.onmessage=null,y.emit(`error`,e),i.close(tH.BadResponse,eH(e instanceof Error?e.message:String(e),`Bad response`))}}})()));e.readyState===v.CLOSING&&await r;let i=()=>{},l=new Promise(e=>i=e);return[e,i,Promise.race([l.then(()=>{if(!S){let t=()=>e.close(1e3,`Normal Closure`);isFinite(a)&&a>0?ee=setTimeout(()=>{e.readyState===v.OPEN&&t()},a):t()}}),r])]}function ie(e){if(cH(e)&&(lH(e.code)||[tH.InternalServerError,tH.InternalClientError,tH.BadRequest,tH.BadResponse,tH.Unauthorized,tH.SubprotocolNotAcceptable,tH.SubscriberAlreadyExists,tH.TooManyInitialisationRequests].includes(e.code)))throw e;if(ne)return!1;if(cH(e)&&e.code===1e3)return S>0;if(!l||te>=l||!d(e))throw e;return C=!0}r||(async()=>{for(S++;;)try{let[,,e]=await re();await e}catch(e){try{if(!ie(e))return}catch(e){return i?.(e)}}})();function ae(e,t){let n=m(e),r=!1,i=!1,a=()=>{S--,r=!0};return(async()=>{for(S++;;)try{let[o,s,c]=await re();if(r)return s();let l=y.onMessage(n,e=>{switch(e.type){case nH.Next:t.next(e.payload);return;case nH.Error:i=!0,r=!0,t.error(e.payload),a();return;case nH.Complete:r=!0,a();return}});o.send(aH({id:n,type:nH.Subscribe,payload:e},h)),a=()=>{!r&&o.readyState===v.OPEN&&o.send(aH({id:n,type:nH.Complete},h)),S--,r=!0,s()},await c.finally(l);return}catch(e){if(!ie(e))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||a()}}return{on:y.on,subscribe:ae,iterate(e){let t=[],n={done:!1,error:null,resolve:()=>{}},r=ae(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=async function*(){for(;;){for(t.length||await new Promise(e=>n.resolve=e);t.length;)yield t.shift();if(n.error)throw n.error;if(n.done)return}}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(ne=!0,x){let[e]=await x;e.close(1e3,`Normal Closure`)}},terminate(){x&&y.emit(`closed`,new sH)}}}var sH=class extends Error{name=`TerminatedCloseEvent`;message=`4499: Terminated`;code=4499;reason=`Terminated`;wasClean=!1};function cH(e){return QV(e)&&`code`in e&&`reason`in e}function lH(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function uH(e){return typeof e==`function`&&`constructor`in e&&`CLOSED`in e&&`CLOSING`in e&&`CONNECTING`in e&&`OPEN`in e}function dH(e){let t=oH({connectionParams:e.headers,url:e.url,...e.client});return e=>({[Symbol.asyncIterator](){let n=[],r=[],i=!1,a=null,o=t.subscribe({extensions:e.headers,operationName:e.operationName??void 0,query:e.query,variables:e.variables},{complete(){i=!0,s()},error(e){a=e,i=!0,s()},next(e){n.push(e),s()}});function s(){for(;r.length>0&&(n.length>0||i);){let e=r.shift();if(!e)break;n.length>0?e({done:!1,value:n.shift()}):e({done:!0,value:void 0})}}return{next(){if(a){let e=a;return a=null,Promise.reject(e)}return n.length>0?Promise.resolve({done:!1,value:n.shift()}):i?Promise.resolve({done:!0,value:void 0}):new Promise(e=>{r.push(e)})},return(){return o(),i=!0,s(),Promise.resolve({done:!0,value:void 0})}}}})}function fH(e,t){return Jr(jV,{props:t,target:e})}function pH(e){Qr(e)}return e.createApqFetcher=PV,e.createHttpFetcher=RV,e.createSseFetcher=XV,e.createWsFetcher=dH,e.lightTheme=Jk,e.mount=fH,e.unmount=pH,e})({});
+//# sourceMappingURL=standalone.js.map \ No newline at end of file
diff --git a/source/graphiql/version.ts b/source/graphiql/version.ts
new file mode 100644
index 0000000..16d9c04
--- /dev/null
+++ b/source/graphiql/version.ts
@@ -0,0 +1 @@
+export const GRAPHIQL_VERSION = "0.4.2";
diff --git a/source/http.ts b/source/http.ts
index c4a70c8..39d6866 100755
--- a/source/http.ts
+++ b/source/http.ts
@@ -54,6 +54,14 @@ export function GraphQLHTTP<
...options
}: GQLOptions<Ctx, Req>): GraphQLHandler<Req> {
return async (request: Req) => {
+ if (options.graphiql) {
+ const { serveAsset } = await import("./graphiql/assets.ts");
+ const asset = serveAsset(request);
+
+ if (asset)
+ return asset;
+ }
+
if (options.subscriptions && request.headers.get("upgrade")?.toLowerCase() === "websocket")
return options.subscriptions(request as unknown as Request);
@@ -91,7 +99,7 @@ export function GraphQLHTTP<
const playground = renderPlaygroundPage({
...playgroundOptions,
- endpoint: "/graphql"
+ endpoint: new URL(request.url).pathname
});
return new Response(playground, {
diff --git a/source/import.ts b/source/import.ts
index f934ef8..bb6c7b9 100644
--- a/source/import.ts
+++ b/source/import.ts
@@ -3,7 +3,7 @@
/*** IMPORT ------------------------------------------- ***/
-import { dirname, resolve } from "@std/path";
+import { dirname, resolve } from "@ende/path";
/*** UTILITY ------------------------------------------ ***/
diff --git a/source/utility/pubsub.ts b/source/utility/pubsub.ts
new file mode 100644
index 0000000..bb8679a
--- /dev/null
+++ b/source/utility/pubsub.ts
@@ -0,0 +1,64 @@
+export class PubSub {
+ #target = new EventTarget();
+
+ publish(trigger: string, payload: unknown): Promise<void> {
+ this.#target.dispatchEvent(new CustomEvent(trigger, { detail: payload }));
+ return Promise.resolve();
+ }
+
+ asyncIterator<T>(triggers: string | string[]): AsyncIterableIterator<T> {
+ const names = Array.isArray(triggers) ? triggers : [triggers];
+ const pulls: Array<(result: IteratorResult<T>) => void> = [];
+ const pushes: T[] = [];
+ let done = false;
+
+ const listener = (event: Event) => {
+ const value = (event as CustomEvent<T>).detail;
+ const pull = pulls.shift();
+
+ if (pull)
+ pull({ done: false, value });
+ else
+ pushes.push(value);
+ };
+
+ for (const name of names)
+ this.#target.addEventListener(name, listener);
+
+ const close = (): Promise<IteratorResult<T>> => {
+ if (!done) {
+ done = true;
+
+ for (const name of names)
+ this.#target.removeEventListener(name, listener);
+
+ for (const pull of pulls.splice(0))
+ pull({ done: true, value: undefined });
+
+ pushes.length = 0;
+ }
+
+ return Promise.resolve({ done: true, value: undefined });
+ };
+
+ return {
+ next: () => {
+ if (done)
+ return Promise.resolve({ done: true, value: undefined });
+
+ if (pushes.length > 0)
+ return Promise.resolve({ done: false, value: pushes.shift() as T });
+
+ return new Promise((resolve) => pulls.push(resolve));
+ },
+ return: close,
+ throw: (error: unknown) => {
+ close();
+ return Promise.reject(error);
+ },
+ [Symbol.asyncIterator]() {
+ return this;
+ }
+ };
+ }
+}
diff --git a/source/utility/types.ts b/source/utility/types.ts
index 2311c25..771625b 100755
--- a/source/utility/types.ts
+++ b/source/utility/types.ts
@@ -3,7 +3,7 @@
/*** IMPORT ------------------------------------------- ***/
-import type { GraphQLArgs, GraphQLSchema } from "graphql";
+import type { GraphQLArgs, GraphQLSchema } from "#deps";
/*** UTILITY ------------------------------------------ ***/
diff --git a/source/ws.ts b/source/ws.ts
index cbf70ea..e623dc9 100644
--- a/source/ws.ts
+++ b/source/ws.ts
@@ -3,11 +3,11 @@
/*** IMPORT ------------------------------------------- ***/
-import { makeServer, type ServerOptions } from "graphql-ws";
+import { makeServer, type ServerOptions } from "#deps";
/*** UTILITY ------------------------------------------ ***/
-import type { GraphQLSchema } from "graphql";
+import type { GraphQLSchema } from "#deps";
/*** EXPORT ------------------------------------------- ***/
diff --git a/vendor/deps.d.ts b/vendor/deps.d.ts
new file mode 100644
index 0000000..ca493ce
--- /dev/null
+++ b/vendor/deps.d.ts
@@ -0,0 +1,14536 @@
+// Generated by dts-bundle-generator v9.5.1
+
+/** @category Version */
+/** A string containing the version of the GraphQL.js library */
+export declare const version: string;
+/** An object containing the components of the GraphQL.js version string */
+export declare const versionInfo: Readonly<{
+ major: number;
+ minor: number;
+ patch: number;
+ preReleaseTag: string | null;
+}>;
+/** @category Development Mode */
+/**
+ * Enables GraphQL.js development mode checks for this module instance.
+ *
+ * Production entry points leave development mode disabled by default. Call this
+ * before constructing schemas or executing requests when additional development
+ * diagnostics should run.
+ * @example
+ * ```ts
+ * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';
+ *
+ * isDevModeEnabled(); // => false
+ * enableDevMode();
+ * isDevModeEnabled(); // => true
+ * ```
+ */
+export declare function enableDevMode(): void;
+/**
+ * Returns whether GraphQL.js development mode has been enabled for this module
+ * instance.
+ * @returns True when development mode is enabled.
+ * @example
+ * ```ts
+ * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';
+ *
+ * enableDevMode();
+ *
+ * isDevModeEnabled(); // => true
+ * ```
+ */
+export declare function isDevModeEnabled(): boolean;
+type Maybe<T> = null | undefined | T;
+interface ObjMap<T> {
+ [key: string]: T;
+}
+interface ReadOnlyObjMap<T> {
+ readonly [key: string]: T;
+}
+declare const NAME = "Name";
+type NAME = typeof NAME;
+declare const DOCUMENT = "Document";
+type DOCUMENT = typeof DOCUMENT;
+declare const OPERATION_DEFINITION = "OperationDefinition";
+type OPERATION_DEFINITION = typeof OPERATION_DEFINITION;
+declare const VARIABLE_DEFINITION = "VariableDefinition";
+type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION;
+declare const SELECTION_SET = "SelectionSet";
+type SELECTION_SET = typeof SELECTION_SET;
+declare const FIELD = "Field";
+type FIELD = typeof FIELD;
+declare const ARGUMENT = "Argument";
+type ARGUMENT = typeof ARGUMENT;
+declare const FRAGMENT_ARGUMENT = "FragmentArgument";
+type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT;
+declare const FRAGMENT_SPREAD = "FragmentSpread";
+type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD;
+declare const INLINE_FRAGMENT = "InlineFragment";
+type INLINE_FRAGMENT = typeof INLINE_FRAGMENT;
+declare const FRAGMENT_DEFINITION = "FragmentDefinition";
+type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION;
+declare const VARIABLE = "Variable";
+type VARIABLE = typeof VARIABLE;
+declare const INT = "IntValue";
+type INT = typeof INT;
+declare const FLOAT = "FloatValue";
+type FLOAT = typeof FLOAT;
+declare const STRING = "StringValue";
+type STRING = typeof STRING;
+declare const BOOLEAN = "BooleanValue";
+type BOOLEAN = typeof BOOLEAN;
+declare const NULL = "NullValue";
+type NULL = typeof NULL;
+declare const ENUM = "EnumValue";
+type ENUM = typeof ENUM;
+declare const LIST = "ListValue";
+type LIST = typeof LIST;
+declare const OBJECT = "ObjectValue";
+type OBJECT = typeof OBJECT;
+declare const OBJECT_FIELD = "ObjectField";
+type OBJECT_FIELD = typeof OBJECT_FIELD;
+declare const DIRECTIVE = "Directive";
+type DIRECTIVE = typeof DIRECTIVE;
+declare const NAMED_TYPE = "NamedType";
+type NAMED_TYPE = typeof NAMED_TYPE;
+declare const LIST_TYPE = "ListType";
+type LIST_TYPE = typeof LIST_TYPE;
+declare const NON_NULL_TYPE = "NonNullType";
+type NON_NULL_TYPE = typeof NON_NULL_TYPE;
+declare const SCHEMA_DEFINITION = "SchemaDefinition";
+type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION;
+declare const OPERATION_TYPE_DEFINITION = "OperationTypeDefinition";
+type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION;
+declare const SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition";
+type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION;
+declare const OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition";
+type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION;
+declare const FIELD_DEFINITION = "FieldDefinition";
+type FIELD_DEFINITION = typeof FIELD_DEFINITION;
+declare const INPUT_VALUE_DEFINITION = "InputValueDefinition";
+type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION;
+declare const INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition";
+type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION;
+declare const UNION_TYPE_DEFINITION = "UnionTypeDefinition";
+type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION;
+declare const ENUM_TYPE_DEFINITION = "EnumTypeDefinition";
+declare const ENUM_VALUE_DEFINITION = "EnumValueDefinition";
+type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION;
+declare const INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition";
+type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION;
+declare const DIRECTIVE_DEFINITION = "DirectiveDefinition";
+type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION;
+declare const SCHEMA_EXTENSION = "SchemaExtension";
+type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION;
+declare const DIRECTIVE_EXTENSION = "DirectiveExtension";
+type DIRECTIVE_EXTENSION = typeof DIRECTIVE_EXTENSION;
+declare const SCALAR_TYPE_EXTENSION = "ScalarTypeExtension";
+type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION;
+declare const OBJECT_TYPE_EXTENSION = "ObjectTypeExtension";
+type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION;
+declare const INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension";
+type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION;
+declare const UNION_TYPE_EXTENSION = "UnionTypeExtension";
+type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION;
+declare const ENUM_TYPE_EXTENSION = "EnumTypeExtension";
+type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION;
+declare const INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
+type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION;
+declare const TYPE_COORDINATE = "TypeCoordinate";
+type TYPE_COORDINATE = typeof TYPE_COORDINATE;
+declare const MEMBER_COORDINATE = "MemberCoordinate";
+type MEMBER_COORDINATE = typeof MEMBER_COORDINATE;
+declare const ARGUMENT_COORDINATE = "ArgumentCoordinate";
+type ARGUMENT_COORDINATE = typeof ARGUMENT_COORDINATE;
+declare const DIRECTIVE_COORDINATE = "DirectiveCoordinate";
+type DIRECTIVE_COORDINATE = typeof DIRECTIVE_COORDINATE;
+declare const DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
+type DIRECTIVE_ARGUMENT_COORDINATE = typeof DIRECTIVE_ARGUMENT_COORDINATE;
+type KindTypeMap = typeof Kind;
+interface Location {
+ line: number;
+ column: number;
+}
+/**
+ * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
+ * optional, but they are useful for clients who store GraphQL documents in source files.
+ * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might
+ * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`.
+ * The `line` and `column` properties in `locationOffset` are 1-indexed.
+ */
+export declare class Source {
+ /** The GraphQL source text. */
+ body: string;
+ /** Name used in diagnostics for this source, such as a file path or request name. */
+ name: string;
+ /** One-indexed line and column where this source begins. */
+ locationOffset: Location;
+ /**
+ * Creates a Source instance.
+ * @param body - The GraphQL source text.
+ * @param name - Name used in diagnostics for this source.
+ * @param locationOffset - One-indexed line and column where this source begins.
+ * @example
+ * ```ts
+ * import { Source } from 'graphql/language';
+ *
+ * const source = new Source('type Query { greeting: String }', 'schema.graphql', {
+ * line: 10,
+ * column: 1,
+ * });
+ *
+ * source.body; // => 'type Query { greeting: String }'
+ * source.name; // => 'schema.graphql'
+ * source.locationOffset; // => { line: 10, column: 1 }
+ * ```
+ */
+ constructor(body: string, name?: string, locationOffset?: Location);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+}
+/** @category Lexing */
+/**
+ * An exported enum describing the different kinds of tokens that the
+ * lexer emits.
+ */
+export declare const TokenKind: {
+ readonly SOF: "<SOF>";
+ readonly EOF: "<EOF>";
+ readonly BANG: "!";
+ readonly DOLLAR: "$";
+ readonly AMP: "&";
+ readonly PAREN_L: "(";
+ readonly PAREN_R: ")";
+ readonly DOT: ".";
+ readonly SPREAD: "...";
+ readonly COLON: ":";
+ readonly EQUALS: "=";
+ readonly AT: "@";
+ readonly BRACKET_L: "[";
+ readonly BRACKET_R: "]";
+ readonly BRACE_L: "{";
+ readonly PIPE: "|";
+ readonly BRACE_R: "}";
+ readonly NAME: "Name";
+ readonly INT: "Int";
+ readonly FLOAT: "Float";
+ readonly STRING: "String";
+ readonly BLOCK_STRING: "BlockString";
+ readonly COMMENT: "Comment";
+};
+/**
+ * An exported enum describing the different kinds of tokens that the
+ * lexer emits.
+ */
+export type TokenKind = (typeof TokenKind)[keyof typeof TokenKind];
+/**
+ * Contains a range of UTF-8 character offsets and token references that
+ * identify the region of the source from which the AST derived.
+ */
+declare class Location$1 {
+ /** The character offset at which this Node begins. */
+ readonly start: number;
+ /** The character offset at which this Node ends. */
+ readonly end: number;
+ /** The Token at which this Node begins. */
+ readonly startToken: Token;
+ /** The Token at which this Node ends. */
+ readonly endToken: Token;
+ /** The Source document the AST represents. */
+ readonly source: Source;
+ /**
+ * Creates a Location instance.
+ * @param startToken - The start token.
+ * @param endToken - The end token.
+ * @param source - Source document used to derive error locations.
+ * @example
+ * ```ts
+ * import { Location, Source, Token, TokenKind } from 'graphql/language';
+ *
+ * const source = new Source('{ hello }');
+ * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);
+ * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);
+ * const location = new Location(startToken, endToken, source);
+ *
+ * location.start; // => 0
+ * location.end; // => 9
+ * location.source.body; // => '{ hello }'
+ * ```
+ */
+ constructor(startToken: Token, endToken: Token, source: Source);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a JSON representation of this location.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ *
+ * const document = parse('{ hello }');
+ * const location = document.loc?.toJSON();
+ *
+ * location; // => { start: 0, end: 9 }
+ * ```
+ */
+ toJSON(): {
+ start: number;
+ end: number;
+ };
+}
+/**
+ * Represents a range of characters represented by a lexical token
+ * within a Source.
+ */
+export declare class Token {
+ /** The kind of Token. */
+ readonly kind: TokenKind;
+ /** The character offset at which this Node begins. */
+ readonly start: number;
+ /** The character offset at which this Node ends. */
+ readonly end: number;
+ /** The 1-indexed line number on which this Token appears. */
+ readonly line: number;
+ /** The 1-indexed column number at which this Token begins. */
+ readonly column: number;
+ /**
+ * For non-punctuation tokens, represents the interpreted value of the token.
+ *
+ * Note: is undefined for punctuation tokens, but typed as string for
+ * convenience in the parser.
+ */
+ readonly value: string;
+ /**
+ * Tokens exist as nodes in a double-linked-list amongst all tokens
+ * including ignored tokens. <SOF> is always the first node and <EOF>
+ * the last.
+ */
+ readonly prev: Token | null;
+ /** Next token in the token stream, including ignored tokens. */
+ readonly next: Token | null;
+ /**
+ * Creates a Token instance.
+ * @param kind - Token kind produced by lexical analysis.
+ * @param start - Character offset where this token begins.
+ * @param end - Character offset where this token ends.
+ * @param line - One-indexed line number where this token begins.
+ * @param column - One-indexed column number where this token begins.
+ * @param value - Interpreted value for non-punctuation tokens.
+ * @example
+ * ```ts
+ * import { Token, TokenKind } from 'graphql/language';
+ *
+ * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');
+ *
+ * token.kind; // => TokenKind.NAME
+ * token.value; // => 'hello'
+ * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }
+ * ```
+ */
+ constructor(kind: TokenKind, start: number, end: number, line: number, column: number, value?: string);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a JSON representation of this token.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { Lexer, Source } from 'graphql/language';
+ *
+ * const lexer = new Lexer(new Source('{ hello }'));
+ * const token = lexer.advance().toJSON();
+ *
+ * token; // => { kind: '{', value: undefined, line: 1, column: 1 }
+ * ```
+ */
+ toJSON(): {
+ kind: TokenKind;
+ value?: string;
+ line: number;
+ column: number;
+ };
+}
+/** The list of all possible AST node types. */
+export type ASTNode = NameNode | DocumentNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode | DirectiveExtensionNode | TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode;
+/** Utility type listing all nodes indexed by their kind. */
+export type ASTKindToNode = {
+ [NodeT in ASTNode as NodeT["kind"]]: NodeT;
+};
+/** An identifier in a GraphQL document. */
+export interface NameNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["NAME"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: string;
+}
+/** The root AST node for a parsed GraphQL document. */
+export interface DocumentNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DOCUMENT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Top-level executable and type-system definitions in this document. */
+ readonly definitions: ReadonlyArray<DefinitionNode>;
+ /** The number of lexical tokens parsed for this document, if token counting was enabled. */
+ readonly tokenCount?: number | undefined;
+}
+/** Any top-level definition that may appear in a GraphQL document. */
+export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode;
+/** Any executable definition that may appear in an operation document. */
+export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode;
+/** A query, mutation, or subscription operation definition. */
+export interface OperationDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OPERATION_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** The operation selected for execution. */
+ readonly operation: OperationTypeNode;
+ /** Name node identifying this AST node. */
+ readonly name?: NameNode | undefined;
+ /** Variable definitions declared by this operation or fragment. */
+ readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+ /** Selections made by this operation, field, or fragment. */
+ readonly selectionSet: SelectionSetNode;
+}
+/**
+ * A narrowed OperationDefinitionNode for subscription operations.
+ * Subscription operations go through a distinct execution pipeline
+ * (source event stream + per-event execution), so narrowing the operation
+ * type allows functions in that pipeline to accept only valid input.
+ */
+export interface SubscriptionOperationDefinitionNode extends OperationDefinitionNode {
+ /** Subscription operation kind for this definition. */
+ readonly operation: (typeof OperationTypeNode)["SUBSCRIPTION"];
+}
+/**
+ * The operation types supported by GraphQL executable definitions.
+ * @category Kinds
+ */
+export declare const OperationTypeNode: {
+ readonly QUERY: "query";
+ readonly MUTATION: "mutation";
+ readonly SUBSCRIPTION: "subscription";
+};
+/**
+ * The operation types supported by GraphQL executable definitions.
+ * @category Kinds
+ */
+export type OperationTypeNode = (typeof OperationTypeNode)[keyof typeof OperationTypeNode];
+/** A variable declaration in an operation or experimental fragment definition. */
+export interface VariableDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["VARIABLE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** The variable being defined or referenced. */
+ readonly variable: VariableNode;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: TypeNode;
+ /** Default value used when no explicit value is supplied. */
+ readonly defaultValue?: ConstValueNode | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** A variable reference, such as `$id`. */
+export interface VariableNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["VARIABLE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+}
+/** A set of fields and fragments selected from an object, interface, or union. */
+export interface SelectionSetNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ kind: KindTypeMap["SELECTION_SET"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ loc?: Location$1 | undefined;
+ /** Fields and fragments contained in this selection set. */
+ selections: ReadonlyArray<SelectionNode>;
+}
+/** Any selection that may appear inside a selection set. */
+export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;
+/** A field selected in an executable GraphQL document. */
+export interface FieldNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["FIELD"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The response-key alias for this field, if one was supplied. */
+ readonly alias?: NameNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Arguments supplied to this field, directive, or coordinate. */
+ readonly arguments?: ReadonlyArray<ArgumentNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+ /** Selections made by this operation, field, or fragment. */
+ readonly selectionSet?: SelectionSetNode | undefined;
+}
+/** An argument supplied to a field or directive. */
+export interface ArgumentNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ARGUMENT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Parsed value represented by this node. */
+ readonly value: ValueNode;
+}
+/** An argument node whose value is guaranteed to be constant. */
+export interface ConstArgumentNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ARGUMENT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Parsed value represented by this node. */
+ readonly value: ConstValueNode;
+}
+/** Variable definition declared by a fragment argument. */
+export interface FragmentArgumentNode {
+ /** AST node kind for a fragment argument. */
+ readonly kind: KindTypeMap["FRAGMENT_ARGUMENT"];
+ /** Source location for this fragment argument. */
+ readonly loc?: Location$1 | undefined;
+ /** Variable name declared by this fragment argument. */
+ readonly name: NameNode;
+ /** Default value literal for this fragment argument, if provided. */
+ readonly value: ValueNode;
+}
+/** A named fragment spread, such as `...userFields`. */
+export interface FragmentSpreadNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["FRAGMENT_SPREAD"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Argument values supplied to the referenced fragment. */
+ readonly arguments?: ReadonlyArray<FragmentArgumentNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+}
+/** An inline fragment spread with an optional type condition. */
+export interface InlineFragmentNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INLINE_FRAGMENT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The type condition that limits where this fragment applies. */
+ readonly typeCondition?: NamedTypeNode | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+ /** Selections made by this operation, field, or fragment. */
+ readonly selectionSet: SelectionSetNode;
+}
+/** A reusable fragment definition declared in an executable document. */
+export interface FragmentDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["FRAGMENT_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Experimental variable definitions declared by this fragment definition. */
+ readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode> | undefined;
+ /** The type condition that limits where this fragment applies. */
+ readonly typeCondition: NamedTypeNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+ /** Selections made by this operation, field, or fragment. */
+ readonly selectionSet: SelectionSetNode;
+}
+/** Any value literal that may appear in an executable GraphQL document. */
+export type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode;
+/** Any value literal that is guaranteed not to contain a variable reference. */
+export type ConstValueNode = IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ConstListValueNode | ConstObjectValueNode;
+/** An integer value literal. */
+export interface IntValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: string;
+}
+/** A floating-point value literal. */
+export interface FloatValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["FLOAT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: string;
+}
+/** A string value literal. */
+export interface StringValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["STRING"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: string;
+ /** Whether this string was parsed from block string syntax. */
+ readonly block?: boolean | undefined;
+}
+/** A boolean value literal. */
+export interface BooleanValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["BOOLEAN"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: boolean;
+}
+/** A null value literal. */
+export interface NullValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["NULL"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+}
+/** An enum value literal. */
+export interface EnumValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ENUM"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Parsed value represented by this node. */
+ readonly value: string;
+}
+/** A list value literal. */
+export interface ListValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["LIST"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Values contained in this enum, list, or input-object definition. */
+ readonly values: ReadonlyArray<ValueNode>;
+}
+/** A list value literal whose elements are all constant values. */
+export interface ConstListValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["LIST"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Values contained in this enum, list, or input-object definition. */
+ readonly values: ReadonlyArray<ConstValueNode>;
+}
+/** An input object value literal. */
+export interface ObjectValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields: ReadonlyArray<ObjectFieldNode>;
+}
+/** An input object value literal whose fields are all constant values. */
+export interface ConstObjectValueNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields: ReadonlyArray<ConstObjectFieldNode>;
+}
+/** A field inside an input object value literal. */
+export interface ObjectFieldNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT_FIELD"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Parsed value represented by this node. */
+ readonly value: ValueNode;
+}
+/** A field inside a constant input object value literal. */
+export interface ConstObjectFieldNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT_FIELD"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Parsed value represented by this node. */
+ readonly value: ConstValueNode;
+}
+/** A directive applied to an executable or type-system location. */
+export interface DirectiveNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Arguments supplied to this field, directive, or coordinate. */
+ readonly arguments?: ReadonlyArray<ArgumentNode> | undefined;
+}
+/** A directive whose arguments are all constant values. */
+export interface ConstDirectiveNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Arguments supplied to this field, directive, or coordinate. */
+ readonly arguments?: ReadonlyArray<ConstArgumentNode> | undefined;
+}
+/** Any GraphQL type reference AST node. */
+export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
+/** A named type reference. */
+export interface NamedTypeNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["NAMED_TYPE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+}
+/** A list type reference. */
+export interface ListTypeNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["LIST_TYPE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: TypeNode;
+}
+/** A non-null type reference. */
+export interface NonNullTypeNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["NON_NULL_TYPE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: NamedTypeNode | ListTypeNode;
+}
+/** Any type-system definition that may appear in a schema document. */
+export type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode;
+/** A schema definition in a type-system document. */
+export interface SchemaDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["SCHEMA_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Root operation types declared by this schema definition or extension. */
+ readonly operationTypes: ReadonlyArray<OperationTypeDefinitionNode>;
+}
+/** A root operation type declaration inside a schema definition or extension. */
+export interface OperationTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OPERATION_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The operation selected for execution. */
+ readonly operation: OperationTypeNode;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: NamedTypeNode;
+}
+/** Any named type definition that may appear in a schema document. */
+export type TypeDefinitionNode = ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode;
+/** A scalar type definition in a type-system document. */
+export interface ScalarTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["SCALAR_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** An object type definition in a type-system document. */
+export interface ObjectTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces?: ReadonlyArray<NamedTypeNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<FieldDefinitionNode> | undefined;
+}
+/** A field definition declared by an object or interface type. */
+export interface FieldDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["FIELD_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Arguments supplied to this field, directive, or coordinate. */
+ readonly arguments?: ReadonlyArray<InputValueDefinitionNode> | undefined;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: TypeNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** An argument or input-field definition. */
+export interface InputValueDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INPUT_VALUE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: TypeNode;
+ /** Default value used when no explicit value is supplied. */
+ readonly defaultValue?: ConstValueNode | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** An interface type definition in a type-system document. */
+export interface InterfaceTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INTERFACE_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces?: ReadonlyArray<NamedTypeNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<FieldDefinitionNode> | undefined;
+}
+/** A union type definition in a type-system document. */
+export interface UnionTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["UNION_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Object types that belong to this union type. */
+ readonly types?: ReadonlyArray<NamedTypeNode> | undefined;
+}
+/** An enum type definition in a type-system document. */
+export interface EnumTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ENUM_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Values contained in this enum, list, or input-object definition. */
+ readonly values?: ReadonlyArray<EnumValueDefinitionNode> | undefined;
+}
+/** An enum value definition. */
+export interface EnumValueDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ENUM_VALUE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** An input object type definition in a type-system document. */
+export interface InputObjectTypeDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INPUT_OBJECT_TYPE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<InputValueDefinitionNode> | undefined;
+}
+/** A directive definition in a type-system document. */
+export interface DirectiveDefinitionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE_DEFINITION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** The optional GraphQL description associated with this definition. */
+ readonly description?: StringValueNode | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Arguments supplied to this field, directive, or coordinate. */
+ readonly arguments?: ReadonlyArray<InputValueDefinitionNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Whether this directive may appear more than once at the same location. */
+ readonly repeatable: boolean;
+ /** Locations where this directive may be applied. */
+ readonly locations: ReadonlyArray<NameNode>;
+}
+/** Any type-system extension that may appear in a schema extension document. */
+export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode | DirectiveExtensionNode;
+/** A schema extension in a type-system document. */
+export interface SchemaExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["SCHEMA_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Root operation types declared by this schema definition or extension. */
+ readonly operationTypes?: ReadonlyArray<OperationTypeDefinitionNode> | undefined;
+}
+/** Any named type extension that may appear in a schema extension document. */
+export type TypeExtensionNode = ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode;
+/** A scalar type extension. */
+export interface ScalarTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["SCALAR_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** An object type extension. */
+export interface ObjectTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["OBJECT_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces?: ReadonlyArray<NamedTypeNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<FieldDefinitionNode> | undefined;
+}
+/** An interface type extension. */
+export interface InterfaceTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INTERFACE_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces?: ReadonlyArray<NamedTypeNode> | undefined;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<FieldDefinitionNode> | undefined;
+}
+/** A union type extension. */
+export interface UnionTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["UNION_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Object types that belong to this union type. */
+ readonly types?: ReadonlyArray<NamedTypeNode> | undefined;
+}
+/** An enum type extension. */
+export interface EnumTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ENUM_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Values contained in this enum, list, or input-object definition. */
+ readonly values?: ReadonlyArray<EnumValueDefinitionNode> | undefined;
+}
+/** An input object type extension. */
+export interface InputObjectTypeExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["INPUT_OBJECT_TYPE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields?: ReadonlyArray<InputValueDefinitionNode> | undefined;
+}
+/** A directive extension. */
+export interface DirectiveExtensionNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE_EXTENSION"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1 | undefined;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives?: ReadonlyArray<ConstDirectiveNode> | undefined;
+}
+/** Any AST node representing a GraphQL schema coordinate. */
+export type SchemaCoordinateNode = TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode;
+/** A schema coordinate that refers to a named type. */
+export interface TypeCoordinateNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["TYPE_COORDINATE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+}
+/** A schema coordinate that refers to a member of a named type. */
+export interface MemberCoordinateNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["MEMBER_COORDINATE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** The member name referenced by this schema coordinate. */
+ readonly memberName: NameNode;
+}
+/** A schema coordinate that refers to a field or directive argument. */
+export interface ArgumentCoordinateNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["ARGUMENT_COORDINATE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** The field name referenced by this schema coordinate. */
+ readonly fieldName: NameNode;
+ /** The argument name referenced by this schema coordinate. */
+ readonly argumentName: NameNode;
+}
+/** A schema coordinate that refers to a directive. */
+export interface DirectiveCoordinateNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE_COORDINATE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+}
+/** A schema coordinate that refers to a directive argument. */
+export interface DirectiveArgumentCoordinateNode {
+ /** The discriminator identifying the concrete AST or introspection kind. */
+ readonly kind: KindTypeMap["DIRECTIVE_ARGUMENT_COORDINATE"];
+ /** The source location for this AST node, if location tracking was enabled. */
+ readonly loc?: Location$1;
+ /** Name node identifying this AST node. */
+ readonly name: NameNode;
+ /** The argument name referenced by this schema coordinate. */
+ readonly argumentName: NameNode;
+}
+/** Represents a location in a Source. */
+export interface SourceLocation {
+ /** One-indexed line number in the source document. */
+ readonly line: number;
+ /** One-indexed column number in the source document. */
+ readonly column: number;
+}
+/**
+ * Takes a Source and a UTF-8 character offset, and returns the corresponding
+ * line and column as a SourceLocation.
+ * @param source - The source document that contains the position.
+ * @param position - The UTF-8 character offset in the source body.
+ * @returns The 1-indexed line and column for the given source position.
+ * @example
+ * ```ts
+ * import { Source, getLocation } from 'graphql/language';
+ *
+ * const source = new Source('type Query { hello: String }');
+ * const location = getLocation(source, 13);
+ *
+ * location; // => { line: 1, column: 14 }
+ * ```
+ */
+export declare function getLocation(source: Source, position: number): SourceLocation;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLErrorExtensions {
+ [attributeName: string]: unknown;
+}
+/**
+ * Custom formatted extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLFormattedErrorExtensions {
+ [attributeName: string]: unknown;
+}
+/** Options used to construct a GraphQLError. */
+export interface GraphQLErrorOptions {
+ /** AST node or nodes associated with this error. */
+ nodes?: ReadonlyArray<ASTNode> | ASTNode | null | undefined;
+ /** Source document used to derive error locations. */
+ source?: Maybe<Source>;
+ /** Character offsets in the source document associated with this error. */
+ positions?: Maybe<ReadonlyArray<number>>;
+ /** Response path where this error occurred during execution. */
+ path?: Maybe<ReadonlyArray<string | number>>;
+ /**
+ * Original error that caused this GraphQLError, if one exists.
+ * Deprecated in favor of `cause` to better align with JavaScript standards.
+ * @deprecated Prefer `cause` instead.
+ */
+ originalError?: Maybe<Error & {
+ readonly extensions?: unknown;
+ }>;
+ /** Cause of this GraphQLError, if one exists. */
+ cause?: unknown;
+ /** Extension fields to include in the formatted result. */
+ extensions?: Maybe<GraphQLErrorExtensions>;
+}
+/**
+ * A GraphQLError describes an Error found during the parse, validate, or
+ * execute phases of performing a GraphQL operation. In addition to a message
+ * and stack trace, it also includes information about the locations in a
+ * GraphQL document and/or execution result that correspond to the Error.
+ */
+export declare class GraphQLError extends Error {
+ /**
+ * An array of `{ line, column }` locations within the source GraphQL document
+ * which correspond to this error.
+ *
+ * Errors during validation often contain multiple locations, for example to
+ * point out two things with the same name. Errors during execution include a
+ * single location, the field which produced the error.
+ *
+ * Enumerable, and appears in the result of JSON.stringify().
+ */
+ readonly locations: ReadonlyArray<SourceLocation> | undefined;
+ /**
+ * An array describing the JSON-path into the execution response which
+ * corresponds to this error. Only included for errors during execution.
+ *
+ * Enumerable, and appears in the result of JSON.stringify().
+ */
+ readonly path: ReadonlyArray<string | number> | undefined;
+ /** An array of GraphQL AST Nodes corresponding to this error. */
+ readonly nodes: ReadonlyArray<ASTNode> | undefined;
+ /**
+ * The source GraphQL document for the first location of this error.
+ *
+ * Note that if this Error represents more than one node, the source may not
+ * represent nodes after the first node.
+ */
+ readonly source: Source | undefined;
+ /**
+ * An array of character offsets within the source GraphQL document
+ * which correspond to this error.
+ */
+ readonly positions: ReadonlyArray<number> | undefined;
+ /**
+ * Original error that caused this GraphQLError, if one exists.
+ * Deprecated in favor of `cause` to better align with JavaScript standards.
+ * @deprecated Use `cause` instead.
+ */
+ readonly originalError: Error | undefined;
+ /** Extension fields to add to the formatted error. */
+ readonly extensions: GraphQLErrorExtensions;
+ /**
+ * Creates a GraphQLError instance.
+ * @param message - Human-readable error message.
+ * @param options - Error metadata such as source locations, response path, cause, original error, and extensions.
+ * @example
+ * ```ts
+ * // Create an error from AST nodes and response metadata.
+ * import { parse } from 'graphql/language';
+ * import { GraphQLError } from 'graphql/error';
+ *
+ * const document = parse('{ greeting }');
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ * const error = new GraphQLError('Cannot query this field.', {
+ * nodes: fieldNode,
+ * path: ['greeting'],
+ * extensions: { code: 'FORBIDDEN' },
+ * });
+ *
+ * error.message; // => 'Cannot query this field.'
+ * error.locations; // => [{ line: 1, column: 3 }]
+ * error.path; // => ['greeting']
+ * error.extensions; // => { code: 'FORBIDDEN' }
+ * ```
+ * @example
+ * ```ts
+ * // This variant derives locations from source positions and preserves the cause.
+ * import { Source } from 'graphql/language';
+ * import { GraphQLError } from 'graphql/error';
+ *
+ * const source = new Source('{ greeting }');
+ * const cause = new Error('Database unavailable.');
+ * const error = new GraphQLError('Resolver failed.', {
+ * source,
+ * positions: [2],
+ * path: ['greeting'],
+ * cause,
+ * });
+ *
+ * error.locations; // => [{ line: 1, column: 3 }]
+ * error.path; // => ['greeting']
+ * error.cause; // => cause
+ * ```
+ */
+ constructor(message: string, options?: GraphQLErrorOptions);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns this error as a human-readable message with source locations.
+ * @returns The formatted error string.
+ * @example
+ * ```ts
+ * import { Source } from 'graphql/language';
+ * import { GraphQLError } from 'graphql/error';
+ *
+ * const error = new GraphQLError('Cannot query field "name".', {
+ * source: new Source('{ name }'),
+ * positions: [2],
+ * });
+ *
+ * error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLError } from 'graphql/error';
+ *
+ * const error = new GraphQLError('Resolver failed.', {
+ * path: ['viewer', 'name'],
+ * extensions: { code: 'INTERNAL' },
+ * });
+ *
+ * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }
+ * ```
+ */
+ toJSON(): GraphQLFormattedError;
+}
+/** See: https://spec.graphql.org/draft/#sec-Errors */
+export interface GraphQLFormattedError {
+ /**
+ * A short, human-readable summary of the problem that **SHOULD NOT** change
+ * from occurrence to occurrence of the problem, except for purposes of
+ * localization.
+ */
+ readonly message: string;
+ /**
+ * If an error can be associated to a particular point in the requested
+ * GraphQL document, it should contain a list of locations.
+ */
+ readonly locations?: ReadonlyArray<SourceLocation>;
+ /**
+ * If an error can be associated to a particular field in the GraphQL result,
+ * it _must_ contain an entry with the key `path` that details the path of
+ * the response field which experienced the error. This allows clients to
+ * identify whether a null result is intentional or caused by a runtime error.
+ */
+ readonly path?: ReadonlyArray<string | number>;
+ /**
+ * Reserved for implementors to extend the protocol however they see fit,
+ * and hence there are no additional restrictions on its contents.
+ */
+ readonly extensions?: GraphQLFormattedErrorExtensions;
+}
+/** Represents a linked response path from a field back to the root response. */
+interface Path {
+ /** The previous segment in the linked response path, or undefined at the root. */
+ readonly prev: Path | undefined;
+ /** The field name or list index for this response path segment. */
+ readonly key: string | number;
+ /** The runtime object type name associated with this path segment, if known. */
+ readonly typename: string | undefined;
+}
+/**
+ * Given a Path, return an Array of the path keys.
+ * @param path - The linked response path to flatten.
+ * @returns An array of response path keys from root to leaf.
+ * @example
+ * ```ts
+ * import { pathToArray } from 'graphql/jsutils/Path';
+ *
+ * const path = {
+ * prev: {
+ * prev: {
+ * prev: undefined,
+ * key: 'viewer',
+ * typename: 'Query',
+ * },
+ * key: 'friends',
+ * typename: 'User',
+ * },
+ * key: 0,
+ * typename: undefined,
+ * };
+ *
+ * pathToArray(path); // => ['viewer', 'friends', 0]
+ * pathToArray(undefined); // => []
+ * ```
+ */
+declare function pathToArray(path: Maybe<Readonly<Path>>): Array<string | number>;
+type PromiseOrValue<T> = Promise<T> | T;
+/** @category Kinds */
+/** The set of allowed directive location values. */
+export declare const DirectiveLocation: {
+ /** Directive location for query operations. */
+ readonly QUERY: "QUERY";
+ /** Directive location for mutation operations. */
+ readonly MUTATION: "MUTATION";
+ /** Directive location for subscription operations. */
+ readonly SUBSCRIPTION: "SUBSCRIPTION";
+ /** Directive location for field selections. */
+ readonly FIELD: "FIELD";
+ /** Directive location for fragment definitions. */
+ readonly FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION";
+ /** Directive location for fragment spreads. */
+ readonly FRAGMENT_SPREAD: "FRAGMENT_SPREAD";
+ /** Directive location for inline fragments. */
+ readonly INLINE_FRAGMENT: "INLINE_FRAGMENT";
+ /** Directive location for variable definitions. */
+ readonly VARIABLE_DEFINITION: "VARIABLE_DEFINITION";
+ /** Directive location for fragment variable definitions. */
+ readonly FRAGMENT_VARIABLE_DEFINITION: "FRAGMENT_VARIABLE_DEFINITION";
+ /** Directive location for schema definitions and extensions. */
+ readonly SCHEMA: "SCHEMA";
+ /** Directive location for scalar type definitions and extensions. */
+ readonly SCALAR: "SCALAR";
+ /** Directive location for object type definitions and extensions. */
+ readonly OBJECT: "OBJECT";
+ /** Directive location for field definitions. */
+ readonly FIELD_DEFINITION: "FIELD_DEFINITION";
+ /** Directive location for argument definitions. */
+ readonly ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION";
+ /** Directive location for interface type definitions and extensions. */
+ readonly INTERFACE: "INTERFACE";
+ /** Directive location for union type definitions and extensions. */
+ readonly UNION: "UNION";
+ /** Directive location for enum type definitions and extensions. */
+ readonly ENUM: "ENUM";
+ /** Directive location for enum value definitions. */
+ readonly ENUM_VALUE: "ENUM_VALUE";
+ /** Directive location for input object type definitions and extensions. */
+ readonly INPUT_OBJECT: "INPUT_OBJECT";
+ /** Directive location for input object field definitions. */
+ readonly INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION";
+ /** Directive location for directive definitions and extensions. */
+ readonly DIRECTIVE_DEFINITION: "DIRECTIVE_DEFINITION";
+};
+/** The set of allowed directive location values. */
+export type DirectiveLocation = (typeof DirectiveLocation)[keyof typeof DirectiveLocation];
+/**
+ * Test if the given value is a GraphQL directive.
+ * @param directive - Value to inspect.
+ * @returns True when the value is a GraphQLDirective.
+ * @example
+ * ```ts
+ * import { DirectiveLocation } from 'graphql/language';
+ * import { GraphQLDirective, GraphQLString, isDirective } from 'graphql/type';
+ *
+ * const upper = new GraphQLDirective({
+ * name: 'upper',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * });
+ *
+ * isDirective(upper); // => true
+ * isDirective(GraphQLString); // => false
+ * ```
+ */
+export declare function isDirective(directive: unknown): directive is GraphQLDirective;
+/**
+ * Returns the value as a GraphQLDirective, or throws if it is not a directive.
+ * @param directive - Value to inspect.
+ * @returns The value typed as a GraphQLDirective.
+ * @example
+ * ```ts
+ * import { DirectiveLocation } from 'graphql/language';
+ * import { assertDirective, GraphQLDirective, GraphQLString } from 'graphql/type';
+ *
+ * const upper = new GraphQLDirective({
+ * name: 'upper',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * });
+ *
+ * assertDirective(upper); // => upper
+ * assertDirective(GraphQLString); // throws an error
+ * ```
+ */
+export declare function assertDirective(directive: unknown): GraphQLDirective;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLDirectiveExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Directives are used by the GraphQL runtime as a way of modifying execution
+ * behavior. Type system creators will usually not create these directly.
+ */
+export declare class GraphQLDirective implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Locations where this directive may be applied. */
+ locations: ReadonlyArray<DirectiveLocation>;
+ /** Arguments accepted by this field or directive. */
+ args: ReadonlyArray<GraphQLArgument>;
+ /** Whether this directive may appear more than once at the same location. */
+ isRepeatable: boolean;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLDirectiveExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<DirectiveDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<DirectiveExtensionNode>;
+ /**
+ * Creates a GraphQLDirective instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { DirectiveLocation, parse } from 'graphql/language';
+ * import {
+ * GraphQLBoolean,
+ * GraphQLDirective,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * } from 'graphql/type';
+ *
+ * const document = parse(`
+ * directive @cacheControl(maxAge: Int) repeatable on FIELD_DEFINITION
+ * extend directive @cacheControl(maxAge: Int) on FIELD_DEFINITION
+ * `);
+ * const definition = document.definitions[0];
+ *
+ * const cacheControl = new GraphQLDirective({
+ * name: 'cacheControl',
+ * description: 'Controls HTTP cache hints for a field.',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * args: {
+ * inheritMaxAge: {
+ * description: 'Inherit the parent cache hint.',
+ * type: new GraphQLNonNull(GraphQLBoolean),
+ * default: { value: false },
+ * deprecationReason: 'Use maxAge instead.',
+ * extensions: { scope: 'cache' },
+ * },
+ * maxAge: {
+ * type: GraphQLInt,
+ * astNode: definition.arguments[0],
+ * },
+ * },
+ * isRepeatable: true,
+ * deprecationReason: 'Use @cache instead.',
+ * extensions: { scope: 'cache' },
+ * astNode: definition,
+ * extensionASTNodes: [document.definitions[1]],
+ * });
+ *
+ * cacheControl.name; // => 'cacheControl'
+ * cacheControl.description; // => 'Controls HTTP cache hints for a field.'
+ * cacheControl.args[0].name; // => 'inheritMaxAge'
+ * cacheControl.args[0].default.value; // => false
+ * cacheControl.isRepeatable; // => true
+ * cacheControl.extensions; // => { scope: 'cache' }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLDirectiveConfig>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { DirectiveLocation } from 'graphql/language';
+ * import { GraphQLDirective, GraphQLString } from 'graphql/type';
+ *
+ * const tag = new GraphQLDirective({
+ * name: 'tag',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * args: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const config = tag.toConfig();
+ * const tagCopy = new GraphQLDirective(config);
+ *
+ * config.args.name.type; // => GraphQLString
+ * tagCopy.args[0].name; // => 'name'
+ * ```
+ */
+ toConfig(): GraphQLDirectiveNormalizedConfig;
+ /**
+ * Returns the schema coordinate identifying this directive.
+ * @returns The directive schema coordinate.
+ * @example
+ * ```ts
+ * import { DirectiveLocation } from 'graphql/language';
+ * import { GraphQLDirective } from 'graphql/type';
+ *
+ * const tag = new GraphQLDirective({
+ * name: 'tag',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * });
+ *
+ * tag.toString(); // => '@tag'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { DirectiveLocation } from 'graphql/language';
+ * import { GraphQLDirective } from 'graphql/type';
+ *
+ * const tag = new GraphQLDirective({
+ * name: 'tag',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * });
+ *
+ * tag.toJSON(); // => '@tag'
+ * JSON.stringify({ directive: tag }); // => '{"directive":"@tag"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/** Configuration used to construct a GraphQLDirective. */
+export interface GraphQLDirectiveConfig {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Locations where this directive may be applied. */
+ locations: ReadonlyArray<DirectiveLocation>;
+ /** Arguments accepted by this field or directive. */
+ args?: Maybe<ObjMap<GraphQLArgumentConfig>>;
+ /** Whether this directive may appear more than once at the same location. */
+ isRepeatable?: Maybe<boolean>;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason?: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLDirectiveExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<DirectiveDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<DirectiveExtensionNode>>;
+}
+interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig {
+ args: GraphQLFieldNormalizedConfigArgumentMap;
+ isRepeatable: boolean;
+ extensions: Readonly<GraphQLDirectiveExtensions>;
+ extensionASTNodes: ReadonlyArray<DirectiveExtensionNode>;
+}
+/** Used to conditionally include fields or fragments. */
+export declare const GraphQLIncludeDirective: GraphQLDirective;
+/** Used to conditionally skip (exclude) fields or fragments. */
+export declare const GraphQLSkipDirective: GraphQLDirective;
+/**
+ * Experimental directive used to conditionally defer fragments.
+ *
+ * This directive is exported for schemas that explicitly opt in to incremental
+ * delivery. It is not included in `specifiedDirectives`.
+ */
+export declare const GraphQLDeferDirective: GraphQLDirective;
+/**
+ * Experimental directive used to conditionally stream list fields.
+ *
+ * This directive is exported for schemas that explicitly opt in to incremental
+ * delivery. It is not included in `specifiedDirectives`.
+ */
+export declare const GraphQLStreamDirective: GraphQLDirective;
+/** Constant string used for default reason for a deprecation. */
+export declare const DEFAULT_DEPRECATION_REASON = "No longer supported";
+/**
+ * Used to declare element of a GraphQL schema as deprecated.
+ *
+ * The `reason` argument is non-null and defaults to
+ * `DEFAULT_DEPRECATION_REASON`.
+ */
+export declare const GraphQLDeprecatedDirective: GraphQLDirective;
+/** Used to provide a URL for specifying the behavior of custom scalar definitions. */
+export declare const GraphQLSpecifiedByDirective: GraphQLDirective;
+/** Used to indicate an Input Object is a OneOf Input Object. */
+export declare const GraphQLOneOfDirective: GraphQLDirective;
+/**
+ * Full list of stable directives specified by GraphQL.js.
+ *
+ * Experimental `@defer` and `@stream` are exported separately and are not
+ * included in this list.
+ */
+export declare const specifiedDirectives: ReadonlyArray<GraphQLDirective>;
+/**
+ * Returns true when the directive is one of the directives specified by GraphQL.
+ * @param directive - Directive to inspect.
+ * @returns True when the directive is specified by GraphQL.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLDirective,
+ * GraphQLIncludeDirective,
+ * isSpecifiedDirective,
+ * } from 'graphql/type';
+ * import { DirectiveLocation } from 'graphql/language';
+ *
+ * const customDirective = new GraphQLDirective({
+ * name: 'auth',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * });
+ *
+ * isSpecifiedDirective(GraphQLIncludeDirective); // => true
+ * isSpecifiedDirective(customDirective); // => false
+ * ```
+ */
+export declare function isSpecifiedDirective(directive: GraphQLDirective): boolean;
+/**
+ * Maximum possible Int value as per GraphQL Spec (32-bit signed integer).
+ * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1
+ */
+export declare const GRAPHQL_MAX_INT = 2147483647;
+/**
+ * Minimum possible Int value as per GraphQL Spec (32-bit signed integer).
+ * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)
+ */
+export declare const GRAPHQL_MIN_INT = -2147483648;
+/** The built-in `Int` scalar type. */
+export declare const GraphQLInt: GraphQLScalarType<number>;
+/** The built-in `Float` scalar type. */
+export declare const GraphQLFloat: GraphQLScalarType<number>;
+/** The built-in `String` scalar type. */
+export declare const GraphQLString: GraphQLScalarType<string>;
+/** The built-in `Boolean` scalar type. */
+export declare const GraphQLBoolean: GraphQLScalarType<boolean>;
+/** The built-in `ID` scalar type. */
+export declare const GraphQLID: GraphQLScalarType<string>;
+/** All built-in scalar types defined by the GraphQL specification. */
+export declare const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>;
+/**
+ * Returns true when the scalar type is one of the scalars specified by GraphQL.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the scalar type is one of the scalars specified by GraphQL.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLScalarType,
+ * GraphQLString,
+ * isSpecifiedScalarType,
+ * } from 'graphql/type';
+ *
+ * const DateTime = new GraphQLScalarType({
+ * name: 'DateTime',
+ * });
+ *
+ * isSpecifiedScalarType(GraphQLString); // => true
+ * isSpecifiedScalarType(DateTime); // => false
+ * ```
+ */
+export declare function isSpecifiedScalarType(type: GraphQLNamedType): boolean;
+/** The introspection type describing a GraphQL schema. */
+export declare const __Schema: GraphQLObjectType;
+/** The introspection type describing a GraphQL directive. */
+export declare const __Directive: GraphQLObjectType;
+/** The introspection enum describing directive locations. */
+export declare const __DirectiveLocation: GraphQLEnumType;
+/** The introspection type describing GraphQL types. */
+export declare const __Type: GraphQLObjectType;
+/** The introspection type describing object and interface fields. */
+export declare const __Field: GraphQLObjectType;
+/** The introspection type describing arguments and input fields. */
+export declare const __InputValue: GraphQLObjectType;
+/** The introspection type describing enum values. */
+export declare const __EnumValue: GraphQLObjectType;
+/**
+ * The introspection enum describing the different kinds of GraphQL types.
+ * @category Introspection
+ */
+export declare const TypeKind: {
+ readonly SCALAR: "SCALAR";
+ readonly OBJECT: "OBJECT";
+ readonly INTERFACE: "INTERFACE";
+ readonly UNION: "UNION";
+ readonly ENUM: "ENUM";
+ readonly INPUT_OBJECT: "INPUT_OBJECT";
+ readonly LIST: "LIST";
+ readonly NON_NULL: "NON_NULL";
+};
+/**
+ * The introspection enum describing the different kinds of GraphQL types.
+ * @category Introspection
+ */
+export type TypeKind = (typeof TypeKind)[keyof typeof TypeKind];
+/** The introspection enum describing GraphQL type kinds. */
+export declare const __TypeKind: GraphQLEnumType;
+/**
+ * Note that these are GraphQLField and not GraphQLFieldConfig,
+ * so the format for args is different.
+ */
+export declare const SchemaMetaFieldDef: GraphQLField<unknown, unknown>;
+/** The `__type` meta field definition used by introspection. */
+export declare const TypeMetaFieldDef: GraphQLField<unknown, unknown>;
+/** The `__typename` meta field definition used by execution and introspection. */
+export declare const TypeNameMetaFieldDef: GraphQLField<unknown, unknown>;
+/** All introspection types defined by the GraphQL specification. */
+export declare const introspectionTypes: ReadonlyArray<GraphQLNamedType>;
+/**
+ * Returns true when the type is one of the built-in introspection types.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the type is one of the built-in introspection types.
+ * @example
+ * ```ts
+ * import { GraphQLString, isIntrospectionType, __Type } from 'graphql/type';
+ *
+ * isIntrospectionType(__Type); // => true
+ * isIntrospectionType(GraphQLString); // => false
+ * ```
+ */
+export declare function isIntrospectionType(type: GraphQLNamedType): boolean;
+/**
+ * Implements the "Type Validation" sub-sections of the specification's
+ * "Type System" section.
+ *
+ * Validation runs synchronously, returning an array of encountered errors, or
+ * an empty array if no errors were encountered and the Schema is valid.
+ * @param schema - GraphQL schema to use.
+ * @returns Schema validation errors, or an empty array when the schema is valid.
+ * @example
+ * ```ts
+ * import { validateSchema } from 'graphql/type';
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ * const errors = validateSchema(schema);
+ *
+ * errors; // => []
+ * ```
+ */
+export declare function validateSchema(schema: GraphQLSchema): ReadonlyArray<GraphQLError>;
+/**
+ * Utility function which asserts a schema is valid by throwing an error if
+ * it is invalid.
+ * @param schema - GraphQL schema to use.
+ * @example
+ * ```ts
+ * import { assertValidSchema } from 'graphql/type';
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * assertValidSchema(schema); // does not throw
+ * ```
+ */
+export declare function assertValidSchema(schema: GraphQLSchema): void;
+/** @category Names */
+/**
+ * Upholds the spec rules about naming.
+ * @param name - The GraphQL name to validate.
+ * @returns The validated GraphQL name.
+ * @example
+ * ```ts
+ * import { assertName } from 'graphql/type';
+ *
+ * assertName('User'); // => 'User'
+ * assertName('123User'); // throws an error
+ * ```
+ */
+export declare function assertName(name: string): string;
+/**
+ * Upholds the spec rules about naming enum values.
+ * @param name - The GraphQL name to validate.
+ * @returns The validated GraphQL name.
+ * @example
+ * ```ts
+ * import { assertEnumValueName } from 'graphql/type';
+ *
+ * assertEnumValueName('ACTIVE'); // => 'ACTIVE'
+ * assertEnumValueName('true'); // throws an error
+ * ```
+ */
+export declare function assertEnumValueName(name: string): string;
+interface GraphQLVariableSignature {
+ name: string;
+ type: GraphQLInputType;
+ defaultValue?: never;
+ default: {
+ literal: ConstValueNode;
+ } | undefined;
+}
+interface FragmentVariableValues {
+ readonly sources: ReadOnlyObjMap<FragmentVariableValueSource>;
+ readonly coerced: ReadOnlyObjMap<unknown>;
+}
+interface FragmentVariableValueSource {
+ readonly signature: GraphQLVariableSignature;
+ readonly value?: ValueNode;
+ readonly fragmentVariableValues?: FragmentVariableValues;
+}
+interface FragmentDetails {
+ definition: FragmentDefinitionNode;
+ variableSignatures?: ObjMap<GraphQLVariableSignature> | undefined;
+}
+/**
+ * Coerced variable values prepared for execution.
+ *
+ * The `coerced` map contains runtime values keyed by variable name. The
+ * `sources` map records whether each value came from request input, an operation
+ * default, or a fragment-variable default so utilities can preserve defaults
+ * when replacing variables in literals.
+ */
+export interface VariableValues {
+ /** Source metadata for each variable value keyed by variable name. */
+ readonly sources: ReadOnlyObjMap<VariableValueSource>;
+ /** Coerced runtime variable values keyed by variable name. */
+ readonly coerced: ReadOnlyObjMap<unknown>;
+}
+interface VariableValueSource {
+ readonly signature: GraphQLVariableSignature;
+ readonly value?: unknown;
+}
+type VariableValuesOrErrors = {
+ variableValues: VariableValues;
+ errors?: never;
+} | {
+ errors: ReadonlyArray<GraphQLError>;
+ variableValues?: never;
+};
+/**
+ * Prepares an object map of variableValues of the correct type based on the
+ * provided variable definitions and arbitrary input. If the input cannot be
+ * parsed to match the variable definitions, GraphQLError values are returned.
+ *
+ * Note: Returned maps use null prototypes to avoid collisions with
+ * Object prototype properties.
+ * @param schema - GraphQL schema to use.
+ * @param varDefNodes - The variable definition AST nodes to coerce.
+ * @param inputs - The runtime variable values keyed by variable name.
+ * @param options - Optional configuration for this operation.
+ * @param [options.maxErrors] - Maximum number of coercion errors to report.
+ * @param [options.hideSuggestions] - Whether suggestion text should be omitted
+ * from errors.
+ * @returns Coerced variable values with source metadata, or request errors.
+ * @example
+ * ```ts
+ * // Coerce provided variables and apply operation defaults.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getVariableValues } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(stars: Int!, limit: Int = 10): [String]
+ * }
+ * `);
+ * const document = parse(`
+ * query ($stars: Int!, $limit: Int = 10) {
+ * reviews(stars: $stars, limit: $limit)
+ * }
+ * `);
+ * const operation = document.definitions[0];
+ *
+ * const result = getVariableValues(schema, operation.variableDefinitions, {
+ * stars: '5',
+ * });
+ *
+ * assert('variableValues' in result);
+ *
+ * result.variableValues.coerced; // => { stars: 5, limit: 10 }
+ * ```
+ * @example
+ * ```ts
+ * // This variant uses maxErrors to cap reported coercion errors.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getVariableValues } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput!): String
+ * }
+ * `);
+ * const document = parse(`
+ * query ($first: ReviewInput!, $second: ReviewInput!) {
+ * first: review(input: $first)
+ * second: review(input: $second)
+ * }
+ * `);
+ * const operation = document.definitions[0];
+ *
+ * const result = getVariableValues(
+ * schema,
+ * operation.variableDefinitions,
+ * { first: { stars: 'bad' }, second: { stars: 'also bad' } },
+ * { maxErrors: 1 },
+ * );
+ *
+ * assert('errors' in result);
+ *
+ * result.errors.length; // => 2
+ * result.errors[1].message; // matches /error limit reached/
+ * ```
+ */
+export declare function getVariableValues(schema: GraphQLSchema, varDefNodes: ReadonlyArray<VariableDefinitionNode>, inputs: {
+ readonly [variable: string]: unknown;
+}, options?: {
+ maxErrors?: number;
+ hideSuggestions?: boolean;
+}): VariableValuesOrErrors;
+/**
+ * Prepares an object map of argument values given a list of argument
+ * definitions and list of argument AST nodes.
+ *
+ * Note: Returned value uses a null prototype to avoid collisions with
+ * JavaScript's own property names.
+ * @param def - Field or directive definition that declares the arguments.
+ * @param node - Field or directive AST node supplying argument literals.
+ * @param variableValues - Operation variable values returned by getVariableValues.
+ * @param fragmentVariableValues - Fragment variable values for the current fragment scope.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns A map of coerced argument values.
+ * @example
+ * ```ts
+ * // Read literal argument values and defaults.
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getArgumentValues } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(stars: Int!, limit: Int = 10): [String]
+ * }
+ * `);
+ * const fieldDef = schema.getQueryType().getFields().reviews;
+ * const document = parse('{ reviews(stars: 5) }');
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ *
+ * getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 }
+ * ```
+ * @example
+ * ```ts
+ * // This variant resolves argument values from operation variables.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getArgumentValues, getVariableValues } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(stars: Int!): [String]
+ * }
+ * `);
+ * const fieldDef = schema.getQueryType().getFields().reviews;
+ * const document = parse('query ($stars: Int!) { reviews(stars: $stars) }');
+ * const operation = document.definitions[0];
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ * const variables = getVariableValues(schema, operation.variableDefinitions, {
+ * stars: '5',
+ * });
+ *
+ * assert('variableValues' in variables);
+ *
+ * getArgumentValues(fieldDef, fieldNode, variables.variableValues); // => { stars: 5 }
+ * getArgumentValues(fieldDef, fieldNode); // throws an error
+ * ```
+ */
+export declare function getArgumentValues(def: GraphQLField<unknown, unknown> | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<FragmentVariableValues>, hideSuggestions?: Maybe<boolean>): ObjMap<unknown>;
+/**
+ * Prepares an object map of argument values given a directive definition
+ * and a AST node which may contain directives. Optionally also accepts a map
+ * of variable values.
+ *
+ * If the directive does not exist on the node, returns undefined.
+ *
+ * Note: Returned value uses a null prototype to avoid collisions with
+ * JavaScript's own property names.
+ * @param directiveDef - Directive definition to read argument definitions from.
+ * @param node - AST node that may contain directives.
+ * @param node.directives - The directives on the AST node.
+ * @param variableValues - Operation variable values returned by getVariableValues.
+ * @param fragmentVariableValues - Fragment variable values for the current fragment scope.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns A map of coerced directive argument values, or undefined when absent.
+ * @example
+ * ```ts
+ * // Read literal directive arguments from a node.
+ * import { parse } from 'graphql/language';
+ * import { GraphQLSkipDirective } from 'graphql/type';
+ * import { getDirectiveValues } from 'graphql/execution';
+ *
+ * const document = parse('{ name @skip(if: true) }');
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ *
+ * getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true }
+ * ```
+ * @example
+ * ```ts
+ * // This variant resolves directive arguments from variables and handles absent directives.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { GraphQLIncludeDirective } from 'graphql/type';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getDirectiveValues, getVariableValues } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { name: String }');
+ * const document = parse(
+ * 'query ($includeName: Boolean!) { name @include(if: $includeName) }',
+ * );
+ * const operation = document.definitions[0];
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ * const variables = getVariableValues(schema, operation.variableDefinitions, {
+ * includeName: false,
+ * });
+ *
+ * assert('variableValues' in variables);
+ *
+ * getDirectiveValues(
+ * GraphQLIncludeDirective,
+ * fieldNode,
+ * variables.variableValues,
+ * ); // => { if: false }
+ * getDirectiveValues(GraphQLIncludeDirective, { directives: [] }); // => undefined
+ * ```
+ */
+export declare function getDirectiveValues(directiveDef: GraphQLDirective, node: {
+ readonly directives?: ReadonlyArray<DirectiveNode> | undefined;
+}, variableValues?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<FragmentVariableValues>, hideSuggestions?: Maybe<boolean>): undefined | ObjMap<unknown>;
+/** These are all of the possible kinds of types. */
+export type GraphQLType = GraphQLNamedType | GraphQLWrappingType;
+/**
+ * Returns true when the value is any GraphQL type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is any GraphQL type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { GraphQLList, GraphQLString, isType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * isType(GraphQLString); // => true
+ * isType(new GraphQLList(GraphQLString)); // => true
+ * isType(schema.getType('Query')); // => true
+ * isType('String'); // => false
+ * ```
+ */
+export declare function isType(type: unknown): type is GraphQLType;
+/**
+ * Returns the value as a GraphQL type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const queryType = assertType(schema.getType('Query'));
+ *
+ * queryType.toString(); // => 'Query'
+ * assertType('Query'); // throws an error
+ * ```
+ */
+export declare function assertType(type: unknown): GraphQLType;
+/**
+ * There are predicates for each kind of GraphQL type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLScalarType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isScalarType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * scalar DateTime
+ *
+ * type Query {
+ * createdAt: DateTime
+ * }
+ * `);
+ *
+ * isScalarType(schema.getType('DateTime')); // => true
+ * isScalarType(schema.getType('Query')); // => false
+ * ```
+ */
+export declare function isScalarType(type: unknown): type is GraphQLScalarType;
+/**
+ * Returns the value as a GraphQLScalarType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLScalarType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertScalarType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * scalar DateTime
+ *
+ * type Query {
+ * createdAt: DateTime
+ * }
+ * `);
+ *
+ * const dateTimeType = assertScalarType(schema.getType('DateTime'));
+ *
+ * dateTimeType.name; // => 'DateTime'
+ * assertScalarType(schema.getType('Query')); // throws an error
+ * ```
+ */
+export declare function assertScalarType(type: unknown): GraphQLScalarType;
+/**
+ * Returns true when the value is a GraphQLObjectType.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLObjectType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * user: User
+ * }
+ * `);
+ *
+ * isObjectType(schema.getType('User')); // => true
+ * isObjectType(schema.getType('ReviewInput')); // => false
+ * ```
+ */
+export declare function isObjectType(type: unknown): type is GraphQLObjectType;
+/**
+ * Returns the value as a GraphQLObjectType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLObjectType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * user: User
+ * }
+ * `);
+ *
+ * const userType = assertObjectType(schema.getType('User'));
+ *
+ * Object.keys(userType.getFields()); // => ['name']
+ * assertObjectType(schema.getType('ReviewInput')); // throws an error
+ * ```
+ */
+export declare function assertObjectType(type: unknown): GraphQLObjectType;
+/**
+ * Returns true when the value is a resolved GraphQL field definition.
+ * @param field - Value to inspect.
+ * @returns True when the value is a GraphQLField.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isField } from 'graphql/type';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ * const field = schema.getQueryType().getFields().greeting;
+ *
+ * isField(field); // => true
+ * isField(schema.getQueryType()); // => false
+ * ```
+ */
+export declare function isField(field: unknown): field is GraphQLField;
+/**
+ * Returns the value as a GraphQLField, or throws if it is not one.
+ * @param field - Value to inspect.
+ * @returns The value typed as a GraphQLField.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertField } from 'graphql/type';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ * const field = assertField(schema.getQueryType().getFields().greeting);
+ *
+ * field.name; // => 'greeting'
+ * assertField(schema.getQueryType()); // throws an error
+ * ```
+ */
+export declare function assertField(field: unknown): GraphQLField;
+/**
+ * Returns true when the value is a resolved GraphQL argument definition.
+ * @param arg - Value to inspect.
+ * @returns True when the value is a GraphQLArgument.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isArgument } from 'graphql/type';
+ *
+ * const schema = buildSchema('type Query { greeting(name: String): String }');
+ * const arg = schema.getQueryType().getFields().greeting.args[0];
+ *
+ * isArgument(arg); // => true
+ * isArgument(schema.getQueryType()); // => false
+ * ```
+ */
+export declare function isArgument(arg: unknown): arg is GraphQLArgument;
+/**
+ * Returns the value as a GraphQLArgument, or throws if it is not one.
+ * @param arg - Value to inspect.
+ * @returns The value typed as a GraphQLArgument.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertArgument } from 'graphql/type';
+ *
+ * const schema = buildSchema('type Query { greeting(name: String): String }');
+ * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]);
+ *
+ * arg.name; // => 'name'
+ * assertArgument(schema.getQueryType()); // throws an error
+ * ```
+ */
+export declare function assertArgument(arg: unknown): GraphQLArgument;
+/**
+ * Returns true when the value is a GraphQLInterfaceType.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLInterfaceType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * isInterfaceType(schema.getType('Node')); // => true
+ * isInterfaceType(schema.getType('User')); // => false
+ * ```
+ */
+export declare function isInterfaceType(type: unknown): type is GraphQLInterfaceType;
+/**
+ * Returns the value as a GraphQLInterfaceType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLInterfaceType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * const nodeType = assertInterfaceType(schema.getType('Node'));
+ *
+ * nodeType.name; // => 'Node'
+ * assertInterfaceType(schema.getType('User')); // throws an error
+ * ```
+ */
+export declare function assertInterfaceType(type: unknown): GraphQLInterfaceType;
+/**
+ * Returns true when the value is a GraphQLUnionType.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLUnionType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isUnionType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Photo {
+ * url: String!
+ * }
+ *
+ * type Video {
+ * url: String!
+ * }
+ *
+ * union Media = Photo | Video
+ *
+ * type Query {
+ * media: [Media]
+ * }
+ * `);
+ *
+ * isUnionType(schema.getType('Media')); // => true
+ * isUnionType(schema.getType('Photo')); // => false
+ * ```
+ */
+export declare function isUnionType(type: unknown): type is GraphQLUnionType;
+/**
+ * Returns the value as a GraphQLUnionType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLUnionType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertUnionType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Photo {
+ * url: String!
+ * }
+ *
+ * type Video {
+ * url: String!
+ * }
+ *
+ * union Media = Photo | Video
+ *
+ * type Query {
+ * media: [Media]
+ * }
+ * `);
+ *
+ * const mediaType = assertUnionType(schema.getType('Media'));
+ *
+ * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video']
+ * assertUnionType(schema.getType('Photo')); // throws an error
+ * ```
+ */
+export declare function assertUnionType(type: unknown): GraphQLUnionType;
+/**
+ * Returns true when the value is a GraphQLEnumType.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLEnumType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isEnumType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * }
+ *
+ * type Query {
+ * favoriteEpisode: Episode
+ * }
+ * `);
+ *
+ * isEnumType(schema.getType('Episode')); // => true
+ * isEnumType(schema.getType('Query')); // => false
+ * ```
+ */
+export declare function isEnumType(type: unknown): type is GraphQLEnumType;
+/**
+ * Returns the value as a GraphQLEnumType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLEnumType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * }
+ *
+ * type Query {
+ * favoriteEpisode: Episode
+ * }
+ * `);
+ *
+ * const episodeType = assertEnumType(schema.getType('Episode'));
+ *
+ * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE']
+ * assertEnumType(schema.getType('Query')); // throws an error
+ * ```
+ */
+export declare function assertEnumType(type: unknown): GraphQLEnumType;
+/**
+ * Returns true when the value is a resolved GraphQL enum value definition.
+ * @param value - Value to inspect.
+ * @returns True when the value is a GraphQLEnumValue.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType, isEnumValue } from 'graphql/type';
+ *
+ * const schema = buildSchema(
+ * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',
+ * );
+ * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0];
+ *
+ * isEnumValue(enumValue); // => true
+ * isEnumValue(schema.getType('Episode')); // => false
+ * ```
+ */
+export declare function isEnumValue(value: unknown): value is GraphQLEnumValue;
+/**
+ * Returns the value as a GraphQLEnumValue, or throws if it is not one.
+ * @param value - Value to inspect.
+ * @returns The value typed as a GraphQLEnumValue.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType, assertEnumValue } from 'graphql/type';
+ *
+ * const schema = buildSchema(
+ * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',
+ * );
+ * const enumValue = assertEnumValue(
+ * assertEnumType(schema.getType('Episode')).getValues()[0],
+ * );
+ *
+ * enumValue.name; // => 'NEW_HOPE'
+ * assertEnumValue(schema.getType('Episode')); // throws an error
+ * ```
+ */
+export declare function assertEnumValue(value: unknown): GraphQLEnumValue;
+/**
+ * Returns true when the value is a GraphQLInputObjectType.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLInputObjectType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isInputObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * isInputObjectType(schema.getType('ReviewInput')); // => true
+ * isInputObjectType(schema.getType('Review')); // => false
+ * ```
+ */
+export declare function isInputObjectType(type: unknown): type is GraphQLInputObjectType;
+/**
+ * Returns the value as a GraphQLInputObjectType, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLInputObjectType.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * const inputType = assertInputObjectType(schema.getType('ReviewInput'));
+ *
+ * Object.keys(inputType.getFields()); // => ['stars']
+ * assertInputObjectType(schema.getType('Review')); // throws an error
+ * ```
+ */
+export declare function assertInputObjectType(type: unknown): GraphQLInputObjectType;
+/**
+ * Returns true when the value is a resolved GraphQL input field definition.
+ * @param field - Value to inspect.
+ * @returns True when the value is a GraphQLInputField.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputObjectType, isInputField } from 'graphql/type';
+ *
+ * const schema = buildSchema(
+ * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',
+ * );
+ * const inputField = assertInputObjectType(
+ * schema.getType('ReviewInput'),
+ * ).getFields().stars;
+ *
+ * isInputField(inputField); // => true
+ * isInputField(schema.getQueryType()); // => false
+ * ```
+ */
+export declare function isInputField(field: unknown): field is GraphQLInputField;
+/**
+ * Returns the value as a GraphQLInputField, or throws if it is not one.
+ * @param field - Value to inspect.
+ * @returns The value typed as a GraphQLInputField.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputField, assertInputObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(
+ * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',
+ * );
+ * const inputField = assertInputField(
+ * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars,
+ * );
+ *
+ * inputField.name; // => 'stars'
+ * assertInputField(schema.getQueryType()); // throws an error
+ * ```
+ */
+export declare function assertInputField(field: unknown): GraphQLInputField;
+/**
+ * Returns true when the value is a GraphQLList.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLList.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { GraphQLList, GraphQLString, isListType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * tags: [String!]!
+ * }
+ * `);
+ *
+ * const tagsField = schema.getQueryType()?.getFields().tags;
+ *
+ * isListType(new GraphQLList(GraphQLString)); // => true
+ * isListType(GraphQLString); // => false
+ * isListType(tagsField?.type); // => false
+ * ```
+ */
+export declare function isListType(type: GraphQLInputType): type is GraphQLList<GraphQLInputType>;
+/**
+ * Returns true when the output type is a GraphQLList.
+ * @param type - The GraphQL output type to inspect.
+ * @returns True when the output type is a list type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getNullableType, isListType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * tags: [String!]!
+ * }
+ * `);
+ *
+ * const tagsField = schema.getQueryType()?.getFields().tags;
+ * const nullableTagsType = getNullableType(tagsField?.type);
+ *
+ * isListType(nullableTagsType); // => true
+ * ```
+ */
+export declare function isListType(type: GraphQLOutputType): type is GraphQLList<GraphQLOutputType>;
+/**
+ * Returns true when the value is a GraphQLList.
+ * @param type - The value to inspect.
+ * @returns True when the value is a list type.
+ * @example
+ * ```ts
+ * import { isListType } from 'graphql/type';
+ *
+ * isListType('[String]'); // => false
+ * isListType(null); // => false
+ * ```
+ */
+export declare function isListType(type: unknown): type is GraphQLList<GraphQLType>;
+/**
+ * Returns the value as a GraphQLList, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLList.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type';
+ *
+ * const listType = assertListType(new GraphQLList(GraphQLString));
+ *
+ * listType.ofType; // => GraphQLString
+ * assertListType(GraphQLString); // throws an error
+ * ```
+ */
+export declare function assertListType(type: unknown): GraphQLList<GraphQLType>;
+/**
+ * Returns true when the value is a GraphQLNonNull.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQLNonNull.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String!
+ * nickname: String
+ * }
+ * `);
+ *
+ * const fields = schema.getQueryType()?.getFields();
+ *
+ * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true
+ * isNonNullType(fields?.name.type); // => true
+ * isNonNullType(fields?.nickname.type); // => false
+ * ```
+ */
+export declare function isNonNullType(type: GraphQLInputType): type is GraphQLNonNull<GraphQLNullableInputType>;
+/**
+ * Returns true when the output type is a GraphQLNonNull.
+ * @param type - The GraphQL output type to inspect.
+ * @returns True when the output type is a non-null type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isNonNullType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String!
+ * nickname: String
+ * }
+ * `);
+ *
+ * const fields = schema.getQueryType()?.getFields();
+ *
+ * isNonNullType(fields?.name.type); // => true
+ * isNonNullType(fields?.nickname.type); // => false
+ * ```
+ */
+export declare function isNonNullType(type: GraphQLOutputType): type is GraphQLNonNull<GraphQLNullableOutputType>;
+/**
+ * Returns true when the value is a GraphQLNonNull.
+ * @param type - The value to inspect.
+ * @returns True when the value is a non-null type.
+ * @example
+ * ```ts
+ * import { isNonNullType } from 'graphql/type';
+ *
+ * isNonNullType('String!'); // => false
+ * isNonNullType(null); // => false
+ * ```
+ */
+export declare function isNonNullType(type: unknown): type is GraphQLNonNull<GraphQLNullableType>;
+/**
+ * Returns the value as a GraphQLNonNull, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQLNonNull.
+ * @example
+ * ```ts
+ * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type';
+ *
+ * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString));
+ *
+ * nonNullType.ofType; // => GraphQLString
+ * assertNonNullType(GraphQLString); // throws an error
+ * ```
+ */
+export declare function assertNonNullType(type: unknown): GraphQLNonNull<GraphQLNullableType>;
+/** These types may be used as input types for arguments and directives. */
+export type GraphQLNullableInputType = GraphQLNamedInputType | GraphQLList<GraphQLInputType>;
+/** These types may be used as input types for arguments and directives. */
+export type GraphQLInputType = GraphQLNullableInputType | GraphQLNonNull<GraphQLNullableInputType>;
+/**
+ * Returns true when the value can be used as a GraphQL input type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value can be used as a GraphQL input type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isInputType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * isInputType(schema.getType('ReviewInput')); // => true
+ * isInputType(schema.getType('Review')); // => false
+ * ```
+ */
+export declare function isInputType(type: unknown): type is GraphQLInputType;
+/**
+ * Returns the value as a GraphQL input type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL input type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * const inputType = assertInputType(schema.getType('ReviewInput'));
+ *
+ * inputType.toString(); // => 'ReviewInput'
+ * assertInputType(schema.getType('Review')); // throws an error
+ * ```
+ */
+export declare function assertInputType(type: unknown): GraphQLInputType;
+/** These types may be used as output types as the result of fields. */
+export type GraphQLNullableOutputType = GraphQLNamedOutputType | GraphQLList<GraphQLOutputType>;
+/** These types may be used as output types as the result of fields. */
+export type GraphQLOutputType = GraphQLNullableOutputType | GraphQLNonNull<GraphQLNullableOutputType>;
+/**
+ * Returns true when the value can be used as a GraphQL output type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value can be used as a GraphQL output type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isOutputType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * isOutputType(schema.getType('Review')); // => true
+ * isOutputType(schema.getType('ReviewInput')); // => false
+ * ```
+ */
+export declare function isOutputType(type: unknown): type is GraphQLOutputType;
+/**
+ * Returns the value as a GraphQL output type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL output type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertOutputType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: ReviewInput): Review
+ * }
+ * `);
+ *
+ * const outputType = assertOutputType(schema.getType('Review'));
+ *
+ * outputType.toString(); // => 'Review'
+ * assertOutputType(schema.getType('ReviewInput')); // throws an error
+ * ```
+ */
+export declare function assertOutputType(type: unknown): GraphQLOutputType;
+/** These types may describe types which may be leaf values. */
+export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
+/**
+ * Returns true when the value is a GraphQL scalar or enum type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL scalar or enum type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isLeafType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * review: Review
+ * }
+ * `);
+ *
+ * isLeafType(schema.getType('Episode')); // => true
+ * isLeafType(schema.getType('String')); // => true
+ * isLeafType(schema.getType('Review')); // => false
+ * ```
+ */
+export declare function isLeafType(type: unknown): type is GraphQLLeafType;
+/**
+ * Returns the value as a GraphQL leaf type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL leaf type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertLeafType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * }
+ *
+ * type Review {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * review: Review
+ * }
+ * `);
+ *
+ * const episodeType = assertLeafType(schema.getType('Episode'));
+ *
+ * episodeType.toString(); // => 'Episode'
+ * assertLeafType(schema.getType('Review')); // throws an error
+ * ```
+ */
+export declare function assertLeafType(type: unknown): GraphQLLeafType;
+/** These types may describe the parent context of a selection set. */
+export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType;
+/**
+ * Returns true when the value is a GraphQL object, interface, or union type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL object, interface, or union type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isCompositeType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * union SearchResult = User
+ *
+ * type Query {
+ * node: Node
+ * search: [SearchResult]
+ * }
+ * `);
+ *
+ * isCompositeType(schema.getType('User')); // => true
+ * isCompositeType(schema.getType('Node')); // => true
+ * isCompositeType(schema.getType('SearchResult')); // => true
+ * isCompositeType(schema.getType('String')); // => false
+ * ```
+ */
+export declare function isCompositeType(type: unknown): type is GraphQLCompositeType;
+/**
+ * Returns the value as a GraphQL composite type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL composite type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertCompositeType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * const userType = assertCompositeType(schema.getType('User'));
+ *
+ * userType.toString(); // => 'User'
+ * assertCompositeType(schema.getType('String')); // throws an error
+ * ```
+ */
+export declare function assertCompositeType(type: unknown): GraphQLCompositeType;
+/** These types may describe the parent context of a selection set. */
+export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;
+/**
+ * Returns true when the value is a GraphQL interface or union type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL interface or union type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { isAbstractType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * union SearchResult = User
+ *
+ * type Query {
+ * node: Node
+ * search: [SearchResult]
+ * }
+ * `);
+ *
+ * isAbstractType(schema.getType('Node')); // => true
+ * isAbstractType(schema.getType('SearchResult')); // => true
+ * isAbstractType(schema.getType('User')); // => false
+ * ```
+ */
+export declare function isAbstractType(type: unknown): type is GraphQLAbstractType;
+/**
+ * Returns the value as a GraphQL abstract type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL abstract type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertAbstractType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * const nodeType = assertAbstractType(schema.getType('Node'));
+ *
+ * nodeType.toString(); // => 'Node'
+ * assertAbstractType(schema.getType('User')); // throws an error
+ * ```
+ */
+export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
+/**
+ * List Type Wrapper
+ *
+ * A list is a wrapping type which points to another type.
+ * Lists are often created within the context of defining the fields of
+ * an object type.
+ * @typeParam T - The GraphQL type wrapped by this list type.
+ * @example
+ * ```ts
+ * const PersonType = new GraphQLObjectType({
+ * name: 'Person',
+ * fields: () => ({
+ * parents: { type: new GraphQLList(PersonType) },
+ * children: { type: new GraphQLList(PersonType) },
+ * }),
+ * });
+ * ```
+ */
+export declare class GraphQLList<T extends GraphQLType> implements GraphQLSchemaElement {
+ /** The type wrapped by this list or non-null type. */
+ readonly ofType: T;
+ private readonly __GraphQLListTypeBrand;
+ /**
+ * Creates a GraphQLList instance.
+ * @param ofType - The type to wrap.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString } from 'graphql/type';
+ *
+ * const stringList = new GraphQLList(GraphQLString);
+ *
+ * stringList.ofType; // => GraphQLString
+ * String(stringList); // => '[String]'
+ * ```
+ */
+ constructor(ofType: T);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns this wrapping type as a GraphQL type-reference string.
+ * @returns The GraphQL type-reference string.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';
+ *
+ * const stringList = new GraphQLList(GraphQLString);
+ * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString));
+ *
+ * stringList.toString(); // => '[String]'
+ * requiredStringList.toString(); // => '[String!]'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString } from 'graphql/type';
+ *
+ * const stringList = new GraphQLList(GraphQLString);
+ *
+ * stringList.toJSON(); // => '[String]'
+ * JSON.stringify({ type: stringList }); // => '{"type":"[String]"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Non-Null Type Wrapper
+ *
+ * A non-null is a wrapping type which points to another type.
+ * Non-null types enforce that their values are never null and can ensure
+ * an error is raised if this ever occurs during a request. It is useful for
+ * fields which you can make a strong guarantee on non-nullability, for example
+ * usually the id field of a database row will never be null.
+ * @typeParam T - The nullable GraphQL type wrapped by this non-null type.
+ * @example
+ * ```ts
+ * const RowType = new GraphQLObjectType({
+ * name: 'Row',
+ * fields: () => ({
+ * id: { type: new GraphQLNonNull(GraphQLString) },
+ * }),
+ * });
+ * ```
+ *
+ * Note: the enforcement of non-nullability occurs within the executor.
+ */
+export declare class GraphQLNonNull<T extends GraphQLNullableType> implements GraphQLSchemaElement {
+ /** The type wrapped by this list or non-null type. */
+ readonly ofType: T;
+ private readonly __GraphQLNonNullTypeBrand;
+ /**
+ * Creates a GraphQLNonNull instance.
+ * @param ofType - The type to wrap.
+ * @example
+ * ```ts
+ * import { GraphQLNonNull, GraphQLString } from 'graphql/type';
+ *
+ * const requiredString = new GraphQLNonNull(GraphQLString);
+ *
+ * requiredString.ofType; // => GraphQLString
+ * String(requiredString); // => 'String!'
+ * ```
+ */
+ constructor(ofType: T);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns this wrapping type as a GraphQL type-reference string.
+ * @returns The GraphQL type-reference string.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';
+ *
+ * const requiredString = new GraphQLNonNull(GraphQLString);
+ * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));
+ *
+ * requiredString.toString(); // => 'String!'
+ * requiredStringList.toString(); // => '[String]!'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLNonNull, GraphQLString } from 'graphql/type';
+ *
+ * const requiredString = new GraphQLNonNull(GraphQLString);
+ *
+ * requiredString.toJSON(); // => 'String!'
+ * JSON.stringify({ type: requiredString }); // => '{"type":"String!"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/** These types wrap and modify other types */
+export type GraphQLWrappingType = GraphQLList<GraphQLType> | GraphQLNonNull<GraphQLNullableType>;
+/**
+ * Returns true when the value is a GraphQL list or non-null wrapper type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL list or non-null wrapper type.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * isWrappingType,
+ * } from 'graphql/type';
+ *
+ * isWrappingType(new GraphQLList(GraphQLString)); // => true
+ * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true
+ * isWrappingType(GraphQLString); // => false
+ * ```
+ */
+export declare function isWrappingType(type: unknown): type is GraphQLWrappingType;
+/**
+ * Returns the value as a GraphQL wrapping type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL wrapping type.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type';
+ *
+ * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString));
+ *
+ * wrappingType.toString(); // => '[String]'
+ * assertWrappingType(GraphQLString); // throws an error
+ * ```
+ */
+export declare function assertWrappingType(type: unknown): GraphQLWrappingType;
+/** These types can all accept null as a value. */
+export type GraphQLNullableType = GraphQLNamedType | GraphQLList<GraphQLType>;
+/**
+ * Returns true when the value is a GraphQL type that can accept null.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL type that can accept null.
+ * @example
+ * ```ts
+ * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type';
+ *
+ * isNullableType(GraphQLString); // => true
+ * isNullableType(new GraphQLNonNull(GraphQLString)); // => false
+ * isNullableType(null); // => false
+ * ```
+ */
+export declare function isNullableType(type: unknown): type is GraphQLNullableType;
+/**
+ * Returns the value as a nullable GraphQL type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a nullable GraphQL type.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLNonNull,
+ * GraphQLString,
+ * assertNullableType,
+ * } from 'graphql/type';
+ *
+ * const nullableType = assertNullableType(GraphQLString);
+ *
+ * nullableType; // => GraphQLString
+ * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error
+ * ```
+ */
+export declare function assertNullableType(type: unknown): GraphQLNullableType;
+/**
+ * Returns the nullable type.
+ * @param type - The GraphQL type to inspect.
+ * @returns The nullable type after removing one non-null wrapper, if present.
+ * @example
+ * ```ts
+ * import { getNullableType } from 'graphql/type';
+ *
+ * getNullableType(null); // => undefined
+ * getNullableType(undefined); // => undefined
+ * ```
+ */
+export declare function getNullableType(type: undefined | null): void;
+/**
+ * Returns the nullable type after removing one non-null wrapper.
+ * @param type - A nullable type or non-null wrapper.
+ * @returns The nullable type after removing one non-null wrapper, if present.
+ * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * getNullableType,
+ * } from 'graphql/type';
+ *
+ * const requiredString = new GraphQLNonNull(GraphQLString);
+ * const stringList = new GraphQLList(GraphQLString);
+ *
+ * getNullableType(requiredString); // => GraphQLString
+ * getNullableType(stringList); // => stringList
+ * ```
+ */
+export declare function getNullableType<T extends GraphQLNullableType>(type: T | GraphQLNonNull<T>): T;
+/**
+ * Returns the nullable type after removing one non-null wrapper.
+ * @param type - The GraphQL type to inspect.
+ * @returns The nullable type after removing one non-null wrapper, if present.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * getNullableType,
+ * } from 'graphql/type';
+ *
+ * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));
+ *
+ * getNullableType(requiredStringList).toString(); // => '[String]'
+ * getNullableType(GraphQLString); // => GraphQLString
+ * ```
+ */
+export declare function getNullableType(type: Maybe<GraphQLType>): GraphQLNullableType | undefined;
+/** These named types do not include modifiers like List or NonNull. */
+export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType;
+/** A named GraphQL type that can be used as an input type. */
+export type GraphQLNamedInputType = GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType;
+/** A named GraphQL type that can be used as an output type. */
+export type GraphQLNamedOutputType = GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType;
+/**
+ * Returns true when the value is a GraphQL named type.
+ * @param type - The GraphQL type to inspect.
+ * @returns True when the value is a GraphQL named type.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type';
+ *
+ * isNamedType(GraphQLString); // => true
+ * isNamedType(new GraphQLList(GraphQLString)); // => false
+ * isNamedType(null); // => false
+ * ```
+ */
+export declare function isNamedType(type: unknown): type is GraphQLNamedType;
+/**
+ * Returns the value as a GraphQL named type, or throws if it is not one.
+ * @param type - The GraphQL type to inspect.
+ * @returns The value typed as a GraphQL named type.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type';
+ *
+ * const namedType = assertNamedType(GraphQLString);
+ *
+ * namedType.name; // => 'String'
+ * assertNamedType(new GraphQLList(GraphQLString)); // throws an error
+ * ```
+ */
+export declare function assertNamedType(type: unknown): GraphQLNamedType;
+/**
+ * Returns the named type.
+ * @param type - The GraphQL type to inspect.
+ * @returns The named type after unwrapping all list and non-null wrappers.
+ * @example
+ * ```ts
+ * import { getNamedType } from 'graphql/type';
+ *
+ * getNamedType(null); // => undefined
+ * getNamedType(undefined); // => undefined
+ * ```
+ */
+export declare function getNamedType(type: undefined | null): void;
+/**
+ * Returns the named input type after unwrapping all list and non-null wrappers.
+ * @param type - The GraphQL input type to inspect.
+ * @returns The named input type after unwrapping all wrappers.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getNamedType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * review(input: [ReviewInput!]!): Boolean
+ * }
+ * `);
+ *
+ * const inputArg = schema.getQueryType()?.getFields().review.args[0];
+ *
+ * getNamedType(inputArg?.type).toString(); // => 'ReviewInput'
+ * ```
+ */
+export declare function getNamedType(type: GraphQLInputType): GraphQLNamedInputType;
+/**
+ * Returns the named output type after unwrapping all list and non-null wrappers.
+ * @param type - The GraphQL output type to inspect.
+ * @returns The named output type after unwrapping all wrappers.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { getNamedType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * users: [User!]!
+ * }
+ * `);
+ *
+ * const usersField = schema.getQueryType()?.getFields().users;
+ *
+ * getNamedType(usersField?.type).toString(); // => 'User'
+ * ```
+ */
+export declare function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType;
+/**
+ * Returns the named type after unwrapping all list and non-null wrappers.
+ * @param type - The GraphQL type to inspect.
+ * @returns The named type after unwrapping all wrappers.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * getNamedType,
+ * } from 'graphql/type';
+ *
+ * const nestedType = new GraphQLNonNull(
+ * new GraphQLList(new GraphQLNonNull(GraphQLString)),
+ * );
+ *
+ * getNamedType(nestedType); // => GraphQLString
+ * ```
+ */
+export declare function getNamedType(type: GraphQLType): GraphQLNamedType;
+/**
+ * Returns the named type after unwrapping all list and non-null wrappers.
+ * @param type - The GraphQL type to inspect.
+ * @returns The named type after unwrapping all wrappers, or undefined for nullish input.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLString, getNamedType } from 'graphql/type';
+ *
+ * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString
+ * getNamedType(undefined); // => undefined
+ * ```
+ */
+export declare function getNamedType(type: Maybe<GraphQLType>): GraphQLNamedType | undefined;
+interface GraphQLSchemaElement {
+ toString: () => string;
+ toJSON: () => string;
+}
+/**
+ * Used while defining GraphQL types to allow for circular references in
+ * otherwise immutable type definitions.
+ * @typeParam T - The element type returned by the thunk or array.
+ */
+export type ThunkReadonlyArray<T> = (() => ReadonlyArray<T>) | ReadonlyArray<T>;
+/**
+ * A thunk that resolves to an object map.
+ * @typeParam T - Value type stored in the object map.
+ */
+export type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
+/**
+ * Resolves a thunked readonly array.
+ * @param thunk - The thunk or value to resolve.
+ * @returns The resolved readonly array.
+ * @typeParam T - The element type resolved from the thunk or array.
+ * @example
+ * ```ts
+ * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type';
+ *
+ * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]);
+ * const fields = resolveReadonlyArrayThunk([GraphQLString]);
+ *
+ * lazyFields; // => [GraphQLString]
+ * fields; // => [GraphQLString]
+ * ```
+ */
+export declare function resolveReadonlyArrayThunk<T>(thunk: ThunkReadonlyArray<T>): ReadonlyArray<T>;
+/**
+ * Resolves a thunked object map.
+ * @param thunk - The thunk or value to resolve.
+ * @returns The resolved object map.
+ * @typeParam T - The object-map value type resolved from the thunk or map.
+ * @example
+ * ```ts
+ * import { GraphQLString, resolveObjMapThunk } from 'graphql/type';
+ *
+ * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString }));
+ * const fields = resolveObjMapThunk({ name: GraphQLString });
+ *
+ * lazyFields.name; // => GraphQLString
+ * fields.name; // => GraphQLString
+ * ```
+ */
+export declare function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T>;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLScalarTypeExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Scalar Type Definition
+ *
+ * Scalar types define the leaf values of a GraphQL response and the input
+ * values accepted by arguments and input object fields. A scalar type has a
+ * name and coercion functions that validate and convert runtime values and
+ * GraphQL literals.
+ *
+ * If a type's coerceOutputValue function returns `null` or does not return a
+ * value (i.e. it returns `undefined`) then an error will be raised and a
+ * `null` value will be returned in the response. Prefer validating inputs
+ * before execution so clients receive input diagnostics before result coercion
+ * fails.
+ * Custom scalar behavior is defined via the following functions:
+ *
+ * - coerceOutputValue(value): Implements "Result Coercion". Given an internal value,
+ * produces an external value valid for this type. Returns undefined or
+ * throws an error to indicate invalid values.
+ *
+ * - coerceInputValue(value): Implements "Input Coercion" for values. Given an
+ * external value (for example, variable values), produces an internal value
+ * valid for this type. Returns undefined or throws an error to indicate
+ * invalid values.
+ *
+ * - coerceInputLiteral(ast): Implements "Input Coercion" for constant literals.
+ * Given a GraphQL literal (AST) (for example, an argument value), produces
+ * an internal value valid for this type. Returns undefined or throws an
+ * error to indicate invalid values.
+ *
+ * - valueToLiteral(value): Converts an external value to a GraphQL
+ * literal (AST). Returns undefined or throws an error to indicate
+ * invalid values.
+ *
+ * Deprecated, to be removed in v18:
+ *
+ * - serialize(value): Implements "Result Coercion". Renamed to
+ * `coerceOutputValue()`.
+ *
+ * - parseValue(value): Implements "Input Coercion" for values. Renamed to
+ * `coerceInputValue()`.
+ *
+ * - parseLiteral(ast): Implements "Input Coercion" for literals including
+ * non-specified replacement of variables embedded within complex scalars.
+ * Replaced by the combination of the `replaceVariables()` utility and the
+ * `coerceInputLiteral()` method.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ * @typeParam TExternal - External representation accepted from or returned to callers.
+ * @example
+ * ```ts
+ * import { GraphQLScalarType, Kind } from 'graphql';
+ *
+ * const ensureOdd = (value) => {
+ * if (!Number.isFinite(value)) {
+ * throw new Error(
+ * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
+ * );
+ * }
+ *
+ * if (value % 2 === 0) {
+ * throw new Error(
+ * `Scalar "Odd" cannot represent "${value}" since it is even.`,
+ * );
+ * }
+ *
+ * return value;
+ * };
+ *
+ * const OddType = new GraphQLScalarType({
+ * name: 'Odd',
+ * coerceOutputValue: (value) => {
+ * return ensureOdd(value);
+ * },
+ * coerceInputValue: (value) => {
+ * return ensureOdd(value);
+ * },
+ * valueToLiteral: (value) => {
+ * return { kind: Kind.INT, value: String(ensureOdd(value)) };
+ * },
+ * });
+ * ```
+ */
+export declare class GraphQLScalarType<TInternal = unknown, TExternal = TInternal> implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** URL identifying the behavior specified for this custom scalar. */
+ specifiedByURL: Maybe<string>;
+ /**
+ * Deprecated legacy serializer used to convert internal values for response
+ * output. Use `coerceOutputValue()` instead.
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
+ */
+ serialize: GraphQLScalarSerializer<TExternal>;
+ /**
+ * Deprecated legacy parser used to convert externally provided input values.
+ * Use `coerceInputValue()` instead.
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
+ */
+ parseValue: GraphQLScalarValueParser<TInternal>;
+ /**
+ * Deprecated legacy parser used to convert externally provided input
+ * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.
+ * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
+ */
+ parseLiteral: GraphQLScalarLiteralParser<TInternal>;
+ /** Coercer used to convert internal scalar values for response output. */
+ coerceOutputValue: GraphQLScalarOutputValueCoercer<TExternal>;
+ /** Coercer used to convert externally provided scalar input values. */
+ coerceInputValue: GraphQLScalarInputValueCoercer<TInternal>;
+ /** Coercer used to convert GraphQL scalar input literals. */
+ coerceInputLiteral: GraphQLScalarInputLiteralCoercer<TInternal> | undefined;
+ /** Converter used to produce GraphQL literals from runtime input values. */
+ valueToLiteral: GraphQLScalarValueToLiteral | undefined;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLScalarTypeExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<ScalarTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
+ /**
+ * Creates a GraphQLScalarType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { Kind, parse } from 'graphql/language';
+ * import { GraphQLScalarType } from 'graphql/type';
+ *
+ * const document = parse(`
+ * "Odd integer values."
+ * scalar Odd @specifiedBy(url: "https://example.com/odd")
+ *
+ * extend scalar Odd @specifiedBy(url: "https://example.com/odd-v2")
+ * `);
+ *
+ * const Odd = new GraphQLScalarType({
+ * name: 'Odd',
+ * description: 'Odd integer values.',
+ * specifiedByURL: 'https://example.com/odd',
+ * coerceOutputValue: (value) => {
+ * if (typeof value !== 'number' || value % 2 === 0) {
+ * throw new TypeError('Odd can only produce odd numbers.');
+ * }
+ * return value;
+ * },
+ * coerceInputValue: (value) => {
+ * if (typeof value !== 'number' || value % 2 === 0) {
+ * throw new TypeError('Odd can only accept odd numbers.');
+ * }
+ * return value;
+ * },
+ * coerceInputLiteral: (ast) => {
+ * if (ast.kind !== Kind.INT) {
+ * throw new TypeError('Odd can only accept integer literals.');
+ * }
+ * const value = Number(ast.value);
+ * if (value % 2 === 0) {
+ * throw new TypeError('Odd can only accept odd integer literals.');
+ * }
+ * return value;
+ * },
+ * valueToLiteral: (value) => {
+ * return { kind: Kind.INT, value: String(ensureOdd(value)) };
+ * },
+ * extensions: { numeric: true },
+ * astNode: document.definitions[0],
+ * extensionASTNodes: [document.definitions[1]],
+ * });
+ *
+ * Odd.description; // => 'Odd integer values.'
+ * Odd.specifiedByURL; // => 'https://example.com/odd'
+ * Odd.coerceOutputValue(3); // => 3
+ * Odd.coerceInputValue(5); // => 5
+ * Odd.extensions; // => { numeric: true }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLScalarTypeConfig<TInternal, TExternal>>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { GraphQLScalarType } from 'graphql/type';
+ *
+ * const Url = new GraphQLScalarType({
+ * name: 'Url',
+ * description: 'An absolute URL string.',
+ * specifiedByURL: 'https://url.spec.whatwg.org/',
+ * });
+ *
+ * const config = Url.toConfig();
+ * const UrlCopy = new GraphQLScalarType(config);
+ *
+ * config.name; // => 'Url'
+ * config.specifiedByURL; // => 'https://url.spec.whatwg.org/'
+ * UrlCopy.name; // => Url.name
+ * ```
+ */
+ toConfig(): GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>;
+ /**
+ * Returns the schema coordinate identifying this scalar type.
+ * @returns The schema coordinate for this scalar type.
+ * @example
+ * ```ts
+ * import { GraphQLScalarType } from 'graphql/type';
+ *
+ * const DateTime = new GraphQLScalarType({ name: 'DateTime' });
+ *
+ * DateTime.toString(); // => 'DateTime'
+ * String(DateTime); // => 'DateTime'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLScalarType } from 'graphql/type';
+ *
+ * const DateTime = new GraphQLScalarType({ name: 'DateTime' });
+ *
+ * DateTime.toJSON(); // => 'DateTime'
+ * JSON.stringify({ type: DateTime }); // => '{"type":"DateTime"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Deprecated function type that serializes a runtime value as a scalar output
+ * value. Use `GraphQLScalarOutputValueCoercer` instead.
+ * @typeParam TExternal - External representation accepted from or returned to callers.
+ * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18.
+ */
+export type GraphQLScalarSerializer<TExternal> = (outputValue: unknown) => TExternal;
+/**
+ * Function used to coerce internal scalar values for response output.
+ * @typeParam TExternal - External representation accepted from or returned to callers.
+ */
+export type GraphQLScalarOutputValueCoercer<TExternal> = (outputValue: unknown) => TExternal;
+/**
+ * Deprecated function type that parses a runtime input value as a scalar input
+ * value. Use `GraphQLScalarInputValueCoercer` instead.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18.
+ */
+export type GraphQLScalarValueParser<TInternal> = (inputValue: unknown) => TInternal;
+/**
+ * Function used to coerce externally provided scalar input values.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ */
+export type GraphQLScalarInputValueCoercer<TInternal> = (inputValue: unknown) => TInternal;
+/**
+ * Deprecated function type that parses a GraphQL value literal as a scalar
+ * input value. Use `GraphQLScalarInputLiteralCoercer` instead.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18.
+ */
+export type GraphQLScalarLiteralParser<TInternal> = (valueNode: ValueNode, variables: Maybe<ObjMap<unknown>>) => Maybe<TInternal>;
+/**
+ * Function used to coerce GraphQL scalar input literals.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ */
+export type GraphQLScalarInputLiteralCoercer<TInternal> = (valueNode: ConstValueNode) => Maybe<TInternal>;
+type GraphQLScalarValueToLiteral = (inputValue: unknown) => ConstValueNode | undefined;
+/**
+ * Configuration used to construct a GraphQLScalarType.
+ * @typeParam TInternal - Internal runtime representation for this scalar.
+ * @typeParam TExternal - External representation accepted from or returned to callers.
+ */
+export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** URL identifying the behavior specified for this custom scalar. */
+ specifiedByURL?: Maybe<string>;
+ /**
+ * Deprecated legacy serializer used to convert internal values for response
+ * output. Use `coerceOutputValue()` instead.
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
+ */
+ serialize?: GraphQLScalarSerializer<TExternal> | undefined;
+ /**
+ * Deprecated legacy parser used to convert externally provided input values.
+ * Use `coerceInputValue()` instead.
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
+ */
+ parseValue?: GraphQLScalarValueParser<TInternal> | undefined;
+ /**
+ * Deprecated legacy parser used to convert externally provided input
+ * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.
+ * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
+ */
+ parseLiteral?: GraphQLScalarLiteralParser<TInternal> | undefined;
+ /** Coerces an internal value to include in a response. */
+ coerceOutputValue?: GraphQLScalarOutputValueCoercer<TExternal> | undefined;
+ /** Coerces an externally provided value to use as an input. */
+ coerceInputValue?: GraphQLScalarInputValueCoercer<TInternal> | undefined;
+ /** Coerces an externally provided const literal value to use as an input. */
+ coerceInputLiteral?: GraphQLScalarInputLiteralCoercer<TInternal> | undefined;
+ /** Translates an externally provided value to a literal (AST). */
+ valueToLiteral?: GraphQLScalarValueToLiteral | undefined;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<ScalarTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
+}
+interface GraphQLScalarTypeNormalizedConfig<TInternal, TExternal> extends GraphQLScalarTypeConfig<TInternal, TExternal> {
+ serialize: GraphQLScalarSerializer<TExternal>;
+ parseValue: GraphQLScalarValueParser<TInternal>;
+ parseLiteral: GraphQLScalarLiteralParser<TInternal>;
+ coerceOutputValue: GraphQLScalarOutputValueCoercer<TExternal>;
+ coerceInputValue: GraphQLScalarInputValueCoercer<TInternal>;
+ coerceInputLiteral: GraphQLScalarInputLiteralCoercer<TInternal> | undefined;
+ extensions: Readonly<GraphQLScalarTypeExtensions>;
+ extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ * We've provided these template arguments because this is an open type and
+ * you may find them useful.
+ * @typeParam _TSource - Reserved source type parameter for extension typing.
+ * @typeParam _TContext - Reserved context type parameter for extension typing.
+ */
+export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Object Type Definition
+ *
+ * Almost all of the GraphQL types you define will be object types. Object types
+ * have a name, but most importantly describe their fields.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
+ * @example
+ * ```ts
+ * const AddressType = new GraphQLObjectType({
+ * name: 'Address',
+ * fields: {
+ * street: { type: GraphQLString },
+ * number: { type: GraphQLInt },
+ * formatted: {
+ * type: GraphQLString,
+ * resolve: (obj) => {
+ * return obj.number + ' ' + obj.street;
+ * },
+ * },
+ * },
+ * });
+ * ```
+ * @example
+ * When two types need to refer to each other, or a type needs to refer to
+ * itself in a field, you can use a function expression (aka a closure or a
+ * thunk) to supply the fields lazily.
+ *
+ * ```ts
+ * const PersonType = new GraphQLObjectType({
+ * name: 'Person',
+ * fields: () => ({
+ * name: { type: GraphQLString },
+ * bestFriend: { type: PersonType },
+ * }),
+ * });
+ * ```
+ */
+export declare class GraphQLObjectType<TSource = any, TContext = any, TAbstract = any> implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Predicate used to determine whether a runtime value belongs to this object type. */
+ isTypeOf: Maybe<GraphQLIsTypeOfFn<TAbstract, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<ObjectTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
+ private _fields;
+ private _interfaces;
+ /**
+ * Creates a GraphQLObjectType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * // Configure an object type with interfaces, fields, arguments, and metadata.
+ * import { parse } from 'graphql/language';
+ * import {
+ * GraphQLID,
+ * GraphQLInterfaceType,
+ * GraphQLNonNull,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const document = parse(`
+ * type User implements Node {
+ * id: ID!
+ * name(format: String = "short"): String
+ * }
+ *
+ * extend type User {
+ * displayName: String
+ * }
+ * `);
+ * const definition = document.definitions[0];
+ * const nameField = definition.fields[1];
+ * const formatArg = nameField.arguments[0];
+ *
+ * const Node = new GraphQLInterfaceType({
+ * name: 'Node',
+ * fields: {
+ * id: { type: new GraphQLNonNull(GraphQLID) },
+ * },
+ * });
+ *
+ * const User = new GraphQLObjectType({
+ * name: 'User',
+ * description: 'A registered user.',
+ * interfaces: [Node],
+ * fields: {
+ * id: { type: new GraphQLNonNull(GraphQLID) },
+ * name: {
+ * description: 'The formatted user name.',
+ * type: GraphQLString,
+ * args: {
+ * format: {
+ * description: 'Controls the name format.',
+ * type: GraphQLString,
+ * default: { value: 'short' },
+ * deprecationReason: 'Use locale instead.',
+ * extensions: { public: true },
+ * astNode: formatArg,
+ * },
+ * },
+ * resolve: (user, { format }) => {
+ * return format === 'long' ? user.fullName : user.name;
+ * },
+ * deprecationReason: 'Use displayName.',
+ * extensions: { cacheSeconds: 60 },
+ * astNode: nameField,
+ * },
+ * },
+ * isTypeOf: (value) => {
+ * return typeof value === 'object' && value != null && 'id' in value;
+ * },
+ * extensions: { entity: 'User' },
+ * astNode: definition,
+ * extensionASTNodes: [document.definitions[1]],
+ * });
+ *
+ * User.name; // => 'User'
+ * User.getInterfaces(); // => [Node]
+ * Object.keys(User.getFields()); // => ['id', 'name']
+ * User.getFields().name.args[0].default.value; // => 'short'
+ * User.extensions; // => { entity: 'User' }
+ * ```
+ * @example
+ * ```ts
+ * // This variant configures a subscription field with subscribe and resolve functions.
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const Subscription = new GraphQLObjectType({
+ * name: 'Subscription',
+ * fields: {
+ * greeting: {
+ * type: GraphQLString,
+ * subscribe: async function* () {
+ * yield { greeting: 'Hello!' };
+ * },
+ * resolve: (event) => {
+ * return event.greeting;
+ * },
+ * },
+ * },
+ * });
+ *
+ * typeof Subscription.getFields().greeting.subscribe; // => 'function'
+ * ```
+ */
+ constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext, TAbstract>>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the fields defined by this type.
+ * @returns The fields keyed by field name.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * id: ID!
+ * name: String
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * const User = assertObjectType(schema.getType('User'));
+ * const fields = User.getFields();
+ *
+ * Object.keys(fields); // => ['id', 'name']
+ * String(fields.id.type); // => 'ID!'
+ * ```
+ */
+ getFields(): GraphQLFieldMap<TSource, TContext>;
+ /**
+ * Returns the interfaces implemented by this type.
+ * @returns The implemented interfaces.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * const User = assertObjectType(schema.getType('User'));
+ *
+ * User.getInterfaces().map((type) => type.name); // => ['Node']
+ * ```
+ */
+ getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const User = new GraphQLObjectType({
+ * name: 'User',
+ * fields: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const config = User.toConfig();
+ * const UserCopy = new GraphQLObjectType(config);
+ *
+ * config.fields.name.type; // => GraphQLString
+ * UserCopy.getFields().name.type; // => GraphQLString
+ * ```
+ */
+ toConfig(): GraphQLObjectTypeNormalizedConfig<TSource, TContext, TAbstract>;
+ /**
+ * Returns the schema coordinate identifying this object type.
+ * @returns The schema coordinate for this object type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * const User = assertObjectType(schema.getType('User'));
+ *
+ * User.toString(); // => 'User'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const User = new GraphQLObjectType({
+ * name: 'User',
+ * fields: { name: { type: GraphQLString } },
+ * });
+ *
+ * User.toJSON(); // => 'User'
+ * JSON.stringify({ type: User }); // => '{"type":"User"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Configuration used to construct a GraphQLObjectType.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
+ */
+export interface GraphQLObjectTypeConfig<TSource, TContext, TAbstract = unknown> {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Interfaces implemented by this object or interface type. */
+ interfaces?: ThunkReadonlyArray<GraphQLInterfaceType> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
+ /** Predicate used to determine whether a runtime value belongs to this object type. */
+ isTypeOf?: Maybe<GraphQLIsTypeOfFn<TAbstract, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<ObjectTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
+}
+interface GraphQLObjectTypeNormalizedConfig<TSource, TContext, TAbstract = unknown> extends GraphQLObjectTypeConfig<TSource, TContext, TAbstract> {
+ interfaces: ReadonlyArray<GraphQLInterfaceType>;
+ fields: GraphQLFieldNormalizedConfigMap<TSource, TContext>;
+ extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
+ extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
+}
+/**
+ * Resolves the concrete object type for an abstract GraphQL type.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export type GraphQLTypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType) => PromiseOrValue<string | undefined>;
+/**
+ * Checks whether a runtime value belongs to a GraphQL object type.
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export type GraphQLIsTypeOfFn<TAbstract, TContext> = (value: TAbstract, context: TContext, info: GraphQLResolveInfo) => PromiseOrValue<boolean>;
+/**
+ * Resolves the runtime value for a GraphQL field.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @typeParam TArgs - Argument object type passed to resolvers.
+ * @typeParam TResult - Result value type.
+ */
+export type GraphQLFieldResolver<TSource, TContext, TArgs = any, TResult = unknown> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult;
+/** Utilities available from resolver info for tracking asynchronous work. */
+export interface GraphQLResolveInfoHelpers {
+ /**
+ * Promise.all wrapper that allows rejected branches to be tracked
+ * as execution async work.
+ *
+ * Intended use: return or await this promise from resolver work.
+ * Un-awaited async side effects are an anti-pattern:
+ *
+ * const { promiseAll } = info.getAsyncHelpers();
+ * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined);
+ *
+ * In that anti-pattern, tracking starts only after rejection (on a
+ * later microtask), so this work is not guaranteed to delay
+ * `hooks.asyncWorkFinished`.
+ *
+ * Use `track(...)` for un-awaited async side effects:
+ *
+ * const { track } = info.getAsyncHelpers();
+ * track([
+ * someAsyncWork().catch(() => undefined),
+ * someOtherAsyncWork().catch(() => undefined)
+ * ]);
+ */
+ readonly promiseAll: <T>(values: ReadonlyArray<PromiseLike<T> | T>) => Promise<Array<T>>;
+ /** Tracks asynchronous work that should delay execution completion hooks. */
+ readonly track: (maybePromises: ReadonlyArray<unknown>) => void;
+}
+/** Information about the currently executing GraphQL field. */
+export interface GraphQLResolveInfo {
+ /** The field name referenced by this schema coordinate. */
+ readonly fieldName: string;
+ /** AST field nodes that contributed to the current field execution. */
+ readonly fieldNodes: ReadonlyArray<FieldNode>;
+ /** GraphQL output type declared for the current field. */
+ readonly returnType: GraphQLOutputType;
+ /** Object type that owns the current field. */
+ readonly parentType: GraphQLObjectType;
+ /** Response path where this error occurred during execution. */
+ readonly path: Path;
+ /** The schema used for validation or execution. */
+ readonly schema: GraphQLSchema;
+ /** Fragment definitions in the operation document keyed by fragment name. */
+ readonly fragments: ObjMap<FragmentDefinitionNode>;
+ /** Initial root value passed to the operation. */
+ readonly rootValue: unknown;
+ /** The operation selected for execution. */
+ readonly operation: OperationDefinitionNode;
+ /**
+ * Coerced variable values and source metadata for this operation. Resolver
+ * code that needs runtime variable values should read `variableValues.coerced`.
+ */
+ readonly variableValues: VariableValues;
+ /** Returns the AbortSignal supplied for this execution, if any. */
+ readonly getAbortSignal: () => AbortSignal | undefined;
+ /** Returns helper functions for tracking asynchronous resolver work. */
+ readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ * We've provided these template arguments because this is an open type and
+ * you may find them useful.
+ * @typeParam _TSource - Reserved source type parameter for extension typing.
+ * @typeParam _TContext - Reserved context type parameter for extension typing.
+ * @typeParam _TArgs - Reserved argument type parameter for extension typing.
+ */
+export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Configuration used to define a GraphQL field.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @typeParam TArgs - Argument object type passed to resolvers.
+ */
+export interface GraphQLFieldConfig<TSource, TContext, TArgs = any> {
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLOutputType;
+ /** Arguments accepted by this field or directive. */
+ args?: GraphQLFieldConfigArgumentMap | undefined;
+ /** Resolver function used to produce this field value. */
+ resolve?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
+ /** Resolver function used to create a subscription event stream for this field. */
+ subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason?: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<FieldDefinitionNode>;
+}
+interface GraphQLFieldNormalizedConfig<TSource, TContext, TArgs = any> extends GraphQLFieldConfig<TSource, TContext, TArgs> {
+ args: GraphQLFieldNormalizedConfigArgumentMap;
+ extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
+}
+/** A map of argument names to argument configuration objects. */
+export type GraphQLFieldConfigArgumentMap = ObjMap<GraphQLArgumentConfig>;
+type GraphQLFieldNormalizedConfigArgumentMap = ObjMap<GraphQLArgumentNormalizedConfig>;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLArgumentExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/** Configuration used to define a GraphQL argument. */
+export interface GraphQLArgumentConfig {
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLInputType;
+ /**
+ * Deprecated legacy default value for this argument. Use `default` instead.
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
+ */
+ defaultValue?: unknown;
+ /** Default value represented as either a runtime value or a GraphQL literal. */
+ default?: GraphQLDefaultInput | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason?: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLArgumentExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<InputValueDefinitionNode>;
+}
+interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig {
+ default: GraphQLDefaultInput | undefined;
+ extensions: Readonly<GraphQLArgumentExtensions>;
+}
+/**
+ * A map of field names to field configuration objects.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<GraphQLFieldConfig<TSource, TContext>>;
+type GraphQLFieldNormalizedConfigMap<TSource, TContext> = ObjMap<GraphQLFieldNormalizedConfig<TSource, TContext>>;
+/**
+ * A resolved GraphQL field definition.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @typeParam TArgs - Argument object type passed to resolvers.
+ */
+export declare class GraphQLField<TSource = any, TContext = any, TArgs = any> implements GraphQLSchemaElement {
+ /** Object or interface type that owns this field, if known. */
+ parentType: GraphQLObjectType<TSource, TContext> | GraphQLInterfaceType<TSource, TContext> | undefined;
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLOutputType;
+ /** Arguments accepted by this field or directive. */
+ args: ReadonlyArray<GraphQLArgument>;
+ /** Resolver function used to produce this field value. */
+ resolve?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
+ /** Resolver function used to create a subscription event stream for this field. */
+ subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<FieldDefinitionNode>;
+ /**
+ * Creates a resolved GraphQL field definition.
+ * @param parentType - Object or interface type that owns this field, if known.
+ * @param name - Field name.
+ * @param config - Field configuration.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const document = parse('type Query { greeting: String }');
+ * const fieldNode = document.definitions[0].fields[0];
+ * const field = new GraphQLField(Query, 'greeting', {
+ * description: 'Greeting text.',
+ * type: GraphQLString,
+ * args: {
+ * name: { type: GraphQLString, default: { value: 'world' } },
+ * },
+ * resolve: (_source, { name }) => `Hello, ${name}!`,
+ * subscribe: async function* () {
+ * yield { greeting: 'Hello!' };
+ * },
+ * deprecationReason: 'Use hello.',
+ * extensions: { cacheSeconds: 60 },
+ * astNode: fieldNode,
+ * });
+ *
+ * field.parentType; // => Query
+ * field.name; // => 'greeting'
+ * field.args[0].default.value; // => 'world'
+ * typeof field.subscribe; // => 'function'
+ * field.deprecationReason; // => 'Use hello.'
+ * field.astNode; // => fieldNode
+ * ```
+ */
+ constructor(parentType: GraphQLObjectType<TSource, TContext> | GraphQLInterfaceType<TSource, TContext> | undefined, name: string, config: GraphQLFieldConfig<TSource, TContext, TArgs>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this field.
+ * @returns A configuration object that can be used to recreate this field.
+ * @example
+ * ```ts
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', {
+ * type: GraphQLString,
+ * extensions: { cacheSeconds: 60 },
+ * });
+ *
+ * field.toConfig().type; // => GraphQLString
+ * field.toConfig().extensions; // => { cacheSeconds: 60 }
+ * ```
+ */
+ toConfig(): GraphQLFieldNormalizedConfig<TSource, TContext, TArgs>;
+ /**
+ * Returns this field as a schema coordinate string.
+ * @returns The field coordinate.
+ * @example
+ * ```ts
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ *
+ * field.toString(); // => 'Query.greeting'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The field coordinate.
+ * @example
+ * ```ts
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ *
+ * JSON.stringify(field); // => '"Query.greeting"'
+ * ```
+ */
+ toJSON(): string;
+}
+/** A resolved GraphQL argument definition. */
+export declare class GraphQLArgument implements GraphQLSchemaElement {
+ /** Field or directive that owns this argument. */
+ parent: GraphQLField | GraphQLDirective;
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLInputType;
+ /**
+ * Deprecated legacy default value used when no explicit value is supplied.
+ * Use `default` instead.
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
+ */
+ defaultValue: unknown;
+ /** Default value represented as either a runtime value or a GraphQL literal. */
+ default: GraphQLDefaultInput | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLArgumentExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<InputValueDefinitionNode>;
+ /**
+ * Creates a resolved GraphQL argument definition.
+ * @param parent - Field or directive that owns this argument.
+ * @param name - Argument name.
+ * @param config - Argument configuration.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLArgument,
+ * GraphQLField,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ * const arg = new GraphQLArgument(field, 'name', {
+ * type: GraphQLString,
+ * default: { value: 'world' },
+ * });
+ *
+ * arg.parent; // => field
+ * arg.name; // => 'name'
+ * arg.default.value; // => 'world'
+ * ```
+ */
+ constructor(parent: GraphQLField | GraphQLDirective, name: string, config: GraphQLArgumentConfig);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this argument.
+ * @returns A configuration object that can be used to recreate this argument.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLArgument,
+ * GraphQLField,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ * const arg = new GraphQLArgument(field, 'name', {
+ * type: GraphQLString,
+ * default: { value: 'world' },
+ * });
+ *
+ * arg.toConfig().default.value; // => 'world'
+ * ```
+ */
+ toConfig(): GraphQLArgumentNormalizedConfig;
+ /**
+ * Returns this argument as a schema coordinate string.
+ * @returns The argument coordinate.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLArgument,
+ * GraphQLField,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });
+ *
+ * arg.toString(); // => 'Query.greeting(name:)'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The argument coordinate.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLArgument,
+ * GraphQLField,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
+ * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });
+ *
+ * JSON.stringify(arg); // => '"Query.greeting(name:)"'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Returns true when the argument is non-null and has no default value.
+ * @param arg - The argument definition to inspect.
+ * @returns True when the argument is non-null and has no default value.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLArgument,
+ * GraphQLField,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * GraphQLObjectType,
+ * GraphQLString,
+ * isRequiredArgument,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
+ * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString });
+ * const requiredArgument = new GraphQLArgument(field, 'id', {
+ * type: new GraphQLNonNull(GraphQLInt),
+ * });
+ * const optionalArgument = new GraphQLArgument(field, 'name', {
+ * type: GraphQLString,
+ * });
+ * const argumentWithDefault = new GraphQLArgument(field, 'limit', {
+ * type: new GraphQLNonNull(GraphQLInt),
+ * default: { value: 10 },
+ * });
+ *
+ * isRequiredArgument(requiredArgument); // => true
+ * isRequiredArgument(optionalArgument); // => false
+ * isRequiredArgument(argumentWithDefault); // => false
+ * ```
+ */
+export declare function isRequiredArgument(arg: GraphQLArgument | GraphQLVariableSignature): boolean;
+/**
+ * A map of field names to resolved field definitions.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export type GraphQLFieldMap<TSource, TContext> = ObjMap<GraphQLField<TSource, TContext>>;
+/** Default input represented as either a runtime value or a GraphQL literal. */
+export type GraphQLDefaultInput = {
+ /** Runtime default value. */
+ value: unknown;
+ /** GraphQL literal default value is not provided in this variant. */
+ literal?: never;
+} | {
+ /** GraphQL literal default value. */
+ literal: ConstValueNode;
+ /** Runtime default value is not provided in this variant. */
+ value?: never;
+};
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLInterfaceTypeExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Interface Type Definition
+ *
+ * When a field can return one of a heterogeneous set of types, a Interface type
+ * is used to describe what types are possible, what fields are in common across
+ * all types, as well as a function to determine which type is actually used
+ * when the field is resolved.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @example
+ * ```ts
+ * const EntityType = new GraphQLInterfaceType({
+ * name: 'Entity',
+ * fields: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ * ```
+ */
+export declare class GraphQLInterfaceType<TSource = any, TContext = any> implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Function that resolves the concrete object type for this abstract type. */
+ resolveType: Maybe<GraphQLTypeResolver<TSource, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLInterfaceTypeExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<InterfaceTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
+ private _fields;
+ private _interfaces;
+ /**
+ * Creates a GraphQLInterfaceType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';
+ *
+ * const document = parse(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * interface Resource implements Node {
+ * id: ID!
+ * }
+ *
+ * extend interface Resource {
+ * url: String
+ * }
+ * `);
+ *
+ * const Node = new GraphQLInterfaceType({
+ * name: 'Node',
+ * fields: {
+ * id: { type: new GraphQLNonNull(GraphQLID) },
+ * },
+ * });
+ *
+ * const Resource = new GraphQLInterfaceType({
+ * name: 'Resource',
+ * description: 'An addressable resource.',
+ * interfaces: [Node],
+ * fields: {
+ * id: { type: new GraphQLNonNull(GraphQLID) },
+ * },
+ * resolveType: (value) => {
+ * return typeof value === 'object' && value != null && 'url' in value
+ * ? 'WebPage'
+ * : null;
+ * },
+ * extensions: { abstract: true },
+ * astNode: document.definitions[1],
+ * extensionASTNodes: [document.definitions[2]],
+ * });
+ *
+ * Resource.name; // => 'Resource'
+ * Resource.getInterfaces(); // => [Node]
+ * Object.keys(Resource.getFields()); // => ['id']
+ * Resource.extensions; // => { abstract: true }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLInterfaceTypeConfig<TSource, TContext>>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the fields defined by this type.
+ * @returns The fields keyed by field name.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * const Node = assertInterfaceType(schema.getType('Node'));
+ * const fields = Node.getFields();
+ *
+ * Object.keys(fields); // => ['id']
+ * String(fields.id.type); // => 'ID!'
+ * ```
+ */
+ getFields(): GraphQLFieldMap<TSource, TContext>;
+ /**
+ * Returns the interfaces implemented by this type.
+ * @returns The implemented interfaces.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Resource {
+ * url: String!
+ * }
+ *
+ * interface Image implements Resource {
+ * url: String!
+ * width: Int
+ * }
+ *
+ * type Photo implements Resource & Image {
+ * url: String!
+ * width: Int
+ * }
+ *
+ * type Query {
+ * image: Image
+ * }
+ * `);
+ *
+ * const Image = assertInterfaceType(schema.getType('Image'));
+ *
+ * Image.getInterfaces().map((type) => type.name); // => ['Resource']
+ * ```
+ */
+ getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';
+ *
+ * const Node = new GraphQLInterfaceType({
+ * name: 'Node',
+ * fields: {
+ * id: { type: new GraphQLNonNull(GraphQLID) },
+ * },
+ * });
+ *
+ * const config = Node.toConfig();
+ * const NodeCopy = new GraphQLInterfaceType(config);
+ *
+ * String(config.fields.id.type); // => 'ID!'
+ * String(NodeCopy.getFields().id.type); // => 'ID!'
+ * ```
+ */
+ toConfig(): GraphQLInterfaceTypeNormalizedConfig<TSource, TContext>;
+ /**
+ * Returns the schema coordinate identifying this interface type.
+ * @returns The schema coordinate for this interface type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ *
+ * const Node = assertInterfaceType(schema.getType('Node'));
+ *
+ * Node.toString(); // => 'Node'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type';
+ *
+ * const Named = new GraphQLInterfaceType({
+ * name: 'Named',
+ * fields: { name: { type: GraphQLString } },
+ * });
+ *
+ * Named.toJSON(); // => 'Named'
+ * JSON.stringify({ type: Named }); // => '{"type":"Named"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Configuration used to construct a GraphQLInterfaceType.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Interfaces implemented by this object or interface type. */
+ interfaces?: ThunkReadonlyArray<GraphQLInterfaceType> | undefined;
+ /** Fields declared by this object, interface, input object, or literal. */
+ fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
+ /**
+ * Optionally provide a custom type resolver function. If one is not provided,
+ * the default implementation will call `isTypeOf` on each implementing
+ * Object type.
+ */
+ resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<InterfaceTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
+}
+interface GraphQLInterfaceTypeNormalizedConfig<TSource, TContext> extends GraphQLInterfaceTypeConfig<TSource, TContext> {
+ interfaces: ReadonlyArray<GraphQLInterfaceType>;
+ fields: GraphQLFieldNormalizedConfigMap<TSource, TContext>;
+ extensions: Readonly<GraphQLInterfaceTypeExtensions>;
+ extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLUnionTypeExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Union Type Definition
+ *
+ * When a field can return one of a heterogeneous set of types, a Union type
+ * is used to describe what types are possible as well as providing a function
+ * to determine which type is actually used when the field is resolved.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ * @example
+ * ```ts
+ * const PetType = new GraphQLUnionType({
+ * name: 'Pet',
+ * types: [DogType, CatType],
+ * resolveType: (value) => {
+ * if (value instanceof Dog) {
+ * return DogType;
+ * }
+ * if (value instanceof Cat) {
+ * return CatType;
+ * }
+ * },
+ * });
+ * ```
+ */
+export declare class GraphQLUnionType<TSource = any, TContext = any> implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Function that resolves the concrete object type for this abstract type. */
+ resolveType: Maybe<GraphQLTypeResolver<TSource, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLUnionTypeExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<UnionTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
+ private _types;
+ /**
+ * Creates a GraphQLUnionType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import {
+ * GraphQLObjectType,
+ * GraphQLString,
+ * GraphQLUnionType,
+ * } from 'graphql/type';
+ *
+ * const document = parse(`
+ * union Media = Photo | Video
+ *
+ * extend union Media = Audio
+ * `);
+ *
+ * const Photo = new GraphQLObjectType({
+ * name: 'Photo',
+ * fields: { url: { type: GraphQLString } },
+ * });
+ * const Video = new GraphQLObjectType({
+ * name: 'Video',
+ * fields: { url: { type: GraphQLString } },
+ * });
+ *
+ * const Media = new GraphQLUnionType({
+ * name: 'Media',
+ * description: 'Media that can appear in a search result.',
+ * types: [Photo, Video],
+ * resolveType: (value) => {
+ * return typeof value === 'object' && value != null && 'duration' in value
+ * ? 'Video'
+ * : 'Photo';
+ * },
+ * extensions: { searchable: true },
+ * astNode: document.definitions[0],
+ * extensionASTNodes: [document.definitions[1]],
+ * });
+ *
+ * Media.description; // => 'Media that can appear in a search result.'
+ * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']
+ * Media.extensions; // => { searchable: true }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLUnionTypeConfig<TSource, TContext>>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the object types included in this union.
+ * @returns The union member object types.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertUnionType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Photo {
+ * url: String!
+ * }
+ *
+ * type Video {
+ * url: String!
+ * }
+ *
+ * union Media = Photo | Video
+ *
+ * type Query {
+ * media: [Media]
+ * }
+ * `);
+ *
+ * const Media = assertUnionType(schema.getType('Media'));
+ *
+ * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']
+ * ```
+ */
+ getTypes(): ReadonlyArray<GraphQLObjectType>;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLObjectType,
+ * GraphQLString,
+ * GraphQLUnionType,
+ * } from 'graphql/type';
+ *
+ * const Photo = new GraphQLObjectType({
+ * name: 'Photo',
+ * fields: { url: { type: GraphQLString } },
+ * });
+ * const Video = new GraphQLObjectType({
+ * name: 'Video',
+ * fields: { url: { type: GraphQLString } },
+ * });
+ * const Media = new GraphQLUnionType({
+ * name: 'Media',
+ * types: [Photo, Video],
+ * });
+ *
+ * const config = Media.toConfig();
+ * const MediaCopy = new GraphQLUnionType(config);
+ *
+ * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video']
+ * ```
+ */
+ toConfig(): GraphQLUnionTypeNormalizedConfig<TSource, TContext>;
+ /**
+ * Returns the schema coordinate identifying this union type.
+ * @returns The schema coordinate for this union type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertUnionType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Photo {
+ * url: String!
+ * }
+ *
+ * union SearchResult = Photo
+ *
+ * type Query {
+ * search: [SearchResult]
+ * }
+ * `);
+ *
+ * const SearchResult = assertUnionType(schema.getType('SearchResult'));
+ *
+ * SearchResult.toString(); // => 'SearchResult'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLObjectType,
+ * GraphQLString,
+ * GraphQLUnionType,
+ * } from 'graphql/type';
+ *
+ * const Photo = new GraphQLObjectType({
+ * name: 'Photo',
+ * fields: { url: { type: GraphQLString } },
+ * });
+ * const SearchResult = new GraphQLUnionType({
+ * name: 'SearchResult',
+ * types: [Photo],
+ * });
+ *
+ * SearchResult.toJSON(); // => 'SearchResult'
+ * JSON.stringify({ type: SearchResult }); // => '{"type":"SearchResult"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Configuration used to construct a GraphQLUnionType.
+ * @typeParam TSource - Source object type passed to resolvers.
+ * @typeParam TContext - Context object type passed to resolvers.
+ */
+export interface GraphQLUnionTypeConfig<TSource, TContext> {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Object types that belong to this union type. */
+ types: ThunkReadonlyArray<GraphQLObjectType>;
+ /**
+ * Optionally provide a custom type resolver function. If one is not provided,
+ * the default implementation will call `isTypeOf` on each implementing
+ * Object type.
+ */
+ resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<UnionTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
+}
+interface GraphQLUnionTypeNormalizedConfig<TSource, TContext> extends GraphQLUnionTypeConfig<TSource, TContext> {
+ types: ReadonlyArray<GraphQLObjectType>;
+ extensions: Readonly<GraphQLUnionTypeExtensions>;
+ extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLEnumTypeExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Enum Type Definition
+ *
+ * Enum types define leaf values whose serialized form is one of a fixed set
+ * of GraphQL enum names. Internally, enum values can map to any runtime value,
+ * often integers.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGBType = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGBType.getValue('GREEN')?.value; // => 1
+ * ```
+ *
+ * Note: If a value is not provided in a definition, the name of the enum value
+ * will be used as its internal value.
+ */
+export declare class GraphQLEnumType /* <T> *//* <T> */ implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLEnumTypeExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<EnumTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
+ private _values;
+ private _valueLookup;
+ private _nameLookup;
+ /**
+ * Creates a GraphQLEnumType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const document = parse(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * JEDI
+ * }
+ *
+ * extend enum Episode {
+ * FORCE_AWAKENS
+ * }
+ * `);
+ * const definition = document.definitions[0];
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * description: 'A Star Wars film episode.',
+ * values: {
+ * NEW_HOPE: {
+ * value: 4,
+ * description: 'Released in 1977.',
+ * extensions: { trilogy: 'original' },
+ * astNode: definition.values[0],
+ * },
+ * EMPIRE: { value: 5, astNode: definition.values[1] },
+ * JEDI: {
+ * value: 6,
+ * deprecationReason: 'Use RETURN_OF_THE_JEDI.',
+ * astNode: definition.values[2],
+ * },
+ * },
+ * extensions: { catalog: 'films' },
+ * astNode: definition,
+ * extensionASTNodes: [document.definitions[1]],
+ * });
+ *
+ * Episode.description; // => 'A Star Wars film episode.'
+ * Episode.coerceOutputValue(5); // => 'EMPIRE'
+ * Episode.coerceInputValue('JEDI'); // => 6
+ * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.'
+ * Episode.extensions; // => { catalog: 'films' }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLEnumTypeConfig>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the values defined by this enum type.
+ * @returns Enum value definitions in schema order.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * JEDI
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * }
+ * `);
+ *
+ * const Episode = assertEnumType(schema.getType('Episode'));
+ *
+ * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI']
+ * ```
+ */
+ getValues(): ReadonlyArray<GraphQLEnumValue>;
+ /**
+ * Returns the enum value definition for a value name.
+ * @param name - The GraphQL name to look up.
+ * @returns The matching enum value definition, if it exists.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * }
+ * `);
+ *
+ * const Episode = assertEnumType(schema.getType('Episode'));
+ *
+ * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE'
+ * Episode.getValue('JEDI'); // => undefined
+ * ```
+ */
+ getValue(name: string): Maybe<GraphQLEnumValue>;
+ /**
+ * Serializes a runtime enum value as a GraphQL enum name.
+ * @param outputValue - Runtime enum value to serialize.
+ * @returns The GraphQL enum name for the runtime value.
+ *
+ * This deprecated method delegates to `coerceOutputValue()`; call
+ * `coerceOutputValue()` directly instead.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.serialize(1); // => 'GREEN'
+ * RGB.serialize(3); // throws an error
+ * ```
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
+ */
+ serialize(outputValue: unknown): Maybe<string>;
+ /**
+ * Coerces a runtime enum value to a GraphQL enum name.
+ * @param outputValue - Runtime enum value to coerce.
+ * @returns The GraphQL enum name for the runtime value.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.coerceOutputValue(1); // => 'GREEN'
+ * RGB.coerceOutputValue(3); // throws an error
+ * ```
+ */
+ coerceOutputValue(outputValue: unknown): Maybe<string>;
+ /**
+ * Deprecated legacy enum parser for externally provided input values. Use
+ * `coerceInputValue()` instead.
+ * @param inputValue - External enum name to parse.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns The internal runtime value for the enum name.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.parseValue('BLUE'); // => 2
+ * RGB.parseValue('PURPLE', true); // throws an error
+ * ```
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
+ */
+ parseValue(inputValue: unknown, hideSuggestions?: Maybe<boolean>): Maybe<any>;
+ /**
+ * Coerces an external enum name to its internal runtime value.
+ * @param inputValue - External enum name to coerce.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns The internal runtime value for the enum name.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.coerceInputValue('BLUE'); // => 2
+ * RGB.coerceInputValue('PURPLE'); // throws an error
+ * RGB.coerceInputValue(2); // throws an error
+ * ```
+ */
+ coerceInputValue(inputValue: unknown, hideSuggestions?: Maybe<boolean>): Maybe<any>;
+ /**
+ * Deprecated legacy enum parser for externally provided input literals. Use
+ * `coerceInputLiteral()` instead.
+ * @param valueNode - Enum value AST node to parse.
+ * @param _variables - Deprecated variable values parameter that is no longer used.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns The internal runtime value for the enum literal.
+ * @example
+ * ```ts
+ * import { parseValue } from 'graphql/language';
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.parseLiteral(parseValue('RED')); // => 0
+ * RGB.parseLiteral(parseValue('"RED"')); // throws an error
+ * ```
+ * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
+ */
+ parseLiteral(valueNode: ValueNode, _variables: Maybe<ObjMap<unknown>>, hideSuggestions?: Maybe<boolean>): Maybe<any>;
+ /**
+ * Coerces an enum value AST node to its internal runtime value.
+ * @param valueNode - Enum value AST node to coerce.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns The internal runtime value for the enum literal.
+ * @example
+ * ```ts
+ * import { parseConstValue } from 'graphql/language';
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0
+ * RGB.coerceInputLiteral(parseConstValue('"RED"'), true); // throws an error
+ * ```
+ */
+ coerceInputLiteral(valueNode: ConstValueNode, hideSuggestions?: Maybe<boolean>): Maybe<any>;
+ /**
+ * Converts a runtime enum value to a GraphQL enum value AST node.
+ * @param value - Runtime enum value to convert.
+ * @returns Enum value AST node, or undefined if the value is invalid.
+ * @example
+ * ```ts
+ * import { print } from 'graphql/language';
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * print(RGB.valueToLiteral(2)); // => 'BLUE'
+ * RGB.valueToLiteral(3); // => undefined
+ * ```
+ */
+ valueToLiteral(value: unknown): ConstValueNode | undefined;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const RGB = new GraphQLEnumType({
+ * name: 'RGB',
+ * values: {
+ * RED: { value: 0 },
+ * GREEN: { value: 1 },
+ * BLUE: { value: 2 },
+ * },
+ * });
+ *
+ * const config = RGB.toConfig();
+ * const RGBCopy = new GraphQLEnumType(config);
+ *
+ * config.values.GREEN.value; // => 1
+ * RGBCopy.coerceOutputValue(2); // => 'BLUE'
+ * ```
+ */
+ toConfig(): GraphQLEnumTypeNormalizedConfig;
+ /**
+ * Returns the schema coordinate identifying this enum type.
+ * @returns The schema coordinate for this enum type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertEnumType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * }
+ * `);
+ *
+ * const Episode = assertEnumType(schema.getType('Episode'));
+ *
+ * Episode.toString(); // => 'Episode'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType } from 'graphql/type';
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * values: {
+ * NEW_HOPE: {},
+ * },
+ * });
+ *
+ * Episode.toJSON(); // => 'Episode'
+ * JSON.stringify({ type: Episode }); // => '{"type":"Episode"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/** Configuration used to construct a GraphQLEnumType. */
+export interface GraphQLEnumTypeConfig {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Values contained in this enum, list, or input-object definition. */
+ values: ThunkObjMap<GraphQLEnumValueConfig>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<EnumTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
+}
+interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {
+ values: GraphQLEnumValueNormalizedConfigMap;
+ extensions: Readonly<GraphQLEnumTypeExtensions>;
+ extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
+}
+/** A map of enum value names to enum value configuration objects. */
+export type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
+type GraphQLEnumValueNormalizedConfigMap = ObjMap<GraphQLEnumValueNormalizedConfig>;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLEnumValueExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/** Configuration used to define a GraphQL enum value. */
+export interface GraphQLEnumValueConfig {
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Parsed value represented by this node. */
+ value?: any;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason?: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLEnumValueExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<EnumValueDefinitionNode>;
+}
+interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig {
+ extensions: Readonly<GraphQLEnumValueExtensions>;
+}
+/** A resolved GraphQL enum value definition. */
+export declare class GraphQLEnumValue implements GraphQLSchemaElement {
+ /** Enum type that owns this enum value. */
+ parentEnum: GraphQLEnumType;
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Parsed value represented by this node. */
+ value: any;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLEnumValueExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<EnumValueDefinitionNode>;
+ /**
+ * Creates a resolved GraphQL enum value definition.
+ * @param parentEnum - Enum type that owns this enum value.
+ * @param name - Enum value name.
+ * @param config - Enum value configuration.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * values: { NEW_HOPE: { value: 4 } },
+ * });
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {
+ * value: 5,
+ * description: 'Released in 1980.',
+ * });
+ *
+ * enumValue.parentEnum; // => Episode
+ * enumValue.name; // => 'EMPIRE'
+ * enumValue.value; // => 5
+ * ```
+ */
+ constructor(parentEnum: GraphQLEnumType, name: string, config: GraphQLEnumValueConfig);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this enum value.
+ * @returns A configuration object that can be used to recreate this enum value.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * values: { NEW_HOPE: { value: 4 } },
+ * });
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {
+ * value: 5,
+ * extensions: { trilogy: 'original' },
+ * });
+ *
+ * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined }
+ * ```
+ */
+ toConfig(): GraphQLEnumValueNormalizedConfig;
+ /**
+ * Returns this enum value as a schema coordinate string.
+ * @returns Enum value coordinate.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * values: { NEW_HOPE: { value: 4 } },
+ * });
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });
+ *
+ * enumValue.toString(); // => 'Episode.EMPIRE'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns Enum value coordinate.
+ * @example
+ * ```ts
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
+ *
+ * const Episode = new GraphQLEnumType({
+ * name: 'Episode',
+ * values: { NEW_HOPE: { value: 4 } },
+ * });
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });
+ *
+ * JSON.stringify(enumValue); // => '"Episode.EMPIRE"'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLInputObjectTypeExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Input Object Type Definition
+ *
+ * An input object defines a structured collection of fields which may be
+ * supplied to a field argument.
+ *
+ * Using `NonNull` will ensure that a value must be provided by the query
+ * @example
+ * ```ts
+ * const GeoPoint = new GraphQLInputObjectType({
+ * name: 'GeoPoint',
+ * fields: {
+ * lat: { type: new GraphQLNonNull(GraphQLFloat) },
+ * lon: { type: new GraphQLNonNull(GraphQLFloat) },
+ * alt: { type: GraphQLFloat, default: { value: 0 } },
+ * },
+ * });
+ * ```
+ */
+export declare class GraphQLInputObjectType implements GraphQLSchemaElement {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLInputObjectTypeExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<InputObjectTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
+ /** Whether this input object uses the experimental OneOf input object semantics. */
+ isOneOf: boolean;
+ private _fields;
+ /**
+ * Creates a GraphQLInputObjectType instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import {
+ * GraphQLID,
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const document = parse(`
+ * input ReviewInput {
+ * stars: Int!
+ * commentary: String
+ * }
+ *
+ * extend input ReviewInput {
+ * body: String
+ * }
+ * `);
+ * const definition = document.definitions[0];
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * description: 'Input collected when reviewing a product.',
+ * fields: {
+ * stars: {
+ * description: 'Star rating from one to five.',
+ * type: new GraphQLNonNull(GraphQLInt),
+ * extensions: { min: 1, max: 5 },
+ * astNode: definition.fields[0],
+ * },
+ * commentary: {
+ * type: GraphQLString,
+ * default: { value: '' },
+ * deprecationReason: 'Use body.',
+ * astNode: definition.fields[1],
+ * },
+ * },
+ * extensions: { form: 'review' },
+ * astNode: definition,
+ * extensionASTNodes: [document.definitions[1]],
+ * isOneOf: false,
+ * });
+ * const SearchBy = new GraphQLInputObjectType({
+ * name: 'SearchBy',
+ * fields: {
+ * id: { type: GraphQLID },
+ * slug: { type: GraphQLString },
+ * },
+ * isOneOf: true,
+ * });
+ *
+ * const fields = ReviewInput.getFields();
+ *
+ * ReviewInput.description; // => 'Input collected when reviewing a product.'
+ * String(fields.stars.type); // => 'Int!'
+ * fields.stars.extensions; // => { min: 1, max: 5 }
+ * fields.commentary.default.value; // => ''
+ * fields.commentary.deprecationReason; // => 'Use body.'
+ * ReviewInput.isOneOf; // => false
+ * SearchBy.isOneOf; // => true
+ * ```
+ */
+ constructor(config: Readonly<GraphQLInputObjectTypeConfig>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the fields defined by this type.
+ * @returns The fields keyed by field name.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * commentary: String = ""
+ * }
+ *
+ * type Query {
+ * reviews(filter: ReviewInput): [String]
+ * }
+ * `);
+ *
+ * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));
+ * const fields = ReviewInput.getFields();
+ *
+ * Object.keys(fields); // => ['stars', 'commentary']
+ * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } }
+ * ```
+ */
+ getFields(): GraphQLInputFieldMap;
+ /**
+ * Returns a normalized configuration object for this object.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * },
+ * });
+ *
+ * const config = ReviewInput.toConfig();
+ * const ReviewInputCopy = new GraphQLInputObjectType(config);
+ *
+ * String(config.fields.stars.type); // => 'Int!'
+ * String(ReviewInputCopy.getFields().stars.type); // => 'Int!'
+ * ```
+ */
+ toConfig(): GraphQLInputObjectTypeNormalizedConfig;
+ /**
+ * Returns the schema coordinate identifying this input object type.
+ * @returns The schema coordinate for this input object type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInputObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * reviews(filter: ReviewInput): [String]
+ * }
+ * `);
+ *
+ * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));
+ *
+ * ReviewInput.toString(); // => 'ReviewInput'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The JSON-serializable representation.
+ * @example
+ * ```ts
+ * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * commentary: { type: GraphQLString },
+ * },
+ * });
+ *
+ * ReviewInput.toJSON(); // => 'ReviewInput'
+ * JSON.stringify({ type: ReviewInput }); // => '{"type":"ReviewInput"}'
+ * ```
+ */
+ toJSON(): string;
+}
+/** Configuration used to construct a GraphQLInputObjectType. */
+export interface GraphQLInputObjectTypeConfig {
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Fields declared by this object, interface, input object, or literal. */
+ fields: ThunkObjMap<GraphQLInputFieldConfig>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<InputObjectTypeDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
+ /** Whether this input object uses the experimental OneOf input object semantics. */
+ isOneOf?: boolean;
+}
+interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig {
+ fields: GraphQLInputFieldNormalizedConfigMap;
+ extensions: Readonly<GraphQLInputObjectTypeExtensions>;
+ extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
+}
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLInputFieldExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/** Configuration used to define a GraphQL input field. */
+export interface GraphQLInputFieldConfig {
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLInputType;
+ /**
+ * Deprecated legacy default value for this input field. Use `default`
+ * instead.
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
+ */
+ defaultValue?: unknown;
+ /** Default value represented as either a runtime value or a GraphQL literal. */
+ default?: GraphQLDefaultInput | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason?: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLInputFieldExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<InputValueDefinitionNode>;
+}
+/** A map of input field names to input field configuration objects. */
+export type GraphQLInputFieldConfigMap = ObjMap<GraphQLInputFieldConfig>;
+interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig {
+ default: GraphQLDefaultInput | undefined;
+ extensions: Readonly<GraphQLInputFieldExtensions>;
+}
+type GraphQLInputFieldNormalizedConfigMap = ObjMap<GraphQLInputFieldNormalizedConfig>;
+/** A resolved GraphQL input field definition. */
+export declare class GraphQLInputField implements GraphQLSchemaElement {
+ /** Input object type that owns this input field. */
+ parentType: GraphQLInputObjectType;
+ /** The GraphQL name for this schema element. */
+ name: string;
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ type: GraphQLInputType;
+ /**
+ * Deprecated legacy default value used when no explicit value is supplied.
+ * Use `default` instead.
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
+ */
+ defaultValue: unknown;
+ /** Default value represented as either a runtime value or a GraphQL literal. */
+ default: GraphQLDefaultInput | undefined;
+ /** Reason this element is deprecated, if one was provided. */
+ deprecationReason: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLInputFieldExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<InputValueDefinitionNode>;
+ /**
+ * Creates a resolved GraphQL input field definition.
+ * @param parentType - Input object type that owns this field.
+ * @param name - Input field name.
+ * @param config - Input field configuration.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputField,
+ * GraphQLInputObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {},
+ * });
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
+ * type: GraphQLString,
+ * default: { value: '' },
+ * });
+ *
+ * field.parentType; // => ReviewInput
+ * field.name; // => 'commentary'
+ * field.default.value; // => ''
+ * ```
+ */
+ constructor(parentType: GraphQLInputObjectType, name: string, config: GraphQLInputFieldConfig);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns a normalized configuration object for this input field.
+ * @returns A configuration object that can be used to recreate this input field.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputField,
+ * GraphQLInputObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {},
+ * });
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
+ * type: GraphQLString,
+ * extensions: { form: 'review' },
+ * });
+ *
+ * field.toConfig().extensions; // => { form: 'review' }
+ * ```
+ */
+ toConfig(): GraphQLInputFieldNormalizedConfig;
+ /**
+ * Returns this input field as a schema coordinate string.
+ * @returns The input field coordinate.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputField,
+ * GraphQLInputObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {},
+ * });
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
+ * type: GraphQLString,
+ * });
+ *
+ * field.toString(); // => 'ReviewInput.commentary'
+ * ```
+ */
+ toString(): string;
+ /**
+ * Returns the JSON representation used when this object is serialized.
+ * @returns The input field coordinate.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputField,
+ * GraphQLInputObjectType,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {},
+ * });
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
+ * type: GraphQLString,
+ * });
+ *
+ * JSON.stringify(field); // => '"ReviewInput.commentary"'
+ * ```
+ */
+ toJSON(): string;
+}
+/**
+ * Returns true when the input field is non-null and has no default value.
+ * @param field - The input field definition to inspect.
+ * @returns True when the input field is non-null and has no default value.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLInputField,
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * isRequiredInputField,
+ * } from 'graphql/type';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {},
+ * });
+ * const requiredField = new GraphQLInputField(ReviewInput, 'id', {
+ * type: new GraphQLNonNull(GraphQLInt),
+ * });
+ * const optionalField = new GraphQLInputField(ReviewInput, 'name', {
+ * type: GraphQLString,
+ * });
+ * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', {
+ * type: new GraphQLNonNull(GraphQLInt),
+ * default: { value: 10 },
+ * });
+ *
+ * isRequiredInputField(requiredField); // => true
+ * isRequiredInputField(optionalField); // => false
+ * isRequiredInputField(fieldWithDefault); // => false
+ * ```
+ */
+export declare function isRequiredInputField(field: GraphQLInputField): boolean;
+/** A map of input field names to resolved input field definitions. */
+export type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
+/**
+ * Test if the given value is a GraphQL schema.
+ * @param schema - Value to inspect.
+ * @returns True when the value is a GraphQLSchema.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { GraphQLString, isSchema } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * isSchema(schema); // => true
+ * isSchema(GraphQLString); // => false
+ * ```
+ */
+export declare function isSchema(schema: unknown): schema is GraphQLSchema;
+/**
+ * Returns the value as a GraphQLSchema, or throws if it is not a schema.
+ * @param schema - GraphQL schema to use.
+ * @returns The value typed as a GraphQLSchema.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertSchema, GraphQLString } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * assertSchema(schema); // => schema
+ * assertSchema(GraphQLString); // throws an error
+ * ```
+ */
+export declare function assertSchema(schema: unknown): GraphQLSchema;
+/**
+ * Custom extensions
+ * @remarks
+ * Use a unique identifier name for your extension, for example the name of
+ * your library or project. Do not use a shortened identifier as this increases
+ * the risk of conflicts. We recommend you add at most one extension field,
+ * an object which can contain all the values you need.
+ */
+export interface GraphQLSchemaExtensions {
+ [attributeName: string | symbol]: unknown;
+}
+/**
+ * Schema Definition
+ *
+ * A Schema is created by supplying the root types of each type of operation,
+ * query and mutation (optional). A schema definition is then supplied to the
+ * validator and executor.
+ * @example
+ * ```ts
+ * const MyAppQueryRootType = new GraphQLObjectType({
+ * name: 'Query',
+ * fields: {
+ * greeting: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const MyAppMutationRootType = new GraphQLObjectType({
+ * name: 'Mutation',
+ * fields: {
+ * setGreeting: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const MyAppSchema = new GraphQLSchema({
+ * query: MyAppQueryRootType,
+ * mutation: MyAppMutationRootType,
+ * });
+ * ```
+ * @example
+ * When the schema is constructed, by default only the types that are reachable
+ * by traversing the root types are included, other types must be explicitly
+ * referenced.
+ *
+ * ```ts
+ * const characterInterface = new GraphQLInterfaceType({
+ * name: 'Character',
+ * fields: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const humanType = new GraphQLObjectType({
+ * name: 'Human',
+ * interfaces: [characterInterface],
+ * fields: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const droidType = new GraphQLObjectType({
+ * name: 'Droid',
+ * interfaces: [characterInterface],
+ * fields: {
+ * name: { type: GraphQLString },
+ * },
+ * });
+ *
+ * const schema = new GraphQLSchema({
+ * query: new GraphQLObjectType({
+ * name: 'Query',
+ * fields: {
+ * hero: { type: characterInterface },
+ * },
+ * }),
+ * // Since this schema references only the `Character` interface it's
+ * // necessary to explicitly list the types that implement it if
+ * // you want them to be included in the final schema.
+ * types: [humanType, droidType],
+ * });
+ * ```
+ * @example
+ * If an array of `directives` are provided to GraphQLSchema, that will be the
+ * exact list of directives represented and allowed. If `directives` is not
+ * provided then a default set of the specified directives (e.g. `@include` and
+ * `@skip`) will be used. If you wish to provide *additional* directives to
+ * these specified directives, you must explicitly declare them.
+ *
+ * ```ts
+ * const MyAppSchema = new GraphQLSchema({
+ * query: MyAppQueryRootType,
+ * directives: specifiedDirectives.concat([myCustomDirective]),
+ * });
+ * ```
+ */
+export declare class GraphQLSchema {
+ /** Human-readable description for this schema element, if provided. */
+ description: Maybe<string>;
+ /** Custom extension fields reserved for users. */
+ extensions: Readonly<GraphQLSchemaExtensions>;
+ /** AST node from which this schema element was built, if available. */
+ astNode: Maybe<SchemaDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
+ /** Whether this schema instance skips validation checks. */
+ assumeValid: boolean;
+ private _queryType;
+ private _mutationType;
+ private _subscriptionType;
+ private _directives;
+ private _typeMap;
+ private _subTypeMap;
+ private _implementationsMap;
+ /**
+ * Creates a GraphQLSchema instance.
+ * @param config - Configuration describing this object.
+ * @example
+ * ```ts
+ * // Create a schema with the required query root.
+ * import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({
+ * name: 'Query',
+ * fields: {
+ * greeting: {
+ * type: GraphQLString,
+ * resolve: () => 'Hello',
+ * },
+ * },
+ * });
+ *
+ * const schema = new GraphQLSchema({
+ * description: 'The application schema.',
+ * query: Query,
+ * });
+ *
+ * schema.getQueryType(); // => Query
+ * schema.description; // => 'The application schema.'
+ * ```
+ * @example
+ * ```ts
+ * // This variant configures every schema option, including directives and extensions.
+ * import { DirectiveLocation, parse } from 'graphql/language';
+ * import {
+ * GraphQLBoolean,
+ * GraphQLDirective,
+ * GraphQLObjectType,
+ * GraphQLSchema,
+ * GraphQLString,
+ * } from 'graphql/type';
+ *
+ * const Query = new GraphQLObjectType({
+ * name: 'Query',
+ * fields: { greeting: { type: GraphQLString } },
+ * });
+ * const Mutation = new GraphQLObjectType({
+ * name: 'Mutation',
+ * fields: { setGreeting: { type: GraphQLString } },
+ * });
+ * const Subscription = new GraphQLObjectType({
+ * name: 'Subscription',
+ * fields: { greetingChanged: { type: GraphQLString } },
+ * });
+ * const AuditEvent = new GraphQLObjectType({
+ * name: 'AuditEvent',
+ * fields: { message: { type: GraphQLString } },
+ * });
+ * const authDirective = new GraphQLDirective({
+ * name: 'auth',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * args: { required: { type: GraphQLBoolean } },
+ * });
+ * const schemaDocument = parse(`
+ * schema {
+ * query: Query
+ * mutation: Mutation
+ * subscription: Subscription
+ * }
+ *
+ * extend schema @auth
+ * `);
+ *
+ * const schema = new GraphQLSchema({
+ * description: 'Operations exposed by the application.',
+ * query: Query,
+ * mutation: Mutation,
+ * subscription: Subscription,
+ * types: [AuditEvent],
+ * directives: [authDirective],
+ * extensions: { owner: 'platform' },
+ * astNode: schemaDocument.definitions[0],
+ * extensionASTNodes: [schemaDocument.definitions[1]],
+ * assumeValid: true,
+ * });
+ *
+ * schema.getMutationType(); // => Mutation
+ * schema.getSubscriptionType(); // => Subscription
+ * schema.getType('AuditEvent'); // => AuditEvent
+ * schema.getDirective('auth'); // => authDirective
+ * schema.extensions; // => { owner: 'platform' }
+ * ```
+ */
+ constructor(config: Readonly<GraphQLSchemaConfig>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the root object type for query operations.
+ * @returns The query root type, if this schema defines one.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * schema.getQueryType()?.name; // => 'Query'
+ * ```
+ */
+ getQueryType(): Maybe<GraphQLObjectType>;
+ /**
+ * Returns the root object type for mutation operations.
+ * @returns The mutation root type, if this schema defines one.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ *
+ * type Mutation {
+ * setGreeting(value: String!): String
+ * }
+ * `);
+ *
+ * schema.getMutationType()?.name; // => 'Mutation'
+ * ```
+ */
+ getMutationType(): Maybe<GraphQLObjectType>;
+ /**
+ * Returns the root object type for subscription operations.
+ * @returns The subscription root type, if this schema defines one.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ *
+ * type Subscription {
+ * greetings: String
+ * }
+ * `);
+ *
+ * schema.getSubscriptionType()?.name; // => 'Subscription'
+ * ```
+ */
+ getSubscriptionType(): Maybe<GraphQLObjectType>;
+ /**
+ * Returns the root object type for the requested operation kind.
+ * @param operation - Operation kind to resolve.
+ * @returns The root object type for the operation kind, if this schema defines one.
+ * @example
+ * ```ts
+ * import { OperationTypeNode } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ *
+ * type Mutation {
+ * setGreeting(value: String!): String
+ * }
+ * `);
+ *
+ * schema.getRootType(OperationTypeNode.QUERY)?.name; // => 'Query'
+ * schema.getRootType(OperationTypeNode.MUTATION)?.name; // => 'Mutation'
+ * schema.getRootType(OperationTypeNode.SUBSCRIPTION); // => undefined
+ * ```
+ */
+ getRootType(operation: OperationTypeNode): Maybe<GraphQLObjectType>;
+ /**
+ * Returns all named types known to this schema.
+ * @returns A map of schema types keyed by type name.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * const typeMap = schema.getTypeMap();
+ *
+ * typeMap.User.name; // => 'User'
+ * typeMap.Query.name; // => 'Query'
+ * typeMap.String.name; // => 'String'
+ * ```
+ */
+ getTypeMap(): TypeMap;
+ /**
+ * Returns the named type with the provided name.
+ * @param name - The GraphQL name to look up.
+ * @returns The named schema type, if one exists.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * schema.getType('User')?.toString(); // => 'User'
+ * schema.getType('Missing'); // => undefined
+ * ```
+ */
+ getType(name: string): GraphQLNamedType | undefined;
+ /**
+ * Returns object types that may be returned for an abstract type.
+ * @param abstractType - Interface or union type to inspect.
+ * @returns Object types that may satisfy the abstract type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType, assertUnionType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Organization implements Node {
+ * id: ID!
+ * }
+ *
+ * union SearchResult = User | Organization
+ *
+ * type Query {
+ * node: Node
+ * search: [SearchResult]
+ * }
+ * `);
+ *
+ * const Node = assertInterfaceType(schema.getType('Node'));
+ * const SearchResult = assertUnionType(schema.getType('SearchResult'));
+ *
+ * schema.getPossibleTypes(Node).map((type) => type.name); // => ['User', 'Organization']
+ * schema.getPossibleTypes(SearchResult).map((type) => type.name); // => ['User', 'Organization']
+ * ```
+ */
+ getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray<GraphQLObjectType>;
+ /**
+ * Returns objects and interfaces that implement an interface type.
+ * @param interfaceType - Interface type to inspect.
+ * @returns Object and interface implementations of the interface.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Resource {
+ * url: String!
+ * }
+ *
+ * interface Image implements Resource {
+ * url: String!
+ * width: Int
+ * }
+ *
+ * type Photo implements Resource & Image {
+ * url: String!
+ * width: Int
+ * }
+ *
+ * type Query {
+ * resource: Resource
+ * }
+ * `);
+ *
+ * const Resource = assertInterfaceType(schema.getType('Resource'));
+ * const implementations = schema.getImplementations(Resource);
+ *
+ * implementations.interfaces.map((type) => type.name); // => ['Image']
+ * implementations.objects.map((type) => type.name); // => ['Photo']
+ * ```
+ */
+ getImplementations(interfaceType: GraphQLInterfaceType): {
+ objects: ReadonlyArray<GraphQLObjectType>;
+ interfaces: ReadonlyArray<GraphQLInterfaceType>;
+ };
+ /**
+ * Returns whether one type is a possible runtime subtype of an abstract type.
+ * @param abstractType - Interface or union type to inspect.
+ * @param maybeSubType - Object or interface type to test as a possible subtype.
+ * @returns True when the subtype may satisfy the abstract type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertInterfaceType, assertObjectType } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Review {
+ * body: String
+ * }
+ *
+ * type Query {
+ * node: Node
+ * review: Review
+ * }
+ * `);
+ *
+ * const Node = assertInterfaceType(schema.getType('Node'));
+ * const User = assertObjectType(schema.getType('User'));
+ * const Review = assertObjectType(schema.getType('Review'));
+ *
+ * schema.isSubType(Node, User); // => true
+ * schema.isSubType(Node, Review); // => false
+ * ```
+ */
+ isSubType(abstractType: GraphQLAbstractType, maybeSubType: GraphQLObjectType | GraphQLInterfaceType): boolean;
+ /**
+ * Returns directives available in this schema.
+ * @returns Directives available in this schema.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * directive @upper on FIELD_DEFINITION
+ *
+ * type Query {
+ * greeting: String @upper
+ * }
+ * `);
+ *
+ * schema.getDirectives().map((directive) => directive.name); // => ['include', 'skip', 'deprecated', 'specifiedBy', 'oneOf', 'upper']
+ * ```
+ */
+ getDirectives(): ReadonlyArray<GraphQLDirective>;
+ /**
+ * Returns the current directive definition.
+ * @param name - The GraphQL name to look up.
+ * @returns The current directive definition, if known.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * directive @upper on FIELD_DEFINITION
+ *
+ * type Query {
+ * greeting: String @upper
+ * }
+ * `);
+ *
+ * schema.getDirective('upper')?.name; // => 'upper'
+ * schema.getDirective('missing'); // => undefined
+ * ```
+ */
+ getDirective(name: string): Maybe<GraphQLDirective>;
+ /**
+ * This method looks up the field on the given type definition.
+ * It has special casing for the three introspection fields, `__schema`,
+ * `__type` and `__typename`.
+ *
+ * `__typename` is special because it can always be queried as a field, even
+ * in situations where no other fields are allowed, like on a Union.
+ *
+ * `__schema` and `__type` could get automatically added to the query type,
+ * but that would require mutating type definitions, which would cause issues.
+ * @param parentType - Composite type to look up the field on.
+ * @param fieldName - Field name to look up.
+ * @returns The field definition, including supported introspection fields.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const queryType = schema.getQueryType();
+ *
+ * schema.getField(queryType, 'greeting')?.name; // => 'greeting'
+ * schema.getField(queryType, '__typename')?.name; // => '__typename'
+ * schema.getField(queryType, 'missing'); // => undefined
+ * ```
+ */
+ getField(parentType: GraphQLCompositeType, fieldName: string): GraphQLField<unknown, unknown> | undefined;
+ /**
+ * Returns a normalized configuration object for this object.
+ *
+ * The returned config preserves the original `assumeValid` flag so the schema
+ * can be recreated with the same validation behavior.
+ * @returns A configuration object that can be used to recreate this object.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { GraphQLSchema } from 'graphql/type';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * const config = schema.toConfig();
+ * const schemaCopy = new GraphQLSchema(config);
+ *
+ * config.query?.name; // => 'Query'
+ * schemaCopy.getQueryType()?.name; // => 'Query'
+ * ```
+ */
+ toConfig(): GraphQLSchemaNormalizedConfig;
+}
+type TypeMap = ObjMap<GraphQLNamedType>;
+interface GraphQLSchemaValidationOptions {
+ /**
+ * When building a schema from a GraphQL service's introspection result, it
+ * might be safe to assume the schema is valid. Set to true to assume the
+ * produced schema is valid.
+ *
+ * Default: false
+ *
+ * @internal
+ */
+ assumeValid?: boolean | undefined;
+}
+/** Configuration used to construct a GraphQLSchema. */
+export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
+ /** Human-readable description for this schema element, if provided. */
+ description?: Maybe<string>;
+ /** Root object type for query operations. */
+ query?: Maybe<GraphQLObjectType>;
+ /** Root object type for mutation operations. */
+ mutation?: Maybe<GraphQLObjectType>;
+ /** Root object type for subscription operations. */
+ subscription?: Maybe<GraphQLObjectType>;
+ /** Object types that belong to this union type. */
+ types?: Maybe<ReadonlyArray<GraphQLNamedType>>;
+ /** Directives available in this schema or applied to this AST node. */
+ directives?: Maybe<ReadonlyArray<GraphQLDirective>>;
+ /** Custom extension fields reserved for users. */
+ extensions?: Maybe<Readonly<GraphQLSchemaExtensions>>;
+ /** AST node from which this schema element was built, if available. */
+ astNode?: Maybe<SchemaDefinitionNode>;
+ /** AST extension nodes applied to this schema element. */
+ extensionASTNodes?: Maybe<ReadonlyArray<SchemaExtensionNode>>;
+}
+interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig {
+ description: Maybe<string>;
+ types: ReadonlyArray<GraphQLNamedType>;
+ directives: ReadonlyArray<GraphQLDirective>;
+ extensions: Readonly<GraphQLSchemaExtensions>;
+ extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
+ assumeValid: boolean;
+}
+/**
+ * Error thrown when GraphQL execution is aborted.
+ * @typeParam TResult - Result value type.
+ */
+export declare class AbortedGraphQLExecutionError<TResult> extends Error {
+ /** Partial execution result available when execution was aborted. */
+ readonly abortedResult: PromiseOrValue<TResult>;
+ /**
+ * Creates an error for an aborted GraphQL execution.
+ * @param reason - Abort reason used as the error cause.
+ * @param result - Partial execution result available when execution stopped.
+ * @example
+ * ```ts
+ * import { AbortedGraphQLExecutionError } from 'graphql/execution';
+ *
+ * const cause = new Error('Request cancelled.');
+ * const partialResult = { data: { viewer: null } };
+ * const error = new AbortedGraphQLExecutionError(cause, partialResult);
+ *
+ * error.message; // => 'Request cancelled.'
+ * error.cause; // => cause
+ * error.abortedResult; // => partialResult
+ * ```
+ */
+ constructor(reason: unknown, result: PromiseOrValue<TResult>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+}
+/** Arguments accepted by execute and executeSync. */
+export interface ExecutionArgs {
+ /** The schema used for validation or execution. */
+ schema: GraphQLSchema;
+ /** The parsed GraphQL document to execute. */
+ document: DocumentNode;
+ /** Initial root value passed to the operation. */
+ rootValue?: unknown;
+ /** Application context value passed to every resolver. */
+ contextValue?: unknown;
+ /** Runtime variable values keyed by variable name. */
+ variableValues?: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Name of the operation to execute when the document contains multiple operations. */
+ operationName?: Maybe<string>;
+ /** Resolver used when a field does not define its own resolver. */
+ fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
+ /** Resolver used when an abstract type does not define its own resolver. */
+ typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
+ /** Resolver used for the root subscription field. */
+ subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
+ /** Whether suggestion text should be omitted from request errors. */
+ hideSuggestions?: Maybe<boolean>;
+ /** AbortSignal used to cancel execution. */
+ abortSignal?: Maybe<AbortSignal>;
+ /** Whether incremental execution may begin eligible work early. */
+ enableEarlyExecution?: Maybe<boolean>;
+ /** Execution hooks invoked during this operation. */
+ hooks?: Maybe<ExecutionHooks>;
+ /** Additional execution options. */
+ options?: {
+ /**
+ * Set the maximum number of errors allowed for coercing (defaults to 50).
+ *
+ * @internal
+ */
+ maxCoercionErrors?: number;
+ };
+}
+/**
+ * Data that must be available at all points during query execution.
+ *
+ * Namely, schema of the type system that is currently executing,
+ * and the fragments defined in the query document
+ */
+export interface ValidatedExecutionArgs {
+ /** Schema used for execution. */
+ schema: GraphQLSchema;
+ /** Parsed GraphQL document being executed. */
+ document: DocumentNode;
+ /** Fragment definitions keyed by fragment name. */
+ fragmentDefinitions: ObjMap<FragmentDefinitionNode>;
+ /** Fragment details keyed by fragment name. */
+ fragments: ObjMap<FragmentDetails>;
+ /** Root value passed to the operation. */
+ rootValue: unknown;
+ /** Application context value passed to every resolver. */
+ contextValue: unknown;
+ /** Operation definition selected for execution. */
+ operation: OperationDefinitionNode;
+ /** Operation variable values with source metadata and coerced runtime values. */
+ variableValues: VariableValues;
+ /** Raw variable values provided by the caller before coercion. */
+ rawVariableValues: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Resolver used for fields without an explicit resolver. */
+ fieldResolver: GraphQLFieldResolver<any, any>;
+ /** Resolver used for abstract types without an explicit type resolver. */
+ typeResolver: GraphQLTypeResolver<any, any>;
+ /** Resolver used for subscription fields without an explicit subscribe resolver. */
+ subscribeFieldResolver: GraphQLFieldResolver<any, any>;
+ /** Whether suggestion text should be omitted from execution errors. */
+ hideSuggestions: boolean;
+ /** Whether execution should use error propagation. */
+ errorPropagation: boolean;
+ /** External signal that may abort execution. */
+ externalAbortSignal: AbortSignal | undefined;
+ /** Whether incremental execution may begin eligible work early. */
+ enableEarlyExecution: boolean;
+ /** Execution hooks supplied by the caller. */
+ hooks: ExecutionHooks | undefined;
+}
+/** Validated execution arguments for a subscription operation. */
+export interface ValidatedSubscriptionArgs extends ValidatedExecutionArgs {
+ /** Subscription operation definition selected for execution. */
+ operation: SubscriptionOperationDefinitionNode;
+}
+/** Information passed to hooks after asynchronous execution work has finished. */
+export interface AsyncWorkFinishedInfo {
+ /** Validated execution arguments for the operation that finished async work. */
+ validatedExecutionArgs: ValidatedExecutionArgs;
+}
+/** Optional hooks invoked during GraphQL execution. */
+export interface ExecutionHooks {
+ /** Called after all tracked asynchronous execution work has settled. */
+ asyncWorkFinished?: (info: AsyncWorkFinishedInfo) => void;
+}
+/**
+ * Represents the response produced by executing a GraphQL operation.
+ * @typeParam TData - Shape of the execution data payload.
+ * @typeParam TExtensions - Shape of the extensions payload.
+ */
+export interface ExecutionResult<TData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> {
+ /** Errors raised while parsing, validating, or executing the operation. */
+ errors?: ReadonlyArray<GraphQLError>;
+ /** Data returned by execution, or null when execution could not produce data. */
+ data?: TData | null;
+ /** Additional non-standard metadata included in the execution result. */
+ extensions?: TExtensions;
+}
+/**
+ * A JSON-serializable GraphQL execution result.
+ * @typeParam TData - Shape of the formatted data payload.
+ * @typeParam TExtensions - Shape of the formatted extensions payload.
+ */
+export interface FormattedExecutionResult<TData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> {
+ /** Errors raised while parsing, validating, or executing the operation. */
+ errors?: ReadonlyArray<GraphQLFormattedError>;
+ /** Data returned by execution, or null when execution could not produce data. */
+ data?: TData | null;
+ /** Additional non-standard metadata included in the formatted result. */
+ extensions?: TExtensions;
+}
+/**
+ * Results for an operation that produced incremental payloads.
+ * @typeParam TInitialData - Shape of the initial result data payload.
+ * @typeParam TDeferredData - Shape of deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface ExperimentalIncrementalExecutionResults<TInitialData = ObjMap<unknown>, TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Initial execution result delivered before subsequent incremental payloads. */
+ initialResult: InitialIncrementalExecutionResult<TInitialData, TExtensions>;
+ /** Async stream of incremental payloads delivered after the initial result. */
+ subsequentResults: AsyncGenerator<SubsequentIncrementalExecutionResult<TDeferredData, TStreamItem, TExtensions>, void, void>;
+}
+/**
+ * JSON-serializable form of incremental execution results.
+ * @typeParam TInitial - Shape of the formatted initial result data payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedExperimentalIncrementalExecutionResults<TInitial = ObjMap<unknown>, TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Formatted initial execution result. */
+ initialResult: FormattedInitialIncrementalExecutionResult<TInitial, TExtensions>;
+ /** Async stream of formatted incremental payloads. */
+ subsequentResults: AsyncGenerator<FormattedSubsequentIncrementalExecutionResult<TDeferredData, TStreamItem, TExtensions>, void, void>;
+}
+/**
+ * Initial execution result for an operation that produced incremental payloads.
+ * @typeParam TData - Shape of the initial data payload.
+ * @typeParam TExtensions - Shape of the extensions payload.
+ */
+export interface InitialIncrementalExecutionResult<TData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends ExecutionResult<TData, TExtensions> {
+ /** Data produced by the initial execution payload. */
+ data: TData;
+ /** Incremental payloads that are still pending after the initial result. */
+ pending: ReadonlyArray<PendingResult>;
+ /** Indicates that subsequent incremental payloads will follow. */
+ hasNext: true;
+ /** Additional non-standard metadata included in the initial result. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of an initial incremental execution result.
+ * @typeParam TInitialData - Shape of the formatted initial data payload.
+ * @typeParam TExtensions - Shape of the formatted extensions payload.
+ */
+export interface FormattedInitialIncrementalExecutionResult<TInitialData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends FormattedExecutionResult<TInitialData, TExtensions> {
+ /** Formatted data produced by the initial execution payload. */
+ data: TInitialData;
+ /** Formatted list of incremental payloads still pending after the initial result. */
+ pending: ReadonlyArray<PendingResult>;
+ /** Indicates whether subsequent incremental payloads will follow. */
+ hasNext: boolean;
+ /** Additional non-standard metadata included in the formatted initial result. */
+ extensions?: TExtensions;
+}
+/**
+ * Subsequent payload produced by incremental execution.
+ * @typeParam TDeferredData - Shape of deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of the extensions payload.
+ */
+export interface SubsequentIncrementalExecutionResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Incremental payloads that became pending with this response. */
+ pending?: ReadonlyArray<PendingResult>;
+ /** Deferred or streamed payloads delivered by this response. */
+ incremental?: ReadonlyArray<IncrementalResult<TDeferredData, TStreamItem, TExtensions>>;
+ /** Incremental payloads that completed with this response. */
+ completed?: ReadonlyArray<CompletedResult>;
+ /** Indicates whether more incremental payloads will follow. */
+ hasNext: boolean;
+ /** Additional non-standard metadata included in this payload. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of a subsequent incremental execution payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedSubsequentIncrementalExecutionResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Indicates whether more incremental payloads will follow. */
+ hasNext: boolean;
+ /** Formatted incremental payloads that became pending with this response. */
+ pending?: ReadonlyArray<PendingResult>;
+ /** Formatted deferred or streamed payloads delivered by this response. */
+ incremental?: ReadonlyArray<FormattedIncrementalResult<TDeferredData, TStreamItem, TExtensions>>;
+ /** Formatted incremental payloads that completed with this response. */
+ completed?: ReadonlyArray<FormattedCompletedResult>;
+ /** Additional non-standard metadata included in this formatted payload. */
+ extensions?: TExtensions;
+}
+/**
+ * Incremental payload produced by a deferred fragment.
+ * @typeParam TDeferredData - Shape of deferred fragment data.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface IncrementalDeferResult<TDeferredData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> {
+ /** Identifier matching this payload to a pending deferred fragment. */
+ id: string;
+ /** Path from the deferred fragment location to this payload. */
+ subPath?: ReadonlyArray<string | number>;
+ /** Errors raised while executing the deferred fragment. */
+ errors?: ReadonlyArray<GraphQLError>;
+ /** Data produced by the deferred fragment. */
+ data: TDeferredData;
+ /** Additional non-standard metadata included in this payload. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of a deferred fragment payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedIncrementalDeferResult<TDeferredData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> {
+ /** Formatted errors raised while executing the deferred fragment. */
+ errors?: ReadonlyArray<GraphQLFormattedError>;
+ /** Formatted data produced by the deferred fragment. */
+ data: TDeferredData;
+ /** Identifier matching this payload to a pending deferred fragment. */
+ id: string;
+ /** Path from the deferred fragment location to this payload. */
+ subPath?: ReadonlyArray<string | number>;
+ /** Additional non-standard metadata included in this formatted payload. */
+ extensions?: TExtensions;
+}
+/**
+ * Incremental payload produced by a streamed list field.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface IncrementalStreamResult<TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Identifier matching this payload to a pending stream. */
+ id: string;
+ /** Path from the streamed field location to these items. */
+ subPath?: ReadonlyArray<string | number>;
+ /** Errors raised while producing streamed items. */
+ errors?: ReadonlyArray<GraphQLError>;
+ /** Streamed list items delivered by this payload. */
+ items: ReadonlyArray<TStreamItem>;
+ /** Additional non-standard metadata included in this payload. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of a streamed list payload.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedIncrementalStreamResult<TStreamItem = Array<unknown>, TExtensions = ObjMap<unknown>> {
+ /** Formatted errors raised while producing streamed items. */
+ errors?: ReadonlyArray<GraphQLFormattedError>;
+ /** Formatted streamed list items delivered by this payload. */
+ items: ReadonlyArray<TStreamItem>;
+ /** Identifier matching this payload to a pending stream. */
+ id: string;
+ /** Path from the streamed field location to these items. */
+ subPath?: ReadonlyArray<string | number>;
+ /** Additional non-standard metadata included in this formatted payload. */
+ extensions?: TExtensions;
+}
+/**
+ * Deferred fragment or streamed list payload produced by incremental execution.
+ * @typeParam TDeferredData - Shape of deferred fragment data.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export type IncrementalResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> = IncrementalDeferResult<TDeferredData, TExtensions> | IncrementalStreamResult<TStreamItem, TExtensions>;
+/**
+ * JSON-serializable deferred fragment or streamed list payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export type FormattedIncrementalResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> = FormattedIncrementalDeferResult<TDeferredData, TExtensions> | FormattedIncrementalStreamResult<TStreamItem, TExtensions>;
+interface PendingResult {
+ id: string;
+ path: ReadonlyArray<string | number>;
+ label?: string;
+}
+interface CompletedResult {
+ id: string;
+ errors?: ReadonlyArray<GraphQLError>;
+}
+interface FormattedCompletedResult {
+ id: string;
+ errors?: ReadonlyArray<GraphQLFormattedError>;
+}
+interface MinimalChannel<TMessage = unknown> {
+ readonly hasSubscribers?: boolean;
+ publish: (message: TMessage) => void;
+ runStores: <T, ContextType extends object>(context: ContextType, fn: (this: ContextType, ...args: Array<unknown>) => T, thisArg?: unknown, ...args: Array<unknown>) => T;
+}
+interface MinimalTracingChannel<TContext = unknown> {
+ readonly hasSubscribers: boolean | undefined;
+ readonly start: MinimalChannel<TContext>;
+ readonly end: MinimalChannel<TContext>;
+ readonly asyncStart: MinimalChannel<TContext>;
+ readonly asyncEnd: MinimalChannel<TContext>;
+ readonly error: MinimalChannel<TContext>;
+ traceSync: <T>(fn: (...args: Array<unknown>) => T, context: TContext extends object ? TContext : object, thisArg?: unknown, ...args: Array<unknown>) => T;
+}
+/** Context published on the sync-only `graphql:parse` channel. */
+export interface GraphQLParseContext {
+ /** Source text or source object passed to the parser. */
+ source: string | Source;
+ /** Error thrown while parsing, when parsing fails. */
+ error?: unknown;
+ /** Parsed document, when parsing succeeds. */
+ result?: DocumentNode;
+}
+/** Context published on the sync-only `graphql:validate` channel. */
+export interface GraphQLValidateContext {
+ /** Schema used for validation. */
+ schema: GraphQLSchema;
+ /** Parsed document being validated. */
+ document: DocumentNode;
+ /** Error thrown while validating, when validation fails abruptly. */
+ error?: unknown;
+ /** Validation errors returned by validation. */
+ result?: ReadonlyArray<GraphQLError>;
+}
+/**
+ * Context published on `graphql:execute`.
+ *
+ * Returned results may contain GraphQL errors collected during execution.
+ */
+export interface GraphQLExecuteContext {
+ /** Schema used for execution. */
+ schema: GraphQLSchema;
+ /** Parsed document being executed. */
+ document: DocumentNode;
+ /** Raw variable values provided by the caller before coercion. */
+ rawVariableValues: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Selected operation name, if one is available. */
+ operationName: string | undefined;
+ /** Selected operation type, if one is available. */
+ operationType: OperationTypeNode | undefined;
+ /** Error thrown or rejected while executing, when execution fails abruptly. */
+ error?: unknown;
+ /** Execution result returned by execution, including GraphQL errors. */
+ result?: ExecutionResult | ExperimentalIncrementalExecutionResults;
+}
+/**
+ * Context published on `graphql:execute:rootSelectionSet`.
+ *
+ * Returned results may contain GraphQL errors collected during execution.
+ */
+export interface GraphQLExecuteRootSelectionSetContext {
+ /** Schema used for execution. */
+ schema: GraphQLSchema;
+ /** Parsed document being executed. */
+ document: DocumentNode;
+ /** Operation definition selected for execution. */
+ operation: OperationDefinitionNode;
+ /** Raw variable values provided by the caller before coercion. */
+ rawVariableValues: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Selected operation name, if one is available. */
+ operationName: string | undefined;
+ /** Selected operation type. */
+ operationType: OperationTypeNode;
+ /** Error thrown or rejected while executing the root selection set. */
+ error?: unknown;
+ /**
+ * Execution result returned from the root selection set, including GraphQL
+ * errors.
+ */
+ result?: ExecutionResult | ExperimentalIncrementalExecutionResults;
+}
+/**
+ * Context published on `graphql:execute:variableCoercion`.
+ *
+ * Coercion runs synchronously while execution arguments are validated, so only
+ * the `start`/`end` (and, on an abrupt throw, `error`) lifecycle fires.
+ * Ordinary variable coercion failures are returned on `result.errors`; when
+ * execution is invoked through APIs such as `execute()` or `subscribe()`, they
+ * surface as GraphQL result errors rather than as the tracing `error`
+ * lifecycle event.
+ */
+export interface GraphQLExecuteVariableCoercionContext {
+ /** Schema used for variable coercion. */
+ schema: GraphQLSchema;
+ /** Parsed document being executed. */
+ document: DocumentNode;
+ /** Operation definition whose variables are being coerced. */
+ operation: OperationDefinitionNode;
+ /** Raw variable values provided by the caller before coercion. */
+ rawVariableValues: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Selected operation name, if one is available. */
+ operationName: string | undefined;
+ /** Selected operation type. */
+ operationType: OperationTypeNode;
+ /** Error thrown while coercing variables, when coercion fails abruptly. */
+ error?: unknown;
+ /** Coerced variable values or coercion errors returned by coercion. */
+ result?: {
+ variableValues: VariableValues;
+ } | {
+ errors: ReadonlyArray<GraphQLError>;
+ };
+}
+/**
+ * Context published on `graphql:subscribe`.
+ *
+ * Subscription source resolver errors and invalid source stream results are
+ * returned on `result` as ExecutionResult errors; they do not publish the
+ * `error` lifecycle event unless subscription setup fails abruptly before
+ * GraphQL can form a result.
+ */
+export interface GraphQLSubscribeContext {
+ /** Schema used for subscription execution. */
+ schema: GraphQLSchema;
+ /** Parsed subscription document. */
+ document: DocumentNode;
+ /** Raw variable values provided by the caller before coercion. */
+ rawVariableValues: Maybe<{
+ readonly [variable: string]: unknown;
+ }>;
+ /** Selected operation name, if one is available. */
+ operationName: string | undefined;
+ /** Selected operation type, if one is available. */
+ operationType: OperationTypeNode | undefined;
+ /** Error thrown or rejected while subscribing, when setup fails abruptly. */
+ error?: unknown;
+ /**
+ * Subscription response stream, or an ExecutionResult containing GraphQL
+ * errors.
+ */
+ result?: AsyncGenerator<ExecutionResult, void, void> | ExecutionResult;
+}
+/**
+ * Context published on `graphql:resolve`.
+ *
+ * Resolver throws and rejections publish the `error` lifecycle event here.
+ * The same failure may also be formatted into the enclosing execution or
+ * subscription result.
+ */
+export interface GraphQLResolveContext {
+ /** Field name being resolved. */
+ fieldName: string;
+ /** Response alias for the field being resolved. */
+ alias: string;
+ /** Parent type name for the field being resolved. */
+ parentType: string;
+ /** Return type string for the field being resolved. */
+ fieldType: string;
+ /** Argument values passed to the resolver. */
+ args: ObjMap<unknown>;
+ /** Whether the field is using the default resolver. */
+ isDefaultResolver: boolean;
+ /** Response path for the field being resolved. */
+ fieldPath: string;
+ /** Error thrown or rejected by the resolver, when resolution fails. */
+ error?: unknown;
+ /** Value returned by the resolver, when resolution succeeds. */
+ result?: unknown;
+}
+/** Mapping from tracing channel name to the context type published on it. */
+export interface GraphQLChannelContextByName {
+ /** Context published on `graphql:parse`. */
+ "graphql:parse": GraphQLParseContext;
+ /** Context published on `graphql:validate`. */
+ "graphql:validate": GraphQLValidateContext;
+ /** Context published on `graphql:execute`. */
+ "graphql:execute": GraphQLExecuteContext;
+ /** Context published on `graphql:execute:variableCoercion`. */
+ "graphql:execute:variableCoercion": GraphQLExecuteVariableCoercionContext;
+ /** Context published on `graphql:execute:rootSelectionSet`. */
+ "graphql:execute:rootSelectionSet": GraphQLExecuteRootSelectionSetContext;
+ /** Context published on `graphql:subscribe`. */
+ "graphql:subscribe": GraphQLSubscribeContext;
+ /** Context published on `graphql:resolve`. */
+ "graphql:resolve": GraphQLResolveContext;
+}
+/**
+ * The collection of tracing channels GraphQL.js emits on. Application
+ * performance monitoring (APM) tools subscribe to these by name on their own
+ * `node:diagnostics_channel` import; both paths land on the same channel
+ * instance because `tracingChannel(name)` is cached by name.
+ */
+export interface GraphQLChannels {
+ /** Tracing channel for `graphql:execute`. */
+ execute: MinimalTracingChannel<GraphQLExecuteContext>;
+ /** Tracing channel for `graphql:execute:variableCoercion`. */
+ executeVariableCoercion: MinimalTracingChannel<GraphQLExecuteVariableCoercionContext>;
+ /** Tracing channel for `graphql:execute:rootSelectionSet`. */
+ executeRootSelectionSet: MinimalTracingChannel<GraphQLExecuteRootSelectionSetContext>;
+ /** Tracing channel for `graphql:parse`. */
+ parse: MinimalTracingChannel<GraphQLParseContext>;
+ /** Tracing channel for `graphql:validate`. */
+ validate: MinimalTracingChannel<GraphQLValidateContext>;
+ /** Tracing channel for `graphql:resolve`. */
+ resolve: MinimalTracingChannel<GraphQLResolveContext>;
+ /** Tracing channel for `graphql:subscribe`. */
+ subscribe: MinimalTracingChannel<GraphQLSubscribeContext>;
+}
+interface LexerInterface {
+ source: Source;
+ lastToken: Token;
+ token: Token;
+ line: number;
+ lineStart: number;
+ advance: () => Token;
+ lookahead: () => Token;
+}
+/**
+ * Given a Source object, creates a Lexer for that source.
+ * A Lexer is a stateful stream generator in that every time
+ * it is advanced, it returns the next token in the Source. Assuming the
+ * source lexes, the final Token emitted by the lexer will be of kind
+ * EOF, after which the lexer will repeatedly return the same EOF token
+ * whenever called.
+ */
+export declare class Lexer implements LexerInterface {
+ /** Source document used to derive error locations. */
+ source: Source;
+ /** Most recent non-ignored token returned by the lexer. */
+ lastToken: Token;
+ /** Current non-ignored token at the lexer cursor. */
+ token: Token;
+ /** The (1-indexed) line containing the current token. */
+ line: number;
+ /** Character offset where the current line starts. */
+ lineStart: number;
+ /**
+ * Creates a Lexer instance.
+ * @param source - Source document used to derive error locations.
+ * @example
+ * ```ts
+ * import { Lexer, Source, TokenKind } from 'graphql/language';
+ *
+ * const lexer = new Lexer(new Source('{ hello }'));
+ *
+ * lexer.token.kind; // => TokenKind.SOF
+ * lexer.advance().kind; // => TokenKind.BRACE_L
+ * lexer.advance().value; // => 'hello'
+ * lexer.advance().kind; // => TokenKind.BRACE_R
+ * ```
+ */
+ constructor(source: Source);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Advances the token stream to the next non-ignored token.
+ * @returns The next non-ignored token.
+ * @example
+ * ```ts
+ * import { Lexer, Source } from 'graphql/language';
+ *
+ * const lexer = new Lexer(new Source('{ hello }'));
+ * const token = lexer.advance();
+ *
+ * token.kind; // => '{'
+ * lexer.token; // => token
+ * ```
+ */
+ advance(): Token;
+ /**
+ * Looks ahead and returns the next non-ignored token, but does not change
+ * the state of Lexer.
+ * @returns The next non-ignored token without advancing the lexer.
+ * @example
+ * ```ts
+ * import { Lexer, Source } from 'graphql/language';
+ *
+ * const lexer = new Lexer(new Source('{ hello }'));
+ * const token = lexer.lookahead();
+ *
+ * token.kind; // => '{'
+ * lexer.token.kind; // => '<SOF>'
+ * ```
+ */
+ lookahead(): Token;
+}
+/** Configuration options to control parser behavior */
+export interface ParseOptions {
+ /**
+ * By default, the parser creates AST nodes that know the location
+ * in the source that they correspond to. This configuration flag
+ * disables that behavior for performance or testing.
+ */
+ noLocation?: boolean | undefined;
+ /**
+ * Parser CPU and memory usage is linear to the number of tokens in a document
+ * however in extreme cases it becomes quadratic due to memory exhaustion.
+ * Parsing happens before validation so even invalid queries can burn lots of
+ * CPU time and memory.
+ * To prevent this you can set a maximum number of tokens allowed within a document.
+ */
+ maxTokens?: number | undefined;
+ /**
+ * EXPERIMENTAL:
+ *
+ * If enabled, the parser will understand and parse fragment variable definitions
+ * and arguments on fragment spreads. Fragment variable definitions will be represented
+ * in the `variableDefinitions` field of the FragmentDefinitionNode.
+ * Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode.
+ * @example
+ * ```graphql prettier-ignore
+ * {
+ * t { ...A(var: true) }
+ * }
+ * fragment A($var: Boolean = false) on T {
+ * ...B(x: $var)
+ * }
+ * ```
+ */
+ experimentalFragmentArguments?: boolean | undefined;
+ /**
+ * Internal parser hook for GraphQL.js entry points that need to parse a
+ * restricted grammar with an alternate lexer.
+ * @internal
+ */
+ lexer?: LexerInterface | undefined;
+}
+/**
+ * Given a GraphQL source, parses it into a Document.
+ * Throws GraphQLError if a syntax error is encountered.
+ * @param source - A GraphQL source string or source object.
+ * @param options - Optional parser configuration.
+ * @returns The parsed GraphQL document AST.
+ * @example
+ * ```ts
+ * // Parse a GraphQL document with the default parser options.
+ * import { parse } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ *
+ * document.kind; // => 'Document'
+ * ```
+ * @example
+ * ```ts
+ * // This variant enables parser options and provides an explicit lexer.
+ * import { Lexer, Source, parse } from 'graphql/language';
+ *
+ * const document = parse(
+ * `
+ * {
+ * t { ...A(var: true) }
+ * }
+ * fragment A($var: Boolean = false) on T {
+ * name
+ * }
+ * `,
+ * {
+ * experimentalFragmentArguments: true,
+ * maxTokens: 80,
+ * noLocation: true,
+ * },
+ * );
+ * const directiveDocument = parse('directive @foo @bar on FIELD');
+ * const source = new Source('{ hero }');
+ * const lexerDocument = parse(source, { lexer: new Lexer(source) });
+ *
+ * document.definitions[0].kind; // => 'OperationDefinition'
+ * document.definitions[1].kind; // => 'FragmentDefinition'
+ * document.loc; // => undefined
+ * directiveDocument.definitions[0].kind; // => 'DirectiveDefinition'
+ * lexerDocument.definitions[0].kind; // => 'OperationDefinition'
+ * ```
+ */
+export declare function parse(source: string | Source, options?: ParseOptions): DocumentNode;
+/**
+ * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for
+ * that value.
+ * Throws GraphQLError if a syntax error is encountered.
+ *
+ * This is useful within tools that operate upon GraphQL Values directly and
+ * in isolation of complete GraphQL documents.
+ *
+ * Consider providing the results to the utility function: valueFromAST().
+ * @param source - A GraphQL source string or source object containing a value.
+ * @param options - Optional parser configuration.
+ * @returns The parsed GraphQL value AST.
+ * @example
+ * ```ts
+ * import { parseValue } from 'graphql/language';
+ *
+ * const value = parseValue('[42]');
+ *
+ * value.kind; // => 'ListValue'
+ * ```
+ */
+export declare function parseValue(source: string | Source, options?: ParseOptions): ValueNode;
+/**
+ * Similar to parseValue(), but raises a parse error if it encounters a
+ * variable. The return type will be a constant value.
+ * @param source - A GraphQL source string or source object containing a constant value.
+ * @param options - Optional parser configuration.
+ * @returns The parsed GraphQL constant value AST.
+ * @example
+ * ```ts
+ * import { parseConstValue } from 'graphql/language';
+ *
+ * const value = parseConstValue('{ enabled: true }');
+ *
+ * value.kind; // => 'ObjectValue'
+ * parseConstValue('$variable'); // throws an error
+ * ```
+ */
+export declare function parseConstValue(source: string | Source, options?: ParseOptions): ConstValueNode;
+/**
+ * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for
+ * that type.
+ * Throws GraphQLError if a syntax error is encountered.
+ *
+ * This is useful within tools that operate upon GraphQL Types directly and
+ * in isolation of complete GraphQL documents.
+ *
+ * Consider providing the results to the utility function: typeFromAST().
+ * @param source - A GraphQL source string or source object containing a type reference.
+ * @param options - Optional parser configuration.
+ * @returns The parsed GraphQL type AST.
+ * @example
+ * ```ts
+ * import { parseType } from 'graphql/language';
+ *
+ * const type = parseType('[String!]');
+ *
+ * type.kind; // => 'ListType'
+ * ```
+ */
+export declare function parseType(source: string | Source, options?: ParseOptions): TypeNode;
+/**
+ * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`),
+ * parse the AST for that schema coordinate.
+ * Throws GraphQLError if a syntax error is encountered.
+ *
+ * Consider providing the results to the utility function:
+ * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly
+ * with an unparsed source.
+ * @param source - A GraphQL source string or source object containing a schema coordinate.
+ * @returns The parsed GraphQL schema coordinate AST.
+ * @example
+ * ```ts
+ * import { parseSchemaCoordinate } from 'graphql/language';
+ *
+ * const coordinate = parseSchemaCoordinate('Query.hero');
+ *
+ * coordinate.kind; // => 'MemberCoordinate'
+ * ```
+ */
+export declare function parseSchemaCoordinate(source: string | Source): SchemaCoordinateNode;
+/** The set of allowed kind values for AST nodes. */
+export type Kind = (typeof Kind)[keyof typeof Kind];
+/** A visitor defines the callbacks called during AST traversal. */
+export type ASTVisitor = EnterLeaveVisitor<ASTNode> | KindVisitor;
+type KindVisitor = {
+ readonly [NodeT in ASTNode as NodeT["kind"]]?: ASTVisitFn<NodeT> | EnterLeaveVisitor<NodeT>;
+};
+interface EnterLeaveVisitor<TVisitedNode extends ASTNode> {
+ readonly enter?: ASTVisitFn<TVisitedNode> | undefined;
+ readonly leave?: ASTVisitFn<TVisitedNode> | undefined;
+}
+/**
+ * A visitor is composed of visit functions called for each node during traversal.
+ * @typeParam TVisitedNode - AST node type handled by this visitor function.
+ */
+export type ASTVisitFn<TVisitedNode extends ASTNode> = (
+/** Current node being visited. */
+node: TVisitedNode,
+/** Index or key for this node within the parent node or array. */
+key: string | number | undefined,
+/** Parent immediately above this node, which may be an array. */
+parent: ASTNode | ReadonlyArray<ASTNode> | undefined,
+/** Key path from the root node to this node. */
+path: ReadonlyArray<string | number>,
+/**
+ * All nodes and arrays visited before reaching this node's parent.
+ * These correspond to array indices in `path`.
+ * Note: ancestors includes arrays that contain the visited node's parent.
+ */
+ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>) => any;
+type ASTReducer<R> = {
+ readonly [NodeT in ASTNode as NodeT["kind"]]?: {
+ readonly enter?: ASTVisitFn<NodeT>;
+ readonly leave: ASTReducerFn<NodeT, R>;
+ };
+};
+type ASTReducerFn<TReducedNode extends ASTNode, R> = (
+/**
+ * Current node being visited.
+ * @internal
+ */
+node: {
+ [K in keyof TReducedNode]: ReducedField<TReducedNode[K], R>;
+},
+/**
+ * Index or key for this node within the parent node or array.
+ * @internal
+ */
+key: string | number | undefined,
+/**
+ * Parent immediately above this node, which may be an array.
+ * @internal
+ */
+parent: ASTNode | ReadonlyArray<ASTNode> | undefined,
+/**
+ * Key path from the root node to this node.
+ * @internal
+ */
+path: ReadonlyArray<string | number>,
+/**
+ * All nodes and arrays visited before reaching this node's parent.
+ * These correspond to array indices in `path`.
+ * Note: ancestors includes arrays that contain the visited node's parent.
+ * @internal
+ */
+ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>) => R;
+type ReducedField<T, R> = T extends ASTNode ? R : T extends ReadonlyArray<ASTNode> ? ReadonlyArray<R> : T;
+/** A visitor key map describes the traversable child properties for each node kind. */
+export type ASTVisitorKeyMap = {
+ [NodeT in ASTNode as NodeT["kind"]]?: ReadonlyArray<keyof NodeT>;
+};
+/** A value that can be returned from a visitor function to stop traversal. */
+export declare const BREAK: unknown;
+/**
+ * visit() will walk through an AST using a depth-first traversal, calling
+ * the visitor's enter function at each node in the traversal, and calling the
+ * leave function after visiting that node and all of its child nodes.
+ *
+ * By returning different values from the enter and leave functions, the
+ * behavior of the visitor can be altered, including skipping over a sub-tree of
+ * the AST (by returning false), editing the AST by returning a value or null
+ * to remove the value, or to stop the whole traversal by returning BREAK.
+ *
+ * When using visit() to edit an AST, the original AST will not be modified, and
+ * a new version of the AST with the changes applied will be returned from the
+ * visit function.
+ * @param root - The AST node at which to start traversal.
+ * @param visitor - The visitor or reducer functions to call while traversing.
+ * @param visitorKeys - Optional map of child keys to visit for each AST node kind.
+ * @returns The original AST, an edited AST, or a reduced value depending on the visitor.
+ * @typeParam N - The root AST node type returned when visiting without reducing.
+ * @example
+ * ```ts
+ * // Return values control traversal: undefined makes no change, false skips
+ * // a subtree, BREAK stops traversal, null removes a node, and any other
+ * // value replaces the current node.
+ * import { Kind, parse, print, visit } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * const editedAST = visit(document, {
+ * Field: (node) => {
+ * if (node.name.value === 'hero') {
+ * return {
+ * ...node,
+ * name: { kind: Kind.NAME, value: 'human' },
+ * };
+ * }
+ * },
+ * });
+ *
+ * print(editedAST); // => '{\n human {\n name\n }\n}'
+ * ```
+ * @example
+ * ```ts
+ * // A named visitor function runs when entering nodes of that kind.
+ * import { parse, visit } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * const fieldNames = [];
+ *
+ * visit(document, {
+ * Field: (node) => {
+ * fieldNames.push(node.name.value);
+ * },
+ * });
+ *
+ * fieldNames; // => ['hero', 'name']
+ * ```
+ * @example
+ * ```ts
+ * // A named visitor object can provide separate enter and leave handlers for
+ * // nodes of that kind.
+ * import { parse, visit } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * const events = [];
+ *
+ * visit(document, {
+ * Field: {
+ * enter: (node) => {
+ * events.push(`enter:${node.name.value}`);
+ * },
+ * leave: (node) => {
+ * events.push(`leave:${node.name.value}`);
+ * },
+ * },
+ * });
+ *
+ * events; // => ['enter:hero', 'enter:name', 'leave:name', 'leave:hero']
+ * ```
+ * @example
+ * ```ts
+ * // Generic enter and leave handlers run for every node.
+ * import { parse, visit } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * let enterCount = 0;
+ * let leaveCount = 0;
+ *
+ * visit(document, {
+ * enter: (node) => {
+ * enterCount += 1;
+ * },
+ * leave: (node) => {
+ * leaveCount += 1;
+ * },
+ * });
+ *
+ * enterCount; // => leaveCount
+ * enterCount > 0; // => true
+ * ```
+ */
+export declare function visit<N extends ASTNode>(root: N, visitor: ASTVisitor, visitorKeys?: ASTVisitorKeyMap): N;
+/**
+ * Traverses an AST with reducer callbacks and returns the reduced value.
+ * @param root - The AST node where traversal starts.
+ * @param visitor - Reducer callbacks to invoke during traversal.
+ * @param visitorKeys - Optional mapping of child keys for each AST node kind.
+ * @returns The value produced by the reducer visitor.
+ * @typeParam R - The value produced by reducer visitor callbacks.
+ * @example
+ * ```ts
+ * // A reducer visitor returns values from leave handlers to build a reduced
+ * // result instead of returning an edited AST.
+ * import { parse, visit } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * const printed = visit(document, {
+ * Name: {
+ * leave: (node) => {
+ * return node.value;
+ * },
+ * },
+ * Field: {
+ * leave: (node) => {
+ * return node.selectionSet == null
+ * ? node.name
+ * : `${node.name} { ${node.selectionSet} }`;
+ * },
+ * },
+ * SelectionSet: {
+ * leave: (node) => {
+ * return node.selections.join(' ');
+ * },
+ * },
+ * OperationDefinition: {
+ * leave: (node) => {
+ * return node.selectionSet;
+ * },
+ * },
+ * Document: {
+ * leave: (node) => {
+ * return node.definitions.join('\n');
+ * },
+ * },
+ * });
+ *
+ * printed; // => 'hero { name }'
+ * ```
+ */
+export declare function visit<R>(root: ASTNode, visitor: ASTReducer<R>, visitorKeys?: ASTVisitorKeyMap): R;
+/**
+ * Creates a new visitor instance which delegates to many visitors to run in
+ * parallel. Each visitor will be visited for each node before moving on.
+ *
+ * If a prior visitor edits a node, no following visitors will see that node.
+ * @param visitors - The visitors to merge into one parallel visitor.
+ * @returns A visitor that delegates traversal to each provided visitor.
+ * @example
+ * ```ts
+ * import { parse, visit, visitInParallel } from 'graphql/language';
+ *
+ * const document = parse('{ hero { name } }');
+ * const events = [];
+ *
+ * visit(
+ * document,
+ * visitInParallel([
+ * {
+ * Field: (node) => {
+ * events.push(`field:${node.name.value}`);
+ * },
+ * },
+ * {
+ * Name: (node) => {
+ * events.push(`name:${node.value}`);
+ * },
+ * },
+ * ]),
+ * );
+ *
+ * events; // => ['field:hero', 'name:hero', 'field:name', 'name:name']
+ * ```
+ */
+export declare function visitInParallel(visitors: ReadonlyArray<ASTVisitor>): ASTVisitor;
+/**
+ * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.
+ * @param visitor - The visitor object to inspect.
+ * @param kind - The AST node kind to resolve handlers for.
+ * @returns The enter and leave handlers that apply for the given node kind.
+ * @example
+ * ```ts
+ * import { Kind, getEnterLeaveForKind } from 'graphql/language';
+ *
+ * const handlers = getEnterLeaveForKind({ Field: () => {} }, Kind.FIELD);
+ *
+ * typeof handlers.enter; // => 'function'
+ * handlers.leave; // => undefined
+ * ```
+ */
+export declare function getEnterLeaveForKind(visitor: ASTVisitor, kind: Kind): EnterLeaveVisitor<ASTNode>;
+interface FragmentSignature {
+ readonly definition: FragmentDefinitionNode;
+ readonly variableDefinitions: Map<string, VariableDefinitionNode>;
+}
+/**
+ * TypeInfo is a utility class which, given a GraphQL schema, can keep track
+ * of the current field and type definitions at any point in a GraphQL document
+ * AST during a recursive descent by calling `enter(node)` and `leave(node)`.
+ */
+export declare class TypeInfo {
+ private _schema;
+ private _typeStack;
+ private _parentTypeStack;
+ private _inputTypeStack;
+ private _fieldDefStack;
+ private _defaultValueStack;
+ private _directive;
+ private _argument;
+ private _enumValue;
+ private _fragmentSignaturesByName;
+ private _fragmentSignature;
+ private _fragmentArgument;
+ /**
+ * Creates a TypeInfo instance.
+ * @param schema - Schema used for type lookups.
+ * @param initialType - Optional type to use at the start of traversal.
+ * @param fragmentSignatures - Fragment signatures available during traversal.
+ * @example
+ * ```ts
+ * // Track field types during a visitWithTypeInfo traversal.
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const seenTypes = [];
+ *
+ * visit(
+ * parse('{ greeting }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Field: () => {
+ * seenTypes.push(String(typeInfo.getType()));
+ * },
+ * }),
+ * );
+ *
+ * seenTypes; // => ['String']
+ * ```
+ * @example
+ * ```ts
+ * // This variant starts from an initial type and supplies fragment signatures.
+ * import { Kind, parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String): String
+ * }
+ * `);
+ * const fragmentDocument = parse(
+ * 'fragment GreetingFields($name: String) on Query { greeting(name: $name) }',
+ * { experimentalFragmentArguments: true },
+ * );
+ * const fragmentDefinition = fragmentDocument.definitions[0];
+ * const variableDefinition = fragmentDefinition.variableDefinitions[0];
+ * const typeInfo = new TypeInfo(schema, schema.getQueryType(), (name) =>
+ * name === 'GreetingFields'
+ * ? {
+ * definition: fragmentDefinition,
+ * variableDefinitions: new Map([['name', variableDefinition]]),
+ * }
+ * : undefined,
+ * );
+ *
+ * typeInfo.enter({
+ * kind: Kind.SELECTION_SET,
+ * selections: [],
+ * });
+ * typeInfo.enter({
+ * kind: Kind.FRAGMENT_SPREAD,
+ * name: { kind: Kind.NAME, value: 'GreetingFields' },
+ * arguments: [],
+ * directives: [],
+ * });
+ *
+ * String(typeInfo.getParentType()); // => 'Query'
+ * typeInfo.getFragmentSignature()?.definition.name.value; // => 'GreetingFields'
+ * ```
+ */
+ constructor(schema: GraphQLSchema,
+ /**
+ * Initial type may be provided in rare cases to facilitate traversals
+ * beginning somewhere other than documents.
+ */
+ initialType?: Maybe<GraphQLType>, fragmentSignatures?: Maybe<(fragmentName: string) => Maybe<FragmentSignature>>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns the current output type at this point in traversal.
+ * @returns The current output type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * viewer: User
+ * }
+ *
+ * type User {
+ * name: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const fieldTypes = {};
+ *
+ * visit(
+ * parse('{ viewer { name } }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Field: (node) => {
+ * fieldTypes[node.name.value] = String(typeInfo.getType());
+ * },
+ * }),
+ * );
+ *
+ * fieldTypes; // => { viewer: 'User', name: 'String' }
+ * ```
+ */
+ getType(): Maybe<GraphQLOutputType>;
+ /**
+ * Returns the current parent composite type.
+ * @returns The current parent composite type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * viewer: User
+ * }
+ *
+ * type User {
+ * name: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const parentTypes = {};
+ *
+ * visit(
+ * parse('{ viewer { name } }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Field: (node) => {
+ * parentTypes[node.name.value] = String(typeInfo.getParentType());
+ * },
+ * }),
+ * );
+ *
+ * parentTypes; // => { viewer: 'Query', name: 'User' }
+ * ```
+ */
+ getParentType(): Maybe<GraphQLCompositeType>;
+ /**
+ * Returns the current input type at this point in traversal.
+ * @returns The current input type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(stars: Int!, sort: Sort = NEWEST): [String]
+ * }
+ *
+ * enum Sort {
+ * NEWEST
+ * OLDEST
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const inputTypes = {};
+ *
+ * visit(
+ * parse('{ reviews(stars: 5, sort: OLDEST) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Argument: (node) => {
+ * inputTypes[node.name.value] = String(typeInfo.getInputType());
+ * },
+ * }),
+ * );
+ *
+ * inputTypes; // => { stars: 'Int!', sort: 'Sort' }
+ * ```
+ */
+ getInputType(): Maybe<GraphQLInputType>;
+ /**
+ * Returns the parent input type for the current input position.
+ * @returns The parent input type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * input ReviewFilter {
+ * stars: Int!
+ * }
+ *
+ * type Query {
+ * reviews(filter: ReviewFilter): [String]
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const parentInputTypes = {};
+ *
+ * visit(
+ * parse('{ reviews(filter: { stars: 5 }) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * ObjectField: (node) => {
+ * parentInputTypes[node.name.value] = String(typeInfo.getParentInputType());
+ * },
+ * }),
+ * );
+ *
+ * parentInputTypes; // => { stars: 'ReviewFilter' }
+ * ```
+ */
+ getParentInputType(): Maybe<GraphQLInputType>;
+ /**
+ * Returns the current field definition.
+ * @returns The current field definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * let fieldName;
+ *
+ * visit(
+ * parse('{ greeting }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Field: () => {
+ * fieldName = typeInfo.getFieldDef()?.name;
+ * },
+ * }),
+ * );
+ *
+ * fieldName; // => 'greeting'
+ * ```
+ */
+ getFieldDef(): Maybe<GraphQLField<unknown, unknown>>;
+ /**
+ * Returns the default input representation for the current input position.
+ * @returns The current default input, if one is available.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(limit: Int = 10): [String]
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * let defaultLimit;
+ *
+ * visit(
+ * parse('{ reviews(limit: 5) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Argument: () => {
+ * defaultLimit = typeInfo.getDefaultValue();
+ * },
+ * }),
+ * );
+ *
+ * defaultLimit; // => { literal: { kind: 'IntValue', value: '10' } }
+ * ```
+ */
+ getDefaultValue(): unknown;
+ /**
+ * Returns the current directive definition.
+ * @returns The current directive definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * let directiveName;
+ *
+ * visit(
+ * parse('{ greeting @include(if: true) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Directive: () => {
+ * directiveName = typeInfo.getDirective()?.name;
+ * },
+ * }),
+ * );
+ *
+ * directiveName; // => 'include'
+ * ```
+ */
+ getDirective(): Maybe<GraphQLDirective>;
+ /**
+ * Returns the current argument definition.
+ * @returns The current argument definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(limit: Int = 10): [String]
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * let argumentName;
+ *
+ * visit(
+ * parse('{ reviews(limit: 5) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Argument: () => {
+ * argumentName = typeInfo.getArgument()?.name;
+ * },
+ * }),
+ * );
+ *
+ * argumentName; // => 'limit'
+ * ```
+ */
+ getArgument(): Maybe<GraphQLArgument>;
+ /**
+ * Returns the current fragment signature.
+ * @returns The fragment signature for the current fragment definition.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse(
+ * `
+ * {
+ * ...GreetingFields
+ * }
+ *
+ * fragment GreetingFields on Query {
+ * greeting
+ * }
+ * `,
+ * { experimentalFragmentArguments: true },
+ * );
+ * const typeInfo = new TypeInfo(schema);
+ * let fragmentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * FragmentSpread: () => {
+ * fragmentName = typeInfo.getFragmentSignature()?.definition.name.value;
+ * },
+ * }),
+ * );
+ *
+ * fragmentName; // => 'GreetingFields'
+ * ```
+ */
+ getFragmentSignature(): Maybe<FragmentSignature>;
+ /**
+ * Returns the function used to look up fragment signatures by name.
+ * @returns A function that maps fragment names to fragment signatures.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse(
+ * `
+ * {
+ * ...GreetingFields
+ * }
+ *
+ * fragment GreetingFields on Query {
+ * greeting
+ * }
+ * `,
+ * { experimentalFragmentArguments: true },
+ * );
+ * const typeInfo = new TypeInfo(schema);
+ * let fragmentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Document: () => {
+ * const getFragmentSignature = typeInfo.getFragmentSignatureByName();
+ * fragmentName =
+ * getFragmentSignature('GreetingFields')?.definition.name.value;
+ * },
+ * }),
+ * );
+ *
+ * fragmentName; // => 'GreetingFields'
+ * ```
+ */
+ getFragmentSignatureByName(): (fragmentName: string) => Maybe<FragmentSignature>;
+ /**
+ * Returns the current fragment argument definition.
+ * @returns The variable definition for the current fragment argument.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String): String
+ * }
+ * `);
+ * const document = parse(
+ * `
+ * {
+ * ...GreetingFields(name: "Ada")
+ * }
+ *
+ * fragment GreetingFields($name: String) on Query {
+ * greeting(name: $name)
+ * }
+ * `,
+ * { experimentalFragmentArguments: true },
+ * );
+ * const typeInfo = new TypeInfo(schema);
+ * let argumentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * FragmentArgument: () => {
+ * argumentName = typeInfo.getFragmentArgument()?.variable.name.value;
+ * },
+ * }),
+ * );
+ *
+ * argumentName; // => 'name'
+ * ```
+ */
+ getFragmentArgument(): Maybe<VariableDefinitionNode>;
+ /**
+ * Returns the current enum value definition.
+ * @returns The current enum value definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * enum Sort {
+ * NEWEST
+ * OLDEST
+ * }
+ *
+ * type Query {
+ * reviews(sort: Sort = NEWEST): [String]
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * let enumValueName;
+ *
+ * visit(
+ * parse('{ reviews(sort: OLDEST) }'),
+ * visitWithTypeInfo(typeInfo, {
+ * EnumValue: () => {
+ * enumValueName = typeInfo.getEnumValue()?.name;
+ * },
+ * }),
+ * );
+ *
+ * enumValueName; // => 'OLDEST'
+ * ```
+ */
+ getEnumValue(): Maybe<GraphQLEnumValue>;
+ /**
+ * Updates this TypeInfo instance for an entered AST node.
+ * @param node - AST node being entered.
+ * @returns Nothing.
+ * @example
+ * ```ts
+ * import { Kind, parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const operation = document.definitions[0];
+ * const selectionSet = operation.selectionSet;
+ * const field = selectionSet.selections[0];
+ * const typeInfo = new TypeInfo(schema);
+ *
+ * typeInfo.enter(operation);
+ * typeInfo.enter(selectionSet);
+ * typeInfo.enter(field);
+ *
+ * field.kind; // => Kind.FIELD
+ * typeInfo.getParentType()?.name; // => 'Query'
+ * String(typeInfo.getType()); // => 'String'
+ * ```
+ */
+ enter(node: ASTNode): void;
+ /**
+ * Updates this TypeInfo instance for a left AST node.
+ * @param node - AST node being entered.
+ * @returns Nothing.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const operation = document.definitions[0];
+ * const selectionSet = operation.selectionSet;
+ * const field = selectionSet.selections[0];
+ * const typeInfo = new TypeInfo(schema);
+ *
+ * typeInfo.enter(operation);
+ * typeInfo.enter(selectionSet);
+ * typeInfo.enter(field);
+ * String(typeInfo.getType()); // => 'String'
+ *
+ * typeInfo.leave(field);
+ * typeInfo.getType(); // => undefined
+ * ```
+ */
+ leave(node: ASTNode): void;
+}
+/**
+ * Creates a new visitor instance which maintains a provided TypeInfo instance
+ * along with visiting visitor.
+ * @param typeInfo - TypeInfo instance to update during traversal.
+ * @param visitor - Visitor callbacks to wrap with TypeInfo updates.
+ * @returns A visitor that keeps TypeInfo in sync while delegating callbacks.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const typeInfo = new TypeInfo(schema);
+ * const fields = [];
+ *
+ * visit(
+ * parse('{ greeting }'),
+ * visitWithTypeInfo(typeInfo, {
+ * Field: (node) => {
+ * fields.push({
+ * name: node.name.value,
+ * parentType: String(typeInfo.getParentType()),
+ * type: String(typeInfo.getType()),
+ * });
+ * },
+ * }),
+ * );
+ *
+ * fields; // => [{ name: 'greeting', parentType: 'Query', type: 'String' }]
+ * ```
+ */
+export declare function visitWithTypeInfo(typeInfo: TypeInfo, visitor: ASTVisitor): ASTVisitor;
+type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
+interface VariableUsage {
+ readonly node: VariableNode;
+ readonly type: Maybe<GraphQLInputType>;
+ readonly parentType: Maybe<GraphQLInputType>;
+ readonly defaultValue: unknown;
+ readonly fragmentVariableDefinition: Maybe<VariableDefinitionNode>;
+}
+declare class ASTValidationContext {
+ private _ast;
+ private _onError;
+ private _fragments;
+ private _fragmentSpreads;
+ private _recursivelyReferencedFragments;
+ constructor(ast: DocumentNode, onError: (error: GraphQLError) => void);
+ get [Symbol.toStringTag](): string;
+ reportError(error: GraphQLError): void;
+ getDocument(): DocumentNode;
+ getFragment(name: string): Maybe<FragmentDefinitionNode>;
+ getFragmentSpreads(node: SelectionSetNode): ReadonlyArray<FragmentSpreadNode>;
+ getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray<FragmentDefinitionNode>;
+}
+declare class SDLValidationContext extends ASTValidationContext {
+ private _schema;
+ constructor(ast: DocumentNode, schema: Maybe<GraphQLSchema>, onError: (error: GraphQLError) => void);
+ get hideSuggestions(): boolean;
+ get [Symbol.toStringTag](): string;
+ getSchema(): Maybe<GraphQLSchema>;
+}
+/** Validation context passed to query validation rules. */
+export declare class ValidationContext extends ASTValidationContext {
+ private _schema;
+ private _typeInfo;
+ private _variableUsages;
+ private _recursiveVariableUsages;
+ private _hideSuggestions;
+ /**
+ * Creates a ValidationContext instance.
+ * @param schema - Schema used to validate the document.
+ * @param ast - Document AST being validated.
+ * @param typeInfo - TypeInfo instance used to track traversal state.
+ * @param onError - Callback invoked for each validation error.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { GraphQLError } from 'graphql/error';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const errors = [];
+ * const context = new ValidationContext(
+ * schema,
+ * document,
+ * new TypeInfo(schema),
+ * (error) => errors.push(error),
+ * );
+ *
+ * context.reportError(new GraphQLError('Example validation error.'));
+ *
+ * context.getSchema(); // => schema
+ * errors[0].message; // => 'Example validation error.'
+ * ```
+ */
+ constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo, onError: (error: GraphQLError) => void, hideSuggestions?: Maybe<boolean>);
+ /**
+ * Returns the value used by `Object.prototype.toString`.
+ * @returns The built-in string tag for this object.
+ */
+ get [Symbol.toStringTag](): string;
+ /**
+ * Returns whether validation error suggestions are hidden.
+ * @returns True when suggestion text should be omitted from errors.
+ */
+ get hideSuggestions(): boolean;
+ /**
+ * Returns the schema being used by this validation context.
+ * @returns The schema being validated against.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const context = new ValidationContext(
+ * schema,
+ * parse('{ greeting }'),
+ * new TypeInfo(schema),
+ * () => {},
+ * );
+ *
+ * context.getSchema().getQueryType()?.name; // => 'Query'
+ * ```
+ */
+ getSchema(): GraphQLSchema;
+ /**
+ * Returns variable usages found directly within this node.
+ * @param node - The AST node to inspect or visit.
+ * @returns Variable usages found directly within this node.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String): String
+ * }
+ * `);
+ * const document = parse('query ($name: String) { greeting(name: $name) }');
+ * const operation = document.definitions[0];
+ * const context = new ValidationContext(
+ * schema,
+ * document,
+ * new TypeInfo(schema),
+ * () => {},
+ * );
+ *
+ * const usages = context.getVariableUsages(operation);
+ *
+ * usages[0].node.name.value; // => 'name'
+ * String(usages[0].type); // => 'String'
+ * ```
+ */
+ getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray<VariableUsage>;
+ /**
+ * Returns variable usages for an operation, including variables used by referenced fragments.
+ * @param operation - Operation definition to inspect.
+ * @returns Variable usages reachable from the operation.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, TypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * viewer: User
+ * }
+ *
+ * type User {
+ * name(prefix: String): String
+ * }
+ * `);
+ * const document = parse(`
+ * query ($prefix: String) {
+ * viewer {
+ * ...UserName
+ * }
+ * }
+ *
+ * fragment UserName on User {
+ * name(prefix: $prefix)
+ * }
+ * `);
+ * const operation = document.definitions[0];
+ * const context = new ValidationContext(
+ * schema,
+ * document,
+ * new TypeInfo(schema),
+ * () => {},
+ * );
+ *
+ * const usages = context.getRecursiveVariableUsages(operation);
+ *
+ * usages.map((usage) => usage.node.name.value); // => ['prefix']
+ * ```
+ */
+ getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray<VariableUsage>;
+ /**
+ * Returns the current output type at this point in traversal.
+ * @returns The current output type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let typeName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Field: () => {
+ * typeName = String(context.getType());
+ * },
+ * }),
+ * );
+ *
+ * typeName; // => 'String'
+ * ```
+ */
+ getType(): Maybe<GraphQLOutputType>;
+ /**
+ * Returns the current parent composite type.
+ * @returns The current parent composite type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let parentTypeName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Field: () => {
+ * parentTypeName = context.getParentType()?.name;
+ * },
+ * }),
+ * );
+ *
+ * parentTypeName; // => 'Query'
+ * ```
+ */
+ getParentType(): Maybe<GraphQLCompositeType>;
+ /**
+ * Returns the current input type at this point in traversal.
+ * @returns The current input type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(limit: Int): [String]
+ * }
+ * `);
+ * const document = parse('{ reviews(limit: 5) }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let inputTypeName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Argument: () => {
+ * inputTypeName = String(context.getInputType());
+ * },
+ * }),
+ * );
+ *
+ * inputTypeName; // => 'Int'
+ * ```
+ */
+ getInputType(): Maybe<GraphQLInputType>;
+ /**
+ * Returns the parent input type for the current input position.
+ * @returns The parent input type, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * input ReviewFilter {
+ * stars: Int
+ * }
+ *
+ * type Query {
+ * reviews(filter: ReviewFilter): [String]
+ * }
+ * `);
+ * const document = parse('{ reviews(filter: { stars: 5 }) }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let parentInputTypeName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * ObjectField: () => {
+ * parentInputTypeName = String(context.getParentInputType());
+ * },
+ * }),
+ * );
+ *
+ * parentInputTypeName; // => 'ReviewFilter'
+ * ```
+ */
+ getParentInputType(): Maybe<GraphQLInputType>;
+ /**
+ * Returns the current field definition.
+ * @returns The current field definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let fieldName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Field: () => {
+ * fieldName = context.getFieldDef()?.name;
+ * },
+ * }),
+ * );
+ *
+ * fieldName; // => 'greeting'
+ * ```
+ */
+ getFieldDef(): Maybe<GraphQLField<unknown, unknown>>;
+ /**
+ * Returns the current directive definition.
+ * @returns The current directive definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ greeting @include(if: true) }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let directiveName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Directive: () => {
+ * directiveName = context.getDirective()?.name;
+ * },
+ * }),
+ * );
+ *
+ * directiveName; // => 'include'
+ * ```
+ */
+ getDirective(): Maybe<GraphQLDirective>;
+ /**
+ * Returns the current argument definition.
+ * @returns The current argument definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * reviews(limit: Int): [String]
+ * }
+ * `);
+ * const document = parse('{ reviews(limit: 5) }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let argumentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Argument: () => {
+ * argumentName = context.getArgument()?.name;
+ * },
+ * }),
+ * );
+ *
+ * argumentName; // => 'limit'
+ * ```
+ */
+ getArgument(): Maybe<GraphQLArgument>;
+ /**
+ * Returns the fragment signature at the current traversal position.
+ * @returns The current fragment signature, if one is active.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse(
+ * `
+ * {
+ * ...GreetingFields
+ * }
+ *
+ * fragment GreetingFields on Query {
+ * greeting
+ * }
+ * `,
+ * { experimentalFragmentArguments: true },
+ * );
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let fragmentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * FragmentSpread: () => {
+ * fragmentName = context.getFragmentSignature()?.definition.name.value;
+ * },
+ * }),
+ * );
+ *
+ * fragmentName; // => 'GreetingFields'
+ * ```
+ */
+ getFragmentSignature(): Maybe<FragmentSignature>;
+ /**
+ * Returns the function used to look up fragment signatures by name.
+ * @returns A function that maps fragment names to fragment signatures.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse(
+ * `
+ * {
+ * ...GreetingFields
+ * }
+ *
+ * fragment GreetingFields on Query {
+ * greeting
+ * }
+ * `,
+ * { experimentalFragmentArguments: true },
+ * );
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let fragmentName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * Document: () => {
+ * const getFragmentSignature = context.getFragmentSignatureByName();
+ * fragmentName =
+ * getFragmentSignature('GreetingFields')?.definition.name.value;
+ * },
+ * }),
+ * );
+ *
+ * fragmentName; // => 'GreetingFields'
+ * ```
+ */
+ getFragmentSignatureByName(): (fragmentName: string) => Maybe<FragmentSignature>;
+ /**
+ * Returns the current enum value definition.
+ * @returns The current enum value definition, if known.
+ * @example
+ * ```ts
+ * import { parse, visit } from 'graphql/language';
+ * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';
+ * import { ValidationContext } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * enum Sort {
+ * NEWEST
+ * OLDEST
+ * }
+ *
+ * type Query {
+ * reviews(sort: Sort): [String]
+ * }
+ * `);
+ * const document = parse('{ reviews(sort: OLDEST) }');
+ * const typeInfo = new TypeInfo(schema);
+ * const context = new ValidationContext(schema, document, typeInfo, () => {});
+ * let enumValueName;
+ *
+ * visit(
+ * document,
+ * visitWithTypeInfo(typeInfo, {
+ * EnumValue: () => {
+ * enumValueName = context.getEnumValue()?.name;
+ * },
+ * }),
+ * );
+ *
+ * enumValueName; // => 'OLDEST'
+ * ```
+ */
+ getEnumValue(): Maybe<GraphQLEnumValue>;
+}
+/** A function that creates an AST visitor for validating a GraphQL document. */
+export type ValidationRule = (context: ValidationContext) => ASTVisitor;
+/**
+ * Options used when validating a GraphQL document.
+ * @category Validation
+ */
+export interface ValidationOptions {
+ /** Maximum number of validation errors before validation stops. */
+ maxErrors?: number;
+ /** Whether suggestion text should be omitted from validation errors. */
+ hideSuggestions?: Maybe<boolean>;
+}
+/**
+ * Implements the "Validation" section of the spec.
+ *
+ * Validation runs synchronously, returning an array of encountered errors, or
+ * an empty array if no errors were encountered and the document is valid.
+ *
+ * A list of specific validation rules may be provided. If not provided, the
+ * default list of rules defined by the GraphQL specification will be used.
+ *
+ * Each validation rule is a function that returns a visitor
+ * (see the language/visitor API). Visitor methods are expected to return
+ * GraphQLErrors, or Arrays of GraphQLErrors when invalid.
+ *
+ * Validate will stop validation after a `maxErrors` limit has been reached.
+ * Attackers can send pathologically invalid queries to induce a DoS attack,
+ * so `maxErrors` defaults to 100 errors.
+ * @param schema - Schema to validate against.
+ * @param documentAST - Document AST to validate.
+ * @param rules - Validation rules to apply.
+ * @param options - Validation options, including error limits and suggestions.
+ * @returns Validation errors, or an empty array when the document is valid.
+ * @example
+ * ```ts
+ * // Validate with the default specified rules.
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validate } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * fullName: String
+ * }
+ * `);
+ *
+ * validate(schema, parse('{ greeting }')); // => []
+ *
+ * const errors = validate(schema, parse('{ missing }'));
+ * errors[0].message; // => 'Cannot query field "missing" on type "Query".'
+ * ```
+ * @example
+ * ```ts
+ * // This variant uses a custom rule list and validation options.
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { FieldsOnCorrectTypeRule, validate } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const document = parse('{ missingOne missingTwo }');
+ *
+ * const errors = validate(schema, document, [FieldsOnCorrectTypeRule], {
+ * maxErrors: 1,
+ * });
+ *
+ * errors.length; // => 2
+ * errors[1].message; // => 'Too many validation errors, error limit reached. Validation aborted.'
+ *
+ * const hiddenSuggestionErrors = validate(
+ * schema,
+ * parse('{ name }'),
+ * [FieldsOnCorrectTypeRule],
+ * { hideSuggestions: true },
+ * );
+ *
+ * hiddenSuggestionErrors[0].message; // => 'Cannot query field "name" on type "Query".'
+ * ```
+ */
+export declare function validate(schema: GraphQLSchema, documentAST: DocumentNode, rules?: ReadonlyArray<ValidationRule>, options?: ValidationOptions): ReadonlyArray<GraphQLError>;
+/** Function used to execute a validated root selection set for a subscription event. */
+export type RootSelectionSetExecutor = (validatedExecutionArgs: ValidatedSubscriptionArgs) => PromiseOrValue<ExecutionResult>;
+/**
+ * Implements the "Executing requests" section of the GraphQL specification.
+ *
+ * Returns either a synchronous ExecutionResult (if all encountered resolvers
+ * are synchronous), or a Promise of an ExecutionResult that will eventually be
+ * resolved and never rejected.
+ *
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
+ * request errors, including missing operations and variable coercion errors,
+ * are returned in an errors-only ExecutionResult.
+ *
+ * Field errors are collected into the response instead of rejecting the
+ * returned promise. Only the field that produced the error and its descendants
+ * are omitted; sibling fields continue to execute. Errors from fields of
+ * non-null type may propagate to the nearest nullable parent, which can be the
+ * entire response data.
+ *
+ * This function does not support incremental delivery (`@defer` and `@stream`).
+ * Use `experimentalExecuteIncrementally` to execute operations with
+ * incremental delivery enabled.
+ * @param args - The arguments used to perform the operation.
+ * @returns A completed execution result, or a promise resolving to one when execution is asynchronous.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { execute } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String!): String
+ * }
+ * `);
+ *
+ * const result = await execute({
+ * schema,
+ * document: parse('query ($name: String!) { greeting(name: $name) }'),
+ * rootValue: {
+ * greeting: ({ name }) => `Hello, ${name}!`,
+ * },
+ * variableValues: { name: 'Ada' },
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello, Ada!' } }
+ * ```
+ */
+export declare function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult>;
+/**
+ * Implements the "Executing requests" section of the GraphQL specification,
+ * including `@defer` and `@stream` as proposed in
+ * https://github.com/graphql/graphql-spec/pull/742
+ *
+ * This function returns either a single ExecutionResult, or an
+ * ExperimentalIncrementalExecutionResults object containing an `initialResult`
+ * and a stream of `subsequentResults`.
+ *
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
+ * request errors, including missing operations and variable coercion errors,
+ * are returned in an errors-only ExecutionResult.
+ * @param args - Execution arguments for the GraphQL operation.
+ * @returns A single execution result or incremental execution results.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { experimentalExecuteIncrementally } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * const result = await experimentalExecuteIncrementally({
+ * schema,
+ * document: parse('{ greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ * @category Incremental Execution
+ */
+export declare function experimentalExecuteIncrementally(args: ExecutionArgs): PromiseOrValue<ExecutionResult | ExperimentalIncrementalExecutionResults>;
+/**
+ * Implements the "Executing operations" section of the spec.
+ *
+ * Returns either a synchronous ExecutionResult, or a Promise for an
+ * ExecutionResult, described by the "Response" section of the GraphQL
+ * specification.
+ *
+ * If errors are encountered while executing a GraphQL field, only that field
+ * and its descendants will be omitted, and sibling fields will still be
+ * executed. These field errors are collected into the returned result instead
+ * of being thrown or rejecting the returned promise.
+ *
+ * Errors from sub-fields of a NonNull type may propagate to the top level, at
+ * which point we still collect the error and null the parent field, which in
+ * this case is the entire response.
+ * @param validatedExecutionArgs - Validated execution arguments.
+ * @returns Execution result for the operation root selection set.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * executeRootSelectionSet,
+ * validateExecutionArgs,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ * const validatedArgs = validateExecutionArgs({
+ * schema,
+ * document: parse('{ greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const result = await executeRootSelectionSet(validatedArgs);
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ */
+export declare function executeRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue<ExecutionResult>;
+/**
+ * Executes the operation root selection set with incremental delivery enabled.
+ * @param validatedExecutionArgs - Validated execution arguments.
+ * @returns A single execution result or incremental execution results.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * experimentalExecuteRootSelectionSet,
+ * validateExecutionArgs,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ * const validatedArgs = validateExecutionArgs({
+ * schema,
+ * document: parse('{ greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const result = await experimentalExecuteRootSelectionSet(validatedArgs);
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ * @category Incremental Execution
+ */
+export declare function experimentalExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue<ExecutionResult | ExperimentalIncrementalExecutionResults>;
+/**
+ * Also implements the "Executing requests" section of the GraphQL specification.
+ * However, it guarantees to complete synchronously (or throw an error) assuming
+ * that all field resolvers are also synchronous.
+ * @param args - The arguments used to perform the operation.
+ * @returns Completed execution output for a synchronous operation.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { executeSync } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ *
+ * const result = executeSync({
+ * schema,
+ * document: parse('{ greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ */
+export declare function executeSync(args: ExecutionArgs): ExecutionResult;
+/**
+ * Executes a subscription operation once for a single source event.
+ *
+ * Field errors are collected into the returned result instead of being thrown
+ * or rejecting the returned promise.
+ * @param validatedExecutionArgs - Validated subscription execution arguments.
+ * @returns Execution result for the subscription event.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * executeSubscriptionEvent,
+ * validateSubscriptionArgs,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting: String
+ * }
+ * `);
+ * const validatedArgs = validateSubscriptionArgs({
+ * schema,
+ * document: parse('subscription { greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const result = await executeSubscriptionEvent(validatedArgs);
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ */
+export declare function executeSubscriptionEvent(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue<ExecutionResult>;
+/**
+ * Implements the "Subscribe" algorithm described in the GraphQL specification.
+ *
+ * Returns either an AsyncGenerator (if successful), an ExecutionResult (error),
+ * or a Promise for one of those results. The call will throw immediately if
+ * the schema is invalid or the selected operation is not a subscription.
+ *
+ * GraphQL request errors, including missing operations and variable coercion
+ * errors, return or resolve to a GraphQL Response (ExecutionResult) with
+ * descriptive errors and no data.
+ *
+ * If the source stream could not be created due to faulty subscription resolver
+ * logic, a non-async-iterable resolver result, or a system error, the
+ * function will return or resolve to a single ExecutionResult containing
+ * `errors` and no `data`.
+ *
+ * If the operation succeeded, the function returns or resolves to an
+ * AsyncGenerator, which yields a stream of ExecutionResults representing the
+ * response stream.
+ *
+ * This function does not support incremental delivery (`@defer` and `@stream`).
+ * If an operation which would defer or stream data is executed with this
+ * function, a field error will be raised at the location of the `@defer` or
+ * `@stream` directive.
+ *
+ * Accepts an object with named arguments.
+ * @param args - Execution arguments for the subscription operation.
+ * @returns A response stream for a valid subscription, or an execution result containing errors.
+ * @example
+ * ```ts
+ * // Use a same-named rootValue function to provide the source event stream.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { subscribe } from 'graphql/execution';
+ *
+ * async function* greetings() {
+ * yield { greeting: 'Hello' };
+ * yield { greeting: 'Bonjour' };
+ * }
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting: String
+ * }
+ * `);
+ *
+ * const result = await subscribe({
+ * schema,
+ * document: parse('subscription { greeting }'),
+ * rootValue: { greeting: () => greetings() },
+ * });
+ *
+ * assert('next' in result);
+ *
+ * const firstPayload = await result.next();
+ * firstPayload.value; // => { data: { greeting: 'Hello' } }
+ * ```
+ * @example
+ * ```ts
+ * // This variant supplies events through a custom subscribeFieldResolver.
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { subscribe } from 'graphql/execution';
+ *
+ * async function* defaultGreetings() {
+ * yield { greeting: 'Hello' };
+ * }
+ *
+ * async function* frenchGreetings() {
+ * yield { greeting: 'Bonjour' };
+ * }
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting(locale: String): String
+ * }
+ * `);
+ *
+ * const result = await subscribe({
+ * schema,
+ * document: parse(
+ * 'subscription Greeting($locale: String) { greeting(locale: $locale) }',
+ * ),
+ * rootValue: {
+ * greeting: (args, contextValue) => {
+ * const locale = args.locale ?? contextValue.defaultLocale;
+ * return locale === 'fr' ? frenchGreetings() : defaultGreetings();
+ * },
+ * },
+ * contextValue: { defaultLocale: 'fr' },
+ * variableValues: { locale: 'fr' },
+ * operationName: 'Greeting',
+ * subscribeFieldResolver: (rootValue, args, contextValue, info) => {
+ * args.locale; // => 'fr'
+ * return rootValue[info.fieldName](args, contextValue);
+ * },
+ * });
+ *
+ * assert('next' in result);
+ *
+ * const firstPayload = await result.next();
+ * firstPayload.value; // => { data: { greeting: 'Bonjour' } }
+ * ```
+ */
+export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>;
+/**
+ * Implements the "CreateSourceEventStream" algorithm described in the
+ * GraphQL specification, resolving the subscription source event stream for a
+ * previously validated subscription request.
+ *
+ * Returns either an AsyncIterable (if successful), an ExecutionResult (error),
+ * or a Promise for one of those results. The call will throw immediately if
+ * it is not passed validated execution arguments.
+ *
+ * If the validated arguments do not result in a compliant subscription, a
+ * GraphQL Response (ExecutionResult) with descriptive errors and no data will
+ * be returned.
+ *
+ * If the source stream could not be created due to faulty subscription
+ * resolver logic or a system error, the function will return or
+ * resolve to a single ExecutionResult containing `errors` and no `data`.
+ *
+ * If the operation succeeded, the function returns or resolves to the
+ * AsyncIterable for the event stream returned by the resolver.
+ *
+ * A Source Event Stream represents a sequence of events, each of which triggers
+ * a GraphQL execution for that event.
+ *
+ * This may be useful when hosting the stateful subscription service in a
+ * different process or machine than the stateless GraphQL execution engine,
+ * or otherwise separating these two steps. For more on this, see the
+ * "Supporting Subscriptions at Scale" information in the GraphQL specification.
+ * @param validatedExecutionArgs - Validated subscription execution arguments.
+ * @returns A source event stream, or an execution result containing errors.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * createSourceEventStream,
+ * validateSubscriptionArgs,
+ * } from 'graphql/execution';
+ *
+ * async function* greetings() {
+ * yield { greeting: 'Hello' };
+ * }
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting: String
+ * }
+ * `);
+ * const validatedArgs = validateSubscriptionArgs({
+ * schema,
+ * document: parse('subscription { greeting }'),
+ * rootValue: { greeting: () => greetings() },
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const stream = await createSourceEventStream(validatedArgs);
+ * Symbol.asyncIterator in stream; // => true
+ * ```
+ */
+export declare function createSourceEventStream(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult>;
+/**
+ * Validates the arguments passed to execute, subscribe, and their lower-level
+ * helpers.
+ *
+ * Throws if the schema is invalid. GraphQL request errors, including variable
+ * coercion errors, are returned as a GraphQLError array.
+ * @param args - Execution arguments to validate.
+ * @returns Validated execution arguments, or validation errors.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validateExecutionArgs } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * interface Named {
+ * name: String!
+ * }
+ *
+ * type User implements Named {
+ * name: String!
+ * }
+ *
+ * type Query {
+ * viewer: Named
+ * }
+ * `);
+ * const abortController = new AbortController();
+ * const validatedArgs = validateExecutionArgs({
+ * schema,
+ * document: parse('query Viewer { viewer { __typename name } }'),
+ * rootValue: { viewer: { kind: 'user', name: 'Ada' } },
+ * contextValue: { locale: 'en' },
+ * operationName: 'Viewer',
+ * fieldResolver: (source, _args, contextValue, info) => {
+ * contextValue.locale; // => 'en'
+ * return source[info.fieldName];
+ * },
+ * typeResolver: (value) => {
+ * return value.kind === 'user' ? 'User' : undefined;
+ * },
+ * hideSuggestions: true,
+ * abortSignal: abortController.signal,
+ * enableEarlyExecution: true,
+ * hooks: {
+ * asyncWorkFinished: () => {},
+ * },
+ * options: { maxCoercionErrors: 1 },
+ * });
+ *
+ * assert('operation' in validatedArgs);
+ *
+ * validatedArgs.operation.name?.value; // => 'Viewer'
+ * validatedArgs.hideSuggestions; // => true
+ * ```
+ */
+export declare function validateExecutionArgs(args: ExecutionArgs): ReadonlyArray<GraphQLError> | ValidatedExecutionArgs;
+/**
+ * Validates execution arguments for a subscription operation.
+ *
+ * Throws if the schema is invalid or the selected operation is not a
+ * subscription. GraphQL request errors, including variable coercion errors, are
+ * returned as a GraphQLError array.
+ * @param args - Execution arguments to validate.
+ * @returns Validated subscription execution arguments, or validation errors.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validateSubscriptionArgs } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting: String
+ * }
+ * `);
+ * const validatedArgs = validateSubscriptionArgs({
+ * schema,
+ * document: parse('subscription { greeting }'),
+ * });
+ *
+ * assert('operation' in validatedArgs);
+ *
+ * validatedArgs.operation.operation; // => 'subscription'
+ * ```
+ */
+export declare function validateSubscriptionArgs(args: ExecutionArgs): ReadonlyArray<GraphQLError> | ValidatedSubscriptionArgs;
+/**
+ * If a resolveType function is not given, then a default resolve behavior is
+ * used which attempts two strategies:
+ *
+ * First, See if the provided value has a `__typename` field defined, if so, use
+ * that value as name of the resolved type.
+ *
+ * Otherwise, test each possible type for the abstract type by calling
+ * isTypeOf for the object being coerced, returning the first type that matches.
+ */
+export declare const defaultTypeResolver: GraphQLTypeResolver<unknown, unknown>;
+/**
+ * If a resolve function is not given, then a default resolve behavior is used
+ * which takes the property of the source object of the same name as the field
+ * and returns it as the result, or if it's a function, returns the result
+ * of calling that function while passing along args and context value.
+ */
+export declare const defaultFieldResolver: GraphQLFieldResolver<unknown, unknown>;
+/**
+ * Implements the "MapSourceToResponseEvent" algorithm described in the
+ * GraphQL specification, mapping each event from a subscription source event
+ * stream to an ExecutionResult in the response stream.
+ * @param validatedExecutionArgs - Validated subscription execution arguments.
+ * @param sourceEventStream - Source event stream returned by the subscription resolver.
+ * @param rootSelectionSetExecutor - Function used to execute each source event.
+ * @returns A response stream of execution results.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * mapSourceToResponseEvent,
+ * validateSubscriptionArgs,
+ * } from 'graphql/execution';
+ *
+ * async function* events() {
+ * yield { greeting: 'Hello' };
+ * }
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * noop: String
+ * }
+ *
+ * type Subscription {
+ * greeting: String
+ * }
+ * `);
+ * const validatedArgs = validateSubscriptionArgs({
+ * schema,
+ * document: parse('subscription { greeting }'),
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const responseStream = mapSourceToResponseEvent(validatedArgs, events());
+ * const firstPayload = await responseStream.next();
+ *
+ * firstPayload.value; // => { data: { greeting: 'Hello' } }
+ * ```
+ */
+export declare function mapSourceToResponseEvent(validatedExecutionArgs: ValidatedSubscriptionArgs, sourceEventStream: AsyncIterable<unknown>, rootSelectionSetExecutor?: RootSelectionSetExecutor): AsyncGenerator<ExecutionResult, void, void>;
+/** Function used by a GraphQL harness to parse GraphQL source text. */
+export type GraphQLParseFn = (...args: Parameters<typeof parse>) => PromiseOrValue<ReturnType<typeof parse>>;
+/** Function used by a GraphQL harness to validate a parsed document. */
+export type GraphQLValidateFn = (...args: Parameters<typeof validate>) => PromiseOrValue<ReturnType<typeof validate>>;
+/** Function used by a GraphQL harness to execute a valid operation. */
+export type GraphQLExecuteFn = (...args: Parameters<typeof execute>) => ReturnType<typeof execute>;
+/** Function used by a GraphQL harness to create a subscription response stream. */
+export type GraphQLSubscribeFn = (...args: Parameters<typeof subscribe>) => ReturnType<typeof subscribe>;
+/**
+ * Overrides for the parse, validate, execute, and subscribe stages used by the
+ * high-level `graphql` and `graphqlSync` request pipeline.
+ */
+export interface GraphQLHarness {
+ /** Parses GraphQL source text into a document AST. */
+ parse: GraphQLParseFn;
+ /** Validates a document AST against a schema. */
+ validate: GraphQLValidateFn;
+ /** Executes a valid operation. */
+ execute: GraphQLExecuteFn;
+ /** Creates a response stream for a subscription operation. */
+ subscribe: GraphQLSubscribeFn;
+}
+/**
+ * Default harness backed by GraphQL.js parse, validate, execute, and subscribe
+ * implementations.
+ */
+export declare const defaultHarness: GraphQLHarness;
+/**
+ * Describes the input object accepted by `graphql` and `graphqlSync`.
+ *
+ * These arguments describe the full parse, validate, and execute lifecycle for
+ * a GraphQL request. They include parser options, validation options, execution
+ * options, and an optional harness for replacing pipeline stages.
+ *
+ * `graphql` and `graphqlSync` do not support incremental delivery (`@defer` and
+ * `@stream`); use `experimentalExecuteIncrementally` after parsing and
+ * validating when incremental delivery is required.
+ */
+export interface GraphQLArgs extends ParseOptions, ValidationOptions, Omit<ExecutionArgs, "document"> {
+ /**
+ * Custom parse, validate, execute, and subscribe functions for this request
+ * pipeline.
+ */
+ harness?: GraphQLHarness | undefined;
+ /**
+ * A GraphQL language-formatted string or source object representing the
+ * requested operation.
+ */
+ source: string | Source;
+ /** Validation rules to use instead of the specified rules. */
+ rules?: ReadonlyArray<ValidationRule> | undefined;
+}
+/**
+ * Parses, validates, and executes a GraphQL document against a schema.
+ *
+ * This is the primary entry point for fulfilling GraphQL operations. Use this
+ * when you want a single-call request lifecycle that returns a promise in all
+ * cases.
+ *
+ * More sophisticated GraphQL servers, such as those which persist queries, may
+ * wish to separate the validation and execution phases to a static-time tooling
+ * step and a server runtime step.
+ * @param args - Request execution arguments, including schema and source.
+ * @returns A promise that resolves to an execution result or validation errors.
+ * @example
+ * ```ts
+ * // Execute a complete asynchronous request with variables.
+ * import { graphql, buildSchema } from 'graphql';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String!): String
+ * }
+ * `);
+ *
+ * const result = await graphql({
+ * schema,
+ * source: 'query SayHello($name: String!) { greeting(name: $name) }',
+ * rootValue: {
+ * greeting: ({ name }) => `Hello, ${name}!`,
+ * },
+ * variableValues: { name: 'Ada' },
+ * operationName: 'SayHello',
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello, Ada!' } }
+ * ```
+ * @example
+ * ```ts
+ * // This variant supplies context plus custom field and type resolvers.
+ * import { graphql, buildSchema } from 'graphql';
+ *
+ * const schema = buildSchema(`
+ * interface Named {
+ * name: String!
+ * }
+ *
+ * type User implements Named {
+ * name: String!
+ * }
+ *
+ * type Query {
+ * viewer: Named
+ * }
+ * `);
+ *
+ * const result = await graphql({
+ * schema,
+ * source: '{ viewer { __typename name } }',
+ * rootValue: { viewer: { kind: 'user', name: 'Ada' } },
+ * contextValue: { locale: 'en' },
+ * fieldResolver: (source, _args, context, info) => {
+ * context.locale; // => 'en'
+ * return source[info.fieldName];
+ * },
+ * typeResolver: (value) => {
+ * return value.kind === 'user' ? 'User' : undefined;
+ * },
+ * });
+ *
+ * result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
+ * ```
+ * @example
+ * ```ts
+ * // This variant customizes the request pipeline with a harness.
+ * import { buildSchema, defaultHarness, graphql } from 'graphql';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const stages = [];
+ * const abortController = new AbortController();
+ * const harness = {
+ * parse: (...args) => {
+ * stages.push('parse');
+ * return defaultHarness.parse(...args);
+ * },
+ * validate: (...args) => {
+ * stages.push('validate');
+ * return defaultHarness.validate(...args);
+ * },
+ * execute: (...args) => {
+ * stages.push('execute');
+ * return defaultHarness.execute(...args);
+ * },
+ * subscribe: (...args) => {
+ * stages.push('subscribe');
+ * return defaultHarness.subscribe(...args);
+ * },
+ * };
+ *
+ * const result = await graphql({
+ * schema,
+ * source: '{ greeting }',
+ * rootValue: { greeting: 'Hello' },
+ * rules: [],
+ * maxErrors: 25,
+ * hideSuggestions: true,
+ * noLocation: true,
+ * abortSignal: abortController.signal,
+ * harness,
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello' } }
+ * stages; // => ['parse', 'validate', 'execute']
+ * ```
+ * @category Request Pipeline
+ */
+export declare function graphql(args: GraphQLArgs): Promise<ExecutionResult>;
+/**
+ * Parses, validates, and executes a GraphQL document synchronously.
+ *
+ * This function guarantees that execution completes synchronously, or throws an
+ * error, assuming that all field resolvers are also synchronous. It throws when
+ * any resolver returns a promise.
+ * @param args - Request execution arguments, including schema and source.
+ * @returns Completed execution output, or request errors if parsing or
+ * validation fails.
+ * @example
+ * ```ts
+ * // Execute a complete synchronous request with variables.
+ * import { graphqlSync, buildSchema } from 'graphql';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String!): String
+ * }
+ * `);
+ *
+ * const result = graphqlSync({
+ * schema,
+ * source: 'query SayHello($name: String!) { greeting(name: $name) }',
+ * rootValue: {
+ * greeting: ({ name }) => `Hello, ${name}!`,
+ * },
+ * variableValues: { name: 'Ada' },
+ * operationName: 'SayHello',
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello, Ada!' } }
+ * ```
+ * @example
+ * ```ts
+ * // This variant uses a synchronous custom field resolver and context.
+ * import { graphqlSync, buildSchema } from 'graphql';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * const result = graphqlSync({
+ * schema,
+ * source: '{ greeting }',
+ * fieldResolver: (_source, _args, contextValue) => {
+ * return contextValue.defaultGreeting;
+ * },
+ * contextValue: { defaultGreeting: 'Hello' },
+ * });
+ *
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ * @category Request Pipeline
+ */
+export declare function graphqlSync(args: GraphQLArgs): ExecutionResult;
+/**
+ * Render a helpful description of the location in the GraphQL Source document.
+ * @param location - The AST location to print.
+ * @returns A formatted source excerpt with line and column information.
+ * @example
+ * ```ts
+ * import { parse, printLocation } from 'graphql/language';
+ *
+ * const document = parse('type Query { hello: String }');
+ * const location = document.definitions[0].loc;
+ *
+ * if (location) {
+ * const printed = printLocation(location);
+ *
+ * printed; // => 'GraphQL request:1:1\n1 | type Query { hello: String }\n | ^'
+ * }
+ * ```
+ */
+export declare function printLocation(location: Location$1): string;
+/**
+ * Render a helpful description of the location in the GraphQL Source document.
+ * @param source - The source document that contains the location.
+ * @param sourceLocation - The 1-indexed line and column to print.
+ * @returns A formatted source excerpt with line and column information.
+ * @example
+ * ```ts
+ * import { Source, printSourceLocation } from 'graphql/language';
+ *
+ * const source = new Source('type Query { hello: String }');
+ * const printed = printSourceLocation(source, { line: 1, column: 14 });
+ *
+ * printed; // => 'GraphQL request:1:14\n1 | type Query { hello: String }\n | ^'
+ * ```
+ */
+export declare function printSourceLocation(source: Source, sourceLocation: SourceLocation): string;
+/**
+ * Converts an AST into a string, using one set of reasonable
+ * formatting rules.
+ * @param ast - The GraphQL AST node to print.
+ * @returns A stable string representation of the AST.
+ * @example
+ * ```ts
+ * import { parse, print } from 'graphql';
+ *
+ * const ast = parse('{ hero { name } }');
+ * const text = print(ast);
+ *
+ * text; // => '{\n hero {\n name\n }\n}'
+ * ```
+ */
+export declare function print(ast: ASTNode): string;
+/**
+ * Returns true when the AST node is a definition node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a definition node.
+ * @example
+ * ```ts
+ * import { parse, isDefinitionNode } from 'graphql/language';
+ *
+ * const document = parse('{ hello }');
+ *
+ * isDefinitionNode(document.definitions[0]); // => true
+ * isDefinitionNode(document); // => false
+ * ```
+ */
+export declare function isDefinitionNode(node: ASTNode): node is DefinitionNode;
+/**
+ * Returns true when the AST node is an executable definition node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is an executable definition node.
+ * @example
+ * ```ts
+ * import { parse, isExecutableDefinitionNode } from 'graphql/language';
+ *
+ * const query = parse('{ hello }');
+ * const schema = parse('type Query { hello: String }');
+ *
+ * isExecutableDefinitionNode(query.definitions[0]); // => true
+ * isExecutableDefinitionNode(schema.definitions[0]); // => false
+ * ```
+ */
+export declare function isExecutableDefinitionNode(node: ASTNode): node is ExecutableDefinitionNode;
+/**
+ * A type predicate for SubscriptionOperationDefinitionNode.
+ * Useful anywhere that must distinguish subscription operations from
+ * queries and mutations, such as the subscription execution pipeline
+ * which routes events through a different code path.
+ * @param node - Operation definition node to test.
+ * @returns True when the operation definition is a subscription.
+ * @example
+ * ```ts
+ * import { parse, isSubscriptionOperationDefinitionNode } from 'graphql/language';
+ *
+ * const subscription = parse('subscription { greeting }').definitions[0];
+ * const query = parse('{ greeting }').definitions[0];
+ *
+ * isSubscriptionOperationDefinitionNode(subscription); // => true
+ * isSubscriptionOperationDefinitionNode(query); // => false
+ * ```
+ */
+export declare function isSubscriptionOperationDefinitionNode(node: OperationDefinitionNode): node is SubscriptionOperationDefinitionNode;
+/**
+ * Returns true when the AST node is a selection node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a selection node.
+ * @example
+ * ```ts
+ * import { Kind, isSelectionNode } from 'graphql/language';
+ *
+ * const field = { kind: Kind.FIELD, name: { kind: Kind.NAME, value: 'hello' } };
+ * const document = { kind: Kind.DOCUMENT, definitions: [] };
+ *
+ * isSelectionNode(field); // => true
+ * isSelectionNode(document); // => false
+ * ```
+ */
+export declare function isSelectionNode(node: ASTNode): node is SelectionNode;
+/**
+ * Returns true when the AST node is a value node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a value node.
+ * @example
+ * ```ts
+ * import { parseType, parseValue, isValueNode } from 'graphql/language';
+ *
+ * const value = parseValue('[42]');
+ * const type = parseType('[String!]');
+ *
+ * isValueNode(value); // => true
+ * isValueNode(type); // => false
+ * ```
+ */
+export declare function isValueNode(node: ASTNode): node is ValueNode;
+/**
+ * Returns true when the AST node is a constant value node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a constant value node.
+ * @example
+ * ```ts
+ * import {
+ * parseConstValue,
+ * parseValue,
+ * isConstValueNode,
+ * } from 'graphql/language';
+ *
+ * const value = parseConstValue('[42]');
+ * const variable = parseValue('$id');
+ *
+ * isConstValueNode(value); // => true
+ * isConstValueNode(variable); // => false
+ * ```
+ */
+export declare function isConstValueNode(node: ASTNode): node is ConstValueNode;
+/**
+ * Returns true when the AST node is a type node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a type node.
+ * @example
+ * ```ts
+ * import { parseType, parseValue, isTypeNode } from 'graphql/language';
+ *
+ * const type = parseType('[String!]');
+ * const value = parseValue('[42]');
+ *
+ * isTypeNode(type); // => true
+ * isTypeNode(value); // => false
+ * ```
+ */
+export declare function isTypeNode(node: ASTNode): node is TypeNode;
+/**
+ * Returns true when the AST node is a type system definition node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a type system definition node.
+ * @example
+ * ```ts
+ * import { parse, isTypeSystemDefinitionNode } from 'graphql/language';
+ *
+ * const schema = parse('type Query { hello: String }');
+ * const query = parse('{ hello }');
+ *
+ * isTypeSystemDefinitionNode(schema.definitions[0]); // => true
+ * isTypeSystemDefinitionNode(query.definitions[0]); // => false
+ * ```
+ */
+export declare function isTypeSystemDefinitionNode(node: ASTNode): node is TypeSystemDefinitionNode;
+/**
+ * Returns true when the AST node is a type definition node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a type definition node.
+ * @example
+ * ```ts
+ * import { parse, isTypeDefinitionNode } from 'graphql/language';
+ *
+ * const typeDefinition = parse('type Query { hello: String }');
+ * const directiveDefinition = parse('directive @cache on FIELD');
+ *
+ * isTypeDefinitionNode(typeDefinition.definitions[0]); // => true
+ * isTypeDefinitionNode(directiveDefinition.definitions[0]); // => false
+ * ```
+ */
+export declare function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode;
+/**
+ * Returns true when the AST node is a type system extension node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a type system extension node.
+ * @example
+ * ```ts
+ * import { parse, isTypeSystemExtensionNode } from 'graphql/language';
+ *
+ * const extension = parse('extend type Query { hello: String }');
+ * const definition = parse('type Query { hello: String }');
+ *
+ * isTypeSystemExtensionNode(extension.definitions[0]); // => true
+ * isTypeSystemExtensionNode(definition.definitions[0]); // => false
+ * ```
+ */
+export declare function isTypeSystemExtensionNode(node: ASTNode): node is TypeSystemExtensionNode;
+/**
+ * Returns true when the AST node is a type extension node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a type extension node.
+ * @example
+ * ```ts
+ * import { parse, isTypeExtensionNode } from 'graphql/language';
+ *
+ * const extension = parse('extend type Query { hello: String }');
+ * const schemaExtension = parse('extend schema { query: Query }');
+ *
+ * isTypeExtensionNode(extension.definitions[0]); // => true
+ * isTypeExtensionNode(schemaExtension.definitions[0]); // => false
+ * ```
+ */
+export declare function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode;
+/**
+ * Returns true when the AST node is a schema coordinate node.
+ * @param node - The AST node to test.
+ * @returns True when the AST node is a schema coordinate node.
+ * @example
+ * ```ts
+ * import {
+ * parse,
+ * parseSchemaCoordinate,
+ * isSchemaCoordinateNode,
+ * } from 'graphql/language';
+ *
+ * const coordinate = parseSchemaCoordinate('Query.hero');
+ * const document = parse('{ hero }');
+ *
+ * isSchemaCoordinateNode(coordinate); // => true
+ * isSchemaCoordinateNode(document); // => false
+ * ```
+ */
+export declare function isSchemaCoordinateNode(node: ASTNode): node is SchemaCoordinateNode;
+/**
+ * Results for an operation that produced legacy incremental payloads.
+ * @typeParam TInitialData - Shape of the initial result data payload.
+ * @typeParam TDeferredData - Shape of deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface LegacyExperimentalIncrementalExecutionResults<TInitialData = ObjMap<unknown>, TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Initial execution result delivered before subsequent legacy incremental payloads. */
+ initialResult: LegacyInitialIncrementalExecutionResult<TInitialData, TExtensions>;
+ /** Async stream of legacy incremental payloads delivered after the initial result. */
+ subsequentResults: AsyncGenerator<LegacySubsequentIncrementalExecutionResult<TDeferredData, TStreamItem, TExtensions>, void, void>;
+}
+/**
+ * Initial execution result for an operation that produced legacy incremental payloads.
+ *
+ * Unlike `InitialIncrementalExecutionResult`, the legacy initial result does
+ * not include a `pending` list. Subsequent payloads identify their location
+ * directly with `path` and optional `label` fields.
+ * @typeParam TInitialData - Shape of the initial data payload.
+ * @typeParam TExtensions - Shape of the extensions payload.
+ */
+export interface LegacyInitialIncrementalExecutionResult<TInitialData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends ExecutionResult<TInitialData, TExtensions> {
+ /** Data produced by the initial execution payload. */
+ data: TInitialData;
+ /** Indicates that subsequent legacy incremental payloads will follow. */
+ hasNext: true;
+ /** Additional non-standard metadata included in the initial result. */
+ extensions?: TExtensions;
+}
+/**
+ * Subsequent payload produced by legacy incremental execution.
+ *
+ * Legacy subsequent payloads may contain deferred fragment data, streamed list
+ * items, or only `hasNext: false` to complete the response stream.
+ * @typeParam TDeferredData - Shape of deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of the extensions payload.
+ */
+export interface LegacySubsequentIncrementalExecutionResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Deferred or streamed payloads delivered by this response. */
+ incremental?: ReadonlyArray<LegacyIncrementalResult<TDeferredData, TStreamItem, TExtensions>>;
+ /** Indicates whether more legacy incremental payloads will follow. */
+ hasNext: boolean;
+ /** Additional non-standard metadata included in this payload. */
+ extensions?: TExtensions;
+}
+/**
+ * Deferred fragment or streamed list payload produced by legacy incremental execution.
+ * @typeParam TDeferredData - Shape of deferred fragment data.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export type LegacyIncrementalResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> = LegacyIncrementalDeferResult<TDeferredData, TExtensions> | LegacyIncrementalStreamResult<TStreamItem, TExtensions>;
+/**
+ * Legacy incremental payload produced by a deferred fragment.
+ *
+ * The payload location is identified directly by `path` and optional `label`
+ * instead of by an `id` from a pending entry.
+ * @typeParam TDeferredData - Shape of deferred fragment data.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface LegacyIncrementalDeferResult<TDeferredData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends ExecutionResult<TDeferredData, TExtensions> {
+ /** Response path to the deferred fragment payload. */
+ path: ReadonlyArray<string | number>;
+ /** Label from the `@defer` directive. */
+ label?: string;
+}
+/**
+ * Legacy incremental payload produced by a streamed list field.
+ * @typeParam TStreamItem - Shape of streamed list items.
+ * @typeParam TExtensions - Shape of extensions payloads.
+ */
+export interface LegacyIncrementalStreamResult<TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Errors raised while producing streamed items. */
+ errors?: ReadonlyArray<GraphQLError>;
+ /** Streamed list items delivered by this payload. */
+ items: ReadonlyArray<TStreamItem> | null;
+ /** Response path to the first streamed list item in this payload. */
+ path: ReadonlyArray<string | number>;
+ /** Label from the `@stream` directive. */
+ label?: string;
+ /** Additional non-standard metadata included in this payload. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of legacy incremental execution results.
+ * @typeParam TInitialData - Shape of the formatted initial result data payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedLegacyExperimentalIncrementalExecutionResults<TInitialData = ObjMap<unknown>, TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Formatted initial execution result. */
+ initialResult: FormattedLegacyInitialIncrementalExecutionResult<TInitialData, TExtensions>;
+ /** Async stream of formatted legacy incremental payloads. */
+ subsequentResults: AsyncGenerator<FormattedLegacySubsequentIncrementalExecutionResult<TDeferredData, TStreamItem, TExtensions>, void, void>;
+}
+/**
+ * JSON-serializable form of a legacy initial incremental execution result.
+ * @typeParam TInitialData - Shape of the formatted initial data payload.
+ * @typeParam TExtensions - Shape of the formatted extensions payload.
+ */
+export interface FormattedLegacyInitialIncrementalExecutionResult<TInitialData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends FormattedExecutionResult<TInitialData, TExtensions> {
+ /** Formatted data produced by the initial execution payload. */
+ data: TInitialData;
+ /** Indicates that subsequent legacy incremental payloads will follow. */
+ hasNext: true;
+ /** Additional non-standard metadata included in the formatted initial result. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable form of a legacy subsequent incremental execution payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedLegacySubsequentIncrementalExecutionResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Formatted deferred or streamed payloads delivered by this response. */
+ incremental?: ReadonlyArray<FormattedLegacyIncrementalResult<TDeferredData, TStreamItem, TExtensions>>;
+ /** Indicates whether more legacy incremental payloads will follow. */
+ hasNext: boolean;
+ /** Additional non-standard metadata included in this formatted payload. */
+ extensions?: TExtensions;
+}
+/**
+ * JSON-serializable deferred fragment or streamed list payload produced by
+ * legacy incremental execution.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export type FormattedLegacyIncrementalResult<TDeferredData = ObjMap<unknown>, TStreamItem = unknown, TExtensions = ObjMap<unknown>> = FormattedLegacyIncrementalDeferResult<TDeferredData, TExtensions> | FormattedLegacyIncrementalStreamResult<TStreamItem, TExtensions>;
+/**
+ * JSON-serializable form of a legacy deferred fragment payload.
+ * @typeParam TDeferredData - Shape of formatted deferred fragment data.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedLegacyIncrementalDeferResult<TDeferredData = ObjMap<unknown>, TExtensions = ObjMap<unknown>> extends FormattedExecutionResult<TDeferredData, TExtensions> {
+ /** Response path to the formatted deferred fragment payload. */
+ path: ReadonlyArray<string | number>;
+ /** Label from the `@defer` directive. */
+ label?: string;
+}
+/**
+ * JSON-serializable form of a legacy streamed list payload.
+ * @typeParam TStreamItem - Shape of formatted streamed list items.
+ * @typeParam TExtensions - Shape of formatted extensions payloads.
+ */
+export interface FormattedLegacyIncrementalStreamResult<TStreamItem = unknown, TExtensions = ObjMap<unknown>> {
+ /** Formatted errors raised while producing streamed items. */
+ errors?: ReadonlyArray<GraphQLFormattedError>;
+ /** Formatted streamed list items delivered by this payload. */
+ items: ReadonlyArray<TStreamItem> | null;
+ /** Response path to the first streamed list item in this formatted payload. */
+ path: ReadonlyArray<string | number>;
+ /** Label from the `@stream` directive. */
+ label?: string;
+ /** Additional non-standard metadata included in this formatted payload. */
+ extensions?: TExtensions;
+}
+/**
+ * Executes a GraphQL operation with support for `@defer` and `@stream` using
+ * the legacy incremental delivery payload format.
+ *
+ * Prefer `experimentalExecuteIncrementally` for the current incremental
+ * delivery format. In the legacy format, each subsequent incremental payload
+ * identifies its location with `path` and optional `label` fields. The current
+ * format instead tracks pending work by `id` and reports completion through
+ * `completed` entries.
+ * @param args - Execution arguments for the GraphQL operation.
+ * @returns A single execution result or legacy incremental execution results.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { legacyExecuteIncrementally } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * hero: Hero
+ * }
+ *
+ * type Hero {
+ * id: ID!
+ * name: String!
+ * }
+ * `);
+ *
+ * const result = await legacyExecuteIncrementally({
+ * schema,
+ * document: parse('{ hero { id ... @defer(label: "HeroName") { name } } }'),
+ * rootValue: { hero: { id: '1', name: 'Luke' } },
+ * });
+ *
+ * assert('initialResult' in result);
+ *
+ * result.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }
+ *
+ * const deferred = await result.subsequentResults.next();
+ * deferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'], label: 'HeroName' } ], hasNext: false }
+ * ```
+ * @example
+ * Compare the legacy payload format with the current incremental delivery
+ * format returned by `experimentalExecuteIncrementally`.
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * experimentalExecuteIncrementally,
+ * legacyExecuteIncrementally,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * hero: Hero
+ * }
+ *
+ * type Hero {
+ * id: ID!
+ * name: String!
+ * }
+ * `);
+ * const document = parse('{ hero { id ... @defer { name } } }');
+ * const rootValue = { hero: { id: '1', name: 'Luke' } };
+ *
+ * const experimental = await experimentalExecuteIncrementally({
+ * schema,
+ * document,
+ * rootValue,
+ * });
+ * const legacy = await legacyExecuteIncrementally({
+ * schema,
+ * document,
+ * rootValue,
+ * });
+ *
+ * assert('initialResult' in experimental);
+ * assert('initialResult' in legacy);
+ *
+ * experimental.initialResult; // => { data: { hero: { id: '1' } }, pending: [ { id: '0', path: ['hero'] } ], hasNext: true }
+ * legacy.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }
+ *
+ * const experimentalDeferred = await experimental.subsequentResults.next();
+ * experimentalDeferred.value; // => { incremental: [{ data: { name: 'Luke' }, id: '0' }], completed: [{ id: '0' }], hasNext: false }
+ *
+ * const legacyDeferred = await legacy.subsequentResults.next();
+ * legacyDeferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'] } ], hasNext: false }
+ * ```
+ * @example
+ * Compare streamed list payloads in the legacy and current incremental
+ * delivery formats.
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * experimentalExecuteIncrementally,
+ * legacyExecuteIncrementally,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { colors: [String] }');
+ * const document = parse('{ colors @stream(initialCount: 1) }');
+ * const rootValue = { colors: ['red', 'green', 'blue'] };
+ *
+ * const experimental = await experimentalExecuteIncrementally({
+ * schema,
+ * document,
+ * rootValue,
+ * });
+ * const legacy = await legacyExecuteIncrementally({
+ * schema,
+ * document,
+ * rootValue,
+ * });
+ *
+ * assert('initialResult' in experimental);
+ * assert('initialResult' in legacy);
+ *
+ * experimental.initialResult; // => { data: { colors: ['red'] }, pending: [ { id: '0', path: ['colors'] } ], hasNext: true }
+ * legacy.initialResult; // => { data: { colors: ['red'] }, hasNext: true }
+ *
+ * const experimentalStream = await experimental.subsequentResults.next();
+ * experimentalStream.value; // => { incremental: [ { items: ['green', 'blue'], id: '0' } ], completed: [{ id: '0' }], hasNext: false }
+ *
+ * const legacyStream = await legacy.subsequentResults.next();
+ * legacyStream.value; // => { incremental: [ { items: ['green', 'blue'], path: ['colors', 1] } ], hasNext: false }
+ * ```
+ */
+export declare function legacyExecuteIncrementally(args: ExecutionArgs): PromiseOrValue<ExecutionResult | LegacyExperimentalIncrementalExecutionResults>;
+/**
+ * Executes a validated operation root selection set with support for `@defer`
+ * and `@stream` using the legacy incremental delivery payload format.
+ * @param validatedExecutionArgs - Validated execution arguments.
+ * @returns A single execution result or legacy incremental execution results.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * legacyExecuteRootSelectionSet,
+ * validateExecutionArgs,
+ * } from 'graphql/execution';
+ *
+ * const schema = buildSchema('type Query { greeting: String }');
+ * const validatedArgs = validateExecutionArgs({
+ * schema,
+ * document: parse('{ greeting }'),
+ * rootValue: { greeting: 'Hello' },
+ * });
+ *
+ * assert('schema' in validatedArgs);
+ *
+ * const result = await legacyExecuteRootSelectionSet(validatedArgs);
+ * result; // => { data: { greeting: 'Hello' } }
+ * ```
+ */
+export declare function legacyExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue<ExecutionResult | LegacyExperimentalIncrementalExecutionResults>;
+/**
+ * Technically these aren't part of the spec but they are strongly encouraged
+ * validation rules.
+ */
+export declare const recommendedRules: ReadonlyArray<ValidationRule>;
+/**
+ * This set includes all validation rules defined by the GraphQL spec.
+ *
+ * The order of the rules in this list has been adjusted to lead to the
+ * most clear output when encountering multiple validation errors.
+ */
+export declare const specifiedRules: ReadonlyArray<ValidationRule>;
+/**
+ * Defer and stream directive labels are unique
+ *
+ * A GraphQL document is only valid if defer and stream directives' label argument is static and unique.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validate, DeferStreamDirectiveLabelRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * friends: [String]
+ * }
+ * `);
+ * const invalidDocument = parse(`
+ * {
+ * friends @stream(label: "friends")
+ * other: friends @stream(label: "friends")
+ * }
+ * `);
+ * const validDocument = parse(`
+ * {
+ * friends @stream(label: "friends")
+ * other: friends @stream(label: "otherFriends")
+ * }
+ * `);
+ *
+ * validate(schema, invalidDocument, [DeferStreamDirectiveLabelRule]).length; // => 1
+ * validate(schema, validDocument, [DeferStreamDirectiveLabelRule]); // => []
+ * ```
+ */
+export declare function DeferStreamDirectiveLabelRule(context: ValidationContext): ASTVisitor;
+/**
+ * Defer and stream directives are used on valid root field
+ *
+ * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * validate,
+ * DeferStreamDirectiveOnRootFieldRule,
+ * } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * message: String
+ * }
+ *
+ * type Mutation {
+ * updateMessage: String
+ * }
+ * `);
+ * const invalidDocument = parse(`
+ * mutation { ... @defer { updateMessage } }
+ * `);
+ * const validDocument = parse(`
+ * { ... @defer { message } }
+ * `);
+ *
+ * validate(schema, invalidDocument, [DeferStreamDirectiveOnRootFieldRule]).length; // => 1
+ * validate(schema, validDocument, [DeferStreamDirectiveOnRootFieldRule]); // => []
+ * ```
+ */
+export declare function DeferStreamDirectiveOnRootFieldRule(context: ValidationContext): ASTVisitor;
+/**
+ * Defer And Stream Directives Are Used On Valid Operations
+ *
+ * A GraphQL document is only valid if defer and stream directives are not used on root mutation or subscription types.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * validate,
+ * DeferStreamDirectiveOnValidOperationsRule,
+ * } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * message: Message
+ * }
+ *
+ * type Subscription {
+ * message: Message
+ * }
+ *
+ * type Message {
+ * body: String
+ * }
+ * `);
+ * const invalidDocument = parse(`
+ * subscription {
+ * message {
+ * ...MessageBody @defer
+ * }
+ * }
+ *
+ * fragment MessageBody on Message {
+ * body
+ * }
+ * `);
+ * const validDocument = parse(`
+ * subscription {
+ * message {
+ * ...MessageBody @defer(if: false)
+ * }
+ * }
+ *
+ * fragment MessageBody on Message {
+ * body
+ * }
+ * `);
+ *
+ * validate(schema, invalidDocument, [DeferStreamDirectiveOnValidOperationsRule])
+ * .length; // => 1
+ * validate(schema, validDocument, [DeferStreamDirectiveOnValidOperationsRule]); // => []
+ * ```
+ */
+export declare function DeferStreamDirectiveOnValidOperationsRule(context: ValidationContext): ASTVisitor;
+/**
+ * Executable definitions
+ *
+ * A GraphQL document is only valid for execution if all definitions are either
+ * operation or fragment definitions.
+ *
+ * See https://spec.graphql.org/draft/#sec-Executable-Definitions
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { ExecutableDefinitionsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * type Extra { field: String }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * ExecutableDefinitionsRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * ExecutableDefinitionsRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function ExecutableDefinitionsRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Fields on correct type
+ *
+ * A GraphQL document is only valid if all fields selected are defined by the
+ * parent type, or are an allowed meta field such as __typename.
+ *
+ * See https://spec.graphql.org/draft/#sec-Field-Selections
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { FieldsOnCorrectTypeRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { missing }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * FieldsOnCorrectTypeRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [FieldsOnCorrectTypeRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function FieldsOnCorrectTypeRule(context: ValidationContext): ASTVisitor;
+/**
+ * Fragments on composite type
+ *
+ * Fragments use a type condition to determine if they apply, since fragments
+ * can only be spread into a composite type (object, interface, or union), the
+ * type condition must also be a composite type.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { FragmentsOnCompositeTypesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * fragment Bad on String { length }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * FragmentsOnCompositeTypesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment Good on Query { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * FragmentsOnCompositeTypesRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function FragmentsOnCompositeTypesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Known argument names
+ *
+ * A GraphQL field is only valid if all supplied arguments are defined by
+ * that field.
+ *
+ * See https://spec.graphql.org/draft/#sec-Argument-Names
+ * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { KnownArgumentNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: String): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { field(unknown: "1") }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * KnownArgumentNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { field(arg: "1") }
+ * `);
+ * const validErrors = validate(schema, validDocument, [KnownArgumentNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Known directives
+ *
+ * A GraphQL document is only valid if all `@directives` are known by the
+ * schema and legally positioned.
+ *
+ * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { KnownDirectivesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { name @unknown }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [KnownDirectivesRule]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name @include(if: true) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [KnownDirectivesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function KnownDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor;
+/**
+ * Known fragment names
+ *
+ * A GraphQL document is only valid if all `...Fragment` fragment spreads refer
+ * to fragments defined in the same document.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { KnownFragmentNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { ...Missing }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * KnownFragmentNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment NameFields on Query { name } query { ...NameFields }
+ * `);
+ * const validErrors = validate(schema, validDocument, [KnownFragmentNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Known Operation Types
+ *
+ * A GraphQL document is only valid if when it contains an operation,
+ * the root type for the operation exists within the schema.
+ *
+ * See https://spec.graphql.org/draft/#sec-Operation-Type-Existence
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validate, KnownOperationTypesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const invalidDocument = parse('mutation { greeting }');
+ * const validDocument = parse('{ greeting }');
+ *
+ * validate(schema, invalidDocument, [KnownOperationTypesRule])[0].message; // => 'The mutation operation is not supported by the schema.'
+ * validate(schema, validDocument, [KnownOperationTypesRule]); // => []
+ * ```
+ */
+export declare function KnownOperationTypesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Known type names
+ *
+ * A GraphQL document is only valid if referenced types (specifically
+ * variable definitions and fragment conditions) are defined by the type schema.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { KnownTypeNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * fragment Bad on Missing { name }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [KnownTypeNamesRule]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment Good on Query { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [KnownTypeNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function KnownTypeNamesRule(context: ValidationContext | SDLValidationContext): ASTVisitor;
+/**
+ * Lone anonymous operation
+ *
+ * A GraphQL document is only valid if when it contains an anonymous operation
+ * (the query short-hand) that it contains only that one operation definition.
+ *
+ * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { LoneAnonymousOperationRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query { name } query Other { name }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * LoneAnonymousOperationRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * LoneAnonymousOperationRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function LoneAnonymousOperationRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * No fragment cycles
+ *
+ * The graph of fragment spreads must not form any cycles including spreading itself.
+ * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { NoFragmentCyclesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * fragment A on Query { ...B } fragment B on Query { ...A } query { ...A }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [NoFragmentCyclesRule]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment A on Query { name } query { ...A }
+ * `);
+ * const validErrors = validate(schema, validDocument, [NoFragmentCyclesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoFragmentCyclesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * No undefined variables
+ *
+ * A GraphQL operation is only valid if all variables encountered, both directly
+ * and via fragment spreads, are defined by that operation.
+ *
+ * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { NoUndefinedVariablesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: ID): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query ($id: ID) { field(arg: $missing) }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * NoUndefinedVariablesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query ($id: ID) { field(arg: $id) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [NoUndefinedVariablesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoUndefinedVariablesRule(context: ValidationContext): ASTVisitor;
+/**
+ * No unused fragments
+ *
+ * A GraphQL document is only valid if all fragment definitions are spread
+ * within operations, or spread within other fragments spread within operations.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { NoUnusedFragmentsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * fragment Unused on Query { name } query { name }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * NoUnusedFragmentsRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment Used on Query { name } query { ...Used }
+ * `);
+ * const validErrors = validate(schema, validDocument, [NoUnusedFragmentsRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoUnusedFragmentsRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * No unused variables
+ *
+ * A GraphQL operation is only valid if all variables defined by an operation
+ * are used, either directly or within a spread fragment.
+ *
+ * See https://spec.graphql.org/draft/#sec-All-Variables-Used
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { NoUnusedVariablesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: ID): String
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query ($id: ID) { name }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * NoUnusedVariablesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query ($id: ID) { field(arg: $id) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [NoUnusedVariablesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Overlapping fields can be merged
+ *
+ * A selection set is only valid if all fields (including spreading any
+ * fragments) either correspond to distinct response names or can be merged
+ * without ambiguity.
+ *
+ * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { OverlappingFieldsCanBeMergedRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * dog: Dog
+ * }
+ *
+ * type Dog {
+ * name: String
+ * barkVolume: Int
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { dog { value: barkVolume value: name } }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * OverlappingFieldsCanBeMergedRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { dog { barkVolume name } }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * OverlappingFieldsCanBeMergedRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function OverlappingFieldsCanBeMergedRule(context: ValidationContext): ASTVisitor;
+/**
+ * Possible fragment spread
+ *
+ * A fragment spread is only valid if the type condition could ever possibly
+ * be true: if there is a non-empty intersection of the possible parent types,
+ * and possible types which pass the type condition.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { PossibleFragmentSpreadsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * dog: Dog
+ * }
+ *
+ * type Dog {
+ * barkVolume: Int
+ * }
+ *
+ * type Cat {
+ * meowVolume: Int
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { dog { ... on Cat { meowVolume } } }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * PossibleFragmentSpreadsRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { dog { ... on Dog { barkVolume } } }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * PossibleFragmentSpreadsRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function PossibleFragmentSpreadsRule(context: ValidationContext): ASTVisitor;
+/**
+ * Provided required arguments
+ *
+ * A field or directive is only valid if all required (non-null without a
+ * default value) field arguments have been provided.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { ProvidedRequiredArgumentsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(required: String!): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { field }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * ProvidedRequiredArgumentsRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { field(required: "x") }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * ProvidedRequiredArgumentsRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function ProvidedRequiredArgumentsRule(context: ValidationContext): ASTVisitor;
+/**
+ * Scalar leafs
+ *
+ * A GraphQL document is valid only if all leaf fields (fields without
+ * sub selections) are of scalar or enum types.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { ScalarLeafsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { name { length } }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [ScalarLeafsRule]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [ScalarLeafsRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function ScalarLeafsRule(context: ValidationContext): ASTVisitor;
+/**
+ * Subscriptions must only include a non-introspection field.
+ *
+ * A GraphQL subscription is valid only if it contains a single root field and
+ * that root field is not an introspection field.
+ *
+ * See https://spec.graphql.org/draft/#sec-Single-root-field
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { SingleFieldSubscriptionsRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ *
+ * type Subscription {
+ * a: String
+ * b: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * subscription { a b }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * SingleFieldSubscriptionsRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * subscription { a }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * SingleFieldSubscriptionsRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function SingleFieldSubscriptionsRule(context: ValidationContext): ASTVisitor;
+/**
+ * Stream directives are used on list fields
+ *
+ * A GraphQL document is only valid if stream directives are used on list fields.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { buildSchema } from 'graphql/utilities';
+ * import { validate, StreamDirectiveOnListFieldRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * friends: [String]
+ * }
+ * `);
+ * const invalidDocument = parse('{ name @stream(initialCount: 0) }');
+ * const validDocument = parse('{ friends @stream(initialCount: 0) }');
+ *
+ * validate(schema, invalidDocument, [StreamDirectiveOnListFieldRule]).length; // => 1
+ * validate(schema, validDocument, [StreamDirectiveOnListFieldRule]); // => []
+ * ```
+ */
+export declare function StreamDirectiveOnListFieldRule(context: ValidationContext): ASTVisitor;
+/**
+ * Unique argument names
+ *
+ * A GraphQL field or directive is only valid if all supplied arguments are
+ * uniquely named.
+ *
+ * See https://spec.graphql.org/draft/#sec-Argument-Names
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueArgumentNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: String): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { field(arg: "1", arg: "2") }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueArgumentNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { field(arg: "1") }
+ * `);
+ * const validErrors = validate(schema, validDocument, [UniqueArgumentNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueArgumentNamesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Unique directive names per location
+ *
+ * A GraphQL document is only valid if all non-repeatable directives at
+ * a given location are uniquely named.
+ *
+ * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueDirectivesPerLocationRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { name @include(if: true) @include(if: false) }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueDirectivesPerLocationRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name @include(if: true) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * UniqueDirectivesPerLocationRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueDirectivesPerLocationRule(context: ValidationContext | SDLValidationContext): ASTVisitor;
+/**
+ * Unique fragment names
+ *
+ * A GraphQL document is only valid if all defined fragments have unique names.
+ *
+ * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueFragmentNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * fragment A on Query { name } fragment A on Query { name } query { ...A }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueFragmentNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * fragment A on Query { name } query { ...A }
+ * `);
+ * const validErrors = validate(schema, validDocument, [UniqueFragmentNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueFragmentNamesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Unique input field names
+ *
+ * A GraphQL input object value is only valid if all supplied fields are
+ * uniquely named.
+ *
+ * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueInputFieldNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * input Filter {
+ * name: String
+ * }
+ *
+ * type Query {
+ * search(filter: Filter): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { search(filter: { name: "a", name: "b" }) }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueInputFieldNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { search(filter: { name: "a" }) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * UniqueInputFieldNamesRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueInputFieldNamesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Unique operation names
+ *
+ * A GraphQL document is only valid if all defined operations have unique names.
+ *
+ * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueOperationNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query Same { name } query Same { name }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueOperationNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query One { name } query Two { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [UniqueOperationNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueOperationNamesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Unique variable names
+ *
+ * A GraphQL operation is only valid if all its variables are uniquely named.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { UniqueVariableNamesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: ID): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query ($id: ID, $id: ID) { field(arg: $id) }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * UniqueVariableNamesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query ($id: ID) { field(arg: $id) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [UniqueVariableNamesRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function UniqueVariableNamesRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Value literals of correct type
+ *
+ * A GraphQL document is only valid if all value literals are of the type
+ * expected at their position.
+ *
+ * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { ValuesOfCorrectTypeRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * count(limit: Int): Int
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { count(limit: "many") }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * ValuesOfCorrectTypeRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { count(limit: 1) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [ValuesOfCorrectTypeRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function ValuesOfCorrectTypeRule(context: ValidationContext): ASTVisitor;
+/**
+ * Variables are input types
+ *
+ * A GraphQL operation is only valid if all the variables it defines are of
+ * input types (scalar, enum, or input object).
+ *
+ * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { VariablesAreInputTypesRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: ID): String
+ * }
+ *
+ * type User {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query ($user: User) { field(arg: "1") }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * VariablesAreInputTypesRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query ($id: ID) { field(arg: $id) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * VariablesAreInputTypesRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function VariablesAreInputTypesRule(context: ValidationContext): ASTVisitor;
+/**
+ * Variables in allowed position
+ *
+ * Variable usages must be compatible with the arguments they are passed to.
+ *
+ * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { VariablesInAllowedPositionRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * field(arg: ID!): String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * query ($id: String) { field(arg: $id) }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * VariablesInAllowedPositionRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * query ($id: ID!) { field(arg: $id) }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * VariablesInAllowedPositionRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function VariablesInAllowedPositionRule(context: ValidationContext): ASTVisitor;
+/**
+ * Implements the max introspection depth validation rule.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { MaxIntrospectionDepthRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { __schema { types { fields { type { fields { type { fields { name } } } } } } } }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * MaxIntrospectionDepthRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { __schema { queryType { name } } }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * MaxIntrospectionDepthRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function MaxIntrospectionDepthRule(context: ASTValidationContext): ASTVisitor;
+/**
+ * Lone Schema definition
+ *
+ * A GraphQL document is only valid if it contains only one schema definition.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { LoneSchemaDefinitionRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * schema { query: Query } schema { query: Query } type Query { name: String }
+ * `;
+ *
+ * LoneSchemaDefinitionRule.name; // => 'LoneSchemaDefinitionRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * schema { query: Query } type Query { name: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function LoneSchemaDefinitionRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique operation types
+ *
+ * A GraphQL document is only valid if it has only one type per operation.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueOperationTypesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * schema { query: Query query: Other } type Query { name: String } type Other { name: String }
+ * `;
+ *
+ * UniqueOperationTypesRule.name; // => 'UniqueOperationTypesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * schema { query: Query } type Query { name: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueOperationTypesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique type names
+ *
+ * A GraphQL document is only valid if all defined types have unique names.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueTypeNamesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * type Query { name: String } type Query { other: String }
+ * `;
+ *
+ * UniqueTypeNamesRule.name; // => 'UniqueTypeNamesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * type Query { name: String } type Other { name: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique enum value names
+ *
+ * A GraphQL enum type is only valid if all its values are uniquely named.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueEnumValueNamesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * enum Status { ACTIVE ACTIVE } type Query { status: Status }
+ * `;
+ *
+ * UniqueEnumValueNamesRule.name; // => 'UniqueEnumValueNamesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * enum Status { ACTIVE INACTIVE } type Query { status: Status }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueEnumValueNamesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique field definition names
+ *
+ * A GraphQL complex type is only valid if all its fields are uniquely named.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * type Query { name: String name: String }
+ * `;
+ *
+ * UniqueFieldDefinitionNamesRule.name; // => 'UniqueFieldDefinitionNamesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * type Query { name: String other: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueFieldDefinitionNamesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique argument definition names
+ *
+ * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments.
+ * A GraphQL Directive is only valid if all its arguments are uniquely named.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueArgumentDefinitionNamesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * type Query { field(arg: String, arg: Int): String }
+ * `;
+ *
+ * UniqueArgumentDefinitionNamesRule.name; // => 'UniqueArgumentDefinitionNamesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * type Query { field(arg: String): String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueArgumentDefinitionNamesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Unique directive names
+ *
+ * A GraphQL document is only valid if all defined directives have unique names.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { UniqueDirectiveNamesRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * directive @tag on FIELD directive @tag on QUERY type Query { name: String }
+ * `;
+ *
+ * UniqueDirectiveNamesRule.name; // => 'UniqueDirectiveNamesRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * directive @tag on FIELD type Query { name: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function UniqueDirectiveNamesRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * Possible type extension
+ *
+ * A type extension is only valid if the type is defined and has the same kind.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql';
+ * import { PossibleTypeExtensionsRule } from 'graphql/validation';
+ *
+ * const invalidSDL = `
+ * extend type Missing { name: String } type Query { name: String }
+ * `;
+ *
+ * PossibleTypeExtensionsRule.name; // => 'PossibleTypeExtensionsRule'
+ * buildSchema(invalidSDL); // throws an error
+ *
+ * const validSDL = `
+ * type Query { name: String } extend type Query { other: String }
+ * `;
+ *
+ * buildSchema(validSDL); // does not throw
+ * ```
+ */
+export declare function PossibleTypeExtensionsRule(context: SDLValidationContext): ASTVisitor;
+/**
+ * No deprecated
+ *
+ * A GraphQL document is only valid if all selected fields and all used enum values have not been
+ * deprecated.
+ *
+ * Note: This rule is optional and is not part of the Validation section of the GraphQL
+ * Specification. The main purpose of this rule is detection of deprecated usages and not
+ * necessarily to forbid their use when querying a service.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import {
+ * GraphQLObjectType,
+ * GraphQLSchema,
+ * GraphQLString,
+ * parse,
+ * validate,
+ * } from 'graphql';
+ * import { NoDeprecatedCustomRule } from 'graphql/validation';
+ *
+ * const schema = new GraphQLSchema({
+ * query: new GraphQLObjectType({
+ * name: 'Query',
+ * fields: {
+ * name: { type: GraphQLString },
+ * oldName: {
+ * type: GraphQLString,
+ * deprecationReason: 'Use name instead.',
+ * },
+ * },
+ * }),
+ * });
+ *
+ * const invalidDocument = parse(`
+ * { oldName }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * NoDeprecatedCustomRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [NoDeprecatedCustomRule]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor;
+/**
+ * Prohibit introspection queries
+ *
+ * A GraphQL document is only valid if all fields selected are not fields that
+ * return an introspection type.
+ *
+ * Note: This rule is optional and is not part of the Validation section of the
+ * GraphQL Specification. This rule effectively disables introspection, which
+ * does not reflect best practices and should only be done if absolutely necessary.
+ * @param context - The validation context used while checking the document.
+ * @returns A visitor that reports validation errors for this rule.
+ * @example
+ * ```ts
+ * import { buildSchema, parse, validate } from 'graphql';
+ * import { NoSchemaIntrospectionCustomRule } from 'graphql/validation';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * const invalidDocument = parse(`
+ * { __schema { queryType { name } } }
+ * `);
+ * const invalidErrors = validate(schema, invalidDocument, [
+ * NoSchemaIntrospectionCustomRule,
+ * ]);
+ *
+ * invalidErrors.length; // => 1
+ *
+ * const validDocument = parse(`
+ * { name }
+ * `);
+ * const validErrors = validate(schema, validDocument, [
+ * NoSchemaIntrospectionCustomRule,
+ * ]);
+ *
+ * validErrors; // => []
+ * ```
+ */
+export declare function NoSchemaIntrospectionCustomRule(context: ValidationContext): ASTVisitor;
+/**
+ * Produces a GraphQLError representing a syntax error, containing useful
+ * descriptive information about the syntax error's position in the source.
+ * @param source - The GraphQL source containing the syntax error.
+ * @param position - Character offset where the syntax error was encountered.
+ * @param description - Human-readable description of the syntax error.
+ * @returns A GraphQLError located at the syntax error position.
+ * @example
+ * ```ts
+ * import { Source } from 'graphql/language';
+ * import { syntaxError } from 'graphql/error';
+ *
+ * const error = syntaxError(new Source('query {'), 7, 'Expected Name');
+ *
+ * error.message; // => 'Syntax Error: Expected Name'
+ * error.locations; // => [{ line: 1, column: 8 }]
+ * ```
+ */
+export declare function syntaxError(source: Source, position: number, description: string): GraphQLError;
+/**
+ * Given an arbitrary value, presumably thrown while attempting to execute a
+ * GraphQL operation, produce a new GraphQLError aware of the location in the
+ * document responsible for the original Error.
+ * @param rawOriginalError - The original error value to wrap.
+ * @param nodes - The AST nodes associated with the error.
+ * @param path - The response path associated with the error.
+ * @returns The GraphQL error.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { locatedError } from 'graphql/error';
+ *
+ * const document = parse('{ viewer { name } }');
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
+ * const error = locatedError(new Error('Resolver failed'), fieldNode, ['viewer']);
+ *
+ * error.message; // => 'Resolver failed'
+ * error.locations; // => [{ line: 1, column: 3 }]
+ * error.path; // => ['viewer']
+ * ```
+ */
+export declare function locatedError(rawOriginalError: unknown, nodes: ASTNode | ReadonlyArray<ASTNode> | undefined | null, path?: Maybe<ReadonlyArray<string | number>>): GraphQLError;
+/** Options controlling which fields are included in the introspection query. */
+export interface IntrospectionOptions {
+ /**
+ * Whether to include descriptions in the introspection result.
+ * Default: true
+ */
+ descriptions?: boolean;
+ /**
+ * Whether to include `specifiedByURL` in the introspection result.
+ * Default: false
+ */
+ specifiedByUrl?: boolean;
+ /**
+ * Whether to include `isRepeatable` flag on directives.
+ * Default: false
+ */
+ directiveIsRepeatable?: boolean;
+ /**
+ * Whether to include `description` field on schema.
+ * Default: false
+ */
+ schemaDescription?: boolean;
+ /**
+ * Whether target GraphQL server support deprecation of input values.
+ * Default: false
+ */
+ inputValueDeprecation?: boolean;
+ /**
+ * Whether target GraphQL server supports deprecation of directives.
+ * Default: false
+ */
+ experimentalDirectiveDeprecation?: boolean;
+ /**
+ * Whether target GraphQL server supports `@oneOf` input objects.
+ * Default: false
+ */
+ oneOf?: boolean;
+ /**
+ * How deep to recurse into nested types, larger values will result in more
+ * accurate results, but have a higher load on the server.
+ * Some servers might restrict the maximum query depth or complexity.
+ * If that's the case, try decreasing this value.
+ *
+ * Default: 9
+ */
+ typeDepth?: number;
+}
+/**
+ * Produce the GraphQL query recommended for a full schema introspection.
+ * Accepts optional IntrospectionOptions.
+ * @param options - Optional configuration for this operation.
+ * @returns The resolved introspection query.
+ * @example
+ * ```ts
+ * // Generate the default introspection query.
+ * import { getIntrospectionQuery } from 'graphql/utilities';
+ *
+ * const query = getIntrospectionQuery();
+ *
+ * query; // matches /__schema/
+ * query; // matches /description/
+ * query; // does not match /specifiedByURL/
+ * ```
+ * @example
+ * ```ts
+ * // This variant customizes optional introspection fields and nesting depth.
+ * import { getIntrospectionQuery } from 'graphql/utilities';
+ *
+ * const query = getIntrospectionQuery({
+ * descriptions: false,
+ * specifiedByUrl: true,
+ * directiveIsRepeatable: true,
+ * schemaDescription: true,
+ * inputValueDeprecation: true,
+ * experimentalDirectiveDeprecation: true,
+ * oneOf: true,
+ * typeDepth: 3,
+ * });
+ *
+ * query; // does not match /description/
+ * query; // matches /specifiedByURL/
+ * query; // matches /isRepeatable/
+ * query; // matches /includeDeprecated: true/
+ * query; // matches /isOneOf/
+ * (query.match(/ofType/g)?.length ?? 0) > 0; // => true
+ * ```
+ */
+export declare function getIntrospectionQuery(options?: IntrospectionOptions): string;
+/** The result shape returned by a full introspection query. */
+export interface IntrospectionQuery {
+ /** The schema. */
+ readonly __schema: IntrospectionSchema;
+}
+/** The introspection representation of a GraphQL schema. */
+export interface IntrospectionSchema {
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** The root object type used for query operations. */
+ readonly queryType: IntrospectionNamedTypeRef<IntrospectionObjectType>;
+ /** The root object type used for mutation operations, if supported. */
+ readonly mutationType: Maybe<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
+ /** The root object type used for subscription operations, if supported. */
+ readonly subscriptionType: Maybe<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
+ /** Object types that belong to this union type. */
+ readonly types: ReadonlyArray<IntrospectionType>;
+ /** Directives available in this schema or applied to this AST node. */
+ readonly directives: ReadonlyArray<IntrospectionDirective>;
+}
+/** Any introspection representation of a GraphQL type. */
+export type IntrospectionType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType | IntrospectionInputObjectType;
+/** An introspection type that can appear in output position. */
+export type IntrospectionOutputType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType;
+/** An introspection type that can appear in input position. */
+export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType;
+/** The introspection representation of a scalar type. */
+export interface IntrospectionScalarType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.SCALAR;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** URL identifying the behavior specified for this custom scalar. */
+ readonly specifiedByURL?: Maybe<string>;
+}
+/** The introspection representation of an object type. */
+export interface IntrospectionObjectType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.OBJECT;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields: ReadonlyArray<IntrospectionField>;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionInterfaceType>>;
+}
+/** The introspection representation of an interface type. */
+export interface IntrospectionInterfaceType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.INTERFACE;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Fields declared by this object, interface, input object, or literal. */
+ readonly fields: ReadonlyArray<IntrospectionField>;
+ /** Interfaces implemented by this object or interface type. */
+ readonly interfaces: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionInterfaceType>>;
+ /** Object types that may be returned for this abstract type. */
+ readonly possibleTypes: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
+}
+/** The introspection representation of a union type. */
+export interface IntrospectionUnionType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.UNION;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Object types that may be returned for this abstract type. */
+ readonly possibleTypes: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
+}
+/** The introspection representation of an enum type. */
+export interface IntrospectionEnumType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.ENUM;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Values declared by this enum type. */
+ readonly enumValues: ReadonlyArray<IntrospectionEnumValue>;
+}
+/** The introspection representation of an input object type. */
+export interface IntrospectionInputObjectType {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.INPUT_OBJECT;
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Input fields declared by this input object type. */
+ readonly inputFields: ReadonlyArray<IntrospectionInputValue>;
+ /** Whether this input object uses the experimental OneOf input object semantics. */
+ readonly isOneOf: boolean;
+}
+/**
+ * The introspection representation of a list type reference.
+ * @typeParam T - The introspection type reference wrapped by this list type reference.
+ */
+export interface IntrospectionListTypeRef<T extends IntrospectionTypeRef = IntrospectionTypeRef> {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.LIST;
+ /** The type wrapped by this list or non-null type. */
+ readonly ofType: T;
+}
+/**
+ * The introspection representation of a non-null type reference.
+ * @typeParam T - The introspection type reference wrapped by this non-null type reference.
+ */
+export interface IntrospectionNonNullTypeRef<T extends IntrospectionTypeRef = IntrospectionTypeRef> {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: typeof TypeKind.NON_NULL;
+ /** The type wrapped by this list or non-null type. */
+ readonly ofType: T;
+}
+/** Any introspection representation of a type reference. */
+export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef | IntrospectionListTypeRef>;
+/** An introspection type reference that can appear in output position. */
+export type IntrospectionOutputTypeRef = IntrospectionNamedTypeRef<IntrospectionOutputType> | IntrospectionListTypeRef<IntrospectionOutputTypeRef> | IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionOutputType> | IntrospectionListTypeRef<IntrospectionOutputTypeRef>>;
+/** An introspection type reference that can appear in input position. */
+export type IntrospectionInputTypeRef = IntrospectionNamedTypeRef<IntrospectionInputType> | IntrospectionListTypeRef<IntrospectionInputTypeRef> | IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionInputType> | IntrospectionListTypeRef<IntrospectionInputTypeRef>>;
+/**
+ * The introspection representation of a named type reference.
+ * @typeParam T - The introspection type represented by this named type reference.
+ */
+export interface IntrospectionNamedTypeRef<T extends IntrospectionType = IntrospectionType> {
+ /** The introspection kind discriminator for this type reference or type. */
+ readonly kind: T["kind"];
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+}
+/** The introspection representation of a field. */
+export interface IntrospectionField {
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Arguments accepted by this field or directive. */
+ readonly args: ReadonlyArray<IntrospectionInputValue>;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: IntrospectionOutputTypeRef;
+ /** Whether this field, argument, enum value, or input value is deprecated. */
+ readonly isDeprecated: boolean;
+ /** Reason this element is deprecated, if one was provided. */
+ readonly deprecationReason: Maybe<string>;
+}
+/** The introspection representation of an argument or input field. */
+export interface IntrospectionInputValue {
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** The GraphQL type reference or runtime type for this element. */
+ readonly type: IntrospectionInputTypeRef;
+ /** Default value used when no explicit value is supplied. */
+ readonly defaultValue: Maybe<string>;
+ /** Whether this field, argument, enum value, or input value is deprecated. */
+ readonly isDeprecated?: boolean;
+ /** Reason this element is deprecated, if one was provided. */
+ readonly deprecationReason?: Maybe<string>;
+}
+/** The introspection representation of an enum value. */
+export interface IntrospectionEnumValue {
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Whether this field, argument, enum value, or input value is deprecated. */
+ readonly isDeprecated: boolean;
+ /** Reason this element is deprecated, if one was provided. */
+ readonly deprecationReason: Maybe<string>;
+}
+/** The introspection representation of a directive. */
+export interface IntrospectionDirective {
+ /** The GraphQL name for this schema element. */
+ readonly name: string;
+ /** Human-readable description for this schema element, if provided. */
+ readonly description?: Maybe<string>;
+ /** Whether this directive may appear more than once at the same location. */
+ readonly isRepeatable?: boolean;
+ /** Whether this field, argument, enum value, or input value is deprecated. */
+ readonly isDeprecated?: boolean;
+ /** Reason this element is deprecated, if one was provided. */
+ readonly deprecationReason?: Maybe<string>;
+ /** Locations where this directive may be applied. */
+ readonly locations: ReadonlyArray<DirectiveLocation>;
+ /** Arguments accepted by this field or directive. */
+ readonly args: ReadonlyArray<IntrospectionInputValue>;
+}
+/**
+ * Returns an operation AST given a document AST and optionally an operation
+ * name. If a name is not provided, an operation is only returned if only one is
+ * provided in the document.
+ * @param documentAST - The parsed GraphQL document AST.
+ * @param operationName - The optional operation name to select.
+ * @returns The resolved operation ast.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { getOperationAST } from 'graphql/utilities';
+ *
+ * const document = parse('query GetName { name }');
+ * const operation = getOperationAST(document, 'GetName');
+ *
+ * operation.name.value; // => 'GetName'
+ * getOperationAST(document, 'Missing'); // => undefined
+ * ```
+ */
+export declare function getOperationAST(documentAST: DocumentNode, operationName?: Maybe<string>): Maybe<OperationDefinitionNode>;
+/**
+ * Build an IntrospectionQuery from a GraphQLSchema
+ *
+ * IntrospectionQuery is useful for utilities that care about type and field
+ * relationships, but do not need to traverse through those relationships.
+ *
+ * This is the inverse of buildClientSchema. The primary use case is outside
+ * of the server context, for instance when doing schema comparisons.
+ * @param schema - GraphQL schema to use.
+ * @param options - Optional configuration for this operation.
+ * @returns Introspection result data for the schema.
+ * @example
+ * ```ts
+ * // Include schema metadata using the default introspection options.
+ * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/")
+ *
+ * type Query {
+ * homepage: Url
+ * }
+ * `);
+ *
+ * const introspection = introspectionFromSchema(schema);
+ * const urlType = introspection.__schema.types.find(
+ * (type) => type.name === 'Url',
+ * );
+ *
+ * urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'
+ * ```
+ * @example
+ * ```ts
+ * // This variant disables optional introspection metadata.
+ * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/")
+ *
+ * type Query {
+ * homepage: Url
+ * }
+ * `);
+ *
+ * const introspection = introspectionFromSchema(schema, {
+ * descriptions: false,
+ * specifiedByUrl: false,
+ * directiveIsRepeatable: false,
+ * schemaDescription: false,
+ * inputValueDeprecation: false,
+ * experimentalDirectiveDeprecation: false,
+ * oneOf: false,
+ * });
+ * const urlType = introspection.__schema.types.find(
+ * (type) => type.name === 'Url',
+ * );
+ * const deprecatedDirective = introspection.__schema.directives.find(
+ * (directive) => directive.name === 'deprecated',
+ * );
+ *
+ * urlType.specifiedByURL; // => undefined
+ * urlType.description; // => undefined
+ * introspection.__schema.description; // => undefined
+ * deprecatedDirective.isRepeatable; // => undefined
+ * ```
+ */
+export declare function introspectionFromSchema(schema: GraphQLSchema, options?: IntrospectionOptions): IntrospectionQuery;
+/**
+ * Build a GraphQLSchema for use by client tools.
+ *
+ * Given the result of a client running the introspection query, creates and
+ * returns a GraphQLSchema instance which can be then used with all graphql-js
+ * tools, but cannot be used to execute a query, as introspection does not
+ * represent the "resolver", "parse" or "serialize" functions or any other
+ * server-internal mechanisms.
+ *
+ * This function expects a complete introspection result. Don't forget to check
+ * the "errors" field of a server response before calling this function.
+ * @param introspection - Introspection result data to build from.
+ * @param options - Optional configuration for this operation.
+ * @returns The client schema represented by the introspection result.
+ * @example
+ * ```ts
+ * import {
+ * buildClientSchema,
+ * introspectionFromSchema,
+ * buildSchema,
+ * } from 'graphql/utilities';
+ *
+ * const schema = buildSchema('type Query { hello: String }');
+ * const clientSchema = buildClientSchema(introspectionFromSchema(schema), {
+ * assumeValid: true,
+ * });
+ *
+ * clientSchema.getQueryType().name; // => 'Query'
+ * ```
+ */
+export declare function buildClientSchema(introspection: IntrospectionQuery, options?: GraphQLSchemaValidationOptions): GraphQLSchema;
+/** Options used when building a schema from SDL or a parsed SDL document. */
+export interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {
+ /**
+ * Set to true to assume the SDL is valid.
+ *
+ * Default: false
+ */
+ assumeValidSDL?: boolean | undefined;
+}
+/**
+ * Builds a GraphQLSchema from a parsed schema definition language document.
+ *
+ * If no schema definition is provided, then it will look for types named Query,
+ * Mutation and Subscription.
+ *
+ * The resulting schema has no resolver functions, so execution will use the
+ * default field resolver.
+ * @param documentAST - The parsed GraphQL document AST.
+ * @param options - Optional configuration for this operation.
+ * @returns The schema built from the provided SDL document.
+ * @example
+ * ```ts
+ * // Build a schema from a valid parsed SDL document.
+ * import { parse } from 'graphql/language';
+ * import { buildASTSchema } from 'graphql/utilities';
+ *
+ * const document = parse('type Query { hello: String }');
+ * const schema = buildASTSchema(document);
+ *
+ * schema.getQueryType().name; // => 'Query'
+ * ```
+ * @example
+ * ```ts
+ * // This variant uses validation options when the SDL references unknown types.
+ * import { parse } from 'graphql/language';
+ * import { buildASTSchema } from 'graphql/utilities';
+ *
+ * const document = parse('type Query { broken: MissingType }');
+ *
+ * buildASTSchema(document); // throws an error
+ * buildASTSchema(document, {
+ * assumeValid: true,
+ * assumeValidSDL: true,
+ * }); // does not throw
+ * ```
+ */
+export declare function buildASTSchema(documentAST: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema;
+/**
+ * Builds a GraphQLSchema directly from a schema definition language source.
+ * @param source - The GraphQL source text or source object.
+ * @param options - Optional configuration for this operation.
+ * @returns The schema built from the provided SDL document.
+ * @example
+ * ```ts
+ * // Build a schema from SDL source using the default options.
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema('type Query { hello: String }');
+ *
+ * schema.getQueryType().name; // => 'Query'
+ * ```
+ * @example
+ * ```ts
+ * // This variant enables parser options and omits source locations.
+ * import { buildSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(
+ * 'directive @tag on FIELD_DEFINITION\n' +
+ * 'directive @compose @tag on FIELD_DEFINITION',
+ * {
+ * experimentalFragmentArguments: true,
+ * noLocation: true,
+ * },
+ * );
+ *
+ * const directive = schema.getDirective('compose');
+ *
+ * directive.name; // => 'compose'
+ * directive.astNode.loc; // => undefined
+ * ```
+ */
+export declare function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema;
+interface Options extends GraphQLSchemaValidationOptions {
+ /**
+ * Set to true to assume the SDL is valid.
+ *
+ * Default: false
+ *
+ * @internal
+ */
+ assumeValidSDL?: boolean | undefined;
+}
+/**
+ * Produces a new schema given an existing schema and a document which may
+ * contain GraphQL type extensions and definitions. The original schema will
+ * remain unaltered.
+ *
+ * Because a schema represents a graph of references, a schema cannot be
+ * extended without effectively making an entire copy. We do not know until it's
+ * too late if subgraphs remain unchanged.
+ *
+ * This algorithm copies the provided schema, applying extensions while
+ * producing the copy. The original schema remains unaltered.
+ * @param schema - GraphQL schema to use.
+ * @param documentAST - The parsed GraphQL document AST.
+ * @param options - Optional configuration for this operation.
+ * @returns A new schema with the extensions and definitions applied.
+ * @example
+ * ```ts
+ * // Extend a schema with new fields and types.
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, extendSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const extensionAST = parse(`
+ * extend type Query {
+ * farewell: String
+ * }
+ *
+ * type Review {
+ * body: String
+ * }
+ * `);
+ *
+ * const extendedSchema = extendSchema(schema, extensionAST);
+ *
+ * schema.getType('Review'); // => undefined
+ * extendedSchema.getType('Review')?.name; // => 'Review'
+ * Object.keys(extendedSchema.getQueryType().getFields()); // => ['greeting', 'farewell']
+ * ```
+ * @example
+ * ```ts
+ * // This variant bypasses validation for an otherwise invalid extension.
+ * import { parse } from 'graphql/language';
+ * import { buildSchema, extendSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const invalidExtension = parse(`
+ * extend type Missing {
+ * field: String
+ * }
+ * `);
+ *
+ * extendSchema(schema, invalidExtension); // throws an error
+ * extendSchema(schema, invalidExtension, {
+ * assumeValid: true,
+ * assumeValidSDL: true,
+ * }); // does not throw
+ * ```
+ */
+export declare function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema;
+/**
+ * Sort GraphQLSchema.
+ *
+ * This function returns a sorted copy of the given GraphQLSchema.
+ * @param schema - GraphQL schema to use.
+ * @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.
+ * @example
+ * ```ts
+ * import {
+ * buildSchema,
+ * lexicographicSortSchema,
+ * printSchema,
+ * } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * zebra: String
+ * apple: String
+ * }
+ *
+ * enum Episode {
+ * JEDI
+ * NEW_HOPE
+ * EMPIRE
+ * }
+ * `);
+ *
+ * const sortedSchema = lexicographicSortSchema(schema);
+ *
+ * printSchema(sortedSchema);
+ * // =>
+ * // enum Episode {
+ * // EMPIRE
+ * // JEDI
+ * // NEW_HOPE
+ * // }
+ * //
+ * // type Query {
+ * // apple: String
+ * // zebra: String
+ * // }
+ * ```
+ */
+export declare function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema;
+/**
+ * Prints the schema.
+ * @param schema - GraphQL schema to use.
+ * @returns The printed string representation.
+ * @example
+ * ```ts
+ * import { buildSchema, printSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * directive @upper on FIELD_DEFINITION
+ *
+ * type Query {
+ * greeting: String @upper
+ * }
+ * `);
+ *
+ * printSchema(schema); // => ['directive @upper on FIELD_DEFINITION', '', 'type Query {', ' greeting: String', '}'].join('\n')
+ * ```
+ */
+export declare function printSchema(schema: GraphQLSchema): string;
+/**
+ * Prints the introspection schema.
+ * @param schema - GraphQL schema to use.
+ * @returns The printed string representation.
+ * @example
+ * ```ts
+ * import { buildSchema, printIntrospectionSchema } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ *
+ * const printed = printIntrospectionSchema(schema);
+ *
+ * printed; // matches /type __Schema/
+ * printed; // matches /enum __TypeKind/
+ * printed; // does not match /type Query/
+ * ```
+ */
+export declare function printIntrospectionSchema(schema: GraphQLSchema): string;
+/**
+ * Prints the type.
+ * @param type - The GraphQL type to inspect.
+ * @returns The printed string representation.
+ * @example
+ * ```ts
+ * import { buildSchema, printType } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * id: ID!
+ * name: String
+ * }
+ *
+ * type Query {
+ * viewer: User
+ * }
+ * `);
+ *
+ * printType(schema.getType('User')); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n')
+ * ```
+ */
+export declare function printType(type: GraphQLNamedType): string;
+/**
+ * Prints a directive definition in GraphQL SDL.
+ * @param directive - Directive to print.
+ * @returns SDL string for the directive definition.
+ * @example
+ * ```ts
+ * import {
+ * DirectiveLocation,
+ * GraphQLDirective,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { printDirective } from 'graphql/utilities';
+ *
+ * const authDirective = new GraphQLDirective({
+ * name: 'auth',
+ * description: 'Requires authorization.',
+ * locations: [DirectiveLocation.FIELD_DEFINITION],
+ * args: {
+ * scope: { type: GraphQLString },
+ * },
+ * });
+ *
+ * printDirective(authDirective); // => '"""Requires authorization."""\ndirective @auth(scope: String) on FIELD_DEFINITION'
+ * ```
+ */
+export declare function printDirective(directive: GraphQLDirective): string;
+/**
+ * Given a Schema and an AST node describing a type, return a GraphQLType
+ * definition which applies to that type. For example, if provided the parsed
+ * AST node for `[User]`, a GraphQLList instance will be returned, containing
+ * the type called "User" found in the schema. If a type called "User" is not
+ * found in the schema, then undefined will be returned.
+ * @param schema - GraphQL schema to use.
+ * @param typeNode - The GraphQL type AST node to resolve.
+ * @returns The GraphQL type referenced by the AST node, or undefined if it cannot be resolved.
+ * @example
+ * ```ts
+ * import { parseType } from 'graphql/language';
+ * import { buildSchema, typeFromAST } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String
+ * }
+ * `);
+ *
+ * typeFromAST(schema, parseType('String'))?.toString(); // => 'String'
+ * typeFromAST(schema, parseType('Missing')); // => undefined
+ * ```
+ */
+export declare function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined;
+/**
+ * Resolves a list type AST node against a schema.
+ * @param schema - GraphQL schema to use.
+ * @param typeNode - The list type AST node to resolve.
+ * @returns The GraphQL list type referenced by the AST node, or undefined if
+ * it cannot be resolved.
+ * @example
+ * ```ts
+ * import { parseType } from 'graphql/language';
+ * import { buildSchema, typeFromAST } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * tags: [String]
+ * }
+ * `);
+ *
+ * typeFromAST(schema, parseType('[String]'))?.toString(); // => '[String]'
+ * typeFromAST(schema, parseType('[Missing]')); // => undefined
+ * ```
+ */
+export declare function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList<any> | undefined;
+/**
+ * Resolves a non-null type AST node against a schema.
+ * @param schema - GraphQL schema to use.
+ * @param typeNode - The non-null type AST node to resolve.
+ * @returns The GraphQL non-null type referenced by the AST node, or undefined
+ * if it cannot be resolved.
+ * @example
+ * ```ts
+ * import { parseType } from 'graphql/language';
+ * import { buildSchema, typeFromAST } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * name: String!
+ * }
+ * `);
+ *
+ * typeFromAST(schema, parseType('String!'))?.toString(); // => 'String!'
+ * typeFromAST(schema, parseType('[String!]!'))?.toString(); // => '[String!]!'
+ * ```
+ */
+export declare function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull<any> | undefined;
+/**
+ * Resolves a type AST node against a schema.
+ * @param schema - GraphQL schema to use.
+ * @param typeNode - The GraphQL type AST node to resolve.
+ * @returns The GraphQL type referenced by the AST node, or undefined if it
+ * cannot be resolved.
+ * @example
+ * ```ts
+ * import { parseType } from 'graphql/language';
+ * import { buildSchema, typeFromAST } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type User {
+ * name: String
+ * }
+ *
+ * type Query {
+ * users: [User!]!
+ * }
+ * `);
+ *
+ * typeFromAST(schema, parseType('User'))?.toString(); // => 'User'
+ * typeFromAST(schema, parseType('[User!]!'))?.toString(); // => '[User!]!'
+ * typeFromAST(schema, parseType('Missing')); // => undefined
+ * ```
+ */
+export declare function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType | undefined;
+/**
+ * Produces a JavaScript value given a GraphQL Value AST.
+ *
+ * A GraphQL type must be provided, which will be used to interpret different
+ * GraphQL Value literals.
+ *
+ * Returns `undefined` when the value could not be validly coerced according to
+ * the provided type.
+ *
+ * This deprecated function will be removed in v18. Use `coerceInputLiteral()`
+ * instead.
+ *
+ * | GraphQL Value | JSON Value |
+ * | -------------------- | ------------- |
+ * | Input Object | Object |
+ * | List | Array |
+ * | Boolean | Boolean |
+ * | String | String |
+ * | Int / Float | Number |
+ * | Enum Value | Unknown |
+ * | NullValue | null |
+ * @param valueNode - GraphQL value AST node to convert.
+ * @param type - The GraphQL type to inspect.
+ * @param variables - Optional runtime variable values keyed by variable name.
+ * @returns The coerced JavaScript value, or undefined if the AST value cannot be coerced to the type.
+ * @example
+ * ```ts
+ * // Coerce literal values without variables.
+ * import { parseValue } from 'graphql/language';
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { valueFromAST } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * tags: { type: new GraphQLList(GraphQLString) },
+ * },
+ * });
+ *
+ * valueFromAST(parseValue('{ stars: 5, tags: ["featured"] }'), ReviewInput); // => { stars: 5, tags: ['featured'] }
+ * valueFromAST(parseValue('{ stars: "bad" }'), ReviewInput); // => undefined
+ * ```
+ * @example
+ * ```ts
+ * // This variant resolves variable references from runtime values.
+ * import { parseValue } from 'graphql/language';
+ * import { GraphQLInt } from 'graphql/type';
+ * import { valueFromAST } from 'graphql/utilities';
+ *
+ * valueFromAST(parseValue('$stars'), GraphQLInt, { stars: 5 }); // => 5
+ * valueFromAST(parseValue('$stars'), GraphQLInt, {}); // => undefined
+ * ```
+ * @deprecated use `coerceInputLiteral()` instead - will be removed in v18
+ */
+export declare function valueFromAST(valueNode: Maybe<ValueNode>, type: GraphQLInputType, variables?: Maybe<ObjMap<unknown>>): unknown;
+/**
+ * Produces a JavaScript value given a GraphQL Value AST.
+ *
+ * Because no GraphQL type is provided, the returned JavaScript value reflects
+ * the provided GraphQL value AST.
+ *
+ * | GraphQL Value | JavaScript Value |
+ * | -------------------- | ---------------- |
+ * | Input Object | Object |
+ * | List | Array |
+ * | Boolean | Boolean |
+ * | String / Enum | String |
+ * | Int / Float | Number |
+ * | Null | null |
+ * @param valueNode - GraphQL value AST node to convert.
+ * @param variables - Optional runtime variable values keyed by variable name.
+ * @returns JavaScript value represented by the GraphQL value AST.
+ * @example
+ * ```ts
+ * import { parseValue } from 'graphql/language';
+ * import { valueFromASTUntyped } from 'graphql/utilities';
+ *
+ * const value = valueFromASTUntyped(parseValue('[1, 2, 3]'));
+ *
+ * value; // => [1, 2, 3]
+ * valueFromASTUntyped(parseValue('$name'), { name: 'Ada' }); // => 'Ada'
+ * ```
+ */
+export declare function valueFromASTUntyped(valueNode: ValueNode, variables?: Maybe<ObjMap<unknown>>): unknown;
+/**
+ * Produces a GraphQL Value AST given a JavaScript object.
+ * Function will match JavaScript/JSON values to GraphQL AST schema format
+ * by using suggested GraphQLInputType.
+ *
+ * A GraphQL type must be provided, which will be used to interpret different
+ * JavaScript values.
+ *
+ * This deprecated function will be removed in v18. Use `valueToLiteral()`
+ * instead, and take care to operate on external values.
+ *
+ * | JSON Value | GraphQL Value |
+ * | ------------- | -------------------- |
+ * | Object | Input Object |
+ * | Array | List |
+ * | Boolean | Boolean |
+ * | String | String / Enum Value |
+ * | Number | Int / Float |
+ * | BigInt | Int |
+ * | Unknown | Enum Value |
+ * | null | NullValue |
+ * @param value - Runtime value to convert.
+ * @param type - The GraphQL type to inspect.
+ * @returns A GraphQL value AST for the provided JavaScript value, or null when no literal can represent it.
+ * @example
+ * ```ts
+ * import { print } from 'graphql/language';
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { astFromValue } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * tags: { type: new GraphQLList(GraphQLString) },
+ * },
+ * });
+ *
+ * const valueNode = astFromValue(
+ * { stars: 5, tags: ['featured', 'verified'] },
+ * ReviewInput,
+ * );
+ *
+ * print(valueNode); // => '{ stars: 5, tags: ["featured", "verified"] }'
+ * astFromValue(undefined, GraphQLString); // => null
+ * astFromValue(null, new GraphQLNonNull(GraphQLString)); // => null
+ * ```
+ * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18
+ */
+export declare function astFromValue(value: unknown, type: GraphQLInputType): Maybe<ConstValueNode>;
+/**
+ * Replaces any Variables found within an AST Value literal with literals
+ * supplied from a map of variable values, or removed if no variable replacement
+ * exists, returning a constant value.
+ *
+ * Used primarily to ensure only complete constant values are used during input
+ * coercion of custom scalars which accept complex literals.
+ * @param valueNode - Value AST node in which variables should be replaced.
+ * @param variableValues - Operation variable values returned by getVariableValues.
+ * @param fragmentVariableValues - Fragment variable values for the current fragment scope.
+ * @returns A constant value AST with variables replaced.
+ * @example
+ * ```ts
+ * import assert from 'node:assert';
+ * import { parse, parseValue, print } from 'graphql/language';
+ * import { getVariableValues } from 'graphql/execution';
+ * import { buildSchema, replaceVariables } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * review(stars: Int = 5): String
+ * }
+ * `);
+ * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');
+ * const operation = document.definitions[0];
+ * const result = getVariableValues(schema, operation.variableDefinitions, {
+ * stars: 4,
+ * });
+ *
+ * assert('variableValues' in result);
+ *
+ * const literal = replaceVariables(
+ * parseValue('{ stars: $stars, comment: $missing }'),
+ * result.variableValues,
+ * );
+ *
+ * print(literal); // => '{ stars: 4 }'
+ * ```
+ */
+export declare function replaceVariables(valueNode: ValueNode, variableValues?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<FragmentVariableValues>): ConstValueNode;
+/**
+ * Produces a GraphQL Value AST given a JavaScript value and a GraphQL type.
+ *
+ * Scalar types are converted by calling the `valueToLiteral` method on that
+ * type, otherwise the default scalar `valueToLiteral` method is used, defined
+ * below.
+ *
+ * Provided value is a non-coerced "input" value. This function does not
+ * perform any coercion, however it does perform validation. Provided values
+ * which are invalid for the given type will result in an `undefined` return
+ * value.
+ * @param value - JavaScript value to convert.
+ * @param type - GraphQL input type to convert the value against.
+ * @returns A GraphQL value AST, or undefined if the value is invalid.
+ * @example
+ * ```ts
+ * import { print } from 'graphql/language';
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { valueToLiteral } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * tags: { type: new GraphQLList(GraphQLString) },
+ * },
+ * });
+ *
+ * const literal = valueToLiteral({ stars: 5, tags: ['featured'] }, ReviewInput);
+ *
+ * print(literal); // => '{ stars: 5, tags: ["featured"] }'
+ * valueToLiteral({ tags: ['missing stars'] }, ReviewInput); // => undefined
+ * ```
+ */
+export declare function valueToLiteral(value: unknown, type: GraphQLInputType): ConstValueNode | undefined;
+/**
+ * Coerces a JavaScript value given a GraphQL Input Type.
+ *
+ * Returns `undefined` when the value could not be validly coerced according to
+ * the provided type. Use `validateInputValue` when coercion diagnostics
+ * are needed.
+ * @param inputValue - JavaScript value to coerce.
+ * @param type - GraphQL input type to coerce the value against.
+ * @returns Coerced value, or undefined if coercion fails.
+ * @example
+ * ```ts
+ * // Coerce runtime input values, returning undefined when coercion fails.
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLList,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { coerceInputValue } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * tags: { type: new GraphQLList(GraphQLString) },
+ * },
+ * });
+ *
+ * coerceInputValue({ stars: '5', tags: ['featured'] }, ReviewInput); // => { stars: 5, tags: ['featured'] }
+ * coerceInputValue({ stars: 'bad' }, ReviewInput); // => undefined
+ * ```
+ */
+export declare function coerceInputValue(inputValue: unknown, type: GraphQLInputType): unknown;
+/**
+ * Produces a coerced "internal" JavaScript value given a GraphQL Value AST.
+ *
+ * Returns `undefined` when the value could not be validly coerced according to
+ * the provided type.
+ * @param valueNode - GraphQL value AST node to coerce.
+ * @param type - GraphQL input type to coerce the literal against.
+ * @param variableValues - Operation variable values returned by getVariableValues.
+ * @param fragmentVariableValues - Fragment variable values for the current fragment scope.
+ * @returns Coerced value, or undefined if coercion fails.
+ * @example
+ * ```ts
+ * // Coerce literal input values without variables.
+ * import { parseValue } from 'graphql/language';
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * GraphQLString,
+ * } from 'graphql/type';
+ * import { coerceInputLiteral } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * comment: { type: GraphQLString },
+ * },
+ * });
+ *
+ * coerceInputLiteral(
+ * parseValue('{ stars: 5, comment: "Loved it" }'),
+ * ReviewInput,
+ * ); // => { stars: 5, comment: 'Loved it' }
+ * coerceInputLiteral(parseValue('{ comment: "Missing" }'), ReviewInput); // => undefined
+ * ```
+ * @example
+ * ```ts
+ * // This variant resolves variable references using VariableValues from getVariableValues().
+ * import assert from 'node:assert';
+ * import { parse, parseValue } from 'graphql/language';
+ * import { GraphQLInt } from 'graphql/type';
+ * import { getVariableValues } from 'graphql/execution';
+ * import { buildSchema, coerceInputLiteral } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * review(stars: Int): String
+ * }
+ * `);
+ * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');
+ * const operation = document.definitions[0];
+ * const result = getVariableValues(schema, operation.variableDefinitions, {
+ * stars: '4',
+ * });
+ *
+ * assert('variableValues' in result);
+ *
+ * coerceInputLiteral(parseValue('$stars'), GraphQLInt, result.variableValues); // => 4
+ * ```
+ */
+export declare function coerceInputLiteral(valueNode: ValueNode, type: GraphQLInputType, variableValues?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<FragmentVariableValues>): unknown;
+/**
+ * Validate that the provided input value is allowed for this type, collecting
+ * all errors via a callback function.
+ * @param inputValue - JavaScript value to validate.
+ * @param type - GraphQL input type to validate the value against.
+ * @param onError - Callback invoked for each validation error and path.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns Nothing.
+ * @example
+ * ```ts
+ * // Collect validation errors with their input paths.
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * } from 'graphql/type';
+ * import { validateInputValue } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * },
+ * });
+ * const errors = [];
+ *
+ * validateInputValue({ stars: 'bad' }, ReviewInput, (error, path) => {
+ * errors.push({ message: error.message, path });
+ * });
+ *
+ * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ]
+ * ```
+ * @example
+ * ```ts
+ * // This variant hides suggestion text for unknown input fields.
+ * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';
+ * import { validateInputValue } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * comment: { type: GraphQLString },
+ * },
+ * });
+ * const errors = [];
+ *
+ * validateInputValue(
+ * { rating: 'extra field' },
+ * ReviewInput,
+ * (error) => {
+ * errors.push(error.message);
+ * },
+ * true,
+ * );
+ *
+ * errors; // => ['Expected value of type "ReviewInput" not to include unknown field "rating", found: { rating: "extra field" }.']
+ * ```
+ */
+export declare function validateInputValue(inputValue: unknown, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray<string | number>) => void, hideSuggestions?: Maybe<boolean>): void;
+/**
+ * Validate that the provided input literal is allowed for this type, collecting
+ * all errors via a callback function.
+ *
+ * If variable values are not provided, the literal is validated statically
+ * (not assuming that those variables are missing runtime values).
+ * @param valueNode - GraphQL value AST node to validate.
+ * @param type - GraphQL input type to validate the literal against.
+ * @param onError - Callback invoked for each validation error and path.
+ * @param variables - Operation variable values returned by getVariableValues.
+ * @param fragmentVariableValues - Fragment variable values for the current fragment scope.
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
+ * @returns Nothing.
+ * @example
+ * ```ts
+ * // Validate literal input values and collect literal paths.
+ * import { parseValue } from 'graphql/language';
+ * import {
+ * GraphQLInputObjectType,
+ * GraphQLInt,
+ * GraphQLNonNull,
+ * } from 'graphql/type';
+ * import { validateInputLiteral } from 'graphql/utilities';
+ *
+ * const ReviewInput = new GraphQLInputObjectType({
+ * name: 'ReviewInput',
+ * fields: {
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
+ * },
+ * });
+ * const errors = [];
+ *
+ * validateInputLiteral(
+ * parseValue('{ stars: "bad" }'),
+ * ReviewInput,
+ * (error, path) => {
+ * errors.push({ message: error.message, path });
+ * },
+ * );
+ *
+ * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ]
+ * ```
+ * @example
+ * ```ts
+ * // This variant resolves variable references using VariableValues from getVariableValues().
+ * import assert from 'node:assert';
+ * import { parse, parseValue } from 'graphql/language';
+ * import { GraphQLInt } from 'graphql/type';
+ * import { getVariableValues } from 'graphql/execution';
+ * import { buildSchema, validateInputLiteral } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * review(stars: Int): String
+ * }
+ * `);
+ * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');
+ * const operation = document.definitions[0];
+ * const result = getVariableValues(schema, operation.variableDefinitions, {
+ * stars: '4',
+ * });
+ *
+ * assert('variableValues' in result);
+ *
+ * const errors = [];
+ * validateInputLiteral(
+ * parseValue('$stars'),
+ * GraphQLInt,
+ * (error) => errors.push(error.message),
+ * result.variableValues,
+ * undefined,
+ * true,
+ * );
+ *
+ * errors; // => []
+ * ```
+ */
+export declare function validateInputLiteral(valueNode: ValueNode, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray<string | number>) => void, variables?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<FragmentVariableValues>, hideSuggestions?: Maybe<boolean>): void;
+/**
+ * Provided a collection of ASTs, presumably each from different files,
+ * concatenate the ASTs together into batched AST, useful for validating many
+ * GraphQL source files which together represent one conceptual application.
+ * @param documents - Document ASTs to concatenate.
+ * @returns A document AST containing all definitions from the provided documents.
+ * @example
+ * ```ts
+ * import { parse } from 'graphql/language';
+ * import { concatAST } from 'graphql/utilities';
+ *
+ * const document = concatAST([
+ * parse('type Query { a: String }'),
+ * parse('type User { id: ID }'),
+ * ]);
+ *
+ * document.definitions.length; // => 2
+ * ```
+ */
+export declare function concatAST(documents: ReadonlyArray<DocumentNode>): DocumentNode;
+/**
+ * separateOperations accepts a single AST document which may contain many
+ * operations and fragments and returns a collection of AST documents each of
+ * which contains a single operation as well the fragment definitions it
+ * refers to.
+ * @param documentAST - The parsed GraphQL document AST.
+ * @returns A map of operation names to documents containing each operation and its referenced fragments.
+ * @example
+ * ```ts
+ * import { parse, print } from 'graphql/language';
+ * import { separateOperations } from 'graphql/utilities';
+ *
+ * const document = parse(`
+ * query GetUser {
+ * viewer {
+ * ...UserFields
+ * }
+ * }
+ *
+ * query GetStatus {
+ * status
+ * }
+ *
+ * fragment UserFields on User {
+ * id
+ * }
+ * `);
+ *
+ * const separated = separateOperations(document);
+ *
+ * Object.keys(separated); // => ['GetUser', 'GetStatus']
+ * print(separated.GetUser); // matches /fragment UserFields/
+ * print(separated.GetStatus); // does not match /fragment UserFields/
+ * ```
+ */
+export declare function separateOperations(documentAST: DocumentNode): ObjMap<DocumentNode>;
+/**
+ * Strips characters that are not significant to the validity or execution
+ * of a GraphQL document:
+ * - UnicodeBOM
+ * - WhiteSpace
+ * - LineTerminator
+ * - Comment
+ * - Comma
+ * - BlockString indentation
+ *
+ * Note: It is required to have a delimiter character between neighboring
+ * non-punctuator tokens and this function always uses single space as delimiter.
+ *
+ * It is guaranteed that both input and output documents if parsed would result
+ * in the exact same AST except for nodes location.
+ *
+ * Warning: It is guaranteed that this function will always produce stable results.
+ * However, it's not guaranteed that it will stay the same between different
+ * releases due to bugfixes or changes in the GraphQL specification.
+ * @param source - The GraphQL source text or source object.
+ * @returns A semantically equivalent GraphQL source string without ignored characters.
+ * @example Query source
+ * ```graphql
+ * query SomeQuery($foo: String!, $bar: String) {
+ * someField(foo: $foo, bar: $bar) {
+ * a
+ * b {
+ * c
+ * d
+ * }
+ * }
+ * }
+ * ```
+ *
+ * Becomes:
+ *
+ * ```graphql prettier-ignore
+ * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}
+ * ```
+ * @example SDL source
+ * ```graphql
+ * """
+ * Type description
+ * """
+ * type Foo {
+ * """
+ * Field description
+ * """
+ * bar: String
+ * }
+ * ```
+ *
+ * Becomes:
+ *
+ * ```graphql prettier-ignore
+ * """Type description""" type Foo{"""Field description""" bar:String}
+ * ```
+ * @example
+ * ```ts
+ * import { stripIgnoredCharacters } from 'graphql/utilities';
+ *
+ * const source = stripIgnoredCharacters('query Example { name }');
+ *
+ * source; // => 'query Example{name}'
+ * ```
+ */
+export declare function stripIgnoredCharacters(source: string | Source): string;
+/**
+ * Provided two types, return true if the types are equal (invariant).
+ * @param typeA - The first GraphQL type to compare.
+ * @param typeB - The second GraphQL type to compare.
+ * @returns True when both types are equal.
+ * @example
+ * ```ts
+ * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';
+ * import { isEqualType } from 'graphql/utilities';
+ *
+ * isEqualType(GraphQLString, GraphQLString); // => true
+ * isEqualType(new GraphQLList(GraphQLString), new GraphQLList(GraphQLString)); // => true
+ * isEqualType(new GraphQLNonNull(GraphQLString), GraphQLString); // => false
+ * ```
+ */
+export declare function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean;
+/**
+ * Provided a type and a super type, return true if the first type is either
+ * equal or a subset of the second super type (covariant).
+ * @param schema - GraphQL schema to use.
+ * @param maybeSubType - The possible subtype to compare.
+ * @param superType - The possible supertype to compare.
+ * @returns True when `maybeSubType` is equal to or a subtype of `superType`.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import {
+ * GraphQLNonNull,
+ * assertInterfaceType,
+ * assertObjectType,
+ * } from 'graphql/type';
+ * import { isTypeSubTypeOf } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * interface Node {
+ * id: ID!
+ * }
+ *
+ * type User implements Node {
+ * id: ID!
+ * }
+ *
+ * type Query {
+ * node: Node
+ * }
+ * `);
+ * const Node = assertInterfaceType(schema.getType('Node'));
+ * const User = assertObjectType(schema.getType('User'));
+ *
+ * isTypeSubTypeOf(schema, User, Node); // => true
+ * isTypeSubTypeOf(schema, new GraphQLNonNull(User), Node); // => true
+ * isTypeSubTypeOf(schema, Node, User); // => false
+ * ```
+ */
+export declare function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean;
+/**
+ * Provided two composite types, determine if they "overlap". Two composite
+ * types overlap when the Sets of possible concrete types for each intersect.
+ *
+ * This is often used to determine if a fragment of a given type could possibly
+ * be visited in a context of another type.
+ *
+ * This function is commutative.
+ * @param schema - GraphQL schema to use.
+ * @param typeA - The first GraphQL type to compare.
+ * @param typeB - The second GraphQL type to compare.
+ * @returns True when the two composite types can apply to at least one common object type.
+ * @example
+ * ```ts
+ * import { buildSchema } from 'graphql/utilities';
+ * import { assertObjectType, assertUnionType } from 'graphql/type';
+ * import { doTypesOverlap } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Photo {
+ * url: String!
+ * }
+ *
+ * type Video {
+ * url: String!
+ * }
+ *
+ * union Media = Photo | Video
+ * union StillImage = Photo
+ *
+ * type Query {
+ * media: [Media]
+ * }
+ * `);
+ * const Media = assertUnionType(schema.getType('Media'));
+ * const StillImage = assertUnionType(schema.getType('StillImage'));
+ * const Video = assertObjectType(schema.getType('Video'));
+ *
+ * doTypesOverlap(schema, Media, StillImage); // => true
+ * doTypesOverlap(schema, StillImage, Video); // => false
+ * ```
+ */
+export declare function doTypesOverlap(schema: GraphQLSchema, typeA: GraphQLCompositeType, typeB: GraphQLCompositeType): boolean;
+/** Categories of schema changes that may break existing operations. */
+export declare const BreakingChangeType: {
+ readonly TYPE_REMOVED: "TYPE_REMOVED";
+ readonly TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND";
+ readonly TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION";
+ readonly VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM";
+ readonly REQUIRED_INPUT_FIELD_ADDED: "REQUIRED_INPUT_FIELD_ADDED";
+ readonly IMPLEMENTED_INTERFACE_REMOVED: "IMPLEMENTED_INTERFACE_REMOVED";
+ readonly FIELD_REMOVED: "FIELD_REMOVED";
+ readonly FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND";
+ readonly REQUIRED_ARG_ADDED: "REQUIRED_ARG_ADDED";
+ readonly ARG_REMOVED: "ARG_REMOVED";
+ readonly ARG_CHANGED_KIND: "ARG_CHANGED_KIND";
+ readonly DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED";
+ readonly DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED";
+ readonly REQUIRED_DIRECTIVE_ARG_ADDED: "REQUIRED_DIRECTIVE_ARG_ADDED";
+ readonly DIRECTIVE_REPEATABLE_REMOVED: "DIRECTIVE_REPEATABLE_REMOVED";
+ readonly DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED";
+};
+/** Categories of schema changes that may break existing operations. */
+export type BreakingChangeType = (typeof BreakingChangeType)[keyof typeof BreakingChangeType];
+/** Categories of schema changes that may be dangerous for existing operations. */
+export declare const DangerousChangeType: {
+ readonly VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM";
+ readonly TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION";
+ readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED";
+ readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED";
+ readonly IMPLEMENTED_INTERFACE_ADDED: "IMPLEMENTED_INTERFACE_ADDED";
+ readonly ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE";
+ readonly INPUT_FIELD_DEFAULT_VALUE_CHANGE: "INPUT_FIELD_DEFAULT_VALUE_CHANGE";
+};
+/** Categories of schema changes that may be dangerous for existing operations. */
+export type DangerousChangeType = (typeof DangerousChangeType)[keyof typeof DangerousChangeType];
+/** Categories of schema changes that are considered safe for existing operations. */
+export declare const SafeChangeType: {
+ readonly DESCRIPTION_CHANGED: "DESCRIPTION_CHANGED";
+ readonly TYPE_ADDED: "TYPE_ADDED";
+ readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED";
+ readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED";
+ readonly DIRECTIVE_ADDED: "DIRECTIVE_ADDED";
+ readonly FIELD_ADDED: "FIELD_ADDED";
+ readonly DIRECTIVE_REPEATABLE_ADDED: "DIRECTIVE_REPEATABLE_ADDED";
+ readonly DIRECTIVE_LOCATION_ADDED: "DIRECTIVE_LOCATION_ADDED";
+ readonly OPTIONAL_DIRECTIVE_ARG_ADDED: "OPTIONAL_DIRECTIVE_ARG_ADDED";
+ readonly FIELD_CHANGED_KIND_SAFE: "FIELD_CHANGED_KIND_SAFE";
+ readonly ARG_CHANGED_KIND_SAFE: "ARG_CHANGED_KIND_SAFE";
+ readonly ARG_DEFAULT_VALUE_ADDED: "ARG_DEFAULT_VALUE_ADDED";
+ readonly INPUT_FIELD_DEFAULT_VALUE_ADDED: "INPUT_FIELD_DEFAULT_VALUE_ADDED";
+};
+/** Categories of schema changes that are considered safe for existing operations. */
+export type SafeChangeType = (typeof SafeChangeType)[keyof typeof SafeChangeType];
+/** Description of a schema change that may break existing operations. */
+export interface BreakingChange {
+ /** Specific kind of breaking schema change. */
+ type: BreakingChangeType;
+ /** Human-readable description of the breaking schema change. */
+ description: string;
+}
+/** Description of a schema change that may be dangerous for existing operations. */
+export interface DangerousChange {
+ /** Specific kind of dangerous schema change. */
+ type: DangerousChangeType;
+ /** Human-readable description of the dangerous schema change. */
+ description: string;
+}
+/** Description of a schema change that is considered safe for existing operations. */
+export interface SafeChange {
+ /** Specific kind of safe schema change. */
+ type: SafeChangeType;
+ /** Human-readable description of the safe schema change. */
+ description: string;
+}
+/** Any schema change detected between two schemas. */
+export type SchemaChange = SafeChange | DangerousChange | BreakingChange;
+/**
+ * Given two schemas, returns an Array containing descriptions of all the types
+ * of breaking changes covered by the other functions down below. This
+ * deprecated wrapper will be removed in v18; use `findSchemaChanges()` instead
+ * and filter for breaking changes.
+ * @param oldSchema - Schema before the change.
+ * @param newSchema - Schema after the change.
+ * @returns Breaking changes between the two schemas.
+ * @example
+ * ```ts
+ * import { buildSchema, findBreakingChanges } from 'graphql/utilities';
+ *
+ * const oldSchema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const newSchema = buildSchema(`
+ * type Query {
+ * hello: String
+ * }
+ * `);
+ *
+ * const changes = findBreakingChanges(oldSchema, newSchema);
+ *
+ * changes.map((change) => change.type); // => ['FIELD_REMOVED']
+ * ```
+ * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.
+ */
+export declare function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
+/**
+ * Given two schemas, returns an Array containing descriptions of all the types
+ * of potentially dangerous changes covered by the other functions down below.
+ * This deprecated wrapper will be removed in v18; use `findSchemaChanges()`
+ * instead and filter for dangerous changes.
+ * @param oldSchema - Schema before the change.
+ * @param newSchema - Schema after the change.
+ * @returns Dangerous changes between the two schemas.
+ * @example
+ * ```ts
+ * import { buildSchema, findDangerousChanges } from 'graphql/utilities';
+ *
+ * const oldSchema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * }
+ * `);
+ * const newSchema = buildSchema(`
+ * enum Episode {
+ * NEW_HOPE
+ * EMPIRE
+ * }
+ *
+ * type Query {
+ * episode: Episode
+ * }
+ * `);
+ *
+ * const changes = findDangerousChanges(oldSchema, newSchema);
+ *
+ * changes.map((change) => change.type); // => ['VALUE_ADDED_TO_ENUM']
+ * ```
+ * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.
+ */
+export declare function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<DangerousChange>;
+/**
+ * Finds all schema changes between two schemas.
+ * @param oldSchema - Schema before the change.
+ * @param newSchema - Schema after the change.
+ * @returns Safe, dangerous, and breaking changes between the two schemas.
+ * @example
+ * ```ts
+ * import { buildSchema, findSchemaChanges } from 'graphql/utilities';
+ *
+ * const oldSchema = buildSchema(`
+ * type Query {
+ * greeting: String
+ * }
+ * `);
+ * const newSchema = buildSchema(`
+ * type Query {
+ * greeting(name: String): String
+ * farewell: String
+ * }
+ * `);
+ *
+ * const changes = findSchemaChanges(oldSchema, newSchema);
+ *
+ * changes.map((change) => change.type); // => ['OPTIONAL_ARG_ADDED', 'FIELD_ADDED']
+ * ```
+ */
+export declare function findSchemaChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<SchemaChange>;
+/**
+ * Wrapper type that contains DocumentNode and types that can be deduced from it.
+ * @typeParam TResponseData - Typed GraphQL response data shape.
+ * @typeParam TRequestVariables - Typed GraphQL request variables shape.
+ */
+export interface TypedQueryDocumentNode<TResponseData = {
+ [key: string]: any;
+}, TRequestVariables = {
+ [key: string]: any;
+}> extends DocumentNode {
+ /** Top-level executable and type-system definitions in this document. */
+ readonly definitions: ReadonlyArray<ExecutableDefinitionNode>;
+ /**
+ * This type is used to ensure that the variables you pass in to the query are assignable to Variables
+ * and that the Result is assignable to whatever you pass your result to. The method is never actually
+ * implemented, but the type is valid because we list it as optional
+ */
+ __ensureTypesOfVariablesAndResultMatching?: (variables: TRequestVariables) => TResponseData;
+}
+interface ResolvedNamedType {
+ readonly kind: "NamedType";
+ readonly type: GraphQLNamedType;
+}
+interface ResolvedField {
+ readonly kind: "Field";
+ readonly type: GraphQLObjectType | GraphQLInterfaceType;
+ readonly field: GraphQLField<unknown, unknown>;
+}
+interface ResolvedInputField {
+ readonly kind: "InputField";
+ readonly type: GraphQLInputObjectType;
+ readonly inputField: GraphQLInputField;
+}
+interface ResolvedEnumValue {
+ readonly kind: "EnumValue";
+ readonly type: GraphQLEnumType;
+ readonly enumValue: GraphQLEnumValue;
+}
+interface ResolvedFieldArgument {
+ readonly kind: "FieldArgument";
+ readonly type: GraphQLObjectType | GraphQLInterfaceType;
+ readonly field: GraphQLField<unknown, unknown>;
+ readonly fieldArgument: GraphQLArgument;
+}
+interface ResolvedDirective {
+ readonly kind: "Directive";
+ readonly directive: GraphQLDirective;
+}
+interface ResolvedDirectiveArgument {
+ readonly kind: "DirectiveArgument";
+ readonly directive: GraphQLDirective;
+ readonly directiveArgument: GraphQLArgument;
+}
+/** A schema element resolved from a schema coordinate. */
+export type ResolvedSchemaElement = ResolvedNamedType | ResolvedField | ResolvedInputField | ResolvedEnumValue | ResolvedFieldArgument | ResolvedDirective | ResolvedDirectiveArgument;
+/**
+ * A schema coordinate is resolved in the context of a GraphQL schema to
+ * uniquely identify a schema element. It returns undefined if the schema
+ * coordinate does not resolve to a schema element, meta-field, or introspection
+ * schema element. It will throw if the containing schema element (if
+ * applicable) does not exist.
+ *
+ * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics
+ * @param schema - GraphQL schema to use.
+ * @param schemaCoordinate - The schema coordinate to resolve.
+ * @returns The schema element identified by the coordinate, or undefined if none exists.
+ * @example
+ * ```ts
+ * import { buildSchema, resolveSchemaCoordinate } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * directive @tag(name: String!) on FIELD_DEFINITION
+ *
+ * input ReviewInput {
+ * stars: Int!
+ * }
+ *
+ * enum Episode {
+ * NEW_HOPE
+ * }
+ *
+ * type Query {
+ * reviews(input: ReviewInput): [String] @tag(name: "reviews")
+ * }
+ * `);
+ *
+ * resolveSchemaCoordinate(schema, 'Query').kind; // => 'NamedType'
+ * resolveSchemaCoordinate(schema, 'Query.reviews').kind; // => 'Field'
+ * resolveSchemaCoordinate(schema, 'Query.reviews(input:)').kind; // => 'FieldArgument'
+ * resolveSchemaCoordinate(schema, 'ReviewInput.stars').kind; // => 'InputField'
+ * resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE').kind; // => 'EnumValue'
+ * resolveSchemaCoordinate(schema, '@tag').kind; // => 'Directive'
+ * resolveSchemaCoordinate(schema, '@tag(name:)').kind; // => 'DirectiveArgument'
+ * resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined
+ * ```
+ */
+export declare function resolveSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: string | Source): ResolvedSchemaElement | undefined;
+/**
+ * Resolves schema coordinate from a parsed SchemaCoordinate node.
+ * @param schema - GraphQL schema to use.
+ * @param schemaCoordinate - The schema coordinate to resolve.
+ * @returns The schema element identified by the parsed coordinate, or undefined if none exists.
+ * @example
+ * ```ts
+ * import { parseSchemaCoordinate } from 'graphql/language';
+ * import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';
+ *
+ * const schema = buildSchema(`
+ * type Query {
+ * greeting(name: String): String
+ * }
+ * `);
+ * const coordinate = parseSchemaCoordinate('Query.greeting(name:)');
+ * const resolved = resolveASTSchemaCoordinate(schema, coordinate);
+ *
+ * resolved.kind; // => 'FieldArgument'
+ * resolved.field.name; // => 'greeting'
+ * resolved.fieldArgument.name; // => 'name'
+ * ```
+ */
+export declare function resolveASTSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: SchemaCoordinateNode): ResolvedSchemaElement | undefined;
+type ExtensionsObject = Record<string | symbol, any>;
+type ObjectTypeExtensions = {
+ type: "object";
+ fields: Record<string, {
+ extensions: ExtensionsObject;
+ arguments: Record<string, ExtensionsObject>;
+ }>;
+};
+type InputTypeExtensions = {
+ type: "input";
+ fields: Record<string, {
+ extensions: ExtensionsObject;
+ }>;
+};
+type InterfaceTypeExtensions = {
+ type: "interface";
+ fields: Record<string, {
+ extensions: ExtensionsObject;
+ arguments: Record<string, ExtensionsObject>;
+ }>;
+};
+type UnionTypeExtensions = {
+ type: "union";
+};
+type ScalarTypeExtensions = {
+ type: "scalar";
+};
+type EnumTypeExtensions = {
+ type: "enum";
+ values: Record<string, ExtensionsObject>;
+};
+type PossibleTypeExtensions = InputTypeExtensions | InterfaceTypeExtensions | ObjectTypeExtensions | UnionTypeExtensions | ScalarTypeExtensions | EnumTypeExtensions;
+type SchemaExtensions = {
+ schemaExtensions: ExtensionsObject;
+ types: Record<string, {
+ extensions: ExtensionsObject;
+ } & PossibleTypeExtensions>;
+};
+interface GraphQLResolveInfo$1 extends GraphQLResolveInfo {
+ signal?: AbortSignal;
+ /** Returns the AbortSignal supplied for this execution, if any. */
+ readonly getAbortSignal: () => AbortSignal | undefined;
+ /** Returns helper functions for tracking asynchronous resolver work. */
+ readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers$1;
+}
+interface GraphQLResolveInfoHelpers$1 {
+ /**
+ * Promise.all wrapper that allows rejected branches to be tracked
+ * as execution async work.
+ *
+ * Intended use: return or await this promise from resolver work.
+ * Un-awaited async side effects are an anti-pattern:
+ *
+ * const { promiseAll } = info.getAsyncHelpers();
+ * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined);
+ *
+ * In that anti-pattern, tracking starts only after rejection (on a
+ * later microtask), so this work is not guaranteed to delay
+ * `hooks.asyncWorkFinished`.
+ *
+ * Use `track(...)` for un-awaited async side effects:
+ *
+ * const { track } = info.getAsyncHelpers();
+ * track([
+ * someAsyncWork().catch(() => undefined),
+ * someOtherAsyncWork().catch(() => undefined)
+ * ]);
+ */
+ readonly promiseAll: <T>(values: ReadonlyArray<PromiseLike<T> | T>) => Promise<Array<T>>;
+ /** Tracks asynchronous work that should delay execution completion hooks. */
+ readonly track: (maybePromises: ReadonlyArray<unknown>) => void;
+}
+interface GraphQLParseOptions {
+ noLocation?: boolean;
+ allowLegacySDLEmptyFields?: boolean;
+ allowLegacySDLImplementsInterfaces?: boolean;
+ experimentalFragmentVariables?: boolean;
+ /**
+ * Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""")
+ * GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while
+ * parsing. Turning the flag on will support the other way as well (`parse`)
+ */
+ commentDescriptions?: boolean;
+}
+type ValidatorBehavior = "error" | "warn" | "ignore";
+interface IResolverValidationOptions {
+ /**
+ * Enable to require a resolver to be defined for any field that has
+ * arguments. Defaults to `ignore`.
+ */
+ requireResolversForArgs?: ValidatorBehavior;
+ /**
+ * Enable to require a resolver to be defined for any field which has
+ * a return type that isn't a scalar. Defaults to `ignore`.
+ */
+ requireResolversForNonScalar?: ValidatorBehavior;
+ /**
+ * Enable to require a resolver for be defined for all fields defined
+ * in the schema. Defaults to `ignore`.
+ */
+ requireResolversForAllFields?: ValidatorBehavior;
+ /**
+ * Enable to require a `resolveType()` for Interface and Union types.
+ * Defaults to `ignore`.
+ */
+ requireResolversForResolveType?: ValidatorBehavior;
+ /**
+ * Enable to require all defined resolvers to match fields that
+ * actually exist in the schema. Defaults to `error` to catch common errors.
+ */
+ requireResolversToMatchSchema?: ValidatorBehavior;
+}
+type IScalarTypeResolver = GraphQLScalarType & {
+ __name?: string;
+ __description?: string;
+ __serialize?: GraphQLScalarSerializer<any>;
+ __parseValue?: GraphQLScalarValueParser<any>;
+ __parseLiteral?: GraphQLScalarLiteralParser<any>;
+ __extensions?: ExtensionsObject;
+ __astNode?: ScalarTypeDefinitionNode;
+ __extensionASTNodes?: Array<ScalarTypeExtensionNode>;
+};
+type IEnumTypeResolver = Record<string, any> & {
+ __name?: string;
+ __description?: string;
+ __extensions?: ExtensionsObject;
+ __astNode?: EnumTypeDefinitionNode;
+ __extensionASTNodes?: Array<EnumTypeExtensionNode>;
+};
+interface IFieldResolverOptions<TSource = any, TContext = any, TArgs = any> {
+ name?: string;
+ description?: string;
+ type?: GraphQLOutputType;
+ args?: Array<GraphQLArgument>;
+ resolve?: IFieldResolver<TSource, TContext, TArgs>;
+ subscribe?: IFieldResolver<TSource, TContext, TArgs>;
+ isDeprecated?: boolean;
+ deprecationReason?: string;
+ extensions?: ExtensionsObject;
+ astNode?: FieldDefinitionNode;
+}
+type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo$1) => TReturn;
+type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array<TypeSource> | (() => TypeSource);
+type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
+ [key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
+} & {
+ __name?: string;
+ __description?: string;
+ __isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>;
+ __extensions?: ExtensionsObject;
+ __astNode?: ObjectTypeDefinitionNode;
+ __extensionASTNodes?: ObjectTypeExtensionNode;
+};
+type IInterfaceTypeResolver<TSource = any, TContext = any, TArgs = any> = {
+ [key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
+} & {
+ __name?: string;
+ __description?: string;
+ __resolveType?: GraphQLTypeResolver<any, any>;
+ __extensions?: ExtensionsObject;
+ __astNode?: InterfaceTypeDefinitionNode;
+ __extensionASTNodes?: Array<InterfaceTypeExtensionNode>;
+};
+type IUnionTypeResolver = {
+ __name?: string;
+ __description?: string;
+ __resolveType?: GraphQLTypeResolver<any, any>;
+ __extensions?: ExtensionsObject;
+ __astNode?: UnionTypeDefinitionNode;
+ __extensionASTNodes?: Array<UnionTypeExtensionNode>;
+};
+type IInputObjectTypeResolver = {
+ __name?: string;
+ __description?: string;
+ __extensions?: ExtensionsObject;
+ __astNode?: InputObjectTypeDefinitionNode;
+ __extensionASTNodes?: Array<InputObjectTypeExtensionNode>;
+};
+type ISchemaLevelResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = IFieldResolver<TSource, TContext, TArgs, TReturn>;
+type IResolvers<TSource = any, TContext = any, TArgs = Record<string, any>, TReturn = any> = Record<string, ISchemaLevelResolver<TSource, TContext, TArgs, TReturn> | IObjectTypeResolver<TSource, TContext> | IInterfaceTypeResolver<TSource, TContext> | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>;
+export interface GraphQLError {
+ /**
+ * An optional schema coordinate (e.g. "MyType.myField") associated with this error.
+ */
+ readonly coordinate?: string;
+}
+interface IExecutableSchemaDefinition<TContext = any> extends BuildSchemaOptions, GraphQLParseOptions {
+ /**
+ * The type definitions used to create the schema
+ */
+ typeDefs: TypeSource;
+ /**
+ * Object describing the field resolvers for the provided type definitions
+ */
+ resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
+ /**
+ * Additional options for validating the provided resolvers
+ */
+ resolverValidationOptions?: IResolverValidationOptions;
+ /**
+ * GraphQL object types that implement interfaces will inherit any missing
+ * resolvers from their interface types defined in the `resolvers` object
+ */
+ inheritResolversFromInterfaces?: boolean;
+ /**
+ * Do not create a schema again and use the one from `buildASTSchema`
+ */
+ updateResolversInPlace?: boolean;
+ /**
+ * Schema extensions
+ */
+ schemaExtensions?: SchemaExtensions | Array<SchemaExtensions>;
+ /**
+ * Default field resolver
+ */
+ defaultFieldResolver?: GraphQLFieldResolver<any, TContext>;
+}
+/**
+ * Builds a schema from the provided type definitions and resolvers.
+ *
+ * The type definitions are written using Schema Definition Language (SDL). They
+ * can be provided as a string, a `DocumentNode`, a function, or an array of any
+ * of these. If a function is provided, it will be passed no arguments and
+ * should return an array of strings or `DocumentNode`s.
+ *
+ * Note: You can use GraphQL magic comment provide additional syntax
+ * highlighting in your editor (with the appropriate editor plugin).
+ *
+ * ```js
+ * const typeDefs = /* GraphQL *\/ `
+ * type Query {
+ * posts: [Post]
+ * author(id: Int!): Author
+ * }
+ * `;
+ * ```
+ *
+ * The `resolvers` object should be a map of type names to nested object, which
+ * themselves map the type's fields to their appropriate resolvers.
+ * See the [Resolvers](/docs/resolvers) section of the documentation for more details.
+ *
+ * ```js
+ * const resolvers = {
+ * Query: {
+ * posts: (obj, args, ctx, info) => getAllPosts(),
+ * author: (obj, args, ctx, info) => getAuthorById(args.id)
+ * }
+ * };
+ * ```
+ *
+ * Once you've defined both the `typeDefs` and `resolvers`, you can create your
+ * schema:
+ *
+ * ```js
+ * const schema = makeExecutableSchema({
+ * typeDefs,
+ * resolvers,
+ * })
+ * ```
+ */
+export declare function makeExecutableSchema<TContext = any>({ typeDefs, resolvers, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, schemaExtensions, defaultFieldResolver, ...otherOptions }: IExecutableSchemaDefinition<TContext>): GraphQLSchema;
+type ID = string;
+declare enum MessageType {
+ ConnectionInit = "connection_init",// Client -> Server
+ ConnectionAck = "connection_ack",// Server -> Client
+ Ping = "ping",// bidirectional
+ Pong = "pong",/// bidirectional
+ Subscribe = "subscribe",// Client -> Server
+ Next = "next",// Server -> Client
+ Error = "error",// Server -> Client
+ Complete = "complete"
+}
+interface ConnectionInitMessage {
+ readonly type: MessageType.ConnectionInit;
+ readonly payload?: Record<string, unknown>;
+}
+interface PingMessage {
+ readonly type: MessageType.Ping;
+ readonly payload?: Record<string, unknown>;
+}
+interface PongMessage {
+ readonly type: MessageType.Pong;
+ readonly payload?: Record<string, unknown>;
+}
+interface SubscribePayload {
+ readonly operationName?: string | null | undefined;
+ readonly query: string;
+ readonly variables?: Record<string, unknown> | null | undefined;
+ readonly extensions?: Record<string, unknown> | null | undefined;
+}
+interface ExecutionResult$1<Data = Record<string, unknown>, Extensions = Record<string, unknown>> {
+ errors?: ReadonlyArray<GraphQLError> | undefined;
+ data?: Data | null | undefined;
+ hasNext?: boolean | undefined;
+ extensions?: Extensions | undefined;
+}
+type JSONMessageReviver = (this: any, key: string, value: any) => any;
+type JSONMessageReplacer = (this: any, key: string, value: any) => any;
+type OperationResult = Promise<AsyncGenerator<ExecutionResult$1> | AsyncIterable<ExecutionResult$1> | ExecutionResult$1> | AsyncGenerator<ExecutionResult$1> | AsyncIterable<ExecutionResult$1> | ExecutionResult$1;
+type GraphQLExecutionContextValue = object | symbol | number | string | boolean | undefined | null;
+/** @category Server */
+export interface ServerOptions<P extends ConnectionInitMessage["payload"] = ConnectionInitMessage["payload"], E = unknown> {
+ /**
+ * The GraphQL schema on which the operations
+ * will be executed and validated against.
+ *
+ * If a function is provided, it will be called on
+ * every subscription request allowing you to manipulate
+ * schema dynamically.
+ *
+ * If the schema is left undefined, you're trusted to
+ * provide one in the returned `ExecutionArgs` from the
+ * `onSubscribe` callback.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ schema?: undefined | GraphQLSchema | ((ctx: Context<P, E>, id: string, payload: SubscribePayload, args: Omit<ExecutionArgs, "schema">) => Promise<GraphQLSchema> | GraphQLSchema);
+ /**
+ * A value which is provided to every resolver and holds
+ * important contextual information like the currently
+ * logged in user, or access to a database.
+ *
+ * If you return from `onSubscribe`, and the returned value is
+ * missing the `contextValue` field, this context will be used
+ * instead.
+ *
+ * If you use the function signature, the final execution arguments
+ * will be passed in (also the returned value from `onSubscribe`).
+ * Since the context is injected on every subscribe, the `SubscribeMessage`
+ * with the regular `Context` will be passed in through the arguments too.
+ *
+ * Note that the context function is invoked on each operation only once.
+ * Meaning, for subscriptions, only at the point of initialising the subscription;
+ * not on every subscription event emission. Read more about the context lifecycle
+ * in subscriptions here: https://github.com/graphql/graphql-js/issues/894.
+ */
+ context?: undefined | GraphQLExecutionContextValue | ((ctx: Context<P, E>, id: string, payload: SubscribePayload, args: ExecutionArgs) => Promise<GraphQLExecutionContextValue> | GraphQLExecutionContextValue);
+ /**
+ * The GraphQL root fields or resolvers to go
+ * alongside the schema. Learn more about them
+ * here: https://graphql.org/learn/execution/#root-fields-resolvers.
+ *
+ * If you return from `onSubscribe`, and the returned value is
+ * missing the `rootValue` field, the relevant operation root
+ * will be used instead.
+ */
+ roots?: undefined | {
+ [operation in OperationTypeNode]?: Record<string, NonNullable<ExecutionArgs["rootValue"]>>;
+ };
+ /**
+ * A custom GraphQL parse function allowing you to apply your own
+ * parsing logic.
+ *
+ * Will not be used when implementing a custom `onSubscribe`.
+ *
+ * Throwing an error from within this function will close the socket
+ * with the `Error` message in the close event reason.
+ */
+ parse?: undefined | typeof parse;
+ /**
+ * A custom GraphQL validate function allowing you to apply your
+ * own validation rules.
+ *
+ * Returned, non-empty, array of `GraphQLError`s will be communicated
+ * to the client through the `ErrorMessage`. Use an empty array if the
+ * document is valid and no errors have been encountered.
+ *
+ * Will not be used when implementing a custom `onSubscribe`.
+ *
+ * Throwing an error from within this function will close the socket
+ * with the `Error` message in the close event reason.
+ */
+ validate?: undefined | typeof validate;
+ /**
+ * Is the `execute` function from GraphQL which is
+ * used to execute the query and mutation operations.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ execute?: undefined | ((args: ExecutionArgs) => OperationResult);
+ /**
+ * Is the `subscribe` function from GraphQL which is
+ * used to execute the subscription operation.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ subscribe?: undefined | ((args: ExecutionArgs) => OperationResult);
+ /**
+ * The amount of time for which the server will wait
+ * for `ConnectionInit` message.
+ *
+ * Set the value to `Infinity`, `''`, `0`, `null` or `undefined` to skip waiting.
+ *
+ * If the wait timeout has passed and the client
+ * has not sent the `ConnectionInit` message,
+ * the server will terminate the socket by
+ * dispatching a close event `4408: Connection initialisation timeout`
+ *
+ * @default 3_000 // 3 seconds
+ */
+ connectionInitWaitTimeout?: undefined | number;
+ /**
+ * Is the connection callback called when the
+ * client requests the connection initialisation
+ * through the message `ConnectionInit`.
+ *
+ * The message payload (`connectionParams` from the
+ * client) is present in the `Context.connectionParams`.
+ *
+ * - Returning `true` or nothing from the callback will
+ * allow the client to connect.
+ *
+ * - Returning `false` from the callback will
+ * terminate the socket by dispatching the
+ * close event `4403: Forbidden`.
+ *
+ * - Returning a `Record` from the callback will
+ * allow the client to connect and pass the returned
+ * value to the client through the optional `payload`
+ * field in the `ConnectionAck` message.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ onConnect?: undefined | ((ctx: Context<P, E>) => Promise<Record<string, unknown> | boolean | void> | Record<string, unknown> | boolean | void);
+ /**
+ * Called when the client disconnects for whatever reason after
+ * he successfully went through the connection initialisation phase.
+ * Provides the close event too. Beware that this callback happens
+ * AFTER all subscriptions have been gracefully completed and BEFORE
+ * the `onClose` callback.
+ *
+ * If you are interested in tracking the subscriptions completions,
+ * consider using the `onComplete` callback.
+ *
+ * This callback will be called EXCLUSIVELY if the client connection
+ * is acknowledged. Meaning, `onConnect` will be called before the `onDisconnect`.
+ *
+ * For tracking socket closures at any point in time, regardless
+ * of the connection state - consider using the `onClose` callback.
+ */
+ onDisconnect?: undefined | ((ctx: Context<P, E>, code?: number, reason?: string) => Promise<void> | void);
+ /**
+ * Called when the client sends a {@link MessageType.Ping} message, at any
+ * point after the connection is opened - before or after the connection
+ * initialisation phase.
+ *
+ * If the client sent the ping with a payload, it will be passed through the
+ * second argument. The first argument provides the {@link Context} of the
+ * connection.
+ *
+ * If this callback is implemented, the server will still automatically reply
+ * to the ping with a pong, right after the callback resolves. Use the
+ * low-level `onPing` listener on the websocket itself for full control over
+ * the response - implementing that listener disables the automatic pong.
+ */
+ onPing?: undefined | ((ctx: Context<P, E>, payload: PingMessage["payload"]) => Promise<void> | void);
+ /**
+ * Called when the client sends a {@link MessageType.Pong} message, at any
+ * point after the connection is opened - before or after the connection
+ * initialisation phase.
+ *
+ * If the client sent the pong with a payload, it will be passed through the
+ * second argument. The first argument provides the {@link Context} of the
+ * connection.
+ */
+ onPong?: undefined | ((ctx: Context<P, E>, payload: PongMessage["payload"]) => Promise<void> | void);
+ /**
+ * Called when the socket closes for whatever reason, at any
+ * point in time. Provides the close event too. Beware
+ * that this callback happens AFTER all subscriptions have
+ * been gracefully completed and AFTER the `onDisconnect` callback.
+ *
+ * If you are interested in tracking the subscriptions completions,
+ * consider using the `onComplete` callback.
+ *
+ * In comparison to `onDisconnect`, this callback will ALWAYS
+ * be called, regardless if the user successfully went through
+ * the connection initialisation or not. `onConnect` might not
+ * called before the `onClose`.
+ */
+ onClose?: undefined | ((ctx: Context<P, E>, code?: number, reason?: string) => Promise<void> | void);
+ /**
+ * The subscribe callback executed right after
+ * acknowledging the request before any payload
+ * processing has been performed.
+ *
+ * If you return `ExecutionArgs` from the callback,
+ * it will be used instead of trying to build one
+ * internally. In this case, you are responsible
+ * for providing a ready set of arguments which will
+ * be directly plugged in the operation execution.
+ *
+ * Omitting the fields `contextValue` or `rootValue`
+ * from the returned value will have the provided server
+ * options fill in the gaps.
+ *
+ * To report GraphQL errors simply return an array
+ * of them from the callback, they will be reported
+ * to the client through the error message.
+ *
+ * Useful for preparing the execution arguments
+ * following a custom logic. A typical use case are
+ * persisted queries, you can identify the query from
+ * the subscribe message and create the GraphQL operation
+ * execution args which are then returned by the function.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ onSubscribe?: undefined | ((ctx: Context<P, E>, id: string, payload: SubscribePayload) => Promise<ExecutionArgs | readonly GraphQLError[] | void> | ExecutionArgs | readonly GraphQLError[] | void);
+ /**
+ * Executed after the operation call resolves. For streaming
+ * operations, triggering this callback does not necessarily
+ * mean that there is already a result available - it means
+ * that the subscription process for the stream has resolved
+ * and that the client is now subscribed.
+ *
+ * The `OperationResult` argument is the result of operation
+ * execution. It can be an iterator or already a value.
+ *
+ * If you want the single result and the events from a streaming
+ * operation, use the `onNext` callback.
+ *
+ * Use this callback to listen for subscribe operation and
+ * execution result manipulation.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ onOperation?: undefined | ((ctx: Context<P, E>, id: string, payload: SubscribePayload, args: ExecutionArgs, result: OperationResult) => Promise<OperationResult | void> | OperationResult | void);
+ /**
+ * Executed after an error occurred right before it
+ * has been dispatched to the client.
+ *
+ * Use this callback to format the outgoing GraphQL
+ * errors before they reach the client.
+ *
+ * Returned result will be injected in the error message payload.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ onError?: undefined | ((ctx: Context<P, E>, id: string, payload: SubscribePayload, errors: readonly GraphQLError[]) => Promise<readonly GraphQLFormattedError[] | void> | readonly GraphQLFormattedError[] | void);
+ /**
+ * Executed after an operation has emitted a result right before
+ * that result has been sent to the client. Results from both
+ * single value and streaming operations will appear in this callback.
+ *
+ * Use this callback if you want to format the execution result
+ * before it reaches the client.
+ *
+ * Returned result will be injected in the next message payload.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ */
+ onNext?: undefined | ((ctx: Context<P, E>, id: string, payload: SubscribePayload, args: ExecutionArgs, result: ExecutionResult$1) => Promise<FormattedExecutionResult | void> | FormattedExecutionResult | void);
+ /**
+ * The complete callback is executed after the
+ * operation has completed right before sending
+ * the complete message to the client.
+ *
+ * Throwing an error from within this function will
+ * close the socket with the `Error` message
+ * in the close event reason.
+ *
+ * Since the library makes sure to complete streaming
+ * operations even after an abrupt closure, this callback
+ * will still be called.
+ */
+ onComplete?: undefined | ((ctx: Context<P, E>, id: string, payload: SubscribePayload) => Promise<void> | void);
+ /**
+ * An optional override for the JSON.parse function used to hydrate
+ * incoming messages to this server. Useful for parsing custom datatypes
+ * out of the incoming JSON.
+ */
+ jsonMessageReviver?: undefined | JSONMessageReviver;
+ /**
+ * An optional override for the JSON.stringify function used to serialize
+ * outgoing messages to from server. Useful for serializing custom
+ * datatypes out to the client.
+ */
+ jsonMessageReplacer?: undefined | JSONMessageReplacer;
+}
+interface Server<E = undefined> {
+ /**
+ * New socket has been established. The lib will validate
+ * the protocol and use the socket accordingly. Returned promise
+ * will resolve after the socket closes.
+ *
+ * The second argument will be passed in the `extra` field
+ * of the `Context`. You may pass the initial request or the
+ * original WebSocket, if you need it down the road.
+ *
+ * Returns a function that should be called when the same socket
+ * has been closed, for whatever reason. The close code and reason
+ * must be passed for reporting to the `onDisconnect` callback. Returned
+ * promise will resolve once the internal cleanup is complete.
+ */
+ opened(socket: WebSocket$1, ctxExtra: E): (code?: number, reason?: string) => Promise<void>;
+}
+interface WebSocket$1 {
+ /**
+ * The subprotocol of the WebSocket. Will be used
+ * to validate against the supported ones.
+ */
+ readonly protocol: string;
+ /**
+ * Sends a message through the socket. Will always
+ * provide a `string` message.
+ *
+ * Please take care that the send is ready. Meaning,
+ * only provide a truly OPEN socket through the `opened`
+ * method of the `Server`.
+ *
+ * The returned promise is used to control the flow of data
+ * (like handling backpressure).
+ */
+ send(data: string): Promise<void> | void;
+ /**
+ * Closes the socket gracefully. Will always provide
+ * the appropriate code and close reason. `onDisconnect`
+ * callback will be called.
+ *
+ * The returned promise is used to control the graceful
+ * closure.
+ */
+ close(code?: number, reason?: string): Promise<void> | void;
+ /**
+ * Called when message is received. The library requires the data
+ * to be a `string`.
+ *
+ * All operations requested from the client will block the promise until
+ * completed, this means that the callback will not resolve until all
+ * subscription events have been emitted (or until the client has completed
+ * the stream), or until the query/mutation resolves.
+ *
+ * Exceptions raised during any phase of operation processing will
+ * reject the callback's promise, catch them and communicate them
+ * to your clients however you wish.
+ */
+ onMessage(cb: (data: string) => Promise<void>): void;
+ /**
+ * Implement a listener for the `PingMessage` sent from the client to the server.
+ * If the client sent the ping with a payload, it will be passed through the
+ * first argument.
+ *
+ * If this listener is implemented, the server will NOT automatically reply
+ * to any pings from the client. Implementing it makes it your responsibility
+ * to decide how and when to respond.
+ */
+ onPing?(payload: PingMessage["payload"]): Promise<void> | void;
+ /**
+ * Implement a listener for the `PongMessage` sent from the client to the server.
+ * If the client sent the pong with a payload, it will be passed through the
+ * first argument.
+ */
+ onPong?(payload: PongMessage["payload"]): Promise<void> | void;
+}
+interface Context<P extends ConnectionInitMessage["payload"] = ConnectionInitMessage["payload"], E = unknown> {
+ /**
+ * Indicates that the `ConnectionInit` message
+ * has been received by the server. If this is
+ * `true`, the client wont be kicked off after
+ * the wait timeout has passed.
+ */
+ readonly connectionInitReceived: boolean;
+ /**
+ * Indicates that the connection was acknowledged
+ * by having dispatched the `ConnectionAck` message
+ * to the related client.
+ */
+ readonly acknowledged: boolean;
+ /** The parameters passed during the connection initialisation. */
+ readonly connectionParams?: Readonly<P>;
+ /**
+ * Holds the active subscriptions for this context. **All operations**
+ * that are taking place are aggregated here. The user is _subscribed_
+ * to an operation when waiting for result(s).
+ *
+ * If the subscription behind an ID is an `AsyncIterator` - the operation
+ * is streaming; on the contrary, if the subscription is `null` - it is simply
+ * a reservation, meaning - the operation resolves to a single result or is still
+ * pending/being prepared.
+ */
+ readonly subscriptions: Record<ID, AsyncGenerator<unknown> | AsyncIterable<unknown> | null>;
+ /**
+ * An extra field where you can store your own context values
+ * to pass between callbacks.
+ */
+ extra: E;
+}
+/**
+ * Makes a Protocol compliant WebSocket GraphQL server. The server
+ * is actually an API which is to be used with your favourite WebSocket
+ * server library!
+ *
+ * Read more about the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md).
+ *
+ * @category Server
+ */
+export declare function makeServer<P extends ConnectionInitMessage["payload"] = ConnectionInitMessage["payload"], E = unknown>(options: ServerOptions<P, E>): Server<E>;
+
+declare namespace Kind {
+ export { ARGUMENT, ARGUMENT_COORDINATE, BOOLEAN, DIRECTIVE, DIRECTIVE_ARGUMENT_COORDINATE, DIRECTIVE_COORDINATE, DIRECTIVE_DEFINITION, DIRECTIVE_EXTENSION, DOCUMENT, ENUM, ENUM_TYPE_DEFINITION, ENUM_TYPE_EXTENSION, ENUM_VALUE_DEFINITION, FIELD, FIELD_DEFINITION, FLOAT, FRAGMENT_ARGUMENT, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, INPUT_OBJECT_TYPE_DEFINITION, INPUT_OBJECT_TYPE_EXTENSION, INPUT_VALUE_DEFINITION, INT, INTERFACE_TYPE_DEFINITION, INTERFACE_TYPE_EXTENSION, LIST, LIST_TYPE, MEMBER_COORDINATE, NAME, NAMED_TYPE, NON_NULL_TYPE, NULL, OBJECT, OBJECT_FIELD, OBJECT_TYPE_DEFINITION, OBJECT_TYPE_EXTENSION, OPERATION_DEFINITION, OPERATION_TYPE_DEFINITION, SCALAR_TYPE_DEFINITION, SCALAR_TYPE_EXTENSION, SCHEMA_DEFINITION, SCHEMA_EXTENSION, SELECTION_SET, STRING, TYPE_COORDINATE, UNION_TYPE_DEFINITION, UNION_TYPE_EXTENSION, VARIABLE, VARIABLE_DEFINITION };
+}
+
+export {
+ Location$1 as Location,
+ Path as ResponsePath,
+ pathToArray as responsePathAsArray,
+};
+
+export {};
diff --git a/vendor/deps.js b/vendor/deps.js
new file mode 100644
index 0000000..22d7525
--- /dev/null
+++ b/vendor/deps.js
@@ -0,0 +1,190 @@
+// @ts-self-types="./deps.d.ts"
+var Ef=Object.defineProperty;var Tf=(e)=>e;function yf(e,t){this[e]=Tf.bind(null,t)}var gf=(e,t)=>{for(var n in t)Ef(e,n,{get:t[n],enumerable:!0,configurable:!0,set:yf.bind(t,n)})};var C={};gf(C,{ARGUMENT:()=>ii,ARGUMENT_COORDINATE:()=>mo,BOOLEAN:()=>tt,DIRECTIVE:()=>oi,DIRECTIVE_ARGUMENT_COORDINATE:()=>Eo,DIRECTIVE_COORDINATE:()=>ho,DIRECTIVE_DEFINITION:()=>pt,DIRECTIVE_EXTENSION:()=>Tr,DOCUMENT:()=>jt,ENUM:()=>Ot,ENUM_TYPE_DEFINITION:()=>Yt,ENUM_TYPE_EXTENSION:()=>pn,ENUM_VALUE_DEFINITION:()=>lo,FIELD:()=>an,FIELD_DEFINITION:()=>co,FLOAT:()=>Bt,FRAGMENT_ARGUMENT:()=>uo,FRAGMENT_DEFINITION:()=>Qe,FRAGMENT_SPREAD:()=>Dt,INLINE_FRAGMENT:()=>_n,INPUT_OBJECT_TYPE_DEFINITION:()=>yt,INPUT_OBJECT_TYPE_EXTENSION:()=>Lt,INPUT_VALUE_DEFINITION:()=>ai,INT:()=>Oe,INTERFACE_TYPE_DEFINITION:()=>xt,INTERFACE_TYPE_EXTENSION:()=>Kt,LIST:()=>Ae,LIST_TYPE:()=>Dn,MEMBER_COORDINATE:()=>fo,NAME:()=>Ne,NAMED_TYPE:()=>Sn,NON_NULL_TYPE:()=>cn,NULL:()=>le,OBJECT:()=>Ve,OBJECT_FIELD:()=>un,OBJECT_TYPE_DEFINITION:()=>At,OBJECT_TYPE_EXTENSION:()=>qt,OPERATION_DEFINITION:()=>Tt,OPERATION_TYPE_DEFINITION:()=>si,SCALAR_TYPE_DEFINITION:()=>Qt,SCALAR_TYPE_EXTENSION:()=>ln,SCHEMA_DEFINITION:()=>Ye,SCHEMA_EXTENSION:()=>Rt,SELECTION_SET:()=>ao,STRING:()=>Ie,TYPE_COORDINATE:()=>po,UNION_TYPE_DEFINITION:()=>wt,UNION_TYPE_EXTENSION:()=>Jt,VARIABLE:()=>Ce,VARIABLE_DEFINITION:()=>ri});var Nf="17.0.2",ro=Object.freeze({major:17,minor:0,patch:2,preReleaseTag:null});function y(e){return io(e,[])}function io(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return If(e,t);default:return String(e)}}function If(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(vf(e)){let r=e.toJSON();if(r!==e)return typeof r==="string"?r:io(r,n)}else if(Array.isArray(e))return _f(e,n);return bf(e,n)}function vf(e){return typeof e.toJSON==="function"}function bf(e,t){let n=Object.entries(e);if(n.length===0)return"{}";if(t.length>2)return"["+Sf(e)+"]";return"{ "+n.map(([i,o])=>i+": "+io(o,t)).join(", ")+" }"}function _f(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),r=e.length-n,i=[];for(let o=0;o<n;++o)i.push(io(e[o],t));if(r===1)i.push("... 1 more item");else if(r>1)i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}function Sf(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor==="function"){let n=e.constructor.name;if(typeof n==="string"&&n!=="")return n}return t}function Df(e,t,n){if(e?.__kind===t)return!0;if(typeof e==="object"&&e!==null){let r=n.prototype[Symbol.toStringTag],i=Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name;if(r===i){let o=y(e);throw Error(`Cannot use ${r} "${o}" from another module or realm.
+
+Ensure that there is only one instance of "graphql" in the node_modules
+directory. If different versions of "graphql" are the dependencies of other
+relied on modules, use "resolutions" to ensure only one version is installed.
+
+https://yarnpkg.com/en/docs/selective-version-resolutions
+
+Duplicate "graphql" modules cannot be used at the same time since different
+versions may have different capabilities and behavior. The data from one
+version used in the function from another could produce confusing and
+spurious results.`)}}return!1}function Of(e,t){return e?.__kind===t}var Le=Of;function Ru(){Le=Df}var Lu=!1;function Af(){Lu=!0,Ru()}function xf(){return Lu}function K(e){return e instanceof Promise}function Be(e){return typeof e?.then==="function"}function oo(e){return e instanceof Error?e:new ku(e)}class ku extends Error{constructor(e){super("Unexpected error value: "+y(e));this.name="NonErrorThrown",this.thrownValue=e}}function ye(e){return typeof e=="object"&&e!==null}function U(e,t){if(!e)throw Error(t??"Unexpected invariant triggered.")}var wf=/\r\n|[\n\r]/g;function Yn(e,t){let n=0,r=1;for(let i of e.body.matchAll(wf)){if(typeof i.index!=="number")U(!1);if(i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function so(e){return Zr(e.source,Yn(e.source,e.start))}function Zr(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${s}:${u}
+`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){let f=Math.floor(u/80),d=u%80,E=[];for(let I=0;I<p.length;I+=80)E.push(p.slice(I,I+80));return c+Fu([[`${s} |`,E[0]],...E.slice(1,f+1).map((I)=>["|",I]),["|","^".padStart(d)],["|",E[f+1]]])}return c+Fu([[`${s-1} |`,l[i-1]],[`${s} |`,p],["|","^".padStart(u)],[`${s+1} |`,l[i+1]]])}function Fu(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
+`)}class m extends Error{constructor(e,t={}){let{nodes:n,source:r,positions:i,path:o,originalError:s,cause:a,extensions:u}=t,c="cause"in t,l=c?a:s,p=c||s!=null?{cause:l}:void 0;super(e,p);this.name="GraphQLError",this.path=o??void 0;let f=s??(a instanceof Error?a:void 0);this.originalError=f,this.nodes=Cu(Array.isArray(n)?n:n?[n]:void 0);let d=Cu(this.nodes?.map((I)=>I.loc).filter((I)=>I!=null));this.source=r??d?.[0]?.source,this.positions=i??d?.map((I)=>I.start),this.locations=i&&r?i.map((I)=>Yn(r,I)):d?.map((I)=>Yn(I.source,I.start));let E=ye(f?.extensions)?f.extensions:void 0;if(this.extensions=u??E??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s?.stack!=null)Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0});else if(Error.captureStackTrace!=null)Error.captureStackTrace(this,m);else Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes){for(let t of this.nodes)if(t.loc)e+=`
+
+`+so(t.loc)}else if(this.source&&this.locations)for(let t of this.locations)e+=`
+
+`+Zr(this.source,t);return e}toJSON(){let e={message:this.message};if(this.locations!=null)e.locations=this.locations;if(this.path!=null)e.path=this.path;if(this.extensions!=null&&Object.keys(this.extensions).length>0)e.extensions=this.extensions;return e}}function Cu(e){return e===void 0||e.length===0?void 0:e}function De(e){if(e instanceof m)return e;let t=oo(e);return new m(t.message,{originalError:t})}class Fe extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){let n=this.get(e);if(n===void 0)this.set(e,[t]);else n.push(t)}}function Vu(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Mu(e){return Pu("or",e)}function Uu(e){return Pu("and",e)}function Pu(e,t){if(t.length===0)U(!1);switch(t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(", ")+", "+e+" "+r}function et(e){return typeof e==="object"&&typeof e?.[Symbol.iterator]==="function"}function sn(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function Gt(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function qn(e){if(e.length===0)return"";return` at ${e.map((t)=>typeof t==="number"?`[${t}]`:`.${t}`).join("")}`}class ei{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class bn{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}var ti={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Rf=new Set(Object.keys(ti));function ni(e){let t=e?.kind;return typeof t==="string"&&Rf.has(t)}var re={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var Ne="Name",jt="Document",Tt="OperationDefinition",ri="VariableDefinition",ao="SelectionSet",an="Field",ii="Argument",uo="FragmentArgument",Dt="FragmentSpread",_n="InlineFragment",Qe="FragmentDefinition",Ce="Variable",Oe="IntValue",Bt="FloatValue",Ie="StringValue",tt="BooleanValue",le="NullValue",Ot="EnumValue",Ae="ListValue",Ve="ObjectValue",un="ObjectField",oi="Directive",Sn="NamedType",Dn="ListType",cn="NonNullType",Ye="SchemaDefinition",si="OperationTypeDefinition",Qt="ScalarTypeDefinition",At="ObjectTypeDefinition",co="FieldDefinition",ai="InputValueDefinition",xt="InterfaceTypeDefinition",wt="UnionTypeDefinition",Yt="EnumTypeDefinition",lo="EnumValueDefinition",yt="InputObjectTypeDefinition",pt="DirectiveDefinition",Rt="SchemaExtension",Tr="DirectiveExtension",ln="ScalarTypeExtension",qt="ObjectTypeExtension",Kt="InterfaceTypeExtension",Jt="UnionTypeExtension",pn="EnumTypeExtension",Lt="InputObjectTypeExtension",po="TypeCoordinate",fo="MemberCoordinate",mo="ArgumentCoordinate",ho="DirectiveCoordinate",Eo="DirectiveArgumentCoordinate";function nt(e,t){if(!e)throw Error(t)}var Lf=5;function qe(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return"";let i=" Did you mean ";if(n!=null)i+=n+" ";let o=Mu(r.slice(0,Lf).map((s)=>`"${s}"`));return i+o+"?"}function ua(e){return e}function kt(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function fn(e,t){let n=0,r=0;while(n<e.length&&r<t.length){let i=e.charCodeAt(n),o=t.charCodeAt(r);if(To(i)&&To(o)){let s=0;do++n,s=s*10+i-ca,i=e.charCodeAt(n);while(To(i)&&s>0);let a=0;do++r,a=a*10+o-ca,o=t.charCodeAt(r);while(To(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++n,++r}}return e.length-t.length}var ca=48,kf=57;function To(e){return!isNaN(e)&&ca<=e&&e<=kf}function Je(e,t){let n=Object.create(null),r=new Gu(e),i=Math.floor(e.length*0.4)+1;for(let o of t){let s=r.measure(o,i);if(s!==void 0)n[o]=s}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:fn(o,s)})}class Gu{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=$u(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=$u(n),i=this._inputArray;if(r.length<i.length){let c=r;r=i,i=c}let o=r.length,s=i.length;if(o-s>t)return;let a=this._rows;for(let c=0;c<=s;c++)a[0][c]=c;for(let c=1;c<=o;c++){let l=a[(c-1)%3],p=a[c%3],f=p[0]=c;for(let d=1;d<=s;d++){let E=r[c-1]===i[d-1]?0:1,I=Math.min(l[d]+1,p[d-1]+1,l[d-1]+E);if(c>1&&d>1&&r[c-1]===i[d-2]&&r[c-2]===i[d-1]){let S=a[(c-2)%3][d-2];I=Math.min(I,S+1)}if(I<f)f=I;p[d]=I}if(f>t)return}let u=a[o%3][s];return u<=t?u:void 0}}function $u(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function We(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;for(let n of Object.getOwnPropertySymbols(e))t[n]=e[n];return t}function yo(e){return e===9||e===32}function Kn(e){return e>=48&&e<=57}function ju(e){return e>=97&&e<=122||e>=65&&e<=90}function Jn(e){return ju(e)||e===95}function go(e){return ju(e)||Kn(e)||e===95}function Bu(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){let o=e[i],s=Ff(o);if(s===o.length)continue;if(n??=i,r=i,i!==0&&s<t)t=s}return e.map((i,o)=>o===0?i:i.slice(t)).slice(n??0,r+1)}function Ff(e){let t=0;while(t<e.length&&yo(e.charCodeAt(t)))++t;return t}function Qu(e){if(e==="")return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o<e.length;++o)switch(e.codePointAt(o)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||=t;break;default:r&&=n,t=!1}if(t)return!1;if(r&&i)return!1;return!0}function No(e,t){let n=e.replaceAll('"""','\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,o=r.length>1&&r.slice(1).every((d)=>d.length===0||yo(d.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,u=e.endsWith("\\"),c=a||u,l=!t?.minimize&&(!i||e.length>70||c||o||s),p="",f=i&&yo(e.charCodeAt(0));if(l&&!f||o)p+=`
+`;if(p+=n,l||c)p+=`
+`;return'"""'+p+'"""'}function Yu(e){return`"${e.replace(Cf,Vf)}"`}var Cf=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Vf(e){return Mf[e.charCodeAt(0)]}var Mf=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","","\\\"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Wn=Object.freeze({});function ft(e,t,n=ti){let r=new Map;for(let E of Object.values(C))r.set(E,Hn(t,E));let i=void 0,o=Array.isArray(e),s=[e],a=-1,u=[],c=e,l=void 0,p=void 0,f=[],d=[];do{a++;let E=a===s.length,I=E&&u.length!==0;if(E){if(l=d.length===0?void 0:f[f.length-1],c=p,p=d.pop(),I)if(o){c=c.slice();let G=0;for(let[Z,W]of u){let H=Z-G;if(W===null)c.splice(H,1),G++;else c[H]=W}}else{c={...c};for(let[G,Z]of u)c[G]=Z}a=i.index,s=i.keys,u=i.edits,o=i.inArray,i=i.prev}else if(p!=null){if(l=o?a:s[a],c=p[l],c===null||c===void 0)continue;f.push(l)}let S;if(!Array.isArray(c)){if(!ni(c))nt(!1,`Invalid AST Node: ${y(c)}.`);if(S=(E?r.get(c.kind)?.leave:r.get(c.kind)?.enter)?.call(t,c,l,p,f,d),S===Wn)break;if(S===!1){if(!E){f.pop();continue}}else if(S!==void 0){if(u.push([l,S]),!E)if(ni(S))c=S;else{f.pop();continue}}}if(S===void 0&&I)u.push([l,c]);if(E)f.pop();else{if(i={inArray:o,index:a,keys:s,edits:u,prev:i},o=Array.isArray(c),s=o?c:n[c.kind]??[],a=-1,u=[],p!=null)d.push(p);p=c}}while(i!==void 0);if(u.length!==0)return u.at(-1)[1];return e}function ui(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(C)){let i=!1,o=Array(e.length).fill(void 0),s=Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){let{enter:c,leave:l}=Hn(e[u],r);i||=c!=null||l!=null,o[u]=c,s[u]=l}if(!i)continue;let a={enter(...u){let c=u[0];for(let l=0;l<e.length;l++)if(t[l]===null){let p=o[l]?.apply(e[l],u);if(p===!1)t[l]=c;else if(p===Wn)t[l]=Wn;else if(p!==void 0)return p}},leave(...u){let c=u[0];for(let l=0;l<e.length;l++)if(t[l]===null){let p=s[l]?.apply(e[l],u);if(p===Wn)t[l]=Wn;else if(p!==void 0&&p!==!1)return p}else if(t[l]===c)t[l]=null}};n[r]=a}return n}function Hn(e,t){let n=e[t];if(typeof n==="object")return n;else if(typeof n==="function")return{enter:n,leave:void 0};return{enter:e.enter,leave:e.leave}}function ee(e){return ft(e,Uf)}var pa=80,Uf={Name:{leave:(e)=>e.value},Variable:{leave:(e)=>"$"+e.name},Document:{leave:(e)=>x(e.definitions,`
+
+`)},OperationDefinition:{leave(e){let t=la(e.variableDefinitions)?J(`(
+`,x(e.variableDefinitions,`
+`),`
+)`):J("(",x(e.variableDefinitions,", "),")"),n=J("",e.description,`
+`)+x([e.operation,x([e.name,t]),x(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>J("",i,`
+`)+e+": "+t+J(" = ",n)+J(" ",x(r," "))},SelectionSet:{leave:({selections:e})=>gt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=x([J("",e,": "),t],"");return x([qu(o,n),J(" ",x(r," ")),J(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let r="..."+e;return qu(r,t)+J(" ",x(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>x(["...",J("on ",e),x(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:o})=>J("",o,`
+`)+`fragment ${e}${J("(",x(n,", "),")")} on ${t} ${J("",x(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?No(e):Yu(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+x(e,", ")+"]";if(t.length>pa)return`[
+`+ci(x(e,`
+`))+`
+]`;return t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+x(e,", ")+" }";return t.length>pa?gt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+J("(",x(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>J("",e,`
+`)+x(["schema",x(t," "),gt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>J("",e,`
+`)+x(["scalar",t,x(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>J("",e,`
+`)+x(["type",t,J("implements ",x(n," & ")),x(r," "),gt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>J("",e,`
+`)+t+(la(n)?J(`(
+`,ci(x(n,`
+`)),`
+)`):J("(",x(n,", "),")"))+": "+r+J(" ",x(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>J("",e,`
+`)+x([t+": "+n,J("= ",r),x(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>J("",e,`
+`)+x(["interface",t,J("implements ",x(n," & ")),x(r," "),gt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>J("",e,`
+`)+x(["union",t,x(n," "),J("= ",x(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>J("",e,`
+`)+x(["enum",t,x(n," "),gt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>J("",e,`
+`)+x([t,x(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>J("",e,`
+`)+x(["input",t,x(n," "),gt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:o})=>J("",e,`
+`)+"directive @"+t+(la(n)?J(`(
+`,ci(x(n,`
+`)),`
+)`):J("(",x(n,", "),")"))+J(" ",x(r," "))+(i?" repeatable":"")+" on "+x(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>x(["extend schema",x(e," "),gt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>x(["extend scalar",e,x(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>x(["extend type",e,J("implements ",x(t," & ")),x(n," "),gt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>x(["extend interface",e,J("implements ",x(t," & ")),x(n," "),gt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>x(["extend union",e,x(t," "),J("= ",x(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>x(["extend enum",e,x(t," "),gt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>x(["extend input",e,x(t," "),gt(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>x(["extend directive @"+e,x(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>x([e,J(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>x([e,J(".",t),J("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>x(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>x(["@",e,J("(",t,":)")])}};function x(e,t=""){return e?.filter((n)=>n!==void 0&&n!=="").join(t)??""}function gt(e){return J(`{
+`,ci(x(e,`
+`)),`
+}`)}function J(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function ci(e){return J(" ",e.replaceAll(`
+`,`
+ `))}function la(e){return e?.some((t)=>t.includes(`
+`))??!1}function qu(e,t){let n=e+J("(",x(t,", "),")");if(n.length>pa)n=e+J(`(
+`,ci(x(t,`
+`)),`
+)`);return n}function Wt(e,t){switch(e.kind){case le:return null;case Oe:return parseInt(e.value,10);case Bt:return parseFloat(e.value);case Ie:case Ot:case tt:return e.value;case Ae:return e.values.map((n)=>Wt(n,t));case Ve:return kt(e.fields,(n)=>n.name.value,(n)=>Wt(n.value,t));case Ce:return t?.[e.name.value]}}function He(e){if(e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!go(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Jn(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Io(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return He(e)}function yr(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||k(e)||j(e)||w(e)}function Ku(e){if(!yr(e))throw Error(`Expected ${y(e)} to be a GraphQL type.`);return e}var Ju=Symbol("Scalar");function ae(e){return Le(e,Ju,ke)}function Wu(e){if(!ae(e))throw Error(`Expected ${y(e)} to be a GraphQL Scalar type.`);return e}var fa=Symbol("Object");function L(e){return Le(e,fa,Ee)}function bo(e){if(!L(e))throw Error(`Expected ${y(e)} to be a GraphQL Object type.`);return e}var Hu=Symbol("Field");function da(e){return Le(e,Hu,zn)}function zu(e){if(!da(e))throw Error(`Expected ${y(e)} to be a GraphQL field.`);return e}var Xu=Symbol("Argument");function li(e){return Le(e,Xu,di)}function Zu(e){if(!li(e))throw Error(`Expected ${y(e)} to be a GraphQL argument.`);return e}var ec=Symbol("Interface");function P(e){return Le(e,ec,Me)}function _o(e){if(!P(e))throw Error(`Expected ${y(e)} to be a GraphQL Interface type.`);return e}var tc=Symbol("Union");function te(e){return Le(e,tc,it)}function nc(e){if(!te(e))throw Error(`Expected ${y(e)} to be a GraphQL Union type.`);return e}var rc=Symbol("Enum");function z(e){return Le(e,rc,we)}function ic(e){if(!z(e))throw Error(`Expected ${y(e)} to be a GraphQL Enum type.`);return e}var oc=Symbol("EnumValue");function ma(e){return Le(e,oc,Ea)}function sc(e){if(!ma(e))throw Error(`Expected ${y(e)} to be a GraphQL Enum value.`);return e}var ac=Symbol("InputObject");function k(e){return Le(e,ac,Ge)}function uc(e){if(!k(e))throw Error(`Expected ${y(e)} to be a GraphQL Input Object type.`);return e}var cc=Symbol("InputField");function ha(e){return Le(e,cc,Ta)}function lc(e){if(!ha(e))throw Error(`Expected ${y(e)} to be a GraphQL input field.`);return e}var pc=Symbol("List");function j(e){return Le(e,pc,oe)}function fc(e){if(!j(e))throw Error(`Expected ${y(e)} to be a GraphQL List type.`);return e}var dc=Symbol("NonNull");function w(e){return Le(e,dc,V)}function mc(e){if(!w(e))throw Error(`Expected ${y(e)} to be a GraphQL Non-Null type.`);return e}function xe(e){return ae(e)||z(e)||k(e)||On(e)&&xe(e.ofType)}function hc(e){if(!xe(e))throw Error(`Expected ${y(e)} to be a GraphQL input type.`);return e}function Nt(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||On(e)&&Nt(e.ofType)}function Ec(e){if(!Nt(e))throw Error(`Expected ${y(e)} to be a GraphQL output type.`);return e}function ve(e){return ae(e)||z(e)}function It(e){if(!ve(e))throw Error(`Expected ${y(e)} to be a GraphQL leaf type.`);return e}function dt(e){return L(e)||P(e)||te(e)}function Tc(e){if(!dt(e))throw Error(`Expected ${y(e)} to be a GraphQL composite type.`);return e}function Ke(e){return P(e)||te(e)}function yc(e){if(!Ke(e))throw Error(`Expected ${y(e)} to be a GraphQL abstract type.`);return e}class oe{constructor(e){this.__kind=pc,this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class V{constructor(e){this.__kind=dc,this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function On(e){return j(e)||w(e)}function gc(e){if(!On(e))throw Error(`Expected ${y(e)} to be a GraphQL wrapping type.`);return e}function pi(e){return yr(e)&&!w(e)}function So(e){if(!pi(e))throw Error(`Expected ${y(e)} to be a GraphQL nullable type.`);return e}function gr(e){if(e)return w(e)?e.ofType:e}function rt(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||k(e)}function Nc(e){if(!rt(e))throw Error(`Expected ${y(e)} to be a GraphQL named type.`);return e}function pe(e){if(e){let t=e;while(On(t))t=t.ofType;return t}}function Do(e){return typeof e==="function"?e():e}function fi(e){return typeof e==="function"?e():e}class ke{constructor(e){if(this.__kind=Ju,this.name=He(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??e.coerceOutputValue??ua,this.parseValue=e.parseValue??e.coerceInputValue??ua,this.parseLiteral=e.parseLiteral??((t,n)=>this.coerceInputValue(Wt(t,n))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral){if(!(typeof e.parseValue==="function"&&typeof e.parseLiteral==="function"))nt(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)}if(e.coerceInputLiteral){if(!(typeof e.coerceInputValue==="function"&&typeof e.coerceInputLiteral==="function"))nt(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`)}}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Ee{constructor(e){this.__kind=fa,this.__kind=fa,this.name=He(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=vc.bind(void 0,this,e.fields),this._interfaces=Ic.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}getInterfaces(){if(typeof this._interfaces==="function")this._interfaces=this._interfaces();return this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Gt(this.getFields(),(e)=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ic(e){return Do(e??[])}function vc(e,t){let n=fi(t);return Gt(n,(r,i)=>new zn(e,i,r))}class zn{constructor(e,t,n){this.__kind=Hu,this.parentType=e,this.name=He(t),this.description=n.description,this.type=n.type;let r=n.args;this.args=r?Object.entries(r).map(([i,o])=>new di(this,i,o)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:kt(this.args,(e)=>e.name,(e)=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??"<meta>"}.${this.name}`}toJSON(){return this.toString()}}class di{constructor(e,t,n){this.__kind=Xu,this.parent=e,this.name=He(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function ze(e){return w(e.type)&&e.default===void 0&&e.defaultValue===void 0}class Me{constructor(e){this.__kind=ec,this.name=He(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=vc.bind(void 0,this,e.fields),this._interfaces=Ic.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}getInterfaces(){if(typeof this._interfaces==="function")this._interfaces=this._interfaces();return this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Gt(this.getFields(),(e)=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class it{constructor(e){this.__kind=tc,this.name=He(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=Pf.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){if(typeof this._types==="function")this._types=this._types();return this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Pf(e){return Do(e)}class we{constructor(e){this.__kind=rc,this.name=He(e.name),this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=$f.bind(void 0,this,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){if(typeof this._values==="function")this._values=this._values();return this._values}getValue(e){return this._nameLookup??=sn(this.getValues(),(t)=>t.name),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){this._valueLookup??=new Map(this.getValues().map((n)=>[n.value,n]));let t=this._valueLookup.get(e);if(t===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${y(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if(typeof e!=="string"){let r=y(e);throw new m(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(t?"":vo(this,r)))}let n=this.getValue(e);if(n==null)throw new m(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":vo(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==Ot){let r=ee(e);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(t?"":vo(this,r)),{nodes:e})}let n=this.getValue(e.value);if(n==null){let r=ee(e);throw new m(`Value "${r}" does not exist in "${this.name}" enum.`+(t?"":vo(this,r)),{nodes:e})}return n.value}valueToLiteral(e){if(typeof e==="string"&&this.getValue(e))return{kind:Ot,value:e}}toConfig(){return{name:this.name,description:this.description,values:kt(this.getValues(),(e)=>e.name,(e)=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function $f(e,t){let n=fi(t);return Object.entries(n).map(([r,i])=>new Ea(e,r,i))}function vo(e,t){let n=e.getValues().map((i)=>i.name),r=Je(t,n);return qe("the enum value",r)}class Ea{constructor(e,t,n){this.__kind=oc,this.parentEnum=e,this.name=Io(t),this.description=n.description,this.value=n.value!==void 0?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class Ge{constructor(e){this.__kind=ac,this.name=He(e.name),this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Gf.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}toConfig(){return{name:this.name,description:this.description,fields:Gt(this.getFields(),(e)=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Gf(e,t){let n=fi(t);return Gt(n,(r,i)=>new Ta(e,i,r))}class Ta{constructor(e,t,n){if("resolve"in n)nt(!1,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`);this.__kind=cc,this.parentType=e,this.name=He(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Xe(e){return w(e.type)&&e.defaultValue===void 0&&e.default===void 0}function Nr(e,t){if(e===t)return!0;if(w(e)&&w(t))return Nr(e.ofType,t.ofType);if(j(e)&&j(t))return Nr(e.ofType,t.ofType);return!1}function Ht(e,t,n){if(t===n)return!0;if(w(n)){if(w(t))return Ht(e,t.ofType,n.ofType);return!1}if(w(t))return Ht(e,t.ofType,n);if(j(n)){if(j(t))return Ht(e,t.ofType,n.ofType);return!1}if(j(t))return!1;return Ke(n)&&(P(t)||L(t))&&e.isSubType(n,t)}function mi(e,t,n){if(t===n)return!0;if(Ke(t)){if(Ke(n))return e.getPossibleTypes(t).some((r)=>e.isSubType(n,r));return e.isSubType(t,n)}if(Ke(n))return e.isSubType(n,t);return!1}function Pe(e,t,n){return{prev:e,key:t,typename:n}}function fe(e){let t=[],n=e;while(n)t.push(n.key),n=n.prev;return t.reverse()}function zt(e,t){if(w(t)){if(e==null)return;return zt(e,t.ofType)}if(e==null)return{kind:le};if(j(t)){if(!et(e))return zt(e,t.ofType);let r=[];for(let i of e){let o=zt(i,t.ofType);if(!o)return;r.push(o)}return{kind:Ae,values:r}}if(k(t)){if(!ye(e))return;let r=[],i=t.getFields();if(Object.keys(e).some((s)=>e[s]!==void 0&&!Object.hasOwn(i,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(Xe(s))return}else{let u=zt(e[s.name],s.type);if(!u)return;r.push({kind:un,name:{kind:Ne,value:s.name},value:u})}return{kind:Ve,fields:r}}let n=It(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch(r){return}return Xn(e)}function Xn(e){if(e==null)return{kind:le};switch(typeof e){case"boolean":return{kind:tt,value:e};case"string":return{kind:Ie,value:e,block:!1};case"bigint":return{kind:Oe,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:le};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:Oe,value:t}:{kind:Bt,value:t}}case"object":{if(et(e))return{kind:Ae,values:Array.from(e,Xn)};let t=e,n=[];for(let r of Object.keys(t)){let i=t[r];if(i!==void 0)n.push({kind:un,name:{kind:Ne,value:r},value:Xn(i)})}return{kind:Ve,fields:n}}}throw TypeError(`Cannot convert value to AST: ${y(e)}.`)}function dn(e,t,n){switch(e.kind){case Ce:{let r=e.name.value,i=n?.sources[r];if(i){let s=i.value;if(s===void 0){let a=i.signature.default;if(a!==void 0)return a.literal;return{kind:le}}return dn(s,t,i.fragmentVariableValues)}let o=t?.sources[r];if(o==null)return{kind:le};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return zt(o.value,o.signature.type)}case Ve:{let r=[];for(let i of e.fields){if(i.value.kind===Ce){let s=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=dn(i.value,t,n);r.push({...i,value:o})}return{...e,fields:r}}case Ae:{let r=[];for(let i of e.values){let o=dn(i,t,n);r.push(o)}return{...e,values:r}}default:return e}}function Zn(e,t,n,r){return hi(e,t,n,r,void 0)}function hi(e,t,n,r,i){if(w(t)){if(e===void 0){An(n,`Expected a value of non-null type "${t}" to be provided.`,i);return}if(e===null){An(n,`Expected value of non-null type "${t}" not to be null.`,i);return}return hi(e,t.ofType,n,r,i)}if(e==null)return;if(j(t))if(!et(e))hi(e,t.ofType,n,r,i);else{let o=0;for(let s of e)hi(s,t.ofType,n,r,Pe(i,o++,void 0))}else if(k(t)){if(!ye(e)||Array.isArray(e)){An(n,`Expected value of type "${t}" to be an object, found: ${y(e)}.`,i);return}let o=t.getFields();for(let a of Object.values(o)){let u=e[a.name];if(u===void 0){if(Xe(a))An(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${y(e)}.`,i)}else hi(u,a.type,n,r,Pe(i,a.name,t.name))}let s=[];for(let a of Object.keys(e)){if(e[a]===void 0)continue;if(!Object.hasOwn(o,a)){let u=r?"":qe(Je(a,Object.keys(o)));An(n,`Expected value of type "${t}" not to include unknown field "${a}"${u?`.${u} Found`:", found"}: ${y(e)}.`,i);continue}s.push(a)}if(t.isOneOf){if(s.length!==1)An(n,Oo(t),i);let a=s[0];if(e[a]===null)An(n,Oo(t),Pe(i,a,t.name))}}else{It(t);let o,s;try{o=t.coerceInputValue(e,r)}catch(a){if(a instanceof m){n(a,fe(i));return}s=a}if(o===void 0)An(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${_c(s)}"; found`:", found"}: ${y(e)}.`,i,De(s))}}function An(e,t,n,r){e(new m(t,{originalError:r}),fe(n))}function xn(e,t,n,r,i,o){return Ei({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function Ei(e,t,n,r,i){if(t.kind===Ce){if(e.static)return;let s=bc(e,t)?.coerced[t.name.value];if(w(n)){if(s===void 0)Ft(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i);else if(s===null)Ft(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i)}return}if(w(n)){if(t.kind===le){Ft(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i);return}return Ei(e,t,n.ofType,r,i)}if(t.kind===le)return;if(j(n))if(t.kind!==Ae)Ei(e,t,n.ofType,r,i);else{let o=0;for(let s of t.values)Ei(e,s,n.ofType,r,Pe(i,o++,void 0))}else if(k(n)){if(t.kind!==Ve){Ft(e.onError,`Expected value of type "${n}" to be an object, found: ${ee(t)}.`,t,i);return}let o=n.getFields(),s=sn(t.fields,(c)=>c.name.value);for(let c of Object.values(o)){let l=s[c.name];if(l===void 0){if(Xe(c))Ft(e.onError,`Expected value of type "${n}" to include required field "${c.name}", found: ${ee(t)}.`,t,i)}else{let p=l.value;if(p.kind===Ce&&!e.static){let f=bc(e,p),d=p.name.value,E=f?.coerced[d];if(n.isOneOf){if(E===void 0)Ft(e.onError,`Expected variable "$${d}" provided to field "${c.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i);else if(E===null)Ft(e.onError,`Expected variable "$${d}" provided to field "${c.name}" for OneOf Input Object type "${n}" not to be null.`,t,i)}else if(E===void 0&&!Xe(c))continue}Ei(e,p,c.type,r,Pe(i,c.name,n.name))}}let a=t.fields,u=[];for(let c of a){let l=c.name.value;if(!Object.hasOwn(o,l)){let p=r?"":qe(Je(l,Object.keys(o)));Ft(e.onError,`Expected value of type "${n}" not to include unknown field "${l}"${p?`.${p} Found`:", found"}: ${ee(t)}.`,c,i)}else u.push(c)}if(n.isOneOf){if(u.length!==1){Ft(e.onError,Oo(n),t,i);return}if(u[0].value.kind===le){let p=u[0].name.value;Ft(e.onError,Oo(n),t,Pe(i,p,void 0))}}}else{It(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(dn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(a){if(a instanceof m){e.onError(a,fe(i));return}s=a}if(o===void 0)Ft(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${_c(s)}"; found`:", found"}: ${ee(t)}.`,t,i,De(s))}}function bc(e,t){let n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function Ft(e,t,n,r,i){e(new m(t,{nodes:n,originalError:i}),fe(r))}function _c(e){if(ye(e)){let t=e.message;if(typeof t==="string"&&t!=="")return t}return String(e)}function Oo(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var F={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var er=2147483647,tr=-2147483648,wn=new ke({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="number")return Sc(t);if(typeof t==="boolean")return t?1:0;if(typeof t==="string")return jf(t);if(typeof t==="bigint")return Dc(t);throw new m(`Int cannot represent non-integer value: ${y(t)}`)},coerceInputValue(e){if(typeof e==="number")return Sc(e);if(typeof e==="bigint")return Dc(e);throw new m(`Int cannot represent non-integer value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Oe)throw new m(`Int cannot represent non-integer value: ${ee(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>er||t<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t},valueToLiteral(e){if((typeof e==="number"&&Number.isInteger(e)||typeof e==="bigint")&&e<=er&&e>=tr)return{kind:Oe,value:String(e)}}}),Ir=new ke({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=Ti(e);if(typeof t==="number")return Oc(t);if(typeof t==="boolean")return t?1:0;if(typeof t==="string")return Bf(t);if(typeof t==="bigint")return Ac(t);throw new m(`Float cannot represent non numeric value: ${y(t)}`)},coerceInputValue(e){if(typeof e==="number")return Oc(e);if(typeof e==="bigint")return Ac(e);throw new m(`Float cannot represent non numeric value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Bt&&e.kind!==Oe)throw new m(`Float cannot represent non numeric value: ${ee(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Xn(e);if(t.kind===Bt||t.kind===Oe)return t}}),ie=new ke({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="string")return t;if(typeof t==="boolean")return t?"true":"false";if(typeof t==="number")return Qf(t);if(typeof t==="bigint")return String(t);throw new m(`String cannot represent value: ${y(e)}`)},coerceInputValue(e){if(typeof e!=="string")throw new m(`String cannot represent a non string value: ${y(e)}`);return e},coerceInputLiteral(e){if(e.kind!==Ie)throw new m(`String cannot represent a non string value: ${ee(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Xn(e);if(t.kind===Ie)return t}}),ge=new ke({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="boolean")return t;if(typeof t==="number")return Yf(t);if(typeof t==="bigint")return t!==0n;throw new m(`Boolean cannot represent a non boolean value: ${y(t)}`)},coerceInputValue(e){if(typeof e!=="boolean")throw new m(`Boolean cannot represent a non boolean value: ${y(e)}`);return e},coerceInputLiteral(e){if(e.kind!==tt)throw new m(`Boolean cannot represent a non boolean value: ${ee(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Xn(e);if(t.kind===tt)return t}}),Rn=new ke({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=Ti(e);if(typeof t==="string")return t;if(typeof t==="number")return ya(t);if(typeof t==="bigint")return String(t);throw new m(`ID cannot represent value: ${y(e)}`)},coerceInputValue(e){if(typeof e==="string")return e;if(typeof e==="number")return ya(e);if(typeof e==="bigint")return String(e);throw new m(`ID cannot represent value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Ie&&e.kind!==Oe)throw new m("ID cannot represent a non-string and non-integer value: "+ee(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e==="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:Oe,value:e}:{kind:Ie,value:e,block:!1};if(typeof e==="number")return{kind:Oe,value:ya(e)};if(typeof e==="bigint")return{kind:Oe,value:String(e)}}}),Ct=Object.freeze([ie,wn,Ir,ge,Rn]);function Ze(e){return Ct.some(({name:t})=>e.name===t)}function Ti(e){if(ye(e)){if(typeof e.valueOf==="function"){let t=e.valueOf();if(!ye(t))return t}if(typeof e.toJSON==="function")return e.toJSON()}return e}function Sc(e){if(!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${y(e)}`);if(e>er||e<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${y(e)}`);return e}function jf(e){if(e==="")throw new m(`Int cannot represent non-integer value: ${y(e)}`);let t=Number(e);if(!Number.isInteger(t))throw new m(`Int cannot represent non-integer value: ${y(e)}`);if(t>er||t<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${y(e)}`);return t}function Dc(e){if(e>er||e<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${String(e)}`);return Number(e)}function Oc(e){if(!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${y(e)}`);return e}function Bf(e){if(e==="")throw new m(`Float cannot represent non numeric value: ${y(e)}`);let t=Number(e);if(!Number.isFinite(t))throw new m(`Float cannot represent non numeric value: ${y(e)}`);return t}function Ac(e){let t=Number(e);if(!Number.isFinite(t))throw new m(`Float cannot represent non numeric value: ${y(e)} (value is too large)`);if(BigInt(t)!==e)throw new m(`Float cannot represent non numeric value: ${y(e)} (value would lose precision)`);return t}function Qf(e){if(!Number.isFinite(e))throw new m(`String cannot represent value: ${y(e)}`);return String(e)}function Yf(e){if(!Number.isFinite(e))throw new m(`Boolean cannot represent a non boolean value: ${y(e)}`);return e!==0}function ya(e){if(!Number.isInteger(e))throw new m(`ID cannot represent value: ${y(e)}`);return String(e)}var xc=Symbol("Directive");function nr(e){return Le(e,xc,Re)}function wc(e){if(!nr(e))throw Error(`Expected ${y(e)} to be a GraphQL directive.`);return e}class Re{constructor(e){if(this.__kind=xc,this.name=He(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.deprecationReason=e.deprecationReason,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],!Array.isArray(e.locations))nt(!1,`@${this.name} locations must be an Array.`);let t=e.args??{};if(!(ye(t)&&!Array.isArray(t)))nt(!1,`@${this.name} args must be an object with argument names as keys.`);this.args=Object.entries(t).map(([n,r])=>new di(this,n,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:kt(this.args,(e)=>e.name,(e)=>e.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}}var Ln=new Re({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[F.FIELD,F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Included when true."}}}),kn=new Re({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[F.FIELD,F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Skipped when true."}}}),Xt=new Re({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:ie,description:"Unique name"}}}),vt=new Re({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[F.FIELD],args:{initialCount:{default:{value:0},type:new V(wn),description:"Number of items to return immediately"},if:{type:new V(ge),description:"Stream when true or undefined.",default:{value:!0}},label:{type:ie,description:"Unique name"}}}),yi="No longer supported",mn=new Re({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[F.FIELD_DEFINITION,F.ARGUMENT_DEFINITION,F.INPUT_FIELD_DEFINITION,F.ENUM_VALUE,F.DIRECTIVE_DEFINITION],args:{reason:{type:new V(ie),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:yi}}}}),gi=new Re({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[F.SCALAR],args:{url:{type:new V(ie),description:"The URL that specifies the behavior of this scalar."}}}),Ni=new Re({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[F.INPUT_OBJECT],args:{}}),Rc=new Re({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[F.QUERY,F.MUTATION,F.SUBSCRIPTION]}),je=Object.freeze([Ln,kn,mn,gi,Ni]);function Vt(e){return je.some(({name:t})=>t===e.name)}function Fn(e,t){if(w(t)){let n=Fn(e,t.ofType);if(n?.kind===le)return null;return n}if(e===null)return{kind:le};if(e===void 0)return null;if(j(t)){let n=t.ofType;if(et(e)){let r=[];for(let i of e){let o=Fn(i,n);if(o!=null)r.push(o)}return{kind:Ae,values:r}}return Fn(e,n)}if(k(t)){if(!ye(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Fn(e[r.name],r.type);if(i)n.push({kind:un,name:{kind:Ne,value:r.name},value:i})}return{kind:Ve,fields:n}}if(ve(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n==="boolean")return{kind:tt,value:n};if(typeof n==="number"&&Number.isFinite(n)){let r=String(n);return Lc.test(r)?{kind:Oe,value:r}:{kind:Bt,value:r}}if(typeof n==="bigint")return{kind:Oe,value:String(n)};if(typeof n==="string"){if(z(t))return{kind:Ot,value:n};if(t===Rn&&Lc.test(n))return{kind:Oe,value:n};return{kind:Ie,value:n}}throw TypeError(`Cannot convert value to AST: ${y(n)}.`)}U(!1,"Unexpected input type: "+y(t))}var Lc=/^-?(?:0|[1-9][0-9]*)$/;function vr(e){let{type:t,default:n}=e;if(n){let i=n.literal??zt(n.value,t);if(i==null)U(!1,"Invalid default value");return i}let r=e.defaultValue;if(r!==void 0){let i=Fn(r,t);if(i==null)U(!1,"Invalid default value");return i}return}var br=new Ee({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ie,resolve:(e)=>e.description},types:{description:"A list of all types supported by this server.",type:new V(new oe(new V(mt))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new V(mt),resolve:(e)=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:mt,resolve:(e)=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:mt,resolve:(e)=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new V(new oe(new V(Ao))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter((n)=>n.deprecationReason==null)}})}),Ao=new Ee({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
+
+In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},isRepeatable:{type:new V(ge),resolve:(e)=>e.isRepeatable},locations:{type:new V(new oe(new V(xo))),resolve:(e)=>e.locations},args:{type:new V(new oe(new V(_r))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter((n)=>n.deprecationReason==null)}},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),xo=new we({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:F.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:F.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:F.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:F.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:F.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:F.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:F.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:F.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:F.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:F.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:F.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:F.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:F.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:F.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:F.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:F.UNION,description:"Location adjacent to a union definition."},ENUM:{value:F.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:F.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:F.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:F.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:F.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),mt=new Ee({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new V(Lo),resolve(e){if(ae(e))return ue.SCALAR;if(L(e))return ue.OBJECT;if(P(e))return ue.INTERFACE;if(te(e))return ue.UNION;if(z(e))return ue.ENUM;if(k(e))return ue.INPUT_OBJECT;if(j(e))return ue.LIST;if(w(e))return ue.NON_NULL;U(!1,`Unexpected type: "${y(e)}".`)}},name:{type:ie,resolve:(e)=>("name"in e)?e.name:void 0},description:{type:ie,resolve:(e)=>("description"in e)?e.description:void 0},specifiedByURL:{type:ie,resolve:(e)=>("specifiedByURL"in e)?e.specifiedByURL:void 0},fields:{type:new oe(new V(wo)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(L(e)||P(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},interfaces:{type:new oe(new V(mt)),resolve(e){if(L(e)||P(e))return e.getInterfaces()}},possibleTypes:{type:new oe(new V(mt)),resolve(e,t,n,{schema:r}){if(Ke(e))return r.getPossibleTypes(e)}},enumValues:{type:new oe(new V(Ro)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(z(e)){let n=e.getValues();return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},inputFields:{type:new oe(new V(_r)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(k(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},ofType:{type:mt,resolve:(e)=>("ofType"in e)?e.ofType:void 0},isOneOf:{type:ge,resolve:(e)=>{if(k(e))return e.isOneOf}}})}),wo=new Ee({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},args:{type:new V(new oe(new V(_r))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter((n)=>n.deprecationReason==null)}},type:{type:new V(mt),resolve:(e)=>e.type},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),_r=new Ee({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},type:{type:new V(mt),resolve:(e)=>e.type},defaultValue:{type:ie,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=vr(e);if(t)return ee(t);return null}},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),Ro=new Ee({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),ue={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},Lo=new we({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ue.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ue.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ue.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ue.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ue.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ue.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ue.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ue.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Ii=new zn(void 0,"__schema",{type:new V(br),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),vi=new zn(void 0,"__type",{type:mt,description:"Request the type information of a single type.",args:{name:{type:new V(ie)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),bi=new zn(void 0,"__typename",{type:new V(ie),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Mt=Object.freeze([br,Ao,xo,mt,wo,_r,Ro,Lo]);function ht(e){return Mt.some(({name:t})=>e.name===t)}function rr(e){return Le(e,kc,ot)}function Sr(e){if(!rr(e))throw Error(`Expected ${y(e)} to be a GraphQL schema.`);return e}var kc=Symbol("Schema");class ot{constructor(e){this.__kind=kc,this.assumeValid=e.assumeValid??!1,this.__validationErrors=e.assumeValid===!0?[]:void 0,this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??je;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),Ut(n,t);if(this._queryType!=null)Ut(this._queryType,t);if(this._mutationType!=null)Ut(this._mutationType,t);if(this._subscriptionType!=null)Ut(this._subscriptionType,t);for(let n of this._directives)if(nr(n))for(let r of n.args)Ut(r.type,t);Ut(br,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let n of t){if(n==null)continue;let r=n.name;if(this._typeMap[r]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=n,P(n)){for(let i of n.getInterfaces())if(P(i)){let o=this._implementationsMap[i.name];o??=this._implementationsMap[i.name]={objects:[],interfaces:[]},o.interfaces.push(n)}}else if(L(n)){for(let i of n.getInterfaces())if(P(i)){let o=this._implementationsMap[i.name];o??=this._implementationsMap[i.name]={objects:[],interfaces:[]},o.objects.push(n)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case re.QUERY:return this.getQueryType();case re.MUTATION:return this.getMutationType();case re.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return te(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(n===void 0){if(te(e))n=new Set(e.getTypes());else{let r=this.getImplementations(e);n=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t)=>t.name===e)}getField(e,t){switch(t){case Ii.name:return this.getQueryType()===e?Ii:void 0;case vi.name:return this.getQueryType()===e?vi:void 0;case bi.name:return bi}if("getFields"in e)return e.getFields()[t];return}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Ut(e,t){let n=pe(e);if(!t.has(n)){if(t.add(n),te(n))for(let r of n.getTypes())Ut(r,t);else if(L(n)||P(n)){for(let r of n.getInterfaces())Ut(r,t);for(let r of Object.values(n.getFields())){Ut(r.type,t);for(let i of r.args)Ut(i.type,t)}}else if(k(n))for(let r of Object.values(n.getFields()))Ut(r.type,t)}return t}function Di(e){if(Sr(e),e.__validationErrors)return e.__validationErrors;let t=new Uc(e);qf(t),Kf(t),Jf(t);let n=t.getErrors();return e.__validationErrors=n,n}function Dr(e){let t=Di(e);if(t.length!==0)throw Error(t.map((n)=>n.message).join(`
+
+`))}class Uc{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new m(e,{nodes:n}))}getErrors(){return this._errors}}function qf(e){let t=e.schema;if(t.getQueryType()==null)e.reportError("Query root type must be provided.",t.astNode);let n=new Fe;for(let r of Object.values(re)){let i=t.getRootType(r);if(i!=null)if(!L(i)){let o=Vu(r),s=y(i);e.reportError(r===re.QUERY?`${o} root type must be Object type, it cannot be ${s}.`:`${o} root type must be Object type if provided, it cannot be ${s}.`,Fc(t,r)??i.astNode)}else n.add(i,r)}for(let[r,i]of n)if(i.length>1){let o=Uu(i);e.reportError(`All root types must be different, "${r}" type is used as ${o} root types.`,i.map((s)=>Fc(t,s)))}}function Fc(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((n)=>n?.operationTypes??[]).find((n)=>n.operation===t)?.type}function Kf(e){for(let t of e.schema.getDirectives()){if(!nr(t)){e.reportError(`Expected directive but got: ${y(t)}.`,t?.astNode);continue}if(ir(e,t),t.locations.length===0)e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(let n of t.args){if(ir(e,n),!xe(n.type))e.reportError(`The type of ${n} must be Input Type but got: ${y(n.type)}.`,n.astNode);if(ze(n)&&n.deprecationReason!=null)e.reportError(`Required argument ${n} cannot be deprecated.`,[ko(n.astNode),n.astNode?.type]);ga(e,n)}}}function ga(e,t){let n=t.default;if(!n)return;let r=[];if(Na(n,t.type,(i,o)=>{r.push([i,o])}),r.length===0)return;if(!n.literal)try{let i=_i(n.value,t.type),o=[];if(Zn(i,t.type,(s,a)=>{o.push([s,a])}),o.length===0){e.reportError(`${t} has invalid default value: ${y(n.value)}. Did you mean: ${y(i)}?`,t.astNode?.defaultValue);return}}catch(i){}for(let[i,o]of r)e.reportError(`${t} has invalid default value${qn(o)}: ${i.message}`,i.nodes??t.astNode?.defaultValue)}function Na(e,t,n,r){if(e.literal){xn(e.literal,t,n,void 0,void 0,r);return}Zn(e.value,t,n,r)}function _i(e,t){if(w(t))return _i(e,t.ofType);if(e===null)return null;if(j(t)){if(et(e))return Array.from(e,(n)=>_i(n,t.ofType));return[_i(e,t.ofType)]}if(k(t)){if(!ye(e))U(!1);let n=t.getFields();return Gt(e,(r,i)=>{if(!(i in n))U(!1);return _i(r,n[i].type)})}return It(t),t.coerceOutputValue(e)}function ir(e,t){if(t.name.startsWith("__"))e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Jf(e){let t=rd(e),n=e.schema.getTypeMap(),r=new Map;for(let o of Object.values(n)){if(!rt(o)){e.reportError(`Expected GraphQL named type but got: ${y(o)}.`,o.astNode);continue}if(!ht(o))ir(e,o);if(L(o))Cc(e,o),Vc(e,o);else if(P(o))Cc(e,o),Vc(e,o);else if(te(o))zf(e,o);else if(z(o))Xf(e,o);else if(k(o))Zf(e,o),i(o),t(o)}td(e,r);function i(o){r.set(o,{inputObj:o,targets:[],dependents:[],unresolvedTargetCount:0,hasFiniteValue:!1})}}function Cc(e,t){let n=Object.values(t.getFields());if(n.length===0)e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){if(ir(e,r),!Nt(r.type))e.reportError(`The type of ${r} must be Output Type but got: ${y(r.type)}.`,r.astNode?.type);for(let i of r.args){if(ir(e,i),!xe(i.type))e.reportError(`The type of ${i} must be Input Type but got: ${y(i.type)}.`,i.astNode?.type);if(ze(i)&&i.deprecationReason!=null)e.reportError(`Required argument ${i} cannot be deprecated.`,[ko(i.astNode),i.astNode?.type]);ga(e,i)}}}function Vc(e,t){let n=new Set;for(let r of t.getInterfaces()){if(!P(r)){e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${y(r)}.`,Si(t,r));continue}if(t===r){e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,Si(t,r));continue}if(n.has(r.name)){e.reportError(`Type ${t} can only implement ${r} once.`,Si(t,r));continue}n.add(r.name),Hf(e,t,r),Wf(e,t,r)}}function Wf(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let o=r[i.name];if(o==null){e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Ht(e.schema,o.type,i.type))e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(let s of i.args){let a=o.args.find((u)=>u.name===s.name);if(!a){e.reportError(`Interface field argument ${s} expected but ${o} does not provide it.`,[s.astNode,o.astNode]);continue}if(!Nr(s.type,a.type))e.reportError(`Interface field argument ${s} expects type ${s.type} but ${a} is type ${a.type}.`,[s.astNode?.type,a.astNode?.type])}for(let s of o.args)if(ze(s)){if(!i.args.find((u)=>u.name===s.name))e.reportError(`Argument "${s}" must not be required type "${s.type}" if not provided by the Interface field "${i}".`,[s.astNode,i.astNode])}if(o.deprecationReason!=null&&i.deprecationReason==null)e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[ko(o.astNode),o.astNode?.type])}}function Hf(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())if(!r.includes(i))e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...Si(n,i),...Si(t,n)])}function zf(e,t){let n=t.getTypes();if(n.length===0)e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=new Set;for(let i of n){if(r.has(i.name)){e.reportError(`Union type ${t} can only include type ${i} once.`,Mc(t,i.name));continue}if(r.add(i.name),!L(i))e.reportError(`Union type ${t} can only include Object types, it cannot include ${y(i)}.`,Mc(t,String(i)))}}function Xf(e,t){let n=t.getValues();if(n.length===0)e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)ir(e,r)}function Zf(e,t){let n=Object.values(t.getFields());if(n.length===0)e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){if(ir(e,r),!xe(r.type))e.reportError(`The type of ${r} must be Input Type but got: ${y(r.type)}.`,r.astNode?.type);if(Xe(r)&&r.deprecationReason!=null)e.reportError(`Required input field ${r} cannot be deprecated.`,[ko(r.astNode),r.astNode?.type]);if(ga(e,r),t.isOneOf)ed(t,r,e)}}function ed(e,t,n){if(w(t.type))n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type);if(t.default!==void 0||t.defaultValue!==void 0)n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function td(e,t){let n=[];for(let c of t.values()){let l=c.inputObj,p=Object.values(l.getFields());for(let f of p){let d=nd(l,f.type);if(d===void 0)continue;c.targets.push({field:f,target:d});let E=t.get(d);if(E!==void 0)E.dependents.push(c)}if(l.isOneOf){if(p.length===0||c.targets.length<p.length)a(c)}else if(c.unresolvedTargetCount=c.targets.length,c.targets.length===0)a(c)}let r;while((r=n.pop())!==void 0)for(let c of r.dependents){if(c.hasFiniteValue)continue;if(c.inputObj.isOneOf){a(c);continue}if(--c.unresolvedTargetCount,c.unresolvedTargetCount===0)a(c)}let i=new Set,o=[],s=new Map;for(let c of t.values())if(!c.hasFiniteValue)u(c);function a(c){if(!c.hasFiniteValue)c.hasFiniteValue=!0,n.push(c)}function u(c){let l=c.inputObj;if(i.has(l))return;i.add(l),s.set(l,o.length);for(let{field:p,target:f}of c.targets){let d=t.get(f);if(d?.hasFiniteValue!==!1)continue;let E=s.get(f);if(o.push({fieldStr:`${l}.${p.name}`,astNode:p.astNode}),E===void 0)u(d);else{let I=o.slice(E),S=I.map((G)=>G.fieldStr).join(", ");e.reportError(`Input Object ${f} cannot be provided a finite value because it references itself through fields: ${S}.`,I.map((G)=>G.astNode))}o.pop()}s.delete(l)}}function nd(e,t){if(e.isOneOf){if(k(t))return t;return}if(w(t)&&k(t.ofType))return t.ofType}function rd(e){let t=Object.create(null),n=[],r=Object.create(null);return function(u){return i(u,Object.create(null))};function i(a,u){if(et(u)){for(let c of u)i(a,c);return}else if(!ye(u))return;for(let c of Object.values(a.getFields())){let l=pe(c.type);if(!k(l))continue;if(Object.hasOwn(u,c.name))i(l,u[c.name]);else s(c,l,`${a}.${c.name}`)}}function o(a,u){if(u.kind===Ae){for(let l of u.values)o(a,l);return}else if(u.kind!==Ve)return;let c=sn(u.fields,(l)=>l.name.value);for(let l of Object.values(a.getFields())){let p=pe(l.type);if(!k(p))continue;if(Object.hasOwn(c,l.name))o(p,c[l.name].value);else s(l,p,`${a}.${l.name}`)}}function s(a,u,c){let l=a.default;if(l===void 0)return;let p=r[c];if(p!==void 0){e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${p<n.length?` via the default values of: ${n.slice(p).map(([f])=>f).join(", ")}`:""}.`,n.slice(p-1).map(([,f])=>f));return}if(t[c]===void 0){if(t[c]=!0,r[c]=n.push([c,a.astNode?.defaultValue]),l.literal)o(u,l.literal);else i(u,l.value);n.pop(),r[c]=void 0}}}function Si(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap((o)=>o.interfaces??[]).filter((o)=>o.name.value===t.name)}function Mc(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap((o)=>o.types??[]).filter((o)=>o.name.value===t)}function ko(e){return e?.directives?.find((t)=>t.name.value===mn.name)}function de(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}function id(){let e;try{let t=globalThis.process;if(typeof t?.getBuiltinModule==="function")e=t.getBuiltinModule("node:diagnostics_channel")}catch{}return e}var or=id(),Ia=or?.tracingChannel("graphql:parse"),va=or?.tracingChannel("graphql:validate"),Oi=or?.tracingChannel("graphql:execute"),Pc=or?.tracingChannel("graphql:execute:variableCoercion"),ba=or?.tracingChannel("graphql:execute:rootSelectionSet"),_a=or?.tracingChannel("graphql:subscribe"),sr=or?.tracingChannel("graphql:resolve"),od=["start","end","asyncStart","asyncEnd","error"];function st(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of od)if(e[n].hasSubscribers)return!0;return!1}function Cn(e,t,n){let r=t;return e.start.runStores(r,()=>{let i;try{i=n()}catch(o){throw r.error=o,e.error.publish(r),e.end.publish(r),o}if(!Be(i))return r.result=i,e.end.publish(r),i;return e.end.publish(r),i.then((o)=>(r.result=o,e.asyncStart.publish(r),e.asyncEnd.publish(r),o),(o)=>{throw r.error=o,e.error.publish(r),e.asyncStart.publish(r),e.asyncEnd.publish(r),o})})}var T={SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class ar{constructor(e){let t=new bn(T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==T.EOF)do if(e.next)e=e.next;else{let t=sd(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===T.COMMENT);return e}}function Co(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.DOT||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}function Or(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Vo(e,t){return Gc(e.charCodeAt(t))&&jc(e.charCodeAt(t+1))}function Gc(e){return e>=55296&&e<=56319}function jc(e){return e>=56320&&e<=57343}function hn(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return T.EOF;else if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function me(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new bn(t,n,r,o,s,i)}function sd(e,t){let n=e.source.body,r=n.length,i=t;while(i<r){let o=n.charCodeAt(i);switch(o){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:if(n.charCodeAt(i+1)===10)i+=2;else++i;++e.line,e.lineStart=i;continue;case 35:return ad(e,i);case 33:return me(e,T.BANG,i,i+1);case 36:return me(e,T.DOLLAR,i,i+1);case 38:return me(e,T.AMP,i,i+1);case 40:return me(e,T.PAREN_L,i,i+1);case 41:return me(e,T.PAREN_R,i,i+1);case 46:{let s=n.charCodeAt(i+1);if(s===46&&n.charCodeAt(i+2)===46)return me(e,T.SPREAD,i,i+3);if(s===46)throw de(e.source,i,'Unexpected "..", did you mean "..."?');else if(Kn(s)){let a=e.source.body.slice(i+1,Fo(e,i+1,s));throw de(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${a}"?`)}break}case 58:return me(e,T.COLON,i,i+1);case 61:return me(e,T.EQUALS,i,i+1);case 64:return me(e,T.AT,i,i+1);case 91:return me(e,T.BRACKET_L,i,i+1);case 93:return me(e,T.BRACKET_R,i,i+1);case 123:return me(e,T.BRACE_L,i,i+1);case 124:return me(e,T.PIPE,i,i+1);case 125:return me(e,T.BRACE_R,i,i+1);case 34:if(n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34)return dd(e,i);return cd(e,i)}if(Kn(o)||o===45)return ud(e,i,o);if(Jn(o))return Sa(e,i);throw de(e.source,i,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Or(o)||Vo(n,i)?`Unexpected character: ${hn(e,i)}.`:`Invalid character: ${hn(e,i)}.`)}return me(e,T.EOF,r,r)}function ad(e,t){let n=e.source.body,r=n.length,i=t+1;while(i<r){let o=n.charCodeAt(i);if(o===10||o===13)break;if(Or(o))++i;else if(Vo(n,i))i+=2;else break}return me(e,T.COMMENT,t,i,n.slice(t+1,i))}function ud(e,t,n){let r=e.source.body,i=t,o=n,s=!1;if(o===45)o=r.charCodeAt(++i);if(o===48){if(o=r.charCodeAt(++i),Kn(o))throw de(e.source,i,`Invalid number, unexpected digit after 0: ${hn(e,i)}.`)}else i=Fo(e,i,o),o=r.charCodeAt(i);if(o===46)s=!0,o=r.charCodeAt(++i),i=Fo(e,i,o),o=r.charCodeAt(i);if(o===69||o===101){if(s=!0,o=r.charCodeAt(++i),o===43||o===45)o=r.charCodeAt(++i);i=Fo(e,i,o),o=r.charCodeAt(i)}if(o===46||Jn(o))throw de(e.source,i,`Invalid number, expected digit but got: ${hn(e,i)}.`);return me(e,s?T.FLOAT:T.INT,t,i,r.slice(t,i))}function Fo(e,t,n){if(!Kn(n))throw de(e.source,t,`Invalid number, expected digit but got: ${hn(e,t)}.`);let r=e.source.body,i=t+1;while(Kn(r.charCodeAt(i)))++i;return i}function cd(e,t){let n=e.source.body,r=n.length,i=t+1,o=i,s="";while(i<r){let a=n.charCodeAt(i);if(a===34)return s+=n.slice(o,i),me(e,T.STRING,t,i+1,s);if(a===92){s+=n.slice(o,i);let u=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?ld(e,i):pd(e,i):fd(e,i);s+=u.value,i+=u.size,o=i;continue}if(a===10||a===13)break;if(Or(a))++i;else if(Vo(n,i))i+=2;else throw de(e.source,i,`Invalid character within String: ${hn(e,i)}.`)}throw de(e.source,i,"Unterminated string.")}function ld(e,t){let n=e.source.body,r=0,i=3;while(i<12){let o=n.charCodeAt(t+i++);if(o===125){if(i<5||!Or(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ai(o),r<0)break}throw de(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function pd(e,t){let n=e.source.body,r=$c(n,t+2);if(Or(r))return{value:String.fromCodePoint(r),size:6};if(Gc(r)){if(n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let i=$c(n,t+8);if(jc(i))return{value:String.fromCodePoint(r,i),size:12}}}throw de(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function $c(e,t){return Ai(e.charCodeAt(t))<<12|Ai(e.charCodeAt(t+1))<<8|Ai(e.charCodeAt(t+2))<<4|Ai(e.charCodeAt(t+3))}function Ai(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function fd(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
+`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw de(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function dd(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",u=[];while(o<r){let c=n.charCodeAt(o);if(c===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){a+=n.slice(s,o),u.push(a);let l=me(e,T.BLOCK_STRING,t,o+3,Bu(u).join(`
+`));return e.line+=u.length-1,e.lineStart=i,l}if(c===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){a+=n.slice(s,o),s=o+1,o+=4;continue}if(c===10||c===13){if(a+=n.slice(s,o),u.push(a),c===13&&n.charCodeAt(o+1)===10)o+=2;else++o;a="",s=o,i=o;continue}if(Or(c))++o;else if(Vo(n,o))o+=2;else throw de(e.source,o,`Invalid character within String: ${hn(e,o)}.`)}throw de(e.source,o,"Unterminated string.")}function Sa(e,t){let n=e.source.body,r=n.length,i=t+1;while(i<r){let o=n.charCodeAt(i);if(go(o))++i;else break}return me(e,T.NAME,t,i,n.slice(t,i))}class Da{constructor(e){this.line=1,this.lineStart=0;let t=new bn(T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t}get[Symbol.toStringTag](){return"SchemaCoordinateLexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==T.EOF){let t=md(this,e.end);e.next=t,t.prev=e,e=t}return e}}function md(e,t){let n=e.source.body,r=n.length,i=t;if(i<r){let o=n.charCodeAt(i);switch(o){case 46:return me(e,T.DOT,i,i+1);case 40:return me(e,T.PAREN_L,i,i+1);case 41:return me(e,T.PAREN_R,i,i+1);case 58:return me(e,T.COLON,i,i+1);case 64:return me(e,T.AT,i,i+1)}if(Jn(o))return Sa(e,i);throw de(e.source,i,`Invalid character: ${hn(e,i)}.`)}return me(e,T.EOF,r,r)}var Bc=Symbol("Source");class Pt{constructor(e,t="GraphQL request",n={line:1,column:1}){if(this.__kind=Bc,this.body=e,this.name=t,this.locationOffset=n,!(this.locationOffset.line>0))nt(!1,"line in locationOffset is 1-indexed and must be positive.");if(!(this.locationOffset.column>0))nt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function xi(e){return Le(e,Bc,Pt)}function bt(e,t){return st(Ia)?Ia.traceSync(()=>Qc(e,t),{source:e}):Qc(e,t)}function Qc(e,t){let n=new Ar(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Yc(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(T.EOF),r}function Uo(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseConstValueLiteral();return n.expectToken(T.EOF),r}function qc(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseTypeReference();return n.expectToken(T.EOF),r}function Po(e){let t=xi(e)?e:new Pt(e),n=new Da(t),r=new Ar(e,{lexer:n});r.expectToken(T.SOF);let i=r.parseSchemaCoordinate();return r.expectToken(T.EOF),i}class Ar{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let i=xi(e)?e:new Pt(e);this._lexer=new ar(i)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(T.NAME);return this.node(e,{kind:Ne,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:jt,definitions:this.many(T.SOF,this.parseDefinition,T.EOF)})}parseDefinition(){if(this.peek(T.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===T.BRACE_L)throw de(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===T.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw de(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(t.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(T.BRACE_L))return this.node(e,{kind:Tt,operation:re.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;if(this.peek(T.NAME))r=this.parseName();return this.node(e,{kind:Tt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(T.NAME);switch(e.value){case"query":return re.QUERY;case"mutation":return re.MUTATION;case"subscription":return re.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ri,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(T.DOLLAR),this.node(e,{kind:Ce,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ao,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R)})}parseSelection(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;if(this.expectOptionalToken(T.COLON))n=t,r=this.parseName();else r=t;return this.node(e,{kind:an,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)}parseFragmentArguments(){let e=this.parseFragmentArgument;return this.optionalMany(T.PAREN_L,e,T.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(T.COLON),this.node(t,{kind:ii,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),this.node(e,{kind:uo,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){let e=this._lexer.token;this.expectToken(T.SPREAD);let t=this.expectOptionalKeyword("on");if(!t&&this.peek(T.NAME)){let n=this.parseFragmentName();if(this.peek(T.PAREN_L)&&this._options.experimentalFragmentArguments)return this.node(e,{kind:Dt,name:n,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)});return this.node(e,{kind:Dt,name:n,directives:this.parseDirectives(!1)})}return this.node(e,{kind:_n,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();if(this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0)return this.node(e,{kind:Qe,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()});return this.node(e,{kind:Qe,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this.advanceLexer(),this.node(t,{kind:Oe,value:t.value});case T.FLOAT:return this.advanceLexer(),this.node(t,{kind:Bt,value:t.value});case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:tt,value:!0});case"false":return this.node(t,{kind:tt,value:!1});case"null":return this.node(t,{kind:le});default:return this.node(t,{kind:Ot,value:t.value})}case T.DOLLAR:if(e)if(this.expectToken(T.DOLLAR),this._lexer.token.kind===T.NAME){let n=this._lexer.token.value;throw de(this._lexer.source,t.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Ie,value:e.value,block:e.kind===T.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:Ae,values:this.any(T.BRACKET_L,t,T.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:Ve,fields:this.any(T.BRACE_L,t,T.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(T.COLON),this.node(t,{kind:un,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];while(this.peek(T.AT))t.push(this.parseDirective(e));if(t.length)return t;return}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(T.AT),this.node(t,{kind:oi,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(T.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(T.BRACKET_R),t=this.node(e,{kind:Dn,type:n})}else t=this.parseNamedType();if(this.expectOptionalToken(T.BANG))return this.node(e,{kind:cn,type:t});return t}parseNamedType(){return this.node(this._lexer.token,{kind:Sn,name:this.parseName()})}peekDescription(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return this.node(e,{kind:Ye,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);let n=this.parseNamedType();return this.node(e,{kind:si,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Qt,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:At,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(T.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(T.COLON);let i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:co,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(T.COLON);let r=this.parseTypeReference(),i;if(this.expectOptionalToken(T.EQUALS))i=this.parseConstValueLiteral();let o=this.parseConstDirectives();return this.node(e,{kind:ai,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:xt,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:wt,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Yt,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:lo,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw de(this._lexer.source,this._lexer.token.start,`${Mo(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:yt,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),n=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(t===void 0&&n===void 0)throw this.unexpected();return this.node(e,{kind:Rt,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:ln,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:qt,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:Kt,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:Jt,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:pn,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:Lt,name:t,directives:n,fields:r})}parseDirectiveExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(T.AT);let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:Tr,name:t,directives:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:pt,description:t,name:n,arguments:r,directives:i,repeatable:o,locations:s})}parseDirectiveLocations(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.hasOwn(F,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(T.AT),n=this.parseName(),r;if(!t&&this.expectOptionalToken(T.DOT))r=this.parseName();let i;if((t||r)&&this.expectOptionalToken(T.PAREN_L))i=this.parseName(),this.expectToken(T.COLON),this.expectToken(T.PAREN_R);if(t){if(i)return this.node(e,{kind:Eo,name:n,argumentName:i});return this.node(e,{kind:ho,name:n})}else if(r){if(i)return this.node(e,{kind:mo,name:n,fieldName:r,argumentName:i});return this.node(e,{kind:fo,name:n,memberName:r})}return this.node(e,{kind:po,name:n})}node(e,t){if(this._options.noLocation!==!0)t.loc=new ei(e,this._lexer.lastToken,this._lexer.source);return t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw de(this._lexer.source,t.start,`Expected ${Kc(e)}, found ${Mo(t)}.`)}expectOptionalToken(e){if(this._lexer.token.kind===e)return this.advanceLexer(),!0;return!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===T.NAME&&t.value===e)this.advanceLexer();else throw de(this._lexer.source,t.start,`Expected "${e}", found ${Mo(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;if(t.kind===T.NAME&&t.value===e)return this.advanceLexer(),!0;return!1}unexpected(e){let t=e??this._lexer.token;return de(this._lexer.source,t.start,`Unexpected ${Mo(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];while(!this.expectOptionalToken(n))r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}return}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==T.EOF){if(++this._tokenCounter,e!==void 0&&this._tokenCounter>e)throw de(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}}function Mo(e){let t=e.value;return Kc(e.kind)+(t!=null?` "${t}"`:"")}function Kc(e){return Co(e)?`"${e}"`:e}function Te(e,t){switch(t.kind){case Dn:{let n=Te(e,t.type);return n&&new oe(n)}case cn:{let n=Te(e,t.type);return n&&new V(n)}case Sn:return e.getType(t.name.value)}}class ur{constructor(e,t,n){if(this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t){if(xe(t))this._inputTypeStack.push(t);if(dt(t))this._parentTypeStack.push(t);if(Nt(t))this._typeStack.push(t)}}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case jt:{let n=hd(e);this._fragmentSignaturesByName=(r)=>n.get(r);break}case ao:{let n=pe(this.getType());this._parentTypeStack.push(dt(n)?n:void 0);break}case an:{let n=this.getParentType(),r,i;if(n){if(r=t.getField(n,e.name.value),r)i=r.type}this._fieldDefStack.push(r),this._typeStack.push(Nt(i)?i:void 0);break}case oi:this._directive=t.getDirective(e.name.value);break;case Tt:{let n=t.getRootType(e.operation);this._typeStack.push(L(n)?n:void 0);break}case Dt:{this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break}case _n:case Qe:{let n=e.typeCondition,r=n?Te(t,n):pe(this.getType());this._typeStack.push(Nt(r)?r:void 0);break}case ri:{let n=Te(t,e.type);this._inputTypeStack.push(xe(n)?n:void 0);break}case ii:{let n,r,i=this.getDirective()??this.getFieldDef();if(i){if(n=i.args.find((o)=>o.name===e.name.value),n)r=n.type}this._argument=n,this._defaultValueStack.push(n?.default??n?.defaultValue??void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case uo:{let r=this.getFragmentSignature()?.variableDefinitions.get(e.name.value);this._fragmentArgument=r;let i;if(r)i=Te(this._schema,r.type);this._inputTypeStack.push(xe(i)?i:void 0);break}case Ae:{let n=gr(this.getInputType()),r=j(n)?n.ofType:void 0;this._defaultValueStack.push(void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case un:{let n=pe(this.getInputType()),r,i;if(k(n)){if(i=n.getFields()[e.name.value],i!=null)r=i.type}this._defaultValueStack.push(i?.default??i?.defaultValue??void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case Ot:{let n=pe(this.getInputType()),r;if(z(n))r=n.getValue(e.value);this._enumValue=r;break}default:}}leave(e){switch(e.kind){case jt:this._fragmentSignaturesByName=()=>null;break;case ao:this._parentTypeStack.pop();break;case an:this._fieldDefStack.pop(),this._typeStack.pop();break;case oi:this._directive=null;break;case Dt:this._fragmentSignature=null;break;case Tt:case _n:case Qe:this._typeStack.pop();break;case ri:this._inputTypeStack.pop();break;case ii:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case uo:{this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break}case Ae:case un:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Ot:this._enumValue=null;break;default:}}}function hd(e){let t=new Map;for(let n of e.definitions)if(n.kind===Qe){let r=new Map;if(n.variableDefinitions)for(let o of n.variableDefinitions)r.set(o.variable.name.value,o);let i={definition:n,variableDefinitions:r};t.set(n.name.value,i)}return t}function xr(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=Hn(t,r.kind).enter;if(i){let o=i.apply(t,n);if(o!==void 0){if(e.leave(r),ni(o))e.enter(o)}return o}},leave(...n){let r=n[0],i=Hn(t,r.kind).leave,o;if(i)o=i.apply(t,n);return e.leave(r),o}}}function $o(e){let t=new Map;return{Directive(n){if(n.name.value===Xt.name||n.name.value===vt.name){let i=n.arguments?.find((s)=>s.name.value==="label")?.value;if(!i||i.kind===le)return;if(i.kind!==Ie){e.reportError(new m(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(i.value);if(o!=null)e.reportError(new m('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]}));else t.set(i.value,n)}}}}function Go(e){return{OperationDefinition(t){let n=e.getDocument(),r=new Map;for(let s of n.definitions)if(s.kind===Qe)r.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);if(o)Oa({context:e,operationType:t.operation,rootType:o,fragments:r,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:i,visitedFragments:o}){for(let s of i.selections)if(s.kind==="Field"){let a=s.directives?.find((u)=>u.name.value===vt.name);if(a)e.reportError(new m(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let u=r.get(a);if(u){let c=Jc(s);if(c!==void 0)e.reportError(new m(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:c}));Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:u.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=Jc(s);if(a!==void 0)e.reportError(new m(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a}));Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:s.selectionSet,visitedFragments:o})}}function Jc(e){return e.directives?.find((t)=>t.name.value===Xt.name)}function Wc(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!1;if(t.value.kind===tt){if(t.value.value)return!1}else if(t.value.kind!==Ce)return!1;return!0}function Ed(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!0;if(t.value.kind===tt){if(t.value.value)return!0;return!1}return!0}function Td(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!1;if(t?.value.kind===tt){if(t.value.value)return!1;return!0}return!0}function jo(e){return{OperationDefinition(t){if(t.operation!==re.SUBSCRIPTION)return;let n=e.getDocument(),r=new Map;for(let o of n.definitions)if(o.kind===Qe)r.set(o.name.value,o);let i=new Set;Aa({context:e,fragments:r,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:i})}}}function Aa({context:e,fragments:t,selectionSet:n,parentNodes:r,visitedFragments:i}){for(let o of n.selections){let s=o.directives?.find((u)=>u.name.value===kn.name);if(s&&Ed(s))continue;let a=o.directives?.find((u)=>u.name.value===Ln.name);if(a&&Td(a))continue;for(let u of o.directives??[])if(u.name.value===Xt.name){if(!Wc(u))e.reportError(new m("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[u,...r]}))}else if(u.name.value===vt.name){if(!Wc(u))e.reportError(new m("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[u,...r]}))}if(o.kind==="FragmentSpread"){let u=o.name.value;if(i.has(u))continue;i.add(u);let c=t.get(u);if(c)Aa({context:e,fragments:t,parentNodes:[o,...r],selectionSet:c?.selectionSet,visitedFragments:i})}else if(o.selectionSet)Aa({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:r,visitedFragments:i})}}function Qo(e){return wi(e)||Ri(e)||Li(e)}function wi(e){return e.kind===Tt||e.kind===Qe}function Yo(e){return e.operation===re.SUBSCRIPTION}function Hc(e){return e.kind===an||e.kind===Dt||e.kind===_n}function xa(e){return e.kind===Ce||e.kind===Oe||e.kind===Bt||e.kind===Ie||e.kind===tt||e.kind===le||e.kind===Ot||e.kind===Ae||e.kind===Ve}function Bo(e){return xa(e)&&(e.kind===Ae?e.values.some(Bo):e.kind===Ve?e.fields.some((t)=>Bo(t.value)):e.kind!==Ce)}function zc(e){return e.kind===Sn||e.kind===Dn||e.kind===cn}function Ri(e){return e.kind===Ye||En(e)||e.kind===pt}function En(e){return e.kind===Qt||e.kind===At||e.kind===xt||e.kind===wt||e.kind===Yt||e.kind===yt}function Li(e){return e.kind===Rt||e.kind===Tr||ki(e)}function ki(e){return e.kind===ln||e.kind===qt||e.kind===Kt||e.kind===Jt||e.kind===pn||e.kind===Lt}function Xc(e){return e.kind===po||e.kind===fo||e.kind===mo||e.kind===ho||e.kind===Eo}function qo(e){return{Document(t){for(let n of t.definitions)if(!wi(n)){let r=n.kind===Ye||n.kind===Rt?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function Ko(e){return{Field(t){let n=e.getParentType();if(n){if(!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=qe("to use an inline fragment on",e.hideSuggestions?[]:yd(i,n,o));if(s==="")s=qe(e.hideSuggestions?[]:gd(n,o));e.reportError(new m(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}}function yd(e,t,n){if(!Ke(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t)){if(o.getFields()[n]==null)continue;r.add(o),i[o.name]=1;for(let s of o.getInterfaces()){if(s.getFields()[n]==null)continue;r.add(s),i[s.name]=(i[s.name]??0)+1}}return[...r].sort((o,s)=>{let a=i[s.name]-i[o.name];if(a!==0)return a;if(P(o)&&e.isSubType(o,s))return-1;if(P(s)&&e.isSubType(s,o))return 1;return fn(o.name,s.name)}).map((o)=>o.name)}function gd(e,t){if(L(e)||P(e)){let n=Object.keys(e.getFields());return Je(t,n)}return[]}function Jo(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=Te(e.getSchema(),n);if(r&&!dt(r)){let i=ee(n);e.reportError(new m(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=Te(e.getSchema(),t.typeCondition);if(n&&!dt(n)){let r=ee(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}function Wo(e){return{...wa(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){let i=t.name.value,o=e.hideSuggestions?[]:Je(i,Array.from(n.variableDefinitions.values()).map((s)=>s.variable.name.value));e.reportError(new m(`Unknown argument "${i}" on fragment "${n.definition.name.value}".`+qe(o),{nodes:t}))}}},Argument(t){let n=e.getArgument(),r=e.getFieldDef();if(!n&&r){let i=t.name.value,o=e.hideSuggestions?[]:Je(i,r.args.map((s)=>s.name));e.reportError(new m(`Unknown argument "${i}" on field "${r}".`+qe(o),{nodes:t}))}}}}function wa(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let o of r)t.set(o.name,o.args.map((s)=>s.name));let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt){let s=o.arguments??[];t.set(o.name.value,s.map((a)=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let u of o.arguments){let c=u.name.value;if(!a.includes(c)){let l=Je(c,a);e.reportError(new m(`Unknown argument "${c}" on directive "@${s}".`+(e.hideSuggestions?"":qe(l)),{nodes:u}))}}return!1}}}function Fi(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let o of r)t.set(o.name,o.locations);let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt)t.set(o.name.value,o.locations.map((s)=>s.value));return{Directive(o,s,a,u,c){let l=o.name.value,p=t.get(l);if(p==null){e.reportError(new m(`Unknown directive "@${l}".`,{nodes:o}));return}let f=Nd(c);if(f!=null&&!p.includes(f))e.reportError(new m(`Directive "@${l}" may not be used on ${f}.`,{nodes:o}))}}}function Nd(e){let t=e.at(-1);if(!(t!=null&&("kind"in t)))U(!1);switch(t.kind){case Tt:return Id(t.operation);case an:return F.FIELD;case Dt:return F.FRAGMENT_SPREAD;case _n:return F.INLINE_FRAGMENT;case Qe:return F.FRAGMENT_DEFINITION;case ri:{let n=e[e.length-3];if(!("kind"in n))U(!1);return n.kind===Tt?F.VARIABLE_DEFINITION:F.FRAGMENT_VARIABLE_DEFINITION}case Ye:case Rt:return F.SCHEMA;case Qt:case ln:return F.SCALAR;case At:case qt:return F.OBJECT;case co:return F.FIELD_DEFINITION;case xt:case Kt:return F.INTERFACE;case wt:case Jt:return F.UNION;case Yt:case pn:return F.ENUM;case lo:return F.ENUM_VALUE;case yt:case Lt:return F.INPUT_OBJECT;case ai:{let n=e.at(-3);if(!(n!=null&&("kind"in n)))U(!1);return n.kind===yt||n.kind===Lt?F.INPUT_FIELD_DEFINITION:F.ARGUMENT_DEFINITION}case pt:case Tr:return F.DIRECTIVE_DEFINITION;default:U(!1,"Unexpected kind: "+y(t.kind))}}function Id(e){switch(e){case re.QUERY:return F.QUERY;case re.MUTATION:return F.MUTATION;case re.SUBSCRIPTION:return F.SUBSCRIPTION}}function Ho(e){return{FragmentSpread(t){let n=t.name.value;if(!e.getFragment(n))e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function zo(e){let t=e.getSchema();return{OperationDefinition(n){let r=n.operation;if(!t.getRootType(r))e.reportError(new m(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}}function Ci(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(En).map((i)=>i.name.value)]);return{NamedType(i,o,s,a,u){let c=i.name.value;if(!r.has(c)){let l=u[2]??s,p=l!=null&&vd(l);if(p&&Zc.has(c))return;let f=e.hideSuggestions?[]:Je(c,p?[...Zc,...r]:[...r]);e.reportError(new m(`Unknown type "${c}".`+qe(f),{nodes:i}))}}}}var Zc=new Set([...Ct,...Mt].map((e)=>e.name));function vd(e){return"kind"in e&&(Ri(e)||Li(e))}function Xo(e){let t=0;return{Document(n){t=n.definitions.filter((r)=>r.kind===Tt).length},OperationDefinition(n){if(!n.name&&t>1)e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function Zo(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(i){if(n){e.reportError(new m("Cannot define a new schema within a schema extension.",{nodes:i}));return}if(r>0)e.reportError(new m("Must provide only one schema definition.",{nodes:i}));++r}}}var bd=3;function es(e){function t(n,r=Object.create(null),i=0){if(n.kind===Dt){let o=n.name.value;if(r[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===an&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")){if(i++,i>=bd)return!0}if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,r,i))return!0}return!1}return{Field(n){if(n.name.value==="__schema"||n.name.value==="__type"){if(t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}}function ts(e){let t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length===0)return;r[s]=n.length;for(let u of a){let c=u.name.value,l=r[c];if(n.push(u),l===void 0){let p=e.getFragment(c);if(p)i(p)}else{let p=n.slice(l),f=p.slice(0,-1).map((d)=>'"'+d.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${c}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:p}))}n.pop()}r[s]=void 0}}function ns(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map((i)=>i.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(let{node:i,fragmentVariableDefinition:o}of r){if(o)continue;let s=i.name.value;if(!n.has(s))e.reportError(new m(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,t]}))}}}}function rs(e){let t=new Set,n=[];return{OperationDefinition(r){for(let i of e.getRecursivelyReferencedFragments(r))t.add(i.name.value);return!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){for(let r of n){let i=r.name.value;if(!t.has(i))e.reportError(new m(`Fragment "${i}" is never used.`,{nodes:r}))}}}}}function is(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),r=new Set(n.map(({node:o})=>o.name.value)),i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;if(!r.has(s))e.reportError(new m(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),r=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;if(!s)r.add(a)}let i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;if(!r.has(s))e.reportError(new m(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function cr(e){switch(e.kind){case Ve:return{...e,fields:_d(e.fields)};case Ae:return{...e,values:e.values.map(cr)};case Oe:case Bt:case Ie:case tt:case le:case Ot:case Ce:return e}}function _d(e){return e.map((t)=>({...t,value:cr(t.value)})).sort((t,n)=>fn(t.name.value,n.name.value))}function nl(e){if(Array.isArray(e))return e.map(([t,n])=>`subfields "${t}" conflict because `+nl(n)).join(" and ");return e}function us(e){let t=new Ca,n=new ol,r=new Map;return{SelectionSet(i){let o=Sd(e,r,t,n,e.getParentType(),i);for(let[[s,a],u,c]of o){let l=nl(a);e.reportError(new m(`Fields "${s}" conflict because ${l}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(c)}))}}}}function Sd(e,t,n,r,i,o){let s=[],[a,u]=as(e,t,i,o,void 0);if(Od(e,s,t,n,r,a),u.length!==0)for(let c=0;c<u.length;c++){os(e,s,t,n,r,!1,a,u[c]);for(let l=c+1;l<u.length;l++)ss(e,s,t,n,r,!1,u[c],u[l])}return s}function os(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);let u=e.getFragment(a.node.name.value);if(!u)return;let[c,l]=La(e,n,u,a.varMap);if(s===c)return;ka(e,t,n,r,i,o,s,void 0,c,a.varMap);for(let p of l)os(e,t,n,r,i,o,s,p)}function ss(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value){if(!Fa(s.node.arguments,s.varMap,a.node.arguments,a.varMap)){e.reportError(new m(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));return}}if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);let u=e.getFragment(s.node.name.value),c=e.getFragment(a.node.name.value);if(!u||!c)return;let[l,p]=La(e,n,u,s.varMap),[f,d]=La(e,n,c,a.varMap);ka(e,t,n,r,i,o,l,s.varMap,f,a.varMap);for(let E of d)ss(e,t,n,r,i,o,s,E);for(let E of p)ss(e,t,n,r,i,o,E,a)}function Dd(e,t,n,r,i,o,s,a,u,c,l){let p=[],[f,d]=as(e,t,o,s,a),[E,I]=as(e,t,u,c,l);ka(e,p,t,n,r,i,f,a,E,l);for(let S of I)os(e,p,t,n,r,i,f,S);for(let S of d)os(e,p,t,n,r,i,E,S);for(let S of d)for(let G of I)ss(e,p,t,n,r,i,S,G);return p}function Od(e,t,n,r,i,o){for(let[s,a]of o.entries())if(a.length>1)for(let u=0;u<a.length;u++)for(let c=u+1;c<a.length;c++){let l=rl(e,n,r,i,!1,s,a[u],void 0,a[c],void 0);if(l)t.push(l)}}function ka(e,t,n,r,i,o,s,a,u,c){for(let[l,p]of s.entries()){let f=u.get(l);if(f!=null)for(let d of p)for(let E of f){let I=rl(e,n,r,i,o,l,d,a,E,c);if(I)t.push(I)}}}function rl(e,t,n,r,i,o,s,a,u,c){let[l,p,f]=s,[d,E,I]=u,S=i||l!==d&&L(l)&&L(d);if(!S){let A=p.name.value,h=E.name.value;if(A!==h)return[[o,`"${A}" and "${h}" are different fields`],[p],[E]];if(!Fa(p.arguments,a,E.arguments,c))return[[o,"they have differing arguments"],[p],[E]]}let G=p.directives,Z=E.directives,W=Ad(G,a,Z,c);if(W!==void 0)return[[o,W],[p],[E]];let H=f?.type,Y=I?.type;if(H&&Y&&Ra(H,Y))return[[o,`they return conflicting types "${y(H)}" and "${y(Y)}"`],[p],[E]];let ne=p.selectionSet,b=E.selectionSet;if(ne&&b){let A=Dd(e,t,n,r,S,pe(H),ne,a,pe(Y),b,c);return wd(A,o,p,E)}}function Fa(e,t,n,r){if(e===void 0||e.length===0)return n===void 0||n.length===0;if(n===void 0||n.length===0)return!1;if(e.length!==n.length)return!1;let i=new Map(n.map(({name:o,value:s})=>[o.value,r===void 0?s:Vi(s,r)]));return e.every((o)=>{let s=o.value;if(t)s=Vi(s,t);let a=i.get(o.name.value);if(a===void 0)return!1;return el(s)===el(a)})}function Vi(e,t){switch(e.kind){case Ce:return t.get(e.name.value)??e;case Ae:return{...e,values:e.values.map((n)=>Vi(n,t))};case Ve:return{...e,fields:e.fields.map((n)=>({...n,value:Vi(n.value,t)}))};default:return e}}function el(e){return ee(cr(e))}function tl(e){return e?.find((t)=>t.name.value==="stream")}function Ad(e,t,n,r){let i=tl(e),o=tl(n);if(!i&&!o)return;else if(i&&o){if(Fa(i.arguments,t,o.arguments,r))return"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100";return"they have overlapping stream directives"}return"they have overlapping stream directives"}function Ra(e,t){if(j(e))return j(t)?Ra(e.ofType,t.ofType):!0;if(j(t))return!0;if(w(e))return w(t)?Ra(e.ofType,t.ofType):!0;if(w(t))return!0;if(ve(e)||ve(t))return e!==t;return!1}function as(e,t,n,r,i){let o=t.get(r);if(o)return o;let s=new Map,a=new Map;il(e,n,r,s,a,i);let u=[s,Array.from(a.values())];return t.set(r,u),u}function La(e,t,n,r){let i=t.get(n.selectionSet);if(i)return i;let o=Te(e.getSchema(),n.typeCondition);return as(e,t,o,n.selectionSet,r)}function il(e,t,n,r,i,o){for(let s of n.selections)switch(s.kind){case an:{let a=s.name.value,u;if(L(t)||P(t))u=t.getFields()[a];let c=s.alias?s.alias.value:a,l=r.get(c);if(l==null)l=[],r.set(c,l);l.push([t,s,u]);break}case Dt:{let a=xd(e,s,o);i.set(a.key,a);break}case _n:{let a=s.typeCondition,u=a?Te(e.getSchema(),a):t;il(e,u,s.selectionSet,r,i,o);break}}}function xd(e,t,n){let r="",i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(let[a,u]of o.variableDefinitions){let c=s.get(a);if(c)r+=a+": "+ee(cr(c));let l=s.get(a);if(l!==void 0)i.set(a,n!==void 0?Vi(l,n):l);else if(u.defaultValue)i.set(a,u.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}function wd(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}class Ca{constructor(){this._data=new Map}has(e,t,n){let r=this._data.get(e)?.get(t);if(r===void 0)return!1;return n?!0:n===r}add(e,t,n){let r=this._data.get(e);if(r===void 0)this._data.set(e,new Map([[t,n]]));else r.set(t,n)}}class ol{constructor(){this._orderedPairSet=new Ca}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){if(e<t)this._orderedPairSet.add(e,t,n);else this._orderedPairSet.add(t,e,n)}}function cs(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(dt(n)&&dt(r)&&!mi(e.getSchema(),n,r)){let i=y(r),o=y(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=Rd(e,n),i=e.getParentType();if(r&&i&&!mi(e.getSchema(),r,i)){let o=y(i),s=y(r);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}}function Rd(e,t){let n=e.getFragment(t);if(n){let r=Te(e.getSchema(),n.typeCondition);if(dt(r))return r}}function ls(e){let t=e.getSchema(),n=new Map;for(let i of e.getDocument().definitions)if(En(i))n.set(i.name.value,i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let o=i.name.value,s=n.get(o),a=t?.getType(o),u;if(s!=null)u=Ld[s.kind];else if(a)u=kd(a);if(u!=null){if(u!==i.kind){let c=Fd(i.kind);e.reportError(new m(`Cannot extend non-${c} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let c=[...n.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new m(`Cannot extend type "${o}" because it is not defined.`+qe(Je(o,c)),{nodes:i.name}))}}}var Ld={[Qt]:ln,[At]:qt,[xt]:Kt,[wt]:Jt,[Yt]:pn,[yt]:Lt};function kd(e){if(ae(e))return ln;if(L(e))return qt;if(P(e))return Kt;if(te(e))return Jt;if(z(e))return pn;if(k(e))return Lt;U(!1,"Unexpected type: "+y(e))}function Fd(e){switch(e){case ln:return"scalar";case qt:return"object";case Kt:return"interface";case Jt:return"union";case pn:return"enum";case Lt:return"input object";default:U(!1,"Unexpected kind: "+y(e))}}function ps(e){return{...Va(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map((i)=>i.name.value));for(let i of n.args)if(!r.has(i.name)&&ze(i))e.reportError(new m(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let r=new Set(t.arguments?.map((i)=>i.name.value));for(let[i,o]of n.variableDefinitions)if(!r.has(i)&&sl(o)){let s=Te(e.getSchema(),o.type),a=y(s);e.reportError(new m(`Fragment "${t.name.value}" argument "${i}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function Va(e){let t=new Map,r=e.getSchema()?.getDirectives()??je;for(let o of r)t.set(o.name,new Map(o.args.filter(ze).map((s)=>[s.name,s])));let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(sl).map((a)=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let u=o.arguments??[],c=new Set(u.map((l)=>l.name.value));for(let[l,p]of a.entries())if(!c.has(l)){let f=yr(p.type)?y(p.type):ee(p.type);e.reportError(new m(`Argument "@${s}(${l}:)" of type "${f}" is required, but it was not provided.`,{nodes:o}))}}}}}}function sl(e){return e.type.kind===cn&&e.defaultValue==null}function fs(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(ve(pe(n))){if(r){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}}}}function Tn(e,t){if(w(t)){if(e==null)return;return Tn(e,t.ofType)}if(e==null)return null;if(j(t)){if(!et(e)){let i=Tn(e,t.ofType);if(i===void 0)return;return[i]}let r=[];for(let i of e){let o=Tn(i,t.ofType);if(o===void 0)return;r.push(o)}return r}if(k(t)){if(!ye(e)||Array.isArray(e))return;let r=Object.create(null),i=t.getFields(),o=0;for(let s of Object.keys(e)){if(e[s]===void 0)continue;if(o++,!Object.hasOwn(i,s))return}for(let s of Object.values(i)){let a=e[s.name];if(a===void 0){if(Xe(s))return;let u=ds(s);if(u!==void 0)r[s.name]=u}else{let u=Tn(a,s.type);if(u===void 0)return;r[s.name]=u}}if(t.isOneOf){let s=Object.keys(r);if(o!==1||s.length!==1)return;let a=s[0];if(r[a]===null)return}return r}let n=It(t);try{return n.coerceInputValue(e)}catch(r){}}function yn(e,t,n,r){if(e.kind===Ce){let o=al(e,n,r);if(o==null&&w(t))return;return o}if(w(t)){if(e.kind===le)return;return yn(e,t.ofType,n,r)}if(e.kind===le)return null;if(j(t)){if(e.kind!==Ae){let s=yn(e,t.ofType,n,r);if(s===void 0)return;return[s]}let o=[];for(let s of e.values){let a=yn(s,t.ofType,n,r);if(a===void 0)if(s.kind===Ce&&al(s,n,r)==null&&!w(t.ofType))a=null;else return;o.push(a)}return o}if(k(t)){if(e.kind!==Ve)return;let o=Object.create(null),s=t.getFields();if(e.fields.some((c)=>!Object.hasOwn(s,c.name.value)))return;let u=new Map(e.fields.map((c)=>[c.name.value,c]));for(let c of Object.values(s)){let l=u.get(c.name);if(!l||l.value.kind===Ce&&Cd(l.value,n,r)){if(Xe(c))return;let p=ds(c);if(p!==void 0)o[c.name]=p}else{let p=yn(l.value,c.type,n,r);if(p===void 0)return;o[c.name]=p}}if(t.isOneOf){let c=Object.keys(o);if(u.size!==1||c.length!==1)return;for(let[l,p]of u)if(p.value.kind===le||o[l]===null)return}return o}let i=It(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(dn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(o){}}function al(e,t,n){let r=e.name.value;if(n?.sources[r]!==void 0)return n.coerced[r];return t?.coerced[r]}function Cd(e,t,n){let r=e.name.value;return(n?.sources[r]!==void 0?n.coerced:t?.coerced)?.[r]===void 0}function ds(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0){if(t=n.literal?yn(n.literal,e.type):Tn(n.value,e.type),t===void 0)U(!1,`Expected value of type "${e.type}" to be valid, found: ${y(n.literal??n.value)}.`);return e._memoizedCoercedDefaultValue=t,t}let r=e.defaultValue;if(r!==void 0)e._memoizedCoercedDefaultValue=r;return r}function ms(e,t){let n=t.variable.name.value,r=Te(e,t.type);if(!xe(r)){let o=ee(t.type);return new m(`Variable "$${n}" expected value of type "${o}" which cannot be used as an input type.`,{nodes:t.type})}let i=t.defaultValue;return{name:n,type:r,default:i&&{literal:i}}}function Mi(e,t,n,r){let i=[],o=r?.maxErrors;try{let s=Vd(e,t,n,(a)=>{if(o!=null&&i.length>=o)throw new m("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)},r?.hideSuggestions);if(i.length===0)return{variableValues:s}}catch(s){i.push(De(s))}return{errors:i}}function Vd(e,t,n,r,i){let o=Object.create(null),s=Object.create(null);for(let a of t){let u=ms(e,a);if(u instanceof m){r(u);continue}let{name:c,type:l}=u,p=Object.hasOwn(n,c)?n[c]:void 0;if(p===void 0){if(o[c]={signature:u},a.defaultValue){Ua(s,c,u,(d,E)=>{r(new m(`Variable "$${c}" has invalid default value${qn(E)}: ${d.message}`,{nodes:a}))},i);continue}else if(!w(l))continue}else o[c]={signature:u,value:p};let f=Tn(p,l);if(f!==void 0)s[c]=f;else Zn(p,l,(d,E)=>{r(new m(`Variable "$${c}" has invalid value${qn(E)}: ${d.message}`,{nodes:a,originalError:d}))},i)}return{sources:o,coerced:s}}function Ua(e,t,n,r,i){try{let o=ds(n);if(o!==void 0)e[t]=o}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;if(Na(s,n.type,(u,c)=>{a=!0,r(u,c)},i),!a)r(De(o),[])}}function ul(e,t,n,r,i){let o=e.arguments??[],s=new Map(o.map((c)=>[c.name.value,c])),a=Object.create(null),u=Object.create(null);for(let[c,l]of Object.entries(t)){let p=s.get(c);if(p!==void 0)a[c]=r==null?{signature:l,value:p.value}:{signature:l,value:p.value,fragmentVariableValues:r};else a[c]={signature:l};cl(u,e,c,l,p,n,r,i)}return{sources:a,coerced:u}}function _t(e,t,n,r,i){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map((u)=>[u.name.value,u]));for(let u of e.args){let c=u.name;cl(o,t,c,u,a.get(u.name),n,r,i)}return o}function cl(e,t,n,r,i,o,s,a){let u=r.type,c=(f,d)=>{throw new m(`${Ma(r,t)} has invalid default value${qn(d)}: ${f.message}`,{nodes:t})};if(!i){if(ze(r))throw new m(`${Ma(r,t)} of required type "${u}" was not provided.`,{nodes:t});Ua(e,n,r,c,a);return}let l=i.value;if(l.kind===Ce){let f=l.name.value,d=s?.sources[f]?s:o;if((d==null||!Object.hasOwn(d.coerced,f))&&!ze(r)){Ua(e,n,r,c,a);return}}let p=yn(l,u,o,s);if(p===void 0)xn(l,u,(f,d)=>{throw f.message=`${Ma(r,t)} has invalid value${qn(d)}: ${f.message}`,f},o,s,a),U(!1,"Invalid argument");e[n]=p}function Ma(e,t){return li(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Zt(e,t,n,r,i){let o=t.directives?.find((s)=>s.name.value===e.name);if(o)return _t(e,o,n,r,i)}function wr(e,t,n,r,i,o,s=!1){let a=new Fe,u=[],c={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return Ui(c,i,a,u),{groupedFieldSet:a,newDeferUsages:u,forbiddenDirectiveInstances:c.forbiddenDirectiveInstances}}function fl(e,t,n,r,i,o){let s={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:!1},a=new Fe,u=[];for(let c of i){let l=c.node.selectionSet;if(l){let{deferUsage:p,fragmentVariableValues:f}=c;Ui(s,l,a,u,p,f)}}return{groupedFieldSet:a,newDeferUsages:u}}function Ui(e,t,n,r,i,o){let{schema:s,fragments:a,variableValues:u,runtimeType:c,visitedFragmentNames:l,hideSuggestions:p}=e;for(let f of t.selections)switch(f.kind){case an:{if(!Pa(e,f,u,o))continue;n.add(Md(f),{node:f,deferUsage:i,fragmentVariableValues:o});break}case _n:{if(!Pa(e,f,u,o)||!pl(s,f,c))continue;let d=ll(u,o,f,i);if(!d)Ui(e,f.selectionSet,n,r,i,o);else r.push(d),Ui(e,f.selectionSet,n,r,d,o);break}case Dt:{let d=f.name.value;if(!Pa(e,f,u,o))continue;let E=a[d];if(E==null||!pl(s,E.definition,c))continue;let I=ll(u,o,f,i),S=l.get(d),G;if(!I){if(S===!1)continue;l.set(d,!1),G=i}else{if(S!==void 0)continue;l.set(d,!0),r.push(I),G=I}let Z=E.variableSignatures,W;if(Z)W=ul(f,Z,u,o,p);Ui(e,E.definition.selectionSet,n,r,G,W);break}}}function ll(e,t,n,r){let i=Zt(Xt,n,e,t);if(!i)return;if(i.if===!1)return;return{label:typeof i.label==="string"?i.label:void 0,parentDeferUsage:r}}function Pa(e,t,n,r){let i=t.directives?.find((u)=>u.name.value===kn.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;if((i?_t(kn,i,n,r,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find((u)=>u.name.value===Ln.name);if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;if((s?_t(Ln,s,n,r,e.hideSuggestions):void 0)?.if===!1)return!1;return!0}function pl(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=Te(e,r);if(i===n)return!0;if(Ke(i))return e.isSubType(i,n);return!1}function Md(e){return e.alias?e.alias.value:e.name.value}function $a(e){return e.map((t)=>t.node)}function hs(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let l of s.definitions)if(l.kind===Qe)a[l.name.value]={definition:l};let{groupedFieldSet:u,forbiddenDirectiveInstances:c}=wr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(c.length>0){e.reportError(new m(i!=null?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:c}));return}if(u.size>1){let f=[...u.values()].slice(1).flatMap((d)=>$a(d));e.reportError(new m(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:f}))}for(let l of u.values())if($a(l)[0].name.value.startsWith("__"))e.reportError(new m(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:$a(l)}))}}}}}function Es(e){return{Directive(t){let n=e.getFieldDef(),r=e.getParentType();if(n&&r&&t.name.value===vt.name&&!(j(n.type)||On(n.type)&&j(n.type.ofType)))e.reportError(new m(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}}function Rr(e,t){let n=new Fe;for(let r of e)n.add(t(r),r);return n}function Ts(e){return{DirectiveDefinition(r){let i=r.arguments??[];return n(`@${r.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){let i=r.name.value,o=r.fields??[];for(let s of o){let a=s.name.value,u=s.arguments??[];n(`${i}.${a}`,u)}return!1}function n(r,i){let o=Rr(i,(s)=>s.name.value);for(let[s,a]of o)if(a.length>1)e.reportError(new m(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map((u)=>u.name)}));return!1}}function Pi(e){return{Field:t,Directive:t};function t(n){let r=n.arguments??[],i=Rr(r,(o)=>o.name.value);for(let[o,s]of i)if(s.length>1)e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:s.map((a)=>a.name)}))}}function ys(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n?.getDirective(i)){e.reportError(new m(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}let o=t.get(i);if(o)e.reportError(new m(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]}));else t.set(i,r.name);return!1}}}function $i(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let u of r)t.set(u.name,!u.isRepeatable);let i=e.getDocument().definitions;for(let u of i)if(u.kind===pt)t.set(u.name.value,!u.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(u){if(!("directives"in u)||!u.directives)return;let c;if(u.kind===Ye||u.kind===Rt)c=o;else if(En(u)||ki(u)){let l=u.name.value;if(c=s.get(l),c===void 0)c=new Map,s.set(l,c)}else if(u.kind===pt||u.kind===Tr){let l=u.name.value;if(c=a.get(l),c===void 0)c=new Map,a.set(l,c)}else c=new Map;for(let l of u.directives){let p=l.name.value;if(t.get(p)===!0){let f=c.get(p);if(f!=null)e.reportError(new m(`The directive "@${p}" can only be used once at this location.`,{nodes:[f,l]}));else c.set(p,l)}}}}}function gs(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);if(a==null)a=new Map,r.set(s,a);let u=o.values??[];for(let c of u){let l=c.name.value,p=n[s];if(z(p)&&p.getValue(l)){e.reportError(new m(`Enum value "${s}.${l}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:c.name}));continue}let f=a.get(l);if(f!=null)e.reportError(new m(`Enum value "${s}.${l}" can only be defined once.`,{nodes:[f,c.name]}));else a.set(l,c.name)}return!1}}function Ns(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);if(a==null)a=new Map,r.set(s,a);let u=o.fields??[];for(let c of u){let l=c.name.value;if(Ud(n[s],l)){e.reportError(new m(`Field "${s}.${l}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:c.name}));continue}let p=a.get(l);if(p!=null)e.reportError(new m(`Field "${s}.${l}" can only be defined once.`,{nodes:[p,c.name]}));else a.set(l,c.name)}return!1}}function Ud(e,t){if(L(e)||P(e)||k(e))return e.getFields()[t]!=null;return!1}function Is(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value,i=t.get(r);if(i!=null)e.reportError(new m(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]}));else t.set(r,n.name);return!1}}}function Gi(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let r=t.pop();if(r==null)U(!1);n=r}},ObjectField(r){let i=r.name.value,o=n.get(i);if(o!=null)e.reportError(new m(`There can be only one input field named "${i}".`,{nodes:[o,r.name]}));else n.set(i,r.name)}}}function vs(e){let t=new Map;return{OperationDefinition(n){let r=n.name;if(r!=null){let i=t.get(r.value);if(i!=null)e.reportError(new m(`There can be only one operation named "${r.value}".`,{nodes:[i,r]}));else t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}}function bs(e){let t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){let s=o.operationTypes??[];for(let a of s){let u=a.operation,c=n.get(u);if(r[u])e.reportError(new m(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:a}));else if(c)e.reportError(new m(`There can be only one ${u} type in schema.`,{nodes:[c,a]}));else n.set(u,a)}return!1}}function _s(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let o=i.name.value;if(n?.getType(o)){e.reportError(new m(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}let s=t.get(o);if(s!=null)e.reportError(new m(`There can be only one type named "${o}".`,{nodes:[s,i.name]}));else t.set(o,i.name);return!1}}function Ss(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],r=Rr(n,(i)=>i.variable.name.value);for(let[i,o]of r)if(o.length>1)e.reportError(new m(`There can be only one variable named "$${i}".`,{nodes:o.map((s)=>s.variable.name)}))}}}function Ds(e){return{NullValue:(t)=>Vn(e,t,e.getInputType()),ListValue:(t)=>Vn(e,t,e.getParentInputType()),ObjectValue:(t)=>Vn(e,t,e.getInputType()),EnumValue:(t)=>Vn(e,t,e.getInputType()),IntValue:(t)=>Vn(e,t,e.getInputType()),FloatValue:(t)=>Vn(e,t,e.getInputType()),StringValue:(t)=>Vn(e,t,e.getInputType()),BooleanValue:(t)=>Vn(e,t,e.getInputType())}}function Vn(e,t,n){if(n)xn(t,n,(r)=>{e.reportError(r)},void 0,void 0,e.hideSuggestions);return!1}function Os(e){return{VariableDefinition(t){let n=Te(e.getSchema(),t.type);if(n!==void 0&&!xe(n)){let r=t.variable.name.value,i=ee(t.type);e.reportError(new m(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function As(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:u}of r){let c=i.name.value,l=u;if(l??=t.get(c),l&&o){let p=e.getSchema(),f=Te(p,l.type);if(f&&!Pd(p,f,l.defaultValue,o,a))e.reportError(new m(`Variable "$${c}" of type "${f}" used in position expecting type "${o}".`,{nodes:[l,i]}));if(k(s)&&s.isOneOf&&pi(f))e.reportError(new m(`Variable "$${c}" is of type "${f}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[l,i]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function Pd(e,t,n,r,i){if(w(r)&&!w(t)){if(!(n!=null&&n.kind!==le)&&i===void 0)return!1;let a=r.ofType;return Ht(e,t,a)}return Ht(e,t,r)}var Ga=Object.freeze([es]),xs=Object.freeze([qo,zo,vs,Xo,hs,Ci,Jo,Os,fs,Ko,Is,Ho,rs,cs,ts,Ss,ns,is,Fi,$i,Go,jo,$o,Es,Wo,Pi,Ds,ps,As,us,Gi,...Ga]),dl=Object.freeze([Zo,bs,_s,gs,Ns,Ts,ys,Ci,Fi,$i,ls,wa,Pi,Gi,Va]);class ja{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let n of this.getDocument().definitions)if(n.kind===Qe)t[n.name.value]=n;this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;while(r=n.pop())for(let i of r.selections)if(i.kind===Dt)t.push(i);else if(i.selectionSet)n.push(i.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=new Set,r=[e.selectionSet],i;while(i=r.pop())for(let o of this.getFragmentSpreads(i)){let s=o.name.value;if(!n.has(s)){n.add(s);let a=this.getFragment(s);if(a)t.push(a),r.push(a.selectionSet)}}this._recursivelyReferencedFragments.set(e,t)}return t}}class Ba extends ja{constructor(e,t,n){super(e,n);this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ji extends ja{constructor(e,t,n,r,i){super(t,r);this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new ur(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===Qe?e:void 0;ft(e,xr(r,{VariableDefinition:()=>!1,Variable(o){let s;if(i)s=r.getFragmentSignatureByName()(i.name.value)?.variableDefinitions.get(o.name.value),n.push({node:o,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:s});else n.push({node:o,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}var $d=Gt(ti,(e)=>e.filter((t)=>t!=="description")),Qa=new m("Too many validation errors, error limit reached. Validation aborted.");function Lr(e,t,n=xs,r){return st(va)?va.traceSync(()=>ml(e,t,n,r),{schema:e,document:t}):ml(e,t,n,r)}function ml(e,t,n,r){let i=r?.maxErrors??100,o=r?.hideSuggestions??!1;Dr(e);let s=[],a=new ur(e),u=new ji(e,t,a,(l)=>{if(s.length>=i)throw Qa;s.push(l)},o),c=ui(n.map((l)=>l(u)));try{ft(t,xr(a,c),$d)}catch(l){if(l===Qa)s.push(Qa);else throw l}return s}function hl(e,t,n=dl){let r=[],i=new Ba(e,t,(s)=>{r.push(s)}),o=n.map((s)=>s(i));return ft(e,ui(o)),r}function El(e){let t=hl(e);if(t.length!==0)throw Error(t.map((n)=>n.message).join(`
+
+`))}function Tl(e,t){let n=hl(e,t);if(n.length!==0)throw Error(n.map((r)=>r.message).join(`
+
+`))}function kr(e){return typeof e?.[Symbol.asyncIterator]==="function"}function en(e,t,n){let r=oo(e);if(Gd(r))return r;return new m(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function Gd(e){return Array.isArray(e.path)}function Fr(e,t){let n=null;for(let r of e.definitions)if(r.kind===Tt){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}function ws(e,t,n,r,i,o,s){let{schema:a,fragmentDefinitions:u,rootValue:c,operation:l,variableValues:p}=e;return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:a,fragments:u,rootValue:c,operation:l,variableValues:p,getAbortSignal:o,getAsyncHelpers:s}}function lr(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Ya(e){let{promise:t,resolve:n,reject:r}=lr(),i=!1,o=(a)=>{if(i)return;i=!0,n(a)},s=(a)=>{if(i)return;i=!0,r(a)};return e.then(o,s),{promise:t,abort(a){s(a)}}}function qa(e,t){let n=Ya(e);if(t.aborted)return n.abort(t.reason),n.promise;let r=()=>{t.removeEventListener("abort",r),n.abort(t.reason)};return t.addEventListener("abort",r),n.promise.then(()=>{t.removeEventListener("abort",r)},()=>{t.removeEventListener("abort",r)}),n.promise}class Ka{constructor(){this.pendingAsyncWork=new Set}add(e){let t=this.pendingAsyncWork,n=e.then(()=>{t.delete(n)},()=>{t.delete(n)});t.add(n)}addValues(e){for(let t of e)if(Be(t))this.add(t)}wait(){if(this.pendingAsyncWork.size===0)return;return this.waitForPendingAsyncWork()}promiseAllTrackOnReject(e){let t=Promise.all(e);return t.then(void 0,()=>{this.addValues(e)}),t}async waitForPendingAsyncWork(){while(this.pendingAsyncWork.size>0)await Promise.allSettled(Array.from(this.pendingAsyncWork))}}function Rs(e){let t=new Ka,n,r=(o)=>t.promiseAllTrackOnReject(o);return{asyncWorkTracker:t,getAbortSignal:()=>e,getAsyncHelpers:()=>n??={promiseAll:r,track:(o)=>t.addValues(o)},promiseAll:r}}function Cr(e){let t;return function(r,i){t??=new WeakMap;let o=t.get(r);if(o===void 0)o=new WeakMap,t.set(r,o);let s=o.get(i);if(s===void 0)s=e(r,i),o.set(i,s);return s}}function yl(e){let t;return function(r,i,o){t??=new WeakMap;let s=t.get(r);if(s===void 0)s=new WeakMap,t.set(r,s);let a=s.get(i);if(a===void 0)a=new WeakMap,s.set(i,a);let u=a.get(o);if(u===void 0)u=e(r,i,o),a.set(o,u);return u}}function gl(e,t){let n=Object.keys(e),r=Object.values(e);return t(r).then((i)=>{let o=Object.create(null);for(let s=0;s<n.length;++s)o[n[s]]=i[s];return o})}function Nl(e,t,n){let r=n;for(let i of e)r=K(r)?r.then((o)=>t(o,i)):t(r,i);return r}class Bi extends Error{constructor(e,t){super(jd(e),{cause:e});this.name="AbortedGraphQLExecutionError",this.abortedResult=t}get[Symbol.toStringTag](){return"AbortedGraphQLExecutionError"}}function jd(e){if(e instanceof Error)return e.message;if(typeof e==="object"&&e!==null&&"message"in e&&typeof e.message==="string")return e.message;return String(e)}function Ls(e){let t=[];try{while(!0){let n=e.next();if(n.done)return t;if(Be(n.value))t.push(n.value)}}catch{return t}}function Il(e,t){let{operation:n,variableValues:r}=e,i=Zt(vt,t[0].node,r,t[0].fragmentVariableValues);if(!i)return;if(i.if===!1)return;if(typeof i.initialCount!=="number")U(!1,"initialCount must be a number");if(!(i.initialCount>=0))U(!1,"initialCount must be a positive integer");if(n.operation===re.SUBSCRIPTION)U(!1,"`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");let o=t.map((s)=>({node:s.node,deferUsage:void 0,fragmentVariableValues:s.fragmentVariableValues}));return{initialCount:i.initialCount,label:typeof i.label==="string"?i.label:void 0,fieldDetailsList:o}}function vl(e,t){try{e?.(t)}catch{}}function bl(e,t,n){let r=t.asyncWorkTracker.wait();if(r===void 0){vl(n,{validatedExecutionArgs:e});return}r.then(()=>{vl(n,{validatedExecutionArgs:e})}).catch(()=>{return})}async function Qi(e){try{await e.return?.()}catch{}}var Bd=yl((e,t,n)=>{let{schema:r,fragments:i,variableValues:o,hideSuggestions:s}=e;return fl(r,i,o,t,n,s)}),ks=Cr((e,t)=>Il(e,t));class _l{constructor(){this._errorPositions=new Set,this._errors=[]}get errors(){return this._errors}add(e,t){if(this.hasNulledPosition(t))return;this._errorPositions.add(t),this._errors.push(e)}hasNulledPosition(e){let t=e;while(t!==void 0){if(this._errorPositions.has(t))return!0;t=t.prev}return this._errorPositions.has(void 0)}}var Qd=Error("This operation was aborted");class Yi{constructor(e,t){if(this.validatedExecutionArgs=e,this.aborted=!1,this.abortReason=Qd,this.collectedErrors=new _l,t===void 0)this.resolverAbortController=new AbortController,this.sharedExecutionContext=Rs(this.resolverAbortController.signal);else this.sharedExecutionContext=t;let{getAbortSignal:n,getAsyncHelpers:r,promiseAll:i}=this.sharedExecutionContext;this.getAbortSignal=n,this.getAsyncHelpers=r,this.promiseAll=i}executeRootSelectionSet(e){if(!st(ba))return this.executeRootSelectionSetImpl(e);return Cn(ba,this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs),()=>this.executeRootSelectionSetImpl(e))}buildExecuteContextFromValidatedArgs(e){return{schema:e.schema,document:e.document,operation:e.operation,rawVariableValues:e.rawVariableValues,operationName:e.operation.name?.value,operationType:e.operation.operation}}executeRootSelectionSetImpl(e){let t=this.validatedExecutionArgs.externalAbortSignal,n;if(t){t.throwIfAborted();let o=()=>{this.abort(t.reason)};n=()=>t.removeEventListener("abort",o),t.addEventListener("abort",o)}let r=()=>{n?.()},i;try{let{schema:o,fragments:s,rootValue:a,operation:u,variableValues:c,hideSuggestions:l}=this.validatedExecutionArgs,{operation:p,selectionSet:f}=u,d=o.getRootType(p);if(d==null)throw new m(`Schema is not configured to execute ${p} operation.`,{nodes:u});let{groupedFieldSet:E,newDeferUsages:I}=wr(o,s,c,d,f,l);if(i=this.executeCollectedRootFields(d,a,E,e??p===re.MUTATION,I),K(i)){let S=i.then((W)=>(r(),this.buildResponse(W)),(W)=>(r(),this.collectedErrors.add(De(W),void 0),this.buildResponse(null)));this.sharedExecutionContext.asyncWorkTracker.add(S);let{promise:G,abort:Z}=Ya(S.then((W)=>this.finish(W)));if(this.abortResultPromise=()=>{Z(this.createAbortedExecutionError(S))},this.aborted)this.abortResultPromise();return G}r()}catch(o){return r(),this.collectedErrors.add(De(o),void 0),this.finish(this.buildResponse(null))}return this.finish(this.buildResponse(i))}abort(e){if(this.aborted)return;if(this.aborted=!0,e!==void 0)this.abortReason=e;this.abortResultPromise?.(),this.resolverAbortController?.abort(this.abortReason)}finish(e){if(this.aborted)throw this.createAbortedExecutionError(e);return this.aborted=!0,e}createAbortedExecutionError(e){return new Bi(this.abortReason,e)}getFinishSharedExecution(){let e=this.resolverAbortController,t=this.validatedExecutionArgs.hooks?.asyncWorkFinished;if(t===void 0)return()=>e?.abort();let n=this.validatedExecutionArgs,r=this.sharedExecutionContext;return()=>{e?.abort(),bl(n,r,t)}}buildResponse(e){this.getFinishSharedExecution()();let t=this.collectedErrors.errors;return t.length?{errors:t,data:e}:{data:e}}executeCollectedRootFields(e,t,n,r,i){return this.executeRootGroupedFieldSet(e,t,n,r,void 0)}executeRootGroupedFieldSet(e,t,n,r,i){return r?this.executeFieldsSerially(e,t,void 0,n,i):this.executeFields(e,t,void 0,n,i)}executeFieldsSerially(e,t,n,r,i){let o=st(sr)?sr:void 0;return Nl(r,(s,[a,u])=>{if(this.aborted)throw Error("Aborted!");let c=Pe(n,a,e.name),l=this.executeField(e,t,u,c,i,o);if(l===void 0)return s;if(K(l))return l.then((p)=>(s[a]=p,o=st(sr)?sr:void 0,s));return s[a]=l,s},Object.create(null))}executeFields(e,t,n,r,i){let o=Object.create(null),s=!1,a=st(sr)?sr:void 0;try{for(let[u,c]of r){let l=Pe(n,u,e.name),p=this.executeField(e,t,c,l,i,a);if(p!==void 0){if(o[u]=p,K(p))s=!0}}}catch(u){if(s)this.sharedExecutionContext.asyncWorkTracker.addValues(Object.values(o));throw u}if(!s)return o;return gl(o,this.promiseAll)}executeField(e,t,n,r,i,o){let s=this.validatedExecutionArgs,{schema:a,contextValue:u,variableValues:c,hideSuggestions:l}=s,p=n[0],f=p.node,d=f.name.value,E=a.getField(e,d);if(!E)return;let I=E.type,S=E.resolve??s.fieldResolver;if(o!==void 0){let Z=S;S=(W,H,Y,ne)=>Cn(o,this.buildResolveContext(H,ne,E.resolve===void 0),()=>Z(W,H,Y,ne))}let G=ws(s,E,Mn(n),e,r,this.getAbortSignal,this.getAsyncHelpers);try{let Z=_t(E,f,c,p.fragmentVariableValues,l),W=S(t,Z,u,G);if(Be(W))return this.completePromisedValue(I,n,G,r,W,i);let H=this.completeValue(I,n,G,r,W,i);if(K(H))return H.then(void 0,(Y)=>(this.handleFieldError(Y,I,n,r),null));return H}catch(Z){return this.handleFieldError(Z,I,n,r),null}}buildResolveContext(e,t,n){let r;return{fieldName:t.fieldName,alias:String(t.path.key),parentType:t.parentType.name,fieldType:String(t.returnType),args:e,isDefaultResolver:n,get fieldPath(){return r??=fe(t.path).join("."),r}}}handleFieldError(e,t,n,r){let i=en(e,Mn(n),fe(r));if(this.validatedExecutionArgs.errorPropagation&&w(t))throw i;this.collectedErrors.add(i,r)}completeValue(e,t,n,r,i,o){if(i instanceof Error)throw i;if(w(e)){let s=this.completeValue(e.ofType,t,n,r,i,o);if(s===null)throw Error(`Cannot return null for non-nullable field ${n.parentType}.${n.fieldName}.`);return s}if(i==null)return null;if(j(e))return this.completeListValue(e,t,n,r,i,o);if(ve(e))return this.completeLeafValue(e,i);if(Ke(e))return this.completeAbstractValue(e,t,n,r,i,o);if(L(e))return this.completeObjectValue(e,t,n,r,i,o);U(!1,"Cannot complete value of unexpected output type: "+y(e))}async completePromisedValue(e,t,n,r,i,o){try{let s=await i;if(this.aborted)throw Error("Aborted!");let a=this.completeValue(e,t,n,r,s,o);if(K(a))a=await a;return a}catch(s){return this.handleFieldError(s,e,t,r),null}}async completeAsyncIterableValue(e,t,n,r,i,o){let s=typeof r.key==="number"?void 0:ks(this.validatedExecutionArgs,t),a=!1,u=[],c=i[Symbol.asyncIterator](),l=0,p;try{while(!0){if(s?.initialCount===l&&this.handleStream(l,r,{handle:c,isAsync:!0},s,n,e))break;let f=Pe(r,l,void 0);try{p=await c.next()}catch(E){throw en(E,Mn(t),fe(r))}if(this.aborted||p.done)break;let d=p.value;if(this.completeMaybePromisedListItemValue(d,u,e,t,n,f,o))a=!0;l++}}catch(f){if(this.sharedExecutionContext.asyncWorkTracker.add(Qi(c)),a)this.sharedExecutionContext.asyncWorkTracker.addValues(u);throw f}if(this.aborted){if(!p?.done)this.sharedExecutionContext.asyncWorkTracker.add(Qi(c));throw Error("Aborted!")}return a?this.promiseAll(u):u}handleStream(e,t,n,r,i,o){return!1}completeListValue(e,t,n,r,i,o){let s=e.ofType;if(kr(i))return this.completeAsyncIterableValue(s,t,n,r,i,o);if(!et(i))throw new m(`Expected Iterable, but did not find one for field "${n.parentType}.${n.fieldName}".`);return this.completeIterableValue(s,t,n,r,i,o)}completeIterableValue(e,t,n,r,i,o){let s=typeof r.key==="number"?void 0:ks(this.validatedExecutionArgs,t),a=!1,u=[],c=0,l=i[Symbol.iterator]();try{while(!0){if(s?.initialCount===c&&this.handleStream(c,r,{handle:l},s,n,e))break;let p=l.next();if(p.done)break;let f=p.value,d=Pe(r,c,void 0);if(this.completeMaybePromisedListItemValue(f,u,e,t,n,d,o))a=!0;c++}}catch(p){let f=this.sharedExecutionContext.asyncWorkTracker;if(a)f.addValues(u);throw f.addValues(Ls(l)),p}return a?this.promiseAll(u):u}completeMaybePromisedListItemValue(e,t,n,r,i,o,s){if(Be(e))return t.push(this.completePromisedListItemValue(e,n,r,i,o,s)),!0;else if(this.completeListItemValue(e,t,n,r,i,o,s))return!0;return!1}completeListItemValue(e,t,n,r,i,o,s){try{let a=this.completeValue(n,r,i,o,e,s);if(K(a))return t.push(a.then(void 0,(u)=>(this.handleFieldError(u,n,r,o),null))),!0;t.push(a)}catch(a){this.handleFieldError(a,n,r,o),t.push(null)}return!1}async completePromisedListItemValue(e,t,n,r,i,o){try{let s=await e;if(this.aborted)throw Error("Aborted!");let a=this.completeValue(t,n,r,i,s,o);if(K(a))a=await a;return a}catch(s){return this.handleFieldError(s,t,n,i),null}}completeLeafValue(e,t){let n=e.coerceOutputValue(t);if(n==null)throw Error(`Expected \`${y(e)}.coerceOutputValue(${y(t)})\` to return non-nullable value, returned: ${y(n)}`);return n}completeAbstractValue(e,t,n,r,i,o){let s=this.validatedExecutionArgs,{schema:a,contextValue:u}=s,l=(e.resolveType??s.typeResolver)(i,u,n,e);if(Be(l))return l.then((p)=>{if(this.aborted)throw Error("Aborted!");return this.completeObjectValue(this.ensureValidRuntimeType(p,a,e,t,n,i),t,n,r,i,o)});return this.completeObjectValue(this.ensureValidRuntimeType(l,a,e,t,n,i),t,n,r,i,o)}ensureValidRuntimeType(e,t,n,r,i,o){if(e==null)throw new m(`Abstract type "${n}" must resolve to an Object type at runtime for field "${i.parentType}.${i.fieldName}". Either the "${n}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:Mn(r)});if(typeof e!=="string")throw new m(`Abstract type "${n}" must resolve to an Object type at runtime for field "${i.parentType}.${i.fieldName}" with value ${y(o)}, received "${y(e)}", which is not a valid Object type name.`);let s=t.getType(e);if(s==null)throw new m(`Abstract type "${n}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:Mn(r)});if(!L(s))throw new m(`Abstract type "${n}" was resolved to a non-object type "${e}".`,{nodes:Mn(r)});if(!t.isSubType(n,s))throw new m(`Runtime Object type "${s}" is not a possible type for "${n}".`,{nodes:Mn(r)});return s}completeObjectValue(e,t,n,r,i,o){if(e.isTypeOf){let s=e.isTypeOf(i,this.validatedExecutionArgs.contextValue,n);if(Be(s))return s.then((a)=>{if(this.aborted)throw Error("Aborted!");if(!a)throw this.invalidReturnTypeError(e,i,t);return this.collectAndExecuteSubfields(e,t,r,i,o)});if(!s)throw this.invalidReturnTypeError(e,i,t)}return this.collectAndExecuteSubfields(e,t,r,i,o)}invalidReturnTypeError(e,t,n){return new m(`Expected value of type "${e}" but got: ${y(t)}.`,{nodes:Mn(n)})}collectAndExecuteSubfields(e,t,n,r,i){let{groupedFieldSet:o,newDeferUsages:s}=Bd(this.validatedExecutionArgs,e,t);return this.executeCollectedSubfields(e,r,n,o,s,i)}executeCollectedSubfields(e,t,n,r,i,o){return this.executeFields(e,t,n,r,void 0)}}function Mn(e){return e.map((t)=>t.node)}var Ja="Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)";class Fs extends Yi{executeCollectedRootFields(e,t,n,r,i){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let o=Error(Ja);throw this.abort(o),o}return this.executeRootGroupedFieldSet(e,t,n,r,void 0)}executeCollectedSubfields(e,t,n,r,i){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let o=Error(Ja);throw this.abort(o),o}return this.executeFields(e,t,n,r,void 0)}completeListValue(e,t,n,r,i,o){if(ks(this.validatedExecutionArgs,t)!==void 0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");let a=Error(Ja);throw this.abort(a),a}return super.completeListValue(e,t,n,r,i,o)}}function Cs(e){let t;return function(r){t??=new WeakMap;let i=t.get(r);if(i===void 0)i=e(r),t.set(r,i);return i}}function Vr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Vs(e,t){for(let n of e.keys())if(Vr(n,t))return e.get(n);return}function Wa(e,t=new Set){let n=new Map,r=new Map;for(let[i,o]of e){let s=Yd(o);if(Vr(s,t)){n.set(i,o);continue}let a=Vs(r,s);if(a===void 0)a=new Map,r.set(s,a);a.set(i,o)}return{groupedFieldSet:n,newGroupedFieldSets:r}}function Yd(e){let t=new Set;for(let n of e){let r=n.deferUsage;if(r===void 0)return t.clear(),t;t.add(r)}for(let n of t){let r=n.parentDeferUsage;while(r!==void 0){if(t.has(r)){t.delete(n);break}r=r.parentDeferUsage}}return t}class Ha{constructor(e,t){this._fn=e,this._onAbort=t}prime(){if(this._maybePromise)return this._maybePromise;try{let e=this._fn();if(K(e))this._maybePromise={status:"pending",promise:e},e.then((t)=>{this._maybePromise={status:"fulfilled",value:t}},(t)=>{this._maybePromise={status:"rejected",reason:t}});else this._maybePromise={status:"fulfilled",value:e}}catch(e){this._maybePromise={status:"rejected",reason:e}}return this._maybePromise}result(){let e=this.prime();switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;case"pending":return e.promise}}abort(e){let t=this._maybePromise;if(!t){this._maybePromise={status:"rejected",reason:e};return}if(t.status==="pending"){if(this._maybePromise={status:"rejected",reason:e},this._onAbort)return this._onAbort(e)}}}var za=Symbol.asyncDispose??Symbol.for("Symbol.asyncDispose");function Un(e,t,n=t){let r=!1,i=!1,o=(s)=>{if(r||i)return;return i=!0,qd(s)};return{[Symbol.asyncIterator](){return this},next(){let s=e.next();return s.then((a)=>{if(a.done)r=!0}).catch(()=>{return}),s},async return(){return await o(t),e.return()},async throw(s){return await o(()=>n(s)),e.throw(s)},async[za](){if(await o(t),typeof e[za]==="function")await e[za]()}}}function qd(e){try{let t=e();if(K(t))return t.catch(()=>{})}catch{}}function pr(e,t){let n=e[Symbol.asyncIterator](),r=n.return?.bind(n),i=n.throw?.bind(n),o=r?()=>Sl(r):()=>Promise.resolve(),s=i?(a)=>Sl(()=>i(a)):o;return Un(Kd(e,t),o,s)}async function Sl(e){try{await e()}catch{}}async function*Kd(e,t){for await(let n of e){let r=t(n);if(K(r)){yield await r;continue}yield r}}class qi{constructor(e,t=1){this._backlog=0,this._waiters=[],this._entries=[],this._isStopped=!1,this._stopRequested=!1,this._stopCleanupCallbacks=[],this._batchRequests=new Set,this._capacity=this._normalizeCapacity(t);let{promise:n,resolve:r}=lr();this._resolveStarted=r;try{let i=e({push:this._push.bind(this),stop:this._stop.bind(this),onStop:this._onStop.bind(this),started:n});if(K(i))i.catch(this._stop.bind(this))}catch(i){let o=this._stop(i);if(K(o))o.catch(()=>{return})}}subscribe(e=(t)=>Array.from(t)){let t=this._iteratorLoop(e);return Un(t,()=>this.cancel(),this.abort.bind(this))}cancel(){if(this._stopRequested)return this._stopCompletion;return this._terminate(void 0,()=>{this._isStopped=!0,this._batchRequests.forEach((e)=>e.resolve(void 0)),this._batchRequests.clear()})}abort(e){if(this._stopRequested)return this._stopCompletion;return this._terminate(e,()=>{if(this._isStopped=!0,this._batchRequests.size){this._batchRequests.forEach((t)=>t.reject(e)),this._batchRequests.clear();return}this._entries.push({kind:"item",settled:{status:"rejected",reason:e}})})}async forEachBatch(e){let t=this.subscribe(async(n)=>{let{promise:r,resolve:i}=lr(),o=function*(){yield*n,i()}();await Promise.all([e(o),r])});for await(let n of t);}setCapacity(e){this._capacity=this._normalizeCapacity(e),this._flush()}getCapacity(){return this._capacity}isStopped(){return this._isStopped}_normalizeCapacity(e){return Math.max(1,Math.floor(e))}_flush(){while(this._waiters.length>0&&this._backlog<this._capacity)this._waiters.shift()?.()}_reserve(){if(this._backlog+=1,this._backlog<this._capacity)return;let{promise:e,resolve:t}=lr();return this._waiters.push(t),e}_release(){if(this._backlog>0)this._backlog-=1;this._flush()}_onStop(e){if(this._stopRequested)throw Error("Cannot register onStop cleanup after stop has been requested.");this._stopCleanupCallbacks.push(e)}_runStopCleanup(e,t){this._stopRequested=!0;let n=this._stopCleanupCallbacks.flatMap((i)=>{try{let o=i(e);return K(o)?[o]:[]}catch{return[]}}),r=n.length>0?Promise.allSettled(n).then(()=>{return}):void 0;if(K(r))return this._stopCompletion=r.then(t,t).then(()=>{return}),this._stopCompletion;t()}async*_iteratorLoop(e){this._resolveStarted();let t;while(t=await this._waitForNextBatch()){let n=e(t);if(K(n))n=await n;if(n===void 0)continue;yield n}}_waitForNextBatch(){let{promise:e,resolve:t,reject:n}=lr();return this._batchRequests.add({resolve:t,reject:n}),this._deliverBatchIfReady(),e}_push(e){if(this._stopRequested)return;let t=this._reserve();if(K(e)){let n={kind:"item"};this._entries.push(n),e.then((r)=>{n.settled={status:"fulfilled",value:r},this._deliverBatchIfReady()},(r)=>{n.settled={status:"rejected",reason:r},this._deliverBatchIfReady()})}else this._entries.push({kind:"item",settled:{status:"fulfilled",value:e}}),this._deliverBatchIfReady();return t}_terminate(e,t){for(let n of this._entries)if(n.kind==="item")this._release();return this._entries.length=0,this._runStopCleanup(e,t)}_stop(e){if(this._stopRequested)return this._stopCompletion;let t=this._runStopCleanup(e,()=>{if(e===void 0){if(this._entries.length===0){this._isStopped=!0,this._deliverBatchIfReady();return}this._entries.push({kind:"stop"}),this._deliverBatchIfReady();return}this._entries.push({kind:"item",settled:{status:"rejected",reason:e}}),this._entries.push({kind:"stop"}),this._deliverBatchIfReady()});if(K(t))t.catch(()=>{return});return t}_deliverBatchIfReady(){if(!this._batchRequests.size)return;let e=this._entries[0],t=this._batchRequests;if(e!==void 0){if(e.kind==="stop")U(!1);let n=e.settled;if(n!==void 0){if(n.status==="fulfilled"){this._batchRequests=new Set,t.forEach((r)=>r.resolve(this._drainBatch()));return}this._entries.shift(),this._release(),this._isStopped=!0,this._batchRequests=new Set,t.forEach((r)=>r.reject(n.reason))}}else if(this._isStopped)this._batchRequests=new Set,t.forEach((n)=>n.resolve(void 0))}*_drainBatch(){while(!0){let e=this._entries[0];if(e===void 0)return;if(e.kind==="stop"){this._isStopped=!0,this._entries.shift();return}let t=e.settled;if(t===void 0||t.status==="rejected")return;this._entries.shift(),this._release(),yield t.value}}}function Ms(e){let t=new Set,n=new Set,r=new Map,i=new Map,o,s,{newGroups:a,newStreams:u}=I(e),c=H(a);for(let N of c)t.add(N);for(let N of u)n.add(N);let l=new qi(({push:N,stop:g,onStop:_,started:B})=>{o=N,s=g,B.then(()=>{for(let X of t)ne(X);for(let X of n)A(X)}),_((X)=>p(X))},1).subscribe((N)=>h(N));return{initialGroups:c,initialStreams:u,events:l};function p(N){let g=[];for(let _ of t)f(_,N,g);for(let _ of n)E(_,N,g);if(g.length>0)return Promise.allSettled(g).then(()=>{return})}function f(N,g,_){let B=r.get(N);if(B){for(let X of B.tasks)d(X,g,_);for(let X of B.childGroups)f(X,g,_)}}function d(N,g,_){let B=N.computation.abort(g);if(K(B))_.push(B);let X=i.get(N);if(X)for(let he of X.childStreams)E(he,g,_)}function E(N,g,_){let B=N.queue.abort(g);if(K(B))_.push(B)}function I(N,g){if(!N)return{newGroups:[],newStreams:[]};let{groups:_,tasks:B,streams:X}=N,he=_?S(_,g):[];if(B)for(let on of B)Z(on);let lt=X?W(X,g):[];return{newGroups:he,newStreams:lt}}function S(N,g){let _=new Set(N),B=new Set,X=[];for(let he of N)G(he,_,X,B,g);return X}function G(N,g,_,B,X){if(B.has(N))return;B.add(N);let he=N.parent;if(he!==void 0&&g.has(he))G(he,g,_,B,X);let lt={childGroups:[],tasks:new Set,pending:0};if(r.set(N,lt),X===void 0&&!he)_.push(N);else if(he)r.get(he)?.childGroups.push(N)}function Z(N){for(let g of N.groups){let _=r.get(g);if(_){if(_.tasks.add(N),_.pending++,t.has(g))b(N)}}}function W(N,g){if(!g)return N;let _=i.get(g);if(_)_.childStreams.push(...N);return[]}function H(N,g=[]){for(let _ of N){let B=r.get(_);if(B)if(B.pending===0)r.delete(_),H(B.childGroups,g);else g.push(_)}return g}function Y(N,g){for(let _ of N)t.add(_),ne(_);for(let _ of g)n.add(_),A(_)}function ne(N){let g=r.get(N);if(g)for(let _ of g.tasks)b(_)}function b(N){if(i.has(N))return;i.set(N,{value:void 0,childStreams:[]});try{let g=N.computation.result();if(K(g))g.then((_)=>{o({kind:"TASK_SUCCESS",task:N,result:_})},(_)=>{o({kind:"TASK_FAILURE",task:N,error:_})});else o({kind:"TASK_SUCCESS",task:N,result:g})}catch(g){o({kind:"TASK_FAILURE",task:N,error:g})}}async function A(N){try{await N.queue.forEachBatch(async(g)=>{let _=o({kind:"STREAM_ITEMS",stream:N,items:g});if(K(_))await _}),o({kind:"STREAM_SUCCESS",stream:N})}catch(g){o({kind:"STREAM_FAILURE",stream:N,error:g})}}function h(N){let g=[];for(let _ of N)switch(_.kind){case"TASK_SUCCESS":g.push(...D(_));break;case"TASK_FAILURE":g.push(...R(_));break;case"STREAM_ITEMS":g.push(...q(_));break;case"STREAM_SUCCESS":if(n.has(_.stream))n.delete(_.stream),g.push(_);break;case"STREAM_FAILURE":n.delete(_.stream),g.push(_);break}if(t.size===0&&n.size===0)s(),g.push({kind:"WORK_QUEUE_TERMINATION"});return g.length>0?g:void 0}function D(N){let{task:g,result:_}=N,{value:B,work:X}=_,he=i.get(g);if(he)he.value=B;I(X,g);let lt=[],on=[],Er=[];for(let Bn of g.groups){let Qn=r.get(Bn);if(Qn){if(Qn.pending--,t.has(Bn)&&Qn.pending===0){let{groupValuesEvent:Xr,groupSuccessEvent:df,newGroups:mf,newStreams:hf}=ce(Bn,Qn);if(Xr)lt.push(Xr);lt.push(df),on.push(...mf),Er.push(...hf)}}}return Y(on,Er),lt}function R(N){let{task:g,error:_}=N;i.delete(g);let B=[];for(let X of g.groups){let he=r.get(X);if(he)B.push(Ue(X,he,_))}return B}function q(N){let{stream:g,items:_}=N,B=[],X=[],he=[];for(let{value:on,work:Er}of _){let{newGroups:Bn,newStreams:Qn}=I(Er),Xr=H(Bn);Y(Xr,Qn),B.push(on),X.push(...Xr),he.push(...Qn)}let lt={kind:"STREAM_VALUES",stream:g,values:B,newGroups:X,newStreams:he};if(g.queue.isStopped())return n.delete(g),[lt,{kind:"STREAM_SUCCESS",stream:g}];return[lt]}function ce(N,g){r.delete(N);let _=[],B=[];for(let he of g.tasks){let lt=i.get(he);if(lt){let{value:on,childStreams:Er}=lt;if(on!==void 0)_.push(on);for(let Bn of Er)B.push(Bn);O(he)}}let X=H(g.childGroups);return t.delete(N),{groupValuesEvent:_.length?{kind:"GROUP_VALUES",group:N,values:_}:void 0,groupSuccessEvent:{kind:"GROUP_SUCCESS",group:N,newGroups:X,newStreams:B},newGroups:X,newStreams:B}}function Ue(N,g,_){return v(N,g),t.delete(N),{kind:"GROUP_FAILURE",group:N,error:_}}function v(N,g){r.delete(N);for(let _ of g.tasks)if(_.groups.every((B)=>!r.has(B)))O(_);for(let _ of g.childGroups){let B=r.get(_);if(B)v(_,B)}}function O(N){for(let g of N.groups)r.get(g)?.tasks.delete(N);i.delete(N)}}class Xa{constructor(){this._ids=new Map,this._nextId=0}buildResponse(e,t,n,r,i){let{initialGroups:o,initialStreams:s,events:a}=Ms(n);function u(){f.throw(r?.reason).catch(()=>{})}if(r)r.addEventListener("abort",u);let c=()=>{i(),r?.removeEventListener("abort",u)},l=this._toPendingResults(o,s),p=t.length?{errors:t,data:e,pending:l,hasNext:!0}:{data:e,pending:l,hasNext:!0},f=Un(pr(a,(d)=>this._handleBatch(d,c)),()=>c());return{initialResult:p,subsequentResults:f}}_ensureId(e){let t=this._ids.get(e);if(t!==void 0)return t;return t=String(this._nextId++),this._ids.set(e,t),t}_toPendingResults(e,t){let n=[];for(let r of[e,t])for(let i of r){let s={id:this._ensureId(i),path:fe(i.path)};if(i.label!==void 0)s.label=i.label;n.push(s)}return n}_handleBatch(e,t){let n={pending:[],incremental:[],completed:[],hasNext:!0};for(let u of e)this._handleWorkQueueEvent(u,n,t);let{incremental:r,completed:i,pending:o,hasNext:s}=n,a={hasNext:s};if(o.length>0)a.pending=o;if(r.length>0)a.incremental=r;if(i.length>0)a.completed=i;return a}_handleWorkQueueEvent(e,t,n){switch(e.kind){case"GROUP_VALUES":{let r=e.group,i=this._ensureId(r);for(let o of e.values){let{bestId:s,subPath:a}=this._getBestIdAndSubPath(i,r,o),u={id:s,data:o.data};if(o.errors!==void 0)u.errors=o.errors;if(a!==void 0)u.subPath=a;t.incremental.push(u)}break}case"GROUP_SUCCESS":{let r=e.group,i=this._ensureId(r);if(t.completed.push({id:i}),this._ids.delete(r),e.newGroups.length>0||e.newStreams.length>0)t.pending.push(...this._toPendingResults(e.newGroups,e.newStreams));break}case"GROUP_FAILURE":{let{group:r,error:i}=e,o=this._ensureId(r);t.completed.push({id:o,errors:[De(i)]}),this._ids.delete(r);break}case"STREAM_VALUES":{let r=e.stream,i=this._ensureId(r),{values:o,newGroups:s,newStreams:a}=e,u=[],c=[];for(let l of o)if(u.push(l.item),l.errors!==void 0)c.push(...l.errors);if(t.incremental.push(c.length>0?{id:i,items:u,errors:c}:{id:i,items:u}),s.length>0||a.length>0)t.pending.push(...this._toPendingResults(s,a));break}case"STREAM_SUCCESS":{let r=e.stream;t.completed.push({id:this._ensureId(r)}),this._ids.delete(r);break}case"STREAM_FAILURE":{let r=e.stream;t.completed.push({id:this._ensureId(r),errors:[De(e.error)]}),this._ids.delete(r);break}case"WORK_QUEUE_TERMINATION":{n?.(),t.hasNext=!1;break}}}_getBestIdAndSubPath(e,t,n){let r=fe(t.path).length,i=e;for(let s of n.deliveryGroups){if(s===t)continue;let a=this._ids.get(s);if(a===void 0)continue;let c=fe(s.path).length;if(c>r)r=c,i=a}let o=n.path.slice(r);return{bestId:i,subPath:o.length>0?o:void 0}}}var Dl=Cs((e)=>Wa(e)),Jd=Cr((e,t)=>Wa(e,t));class Mr extends Yi{constructor(e,t,n){super(e,t);this.deferUsageSet=n,this.groups=[],this.tasks=[],this.streams=[]}getCreateSubExecutor(){let e=this.validatedExecutionArgs,t=this.sharedExecutionContext;return(n)=>new Mr(e,t,n)}abort(e){super.abort(e);for(let t of this.tasks){let n=t.computation.abort(e);if(K(n))U(!1)}for(let t of this.streams){let n=t.queue.abort(e);if(K(n))U(!1)}}buildResponse(e){let t=this.getIncrementalWork(),{tasks:n,streams:r}=t;if(n?.length===0&&r?.length===0)return super.buildResponse(e);let i=this.collectedErrors.errors;if(e===null)U(!1);return new Xa().buildResponse(e,i,t,this.validatedExecutionArgs.externalAbortSignal,this.getFinishSharedExecution())}executeCollectedRootFields(e,t,n,r,i){if(i.length===0)return this.executeRootGroupedFieldSet(e,t,n,r,void 0);if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let{newDeliveryGroups:o,newDeliveryGroupMap:s}=this.getNewDeliveryGroupMap(i,void 0,void 0),{groupedFieldSet:a,newGroupedFieldSets:u}=this.buildRootExecutionPlan(n),c=this.executeRootGroupedFieldSet(e,t,a,r,s);if(this.groups.push(...o),u.size>0)this.collectExecutionGroups(e,t,void 0,u,s);return c}buildRootExecutionPlan(e){return Dl(e)}executeCollectedSubfields(e,t,n,r,i,o){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.")}if(o===void 0&&i.length===0)return this.executeFields(e,t,n,r,o);let{newDeliveryGroups:s,newDeliveryGroupMap:a}=this.getNewDeliveryGroupMap(i,o,n),{groupedFieldSet:u,newGroupedFieldSets:c}=this.buildSubExecutionPlan(r),l=this.executeFields(e,t,n,u,a);if(this.groups.push(...s),c.size>0)this.collectExecutionGroups(e,t,n,c,a);return l}buildSubExecutionPlan(e){return this.deferUsageSet===void 0?Dl(e):Jd(e,this.deferUsageSet)}collectExecutionGroups(e,t,n,r,i){let o=this.getCreateSubExecutor();for(let[s,a]of r){let u=Hd(s,i),c=o(s),l={groups:u,path:n,computation:new Ha(()=>c.executeExecutionGroup(u,e,t,n,a,i),(f)=>c.abort(f))},p=this.deferUsageSet;if(this.validatedExecutionArgs.enableEarlyExecution)if(this.shouldDefer(p,s))Promise.resolve().then(()=>l.computation.prime());else l.computation.prime();this.tasks.push(l)}}executeExecutionGroup(e,t,n,r,i,o){let s;try{s=this.executeFields(t,n,r,i,o)}catch(a){throw this.abort(),a}if(K(s))return s.then((a)=>this.buildExecutionGroupResult(e,r,a),(a)=>{throw this.abort(),a});return this.buildExecutionGroupResult(e,r,s)}buildExecutionGroupResult(e,t,n){let r=n,i=this.collectedErrors.errors;return this.finish({value:i.length?{deliveryGroups:e,path:fe(t),errors:i,data:r}:{deliveryGroups:e,path:fe(t),data:r},work:this.getIncrementalWork()})}getIncrementalWork(){let{groups:e,tasks:t,streams:n,collectedErrors:r}=this;if(r.errors.length===0)return{groups:e,tasks:t,streams:n};let i=Error("Cancelled secondary to null within original result"),o=[];for(let a of t)if(r.hasNulledPosition(a.path)){let u=a.computation.abort(i);if(K(u))U(!1)}else o.push(a);let s=[];for(let a of n)if(r.hasNulledPosition(a.path)){let u=a.queue.abort(i);if(K(u))U(!1)}else s.push(a);return{groups:e,tasks:o,streams:s}}getNewDeliveryGroupMap(e,t,n){let r=[],i=new Map(t);for(let o of e){let s=o.parentDeferUsage,a=s===void 0?void 0:Ol(s,i),u={path:n,label:o.label,parent:a};r.push(u),i.set(o,u)}return{newDeliveryGroups:r,newDeliveryGroupMap:i}}shouldDefer(e,t){return e===void 0||!Array.from(t).every((n)=>e.has(n))}handleStream(e,t,n,r,i,o){let{handle:s,isAsync:a}=n,u=this.buildStreamItemQueue(e,t,s,r.fieldDetailsList,i,o,a),c={label:r.label,path:t,queue:u,initialCount:e};return this.streams.push(c),!0}buildStreamItemQueue(e,t,n,r,i,o,s){let a=this.getCreateSubExecutor(),{enableEarlyExecution:u}=this.validatedExecutionArgs,c=this.sharedExecutionContext;return new qi(async({push:p,stop:f,onStop:d,started:E})=>{let I=new Set,S=!1,G=!1;if(d((W)=>{if(G=!0,!S){for(let H of I)H(W);if(s)c.asyncWorkTracker.add(Qi(n));else c.asyncWorkTracker.addValues(Ls(n))}}),await(u?Promise.resolve():E),G)return;let Z=e;while(!0){let W;try{if(s){if(W=await n.next(),G)return}else W=n.next()}catch(A){throw en(A,Wd(r),fe(t))}if(W.done){S=!0;let A=f();if(K(A))A.catch(()=>{return});return}let H=Pe(t,Z,void 0),Y=a(),ne=Y.completeStreamItem(H,W.value,r,i,o);if(K(ne)){if(u){let A=(h)=>Y.abort(h);I.add(A),ne=ne.finally(()=>{I.delete(A)})}else if(ne=await ne,G)return}let b=p(ne);if(K(b)){if(await b,G)return}Z+=1}},100)}completeStreamItem(e,t,n,r,i){if(Be(t))return this.completePromisedValue(i,n,r,e,t,void 0).then((s)=>this.buildStreamItemResult(s),(s)=>(this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null))).then(void 0,(s)=>{throw this.abort(),s});let o;try{try{o=this.completeValue(i,n,r,e,t,void 0)}catch(s){return this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null)}}catch(s){throw this.abort(),s}if(K(o))return o.then((s)=>this.buildStreamItemResult(s),(s)=>(this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null))).then(void 0,(s)=>{throw this.abort(),s});return this.buildStreamItemResult(o)}buildStreamItemResult(e){let t=e,n=this.collectedErrors.errors,r=this.getIncrementalWork();return this.finish(n.length>0?{value:{item:t,errors:n},work:r}:{value:{item:t},work:r})}}function Wd(e){return e.map((t)=>t.node)}function Hd(e,t){return Array.from(e).map((n)=>Ol(n,t))}function Ol(e,t){return t.get(e)}var zd="The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.";function Ur(e){if(!st(Oi))return Al(e);return Cn(Oi,Za(e),()=>Al(e))}function Za(e){let t,n=()=>{if(t===void 0)t=Fr(e.document,e.operationName);return t};return{schema:e.schema,document:e.document,rawVariableValues:e.variableValues,get operationName(){return e.operationName??n()?.name?.value},get operationType(){return n()?.operation}}}function Al(e){if(e.schema.getDirective("defer")||e.schema.getDirective("stream"))throw Error(zd);let t=fr(e);if(!("schema"in t))return{errors:t};return tu(t)}function eu(e){if(!st(Oi))return xl(e);return Cn(Oi,Za(e),()=>xl(e))}function xl(e){let t=fr(e);if(!("schema"in t))return{errors:t};return nu(t)}function tu(e){return new Fs(e).executeRootSelectionSet()}function nu(e){return new Mr(e).executeRootSelectionSet()}function $s(e){let t=eu(e);if(K(t)||"initialResult"in t)throw Error("GraphQL execution failed to complete synchronously.");return t}function ru(e){return new Fs(e).executeRootSelectionSet(!1)}function Pr(e){if(!st(_a))return wl(e);return Cn(_a,Za(e),()=>wl(e))}function wl(e){let t=ou(e);if(!("schema"in t))return{errors:t};let n=iu(t);if(K(n))return n.then((r)=>kr(r)?Ps(t,r):r);return kr(n)?Ps(t,n):n}function iu(e){if(!("operation"in e))throw new m("Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.");try{let t=Zd(e);if(K(t))return t.then(void 0,(n)=>({errors:[De(n)]}));return t}catch(t){return{errors:[De(t)]}}}function fr(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u,subscribeFieldResolver:c,abortSignal:l,enableEarlyExecution:p,hooks:f,options:d}=e;Dr(t);let E,I=Object.create(null),S=Object.create(null),G=[];for(let h of n.definitions)switch(h.kind){case Tt:if(s==null){if(E!==void 0)return[new m("Must provide operation name if query contains multiple operations.")];E=h}else if(h.name?.value===s)E=h;break;case Qe:{I[h.name.value]=h;let D;if(h.variableDefinitions){let R=Object.create(null);for(let q of h.variableDefinitions){let ce=ms(t,q);if(ce instanceof m){G.push(ce);continue}R[ce.name]=ce}D=R}S[h.name.value]={definition:h,variableSignatures:D};break}default:}if(!E){if(s!=null)return[new m(`Unknown operation named "${s}".`)];return[new m("Must provide an operation.")]}if(G.length>0)return G;let Z=E.variableDefinitions??[],W=e.hideSuggestions??!1,H=o??{},Y={maxErrors:d?.maxCoercionErrors??50,hideSuggestions:W},ne=Pc,b=st(ne)?Cn(ne,{schema:t,document:n,operation:E,rawVariableValues:o,operationName:E.name?.value,operationType:E.operation},()=>Mi(t,Z,H,Y)):Mi(t,Z,H,Y);if(b.errors)return b.errors;let A=!E.directives?.find((h)=>h.name.value===Rc.name);return{schema:t,document:n,fragmentDefinitions:I,fragments:S,rootValue:r,contextValue:i,operation:E,variableValues:b.variableValues,fieldResolver:a??Us,typeResolver:u??su,subscribeFieldResolver:c??Us,hideSuggestions:W,errorPropagation:A,externalAbortSignal:l??void 0,enableEarlyExecution:p===!0,hooks:f??void 0,rawVariableValues:o}}function ou(e){let t=fr(e);if(!("schema"in t))return t;return Xd(t),t}function Xd(e){if(!Yo(e.operation))throw new m("Expected subscription operation.")}var su=function(e,t,n,r){if(ye(e)&&typeof e.__typename==="string")return e.__typename;let i=n.schema.getPossibleTypes(r),o=[];try{for(let s=0;s<i.length;s++){let a=i[s];if(a.isTypeOf){let u=a.isTypeOf(e,t,n);if(Be(u))o[s]=u;else if(u){if(o.length)n.getAsyncHelpers().track(o);return a.name}}}}catch(s){if(o.length)n.getAsyncHelpers().track(o);throw s}if(o.length)return n.getAsyncHelpers().promiseAll(o).then((s)=>{for(let a=0;a<s.length;a++)if(s[a])return i[a].name})},Us=function(e,t,n,r){if(ye(e)||typeof e==="function"){let i=e[r.fieldName];if(typeof i==="function")return e[r.fieldName](t,n,r);return i}};function Ps(e,t,n=ru){function r(o){let s={...e,rootValue:o};return n(s)}let i=e.externalAbortSignal;if(i){let o=pr(t,r);return{...o,next:()=>qa(o.next(),i)}}return pr(t,r)}function Zd(e){let{schema:t,fragments:n,rootValue:r,contextValue:i,operation:o,variableValues:s,hideSuggestions:a,externalAbortSignal:u}=e,c=t.getSubscriptionType();if(c==null)throw new m("Schema is not configured to execute subscription operation.",{nodes:o});let{groupedFieldSet:l}=wr(t,n,s,c,o.selectionSet,a),p=l.entries().next().value,[f,d]=p,E=d[0],I=E.node,S=I.name.value,G=t.getField(c,S),Z=d.map((ne)=>ne.node);if(!G)throw new m(`The subscription field "${S}" is not defined.`,{nodes:Z});let W=Rs(u),H=Pe(void 0,f,c.name),Y=ws(e,G,Z,c,H,W.getAbortSignal,W.getAsyncHelpers);try{let ne=_t(G,I,s,E.fragmentVariableValues,a),A=(G.subscribe??e.subscribeFieldResolver)(r,ne,i,Y);if(Be(A)){let h=Promise.resolve(A);return(u?qa(h,u):h).then(Rl).then(void 0,(R)=>{throw en(R,em(d),fe(H))})}return Rl(A)}catch(ne){throw en(ne,Z,fe(H))}}function Rl(e){if(e instanceof Error)throw e;if(!kr(e))throw new m(`Subscription field must return Async Iterable. Received: ${y(e)}.`);return e}function em(e){return e.map((t)=>t.node)}var au={parse:bt,validate:Lr,execute:Ur,subscribe:Pr};function tm(e){return new Promise((t)=>t(Fl(e)))}function nm(e){let t=Fl(e);if(K(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function Fl(e){let t=e.harness??au,{schema:n,source:r}=e,i=Di(n);if(i.length>0)return{errors:i};let o;try{o=t.parse(r,e)}catch(s){return{errors:[De(s)]}}if(K(o))return o.then((s)=>Ll(t,e,n,s),(s)=>({errors:[De(s)]}));return Ll(t,e,n,o)}function Ll(e,t,n,r){let i=e.validate(n,r,t.rules,t);if(K(i))return i.then((o)=>kl(e,t,o,r));return kl(e,t,i,r)}function kl(e,t,n,r){if(n.length>0)return{errors:n};return e.execute({...t,document:r})}class uu{constructor(){this._indices=new Map}buildResponse(e,t,n,r,i){let{initialStreams:o,events:s}=Ms(n);for(let p of o)this._indices.set(p,p.initialCount);function a(){l.throw(r?.reason).catch(()=>{})}if(r)r.addEventListener("abort",a);let u=()=>{i(),r?.removeEventListener("abort",a)},c=t.length?{errors:t,data:e,hasNext:!0}:{data:e,hasNext:!0},l=Un(pr(s,(p)=>this._handleBatch(p,u)),()=>u());return{initialResult:c,subsequentResults:l}}_handleBatch(e,t){let n={incremental:[],hasNext:!0};for(let s of e)this._handleWorkQueueEvent(s,n,t);let{incremental:r,hasNext:i}=n,o={hasNext:i};if(r.length>0)o.incremental=r;return o}_handleWorkQueueEvent(e,t,n){switch(e.kind){case"GROUP_VALUES":{let r=e.group;for(let i of e.values)t.incremental.push(Gs({data:i.data,path:fe(r.path)},r.label,i.errors));break}case"GROUP_SUCCESS":break;case"GROUP_FAILURE":{let r=e.group;t.incremental.push(Gs({data:null,path:fe(r.path)},r.label,[De(e.error)]));break}case"STREAM_VALUES":{let r=e.stream,{values:i}=e,o=[],s=[];for(let u of i)if(o.push(u.item),u.errors!==void 0)s.push(...u.errors);let a=this._indices.get(r);if(a===void 0)a=r.initialCount,this._indices.set(r,a);this._indices.set(r,a+o.length),t.incremental.push(Gs({items:o,path:fe(Pe(r.path,a,void 0))},r.label,s.length>0?s:void 0));break}case"STREAM_SUCCESS":{this._indices.delete(e.stream);break}case"STREAM_FAILURE":{this._indices.delete(e.stream);let r=e.stream;t.incremental.push(Gs({items:null,path:fe(r.path)},r.label,[De(e.error)]));break}case"WORK_QUEUE_TERMINATION":{n?.(),t.hasNext=!1;break}}}}function Gs(e,t,n){let r=e;if(n!==void 0)r.errors=n;if(t!==void 0)r.label=t;return r}var Cl=Cs((e)=>Vl(e)),rm=Cr((e,t)=>Vl(e,t));class js extends Mr{getCreateSubExecutor(){let e=this.validatedExecutionArgs,t=this.sharedExecutionContext;return(n)=>new js(e,t,n)}buildResponse(e){let t=this.getIncrementalWork(),{tasks:n,streams:r}=t;if(n?.length===0&&r?.length===0)return super.buildResponse(e);let i=this.collectedErrors.errors;if(e===null)U(!1);return new uu().buildResponse(e,i,t,this.validatedExecutionArgs.externalAbortSignal,this.getFinishSharedExecution())}buildRootExecutionPlan(e){return Cl(e)}buildSubExecutionPlan(e){return this.deferUsageSet===void 0?Cl(e):rm(e,this.deferUsageSet)}}function Vl(e,t=new Set){let n=new Fe,r=new Map;for(let[i,o]of e)for(let s of o){let a=s.deferUsage,u=a===void 0?new Set:new Set([a]);if(Vr(t,u))n.add(i,s);else{let c=Vs(r,u);if(c===void 0)c=new Fe,r.set(u,c);c.add(i,s)}}return{groupedFieldSet:n,newGroupedFieldSets:r}}function Ml(e){let t=fr(e);if(!("schema"in t))return{errors:t};return cu(t)}function cu(e){return new js(e).executeRootSelectionSet()}function Ul(e){return{Field(t){let n=e.getFieldDef(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The field ${n} is deprecated. ${r}`,{nodes:t}))},Argument(t){let n=e.getArgument(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The argument "${n}" is deprecated. ${r}`,{nodes:t}))},ObjectField(t){let n=pe(e.getParentInputType());if(k(n)){let r=n.getFields()[t.name.value],i=r?.deprecationReason;if(i!=null)e.reportError(new m(`The input field ${r} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The enum value "${n}" is deprecated. ${r}`,{nodes:t}))}}}function Pl(e){return{Field(t){let n=pe(e.getType());if(n&&ht(n))e.reportError(new m(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}function Bs(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,experimentalDirectiveDeprecation:!1,oneOf:!1,typeDepth:9,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function s(l){return t.inputValueDeprecation?l:""}function a(l){return t.experimentalDirectiveDeprecation?l:""}let u=t.oneOf?"isOneOf":"";function c(l,p){if(l<=0)return"";if(l>100)throw Error("Please set typeDepth to a reasonable value between 0 and 100; the default is 9.");return`
+${p}ofType {
+${p} name
+${p} kind${c(l-1,p+" ")}
+${p}}`}return`
+ query IntrospectionQuery {
+ __schema {
+ ${o}
+ queryType { name kind }
+ mutationType { name kind }
+ subscriptionType { name kind }
+ types {
+ ...FullType
+ }
+ directives${a("(includeDeprecated: true)")} {
+ name
+ ${n}
+ ${i}
+ ${a("isDeprecated")}
+ ${a("deprecationReason")}
+ locations
+ args${s("(includeDeprecated: true)")} {
+ ...InputValue
+ }
+ }
+ }
+ }
+
+ fragment FullType on __Type {
+ kind
+ name
+ ${n}
+ ${r}
+ ${u}
+ fields(includeDeprecated: true) {
+ name
+ ${n}
+ args${s("(includeDeprecated: true)")} {
+ ...InputValue
+ }
+ type {
+ ...TypeRef
+ }
+ isDeprecated
+ deprecationReason
+ }
+ inputFields${s("(includeDeprecated: true)")} {
+ ...InputValue
+ }
+ interfaces {
+ ...TypeRef
+ }
+ enumValues(includeDeprecated: true) {
+ name
+ ${n}
+ isDeprecated
+ deprecationReason
+ }
+ possibleTypes {
+ ...TypeRef
+ }
+ }
+
+ fragment InputValue on __InputValue {
+ name
+ ${n}
+ type { ...TypeRef }
+ defaultValue
+ ${s("isDeprecated")}
+ ${s("deprecationReason")}
+ }
+
+ fragment TypeRef on __Type {
+ kind
+ name${c(t.typeDepth," ")}
+ }
+ `}function $l(e,t){let n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,experimentalDirectiveDeprecation:!0,oneOf:!0,...t},r=bt(Bs(n)),i=$s({schema:e,document:r});if(!(i.errors==null&&i.data!=null))U(!1);return i.data}function Gl(e,t){if(!(ye(e)&&ye(e.__schema)))nt(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${y(e)}.`);let n=e.__schema,r=new Map(n.types.map((h)=>[h.name,f(h)]));for(let h of[...Ct,...Mt])if(r.has(h.name))r.set(h.name,h);let i=n.queryType!=null?l(n.queryType):null,o=n.mutationType!=null?l(n.mutationType):null,s=n.subscriptionType!=null?l(n.subscriptionType):null,a=n.directives!=null?n.directives.map(A):[];return new ot({description:n.description,query:i,mutation:o,subscription:s,types:[...r.values()],directives:a,assumeValid:t?.assumeValid});function u(h){if(h.kind===ue.LIST){let D=h.ofType;if(D==null)throw Error("Decorated type deeper than introspection query.");return new oe(u(D))}if(h.kind===ue.NON_NULL){let D=h.ofType;if(D==null)throw Error("Decorated type deeper than introspection query.");let R=u(D);return new V(So(R))}return c(h)}function c(h){let D=h.name;if(!D)throw Error(`Unknown type reference: ${y(h)}.`);let R=r.get(D);if(R==null)throw Error(`Invalid or incomplete schema, unknown type: ${D}. Ensure that a full introspection query is used in order to build a client schema.`);return R}function l(h){return bo(c(h))}function p(h){return _o(c(h))}function f(h){switch(h.kind){case ue.SCALAR:return d(h);case ue.OBJECT:return I(h);case ue.INTERFACE:return S(h);case ue.UNION:return G(h);case ue.ENUM:return Z(h);case ue.INPUT_OBJECT:return W(h);default:throw Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${y(h)}.`)}}function d(h){return new ke({name:h.name,description:h.description,specifiedByURL:h.specifiedByURL})}function E(h){if(h.interfaces===null&&h.kind===ue.INTERFACE)return[];if(h.interfaces==null){let D=y(h);throw Error(`Introspection result missing interfaces: ${D}.`)}return h.interfaces.map(p)}function I(h){return new Ee({name:h.name,description:h.description,interfaces:()=>E(h),fields:()=>H(h)})}function S(h){return new Me({name:h.name,description:h.description,interfaces:()=>E(h),fields:()=>H(h)})}function G(h){if(h.possibleTypes==null){let D=y(h);throw Error(`Introspection result missing possibleTypes: ${D}.`)}return new it({name:h.name,description:h.description,types:()=>h.possibleTypes.map(l)})}function Z(h){if(h.enumValues==null){let D=y(h);throw Error(`Introspection result missing enumValues: ${D}.`)}return new we({name:h.name,description:h.description,values:kt(h.enumValues,(D)=>D.name,(D)=>({description:D.description,deprecationReason:D.deprecationReason}))})}function W(h){if(h.inputFields==null){let D=y(h);throw Error(`Introspection result missing inputFields: ${D}.`)}return new Ge({name:h.name,description:h.description,fields:()=>ne(h.inputFields),isOneOf:h.isOneOf})}function H(h){if(h.fields==null)throw Error(`Introspection result missing fields: ${y(h)}.`);return kt(h.fields,(D)=>D.name,Y)}function Y(h){let D=u(h.type);if(!Nt(D)){let R=y(D);throw Error(`Introspection must provide output type for fields, but received: ${R}.`)}if(h.args==null){let R=y(h);throw Error(`Introspection result missing field args: ${R}.`)}return{description:h.description,deprecationReason:h.deprecationReason,type:D,args:ne(h.args)}}function ne(h){return kt(h,(D)=>D.name,b)}function b(h){let D=u(h.type);if(!xe(D)){let R=y(D);throw Error(`Introspection must provide input type for arguments, but received: ${R}.`)}return{description:h.description,type:D,default:h.defaultValue!=null?{literal:Uo(h.defaultValue)}:void 0,deprecationReason:h.deprecationReason}}function A(h){if(h.args==null){let D=y(h);throw Error(`Introspection result missing directive args: ${D}.`)}if(h.locations==null){let D=y(h);throw Error(`Introspection result missing directive locations: ${D}.`)}return new Re({name:h.name,description:h.description,isRepeatable:h.isRepeatable,deprecationReason:h.deprecationReason,locations:h.locations.slice(),args:ne(h.args)})}}var se={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function Qs(e,t){let n=t({getNamedType:u,setNamedType:c,getNamedTypes:l}),r=new Map;for(let b of e.types){let A=b.name,h=p(b);if(h)r.set(A,h)}let i=[];for(let b of e.directives){if(Vt(b)){i.push(b);continue}let A=ne(b.toConfig());if(A)i.push(new Re(A))}let o={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(r.values()),directives:i},s=n[se.SCHEMA];return s==null?o:s(o);function a(b){if(j(b))return new oe(a(b.ofType));if(w(b))return new V(a(b.ofType));return u(b.name)}function u(b){let A=im.get(b)??r.get(b);if(A===void 0)U(!1,`Unknown type: "${b}".`);return A}function c(b){r.set(b.name,b)}function l(){return Array.from(r.values())}function p(b){if(ht(b)||Ze(b))return b;if(ae(b))return f(b);if(L(b))return d(b);if(P(b))return S(b);if(te(b))return G(b);if(z(b))return Z(b);if(k(b))return H(b);U(!1,"Unexpected type: "+y(b))}function f(b){let A=b.toConfig(),h=n[se.SCALAR];return A=h==null?A:h(A),new ke(A)}function d(b){let A=b.toConfig(),h={...A,interfaces:()=>A.interfaces.map((R)=>u(R.name)),fields:()=>E(A.fields,b.name)},D=n[se.OBJECT];return h=D==null?h:D(h),new Ee(h)}function E(b,A){let h=Object.create(null);for(let[D,R]of Object.entries(b)){let q={...R,type:a(R.type),args:I(R.args,D,A)},ce=n[se.FIELD];if(ce)q=ce(q,A);h[D]=q}return h}function I(b,A,h){let D=Object.create(null);for(let[R,q]of Object.entries(b)){let ce={...q,type:a(q.type)},Ue=n[se.ARGUMENT];if(Ue)ce=Ue(ce,A,h);D[R]=ce}return D}function S(b){let A=b.toConfig(),h={...A,interfaces:()=>A.interfaces.map((R)=>u(R.name)),fields:()=>E(A.fields,b.name)},D=n[se.INTERFACE];return h=D==null?h:D(h),new Me(h)}function G(b){let A=b.toConfig(),h={...A,types:()=>A.types.map((R)=>u(R.name))},D=n[se.UNION];return h=D==null?h:D(h),new it(h)}function Z(b){let A=b.toConfig(),h={...A,values:()=>{let R=Object.create(null);for(let[q,ce]of Object.entries(A.values)){let Ue=W(ce,q,b.name);R[q]=Ue}return R}},D=n[se.ENUM];return h=D==null?h:D(h),new we(h)}function W(b,A,h){let D={...b},R=n[se.ENUM_VALUE];return R==null?D:R(D,A,h)}function H(b){let A=b.toConfig(),h={...A,fields:()=>{let R=Object.create(null);for(let[q,ce]of Object.entries(A.fields)){let Ue=Y(ce,q,b.name);R[q]=Ue}return R}},D=n[se.INPUT_OBJECT];return h=D==null?h:D(h),new Ge(h)}function Y(b,A,h){let D={...b,type:a(b.type)},R=n[se.INPUT_FIELD];return R==null?D:R(D,A,h)}function ne(b){let A={...b,args:I(b.args,b.name,void 0)},h=n[se.DIRECTIVE];return h==null?A:h(A)}}var im=new Map([...Ct,...Mt].map((e)=>[e.name,e]));function jl(e,t,n){if(Sr(e),n?.assumeValid!==!0&&n?.assumeValidSDL!==!0)Tl(t,e);let r=e.toConfig(),i=pu(r,t,n);return r===i?e:new ot(i)}function pu(e,t,n){let r=[],i=new Fe,o=new Fe,s=new Fe,a=new Fe,u=new Fe,c=new Fe,l=new Fe,p=[],f,d=[],E=!1;for(let I of t.definitions){switch(I.kind){case Ye:f=I;break;case Rt:d.push(I);break;case pt:p.push(I);break;case Tr:l.add(I.name.value,I);break;case Qt:case At:case xt:case wt:case Yt:case yt:r.push(I);break;case ln:i.add(I.name.value,I);break;case qt:o.add(I.name.value,I);break;case Kt:s.add(I.name.value,I);break;case Jt:a.add(I.name.value,I);break;case pn:u.add(I.name.value,I);break;case Lt:c.add(I.name.value,I);break;default:continue}E=!0}if(!E)return e;return Qs(e,(I)=>{let{getNamedType:S,setNamedType:G,getNamedTypes:Z}=I;return{[se.SCHEMA]:(v)=>{for(let N of r){let g=om.get(N.name.value)??Ue(N);G(g)}let O={query:v.query&&S(v.query.name),mutation:v.mutation&&S(v.mutation.name),subscription:v.subscription&&S(v.subscription.name),...f&&W([f]),...W(d)};return{description:f?.description?.value??v.description,...O,types:Z(),directives:[...v.directives.map(b),...p.map(ne)],extensions:v.extensions,astNode:f??v.astNode,extensionASTNodes:v.extensionASTNodes.concat(d),assumeValid:n?.assumeValid??!1}},[se.INPUT_OBJECT]:(v)=>{let O=c.get(v.name)??[];return{...v,fields:()=>({...v.fields(),...D(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.ENUM]:(v)=>{let O=u.get(v.name)??[];return{...v,values:()=>({...v.values(),...R(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.SCALAR]:(v)=>{let O=i.get(v.name)??[],N=v.specifiedByURL;for(let g of O)N=lu(g)??N;return{...v,specifiedByURL:N,extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.OBJECT]:(v)=>{let O=o.get(v.name)??[];return{...v,interfaces:()=>[...v.interfaces(),...q(O)],fields:()=>({...v.fields(),...A(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.INTERFACE]:(v)=>{let O=s.get(v.name)??[];return{...v,interfaces:()=>[...v.interfaces(),...q(O)],fields:()=>({...v.fields(),...A(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.UNION]:(v)=>{let O=a.get(v.name)??[];return{...v,types:()=>[...v.types(),...ce(O)],extensionASTNodes:v.extensionASTNodes.concat(O)}}};function W(v){let O={};for(let N of v){let g=N.operationTypes??[];for(let _ of g)O[_.operation]=H(_.type)}return O}function H(v){let O=v.name.value,N=S(O);if(N===void 0)U(!1,`Unknown type: "${O}".`);return N}function Y(v){if(v.kind===Dn)return new oe(Y(v.type));if(v.kind===cn)return new V(Y(v.type));return H(v)}function ne(v){let O=l.get(v.name.value)??[],N=dr(v)??O.map((g)=>dr(g)).find((g)=>g!=null);return new Re({name:v.name.value,description:v.description?.value,locations:v.locations.map(({value:g})=>g),isRepeatable:v.repeatable,args:h(v.arguments),deprecationReason:N,astNode:v,extensionASTNodes:O})}function b(v){let O=l.get(v.name)??[];if(O.length===0)return v;let N=v.deprecationReason??O.map((g)=>dr(g)).find((g)=>g!=null);return new Re({...v.toConfig(),deprecationReason:N,extensionASTNodes:v.extensionASTNodes.concat(O)})}function A(v){let O=Object.create(null);for(let N of v){let g=N.fields??[];for(let _ of g)O[_.name.value]={type:Y(_.type),description:_.description?.value,args:h(_.arguments),deprecationReason:dr(_),astNode:_}}return O}function h(v){let O=v??[],N=Object.create(null);for(let g of O){let _=Y(g.type);N[g.name.value]={type:_,description:g.description?.value,default:g.defaultValue&&{literal:g.defaultValue},deprecationReason:dr(g),astNode:g}}return N}function D(v){let O=Object.create(null);for(let N of v){let g=N.fields??[];for(let _ of g){let B=Y(_.type);O[_.name.value]={type:B,description:_.description?.value,default:_.defaultValue&&{literal:_.defaultValue},deprecationReason:dr(_),astNode:_}}}return O}function R(v){let O=Object.create(null);for(let N of v){let g=N.values??[];for(let _ of g)O[_.name.value]={description:_.description?.value,deprecationReason:dr(_),astNode:_}}return O}function q(v){return v.flatMap((O)=>O.interfaces?.map(H)??[])}function ce(v){return v.flatMap((O)=>O.types?.map(H)??[])}function Ue(v){let O=v.name.value;switch(v.kind){case At:{let N=o.get(O)??[],g=[v,...N];return new Ee({name:O,description:v.description?.value,interfaces:()=>q(g),fields:()=>A(g),astNode:v,extensionASTNodes:N})}case xt:{let N=s.get(O)??[],g=[v,...N];return new Me({name:O,description:v.description?.value,interfaces:()=>q(g),fields:()=>A(g),astNode:v,extensionASTNodes:N})}case Yt:{let N=u.get(O)??[],g=[v,...N];return new we({name:O,description:v.description?.value,values:()=>R(g),astNode:v,extensionASTNodes:N})}case wt:{let N=a.get(O)??[],g=[v,...N];return new it({name:O,description:v.description?.value,types:()=>ce(g),astNode:v,extensionASTNodes:N})}case Qt:{let N=i.get(O)??[],g=lu(v);for(let _ of N)g=lu(_)??g;return new ke({name:O,description:v.description?.value,specifiedByURL:g,astNode:v,extensionASTNodes:N})}case yt:{let N=c.get(O)??[],g=[v,...N];return new Ge({name:O,description:v.description?.value,fields:()=>D(g),astNode:v,extensionASTNodes:N,isOneOf:sm(v)})}}}})}var om=new Map([...Ct,...Mt].map((e)=>[e.name,e]));function dr(e){return Zt(mn,e)?.reason}function lu(e){return Zt(gi,e)?.url}function sm(e){return Boolean(Zt(Ni,e))}function Ki(e,t){if(t?.assumeValid!==!0&&t?.assumeValidSDL!==!0)El(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=pu(n,e,t);if(r.astNode==null)for(let o of r.types)switch(o.name){case"Query":r.query=o;break;case"Mutation":r.mutation=o;break;case"Subscription":r.subscription=o;break}let i=[...r.directives,...je.filter((o)=>r.directives.every((s)=>s.name!==o.name))];return new ot({...r,directives:i})}function Ys(e,t){let n=bt(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return Ki(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function Bl(e){return new ot(Qs(e.toConfig(),()=>({[se.OBJECT]:(t)=>({...t,interfaces:()=>Ji(t.interfaces()),fields:()=>$r(t.fields())}),[se.FIELD]:(t)=>({...t,args:$r(t.args)}),[se.INTERFACE]:(t)=>({...t,interfaces:()=>Ji(t.interfaces()),fields:()=>$r(t.fields())}),[se.UNION]:(t)=>({...t,types:()=>Ji(t.types())}),[se.ENUM]:(t)=>({...t,values:()=>$r(t.values())}),[se.INPUT_OBJECT]:(t)=>({...t,fields:()=>$r(t.fields())}),[se.DIRECTIVE]:(t)=>({...t,locations:Ql(t.locations,(n)=>n),args:$r(t.args)}),[se.SCHEMA]:(t)=>({...t,types:Ji(t.types),directives:Ji(t.directives)})})))}function $r(e){let t=Object.create(null);for(let n of Object.keys(e).sort(fn))t[n]=e[n];return t}function Ji(e){return Ql(e,(t)=>t.name)}function Ql(e,t){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);return fn(i,o)})}function Yl(e){return Kl(e,(t)=>!Vt(t),am)}function ql(e){return Kl(e,Vt,ht)}function am(e){return!Ze(e)&&!ht(e)}function Kl(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[um(e),...r.map((o)=>hu(o)),...i.map((o)=>du(o))].filter(Boolean).join(`
+
+`)}function um(e){let t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(!t&&!n&&!r)return;if(e.description!=null||!cm(e))return St(e)+`schema {
+`+(t?` query: ${t}
+`:"")+(n?` mutation: ${n}
+`:"")+(r?` subscription: ${r}
+`:"")+"}"}function cm(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}function du(e){if(ae(e))return lm(e);if(L(e))return pm(e);if(P(e))return fm(e);if(te(e))return dm(e);if(z(e))return mm(e);if(k(e))return hm(e);U(!1,"Unexpected type: "+y(e))}function lm(e){return St(e)+`scalar ${e}`+Em(e)}function Jl(e){let t=e.getInterfaces();return t.length?" implements "+t.map((n)=>n.name).join(" & "):""}function pm(e){return St(e)+`type ${e}`+Jl(e)+Wl(e)}function fm(e){return St(e)+`interface ${e}`+Jl(e)+Wl(e)}function dm(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return St(e)+`union ${e.name}`+n}function mm(e){let t=e.getValues().map((n,r)=>St(n," ",!r)+" "+n.name+qs(n.deprecationReason));return St(e)+`enum ${e}`+mu(t)}function hm(e){let t=Object.values(e.getFields()).map((n,r)=>St(n," ",!r)+" "+fu(n));return St(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+mu(t)}function Wl(e){let t=Object.values(e.getFields()).map((n,r)=>St(n," ",!r)+" "+n.name+Hl(n.args," ")+": "+String(n.type)+qs(n.deprecationReason));return mu(t)}function mu(e){return e.length!==0?` {
+`+e.join(`
+`)+`
+}`:""}function Hl(e,t=""){if(e.length===0)return"";if(e.every((n)=>n.description==null))return"("+e.map(fu).join(", ")+")";return`(
+`+e.map((n,r)=>St(n," "+t,!r)+" "+t+fu(n)).join(`
+`)+`
+`+t+")"}function fu(e){let t=e.name+": "+String(e.type),n=vr(e);if(n)t+=` = ${ee(n)}`;return t+qs(e.deprecationReason)}function hu(e){return St(e)+`directive ${e}`+Hl(e.args)+qs(e.deprecationReason)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function qs(e){if(e==null)return"";if(e!==yi)return` @deprecated(reason: ${ee({kind:Ie,value:e})})`;return" @deprecated"}function Em(e){if(e.specifiedByURL==null)return"";return` @specifiedBy(url: ${ee({kind:Ie,value:e.specifiedByURL})})`}function St(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=ee({kind:Ie,value:r,block:Qu(r)});return(t&&!n?`
+`+t:t)+i.replaceAll(`
+`,`
+`+t)+`
+`}function Pn(e,t,n){if(!e)return;if(e.kind===Ce){let r=e.name.value;if(n==null||!Object.hasOwn(n,r))return;let i=n[r];if(i===void 0)return;if(i===null&&w(t))return;return i}if(w(t)){if(e.kind===le)return;return Pn(e,t.ofType,n)}if(e.kind===le)return null;if(j(t)){let r=t.ofType;if(e.kind===Ae){let o=[];for(let s of e.values)if(zl(s,n)){if(w(r))return;o.push(null)}else{let a=Pn(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=Pn(e,r,n);if(i===void 0)return;return[i]}if(k(t)){if(e.kind!==Ve)return;let r=Object.create(null),i=t.getFields();if(e.fields.some((a)=>!Object.hasOwn(i,a.name.value)))return;let s=new Map(e.fields.map((a)=>[a.name.value,a]));for(let a of Object.values(i)){let u=s.get(a.name);if(u==null||zl(u.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(w(a.type))return;continue}let c=Pn(u.value,a.type,n);if(c===void 0)return;r[a.name]=c}if(t.isOneOf){let a=Object.keys(r);if(s.size!==1||a.length!==1)return;for(let[u,c]of s)if(c.value.kind===le||r[u]===null)return}return r}if(ve(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}if(r===void 0)return;return r}U(!1,"Unexpected input type: "+y(t))}function zl(e,t){return e.kind===Ce&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function Xl(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:jt,definitions:t}}function ep(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case Tt:t.push(i);break;case Qe:n[i.name.value]=Zl(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let o=new Set;for(let a of Zl(i.selectionSet))tp(o,n,a);let s=i.name?i.name.value:"";r[s]={kind:jt,definitions:e.definitions.filter((a)=>a===i||a.kind===Qe&&o.has(a.name.value))}}return r}function tp(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)tp(e,t,i)}}function Zl(e){let t=[];return ft(e,{FragmentSpread(n){t.push(n.name.value)}}),t}function np(e){let t=xi(e)?e:new Pt(e),n=t.body,r=new ar(t),i="",o=!1;while(r.advance().kind!==T.EOF){let s=r.token,a=s.kind,u=!Co(s.kind);if(o){if(u||s.kind===T.SPREAD)i+=" "}let c=n.slice(s.start,s.end);if(a===T.BLOCK_STRING)i+=No(s.value,{minimize:!0});else i+=c;o=u}return i}var Se={TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"},at={VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE",INPUT_FIELD_DEFAULT_VALUE_CHANGE:"INPUT_FIELD_DEFAULT_VALUE_CHANGE"},_e={DESCRIPTION_CHANGED:"DESCRIPTION_CHANGED",TYPE_ADDED:"TYPE_ADDED",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",DIRECTIVE_ADDED:"DIRECTIVE_ADDED",FIELD_ADDED:"FIELD_ADDED",DIRECTIVE_REPEATABLE_ADDED:"DIRECTIVE_REPEATABLE_ADDED",DIRECTIVE_LOCATION_ADDED:"DIRECTIVE_LOCATION_ADDED",OPTIONAL_DIRECTIVE_ARG_ADDED:"OPTIONAL_DIRECTIVE_ARG_ADDED",FIELD_CHANGED_KIND_SAFE:"FIELD_CHANGED_KIND_SAFE",ARG_CHANGED_KIND_SAFE:"ARG_CHANGED_KIND_SAFE",ARG_DEFAULT_VALUE_ADDED:"ARG_DEFAULT_VALUE_ADDED",INPUT_FIELD_DEFAULT_VALUE_ADDED:"INPUT_FIELD_DEFAULT_VALUE_ADDED"};function sp(e,t){return Ks(e,t).filter((n)=>(n.type in Se))}function ap(e,t){return Ks(e,t).filter((n)=>(n.type in at))}function Ks(e,t){return[...ym(e,t),...Tm(e,t)]}function Tm(e,t){let n=[],r=gn(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:Se.DIRECTIVE_REMOVED,description:`Directive ${i} was removed.`});for(let i of r.added)n.push({type:_e.DIRECTIVE_ADDED,description:`Directive @${i.name} was added.`});for(let[i,o]of r.persisted){let s=gn(i.args,o.args);for(let a of s.added)if(ze(a))n.push({type:Se.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required argument ${a} was added.`});else n.push({type:_e.OPTIONAL_DIRECTIVE_ARG_ADDED,description:`An optional argument @${i.name}(${a.name}:) was added.`});for(let a of s.removed)n.push({type:Se.DIRECTIVE_ARG_REMOVED,description:`Argument ${a} was removed.`});for(let[a,u]of s.persisted){let c=Gr(a.type,u.type),l=jr(a),p=jr(u);if(!c)n.push({type:Se.ARG_CHANGED_KIND,description:`Argument @${i.name}(${a.name}:) has changed type from ${String(a.type)} to ${String(u.type)}.`});else if(l!==void 0){if(p===void 0)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`@${i.name}(${a.name}:) defaultValue was removed.`});else if(l!==p)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`@${i.name}(${a.name}:) has changed defaultValue from ${l} to ${p}.`})}else if(p!==void 0&&l===void 0)n.push({type:_e.ARG_DEFAULT_VALUE_ADDED,description:`@${i.name}(${a.name}:) added a defaultValue ${p}.`});else if(a.type.toString()!==u.type.toString())n.push({type:_e.ARG_CHANGED_KIND_SAFE,description:`Argument @${i.name}(${a.name}:) has changed type from ${String(a.type)} to ${String(u.type)}.`});if(a.description!==u.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of @${i.name}(${i.name}) has changed to "${u.description}".`})}if(i.isRepeatable&&!o.isRepeatable)n.push({type:Se.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i}.`});else if(o.isRepeatable&&!i.isRepeatable)n.push({type:_e.DIRECTIVE_REPEATABLE_ADDED,description:`Repeatable flag was added to @${i.name}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of @${i.name} has changed to "${o.description}".`});for(let a of i.locations)if(!o.locations.includes(a))n.push({type:Se.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i}.`});for(let a of o.locations)if(!i.locations.includes(a))n.push({type:_e.DIRECTIVE_LOCATION_ADDED,description:`${a} was added to @${i.name}.`})}return n}function ym(e,t){let n=[],r=gn(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:Se.TYPE_REMOVED,description:Ze(i)?`Standard scalar ${i} was removed because it is not referenced anymore.`:`${i} was removed.`});for(let i of r.added)n.push({type:_e.TYPE_ADDED,description:`${i} was added.`});for(let[i,o]of r.persisted){if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of ${i.name} has changed to "${o.description}".`});if(z(i)&&z(o))n.push(...Im(i,o));else if(te(i)&&te(o))n.push(...Nm(i,o));else if(k(i)&&k(o))n.push(...gm(i,o));else if(L(i)&&L(o))n.push(...ip(i,o),...rp(i,o));else if(P(i)&&P(o))n.push(...ip(i,o),...rp(i,o));else if(i.constructor!==o.constructor)n.push({type:Se.TYPE_CHANGED_KIND,description:`${i} changed from ${op(i)} to ${op(o)}.`})}return n}function gm(e,t){let n=[],r=gn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)if(Xe(i))n.push({type:Se.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i} was added.`});else n.push({type:at.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i} was added.`});for(let i of r.removed)n.push({type:Se.FIELD_REMOVED,description:`Field ${i} was removed.`});for(let[i,o]of r.persisted){let s=Gr(i.type,o.type),a=jr(i),u=jr(o);if(!s)n.push({type:Se.FIELD_CHANGED_KIND,description:`Field ${o} changed type from ${i.type} to ${o.type}.`});else if(a!==void 0){if(u===void 0)n.push({type:at.INPUT_FIELD_DEFAULT_VALUE_CHANGE,description:`${i} defaultValue was removed.`});else if(a!==u)n.push({type:at.INPUT_FIELD_DEFAULT_VALUE_CHANGE,description:`${i} has changed defaultValue from ${a} to ${u}.`})}else if(u!==void 0&&a===void 0)n.push({type:_e.INPUT_FIELD_DEFAULT_VALUE_ADDED,description:`${i} added a defaultValue ${u}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.FIELD_CHANGED_KIND_SAFE,description:`Field ${e}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of input-field ${t}.${o.name} has changed to "${o.description}".`})}return n}function Nm(e,t){let n=[],r=gn(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:at.TYPE_ADDED_TO_UNION,description:`${i} was added to union type ${e}.`});for(let i of r.removed)n.push({type:Se.TYPE_REMOVED_FROM_UNION,description:`${i} was removed from union type ${e}.`});return n}function Im(e,t){let n=[],r=gn(e.getValues(),t.getValues());for(let i of r.added)n.push({type:at.VALUE_ADDED_TO_ENUM,description:`Enum value ${i} was added.`});for(let i of r.removed)n.push({type:Se.VALUE_REMOVED_FROM_ENUM,description:`Enum value ${i} was removed.`});for(let[i,o]of r.persisted)if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of enum value ${e}.${i.name} has changed to "${o.description}".`});return n}function rp(e,t){let n=[],r=gn(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:at.IMPLEMENTED_INTERFACE_ADDED,description:`${i} added to interfaces implemented by ${e}.`});for(let i of r.removed)n.push({type:Se.IMPLEMENTED_INTERFACE_REMOVED,description:`${e} no longer implements interface ${i}.`});return n}function ip(e,t){let n=[],r=gn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:Se.FIELD_REMOVED,description:`Field ${i} was removed.`});for(let i of r.added)n.push({type:_e.FIELD_ADDED,description:`Field ${e}.${i.name} was added.`});for(let[i,o]of r.persisted){if(n.push(...vm(i,o)),!Wi(i.type,o.type))n.push({type:Se.FIELD_CHANGED_KIND,description:`Field ${o} changed type from ${i.type} to ${o.type}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.FIELD_CHANGED_KIND_SAFE,description:`Field ${e}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of field ${e}.${i.name} has changed to "${o.description}".`})}return n}function vm(e,t){let n=[],r=gn(e.args,t.args);for(let i of r.removed)n.push({type:Se.ARG_REMOVED,description:`Argument ${i} was removed.`});for(let[i,o]of r.persisted){let s=Gr(i.type,o.type),a=jr(i),u=jr(o);if(!s)n.push({type:Se.ARG_CHANGED_KIND,description:`Argument ${o} has changed type from ${i.type} to ${o.type}.`});else if(a!==void 0){if(u===void 0)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`${i} defaultValue was removed.`});else if(a!==u)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`${i} has changed defaultValue from ${a} to ${u}.`})}else if(u!==void 0&&a===void 0)n.push({type:_e.ARG_DEFAULT_VALUE_ADDED,description:`${i} added a defaultValue ${u}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.ARG_CHANGED_KIND_SAFE,description:`Argument ${i} has changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of argument ${i} has changed to "${o.description}".`})}for(let i of r.added)if(ze(i))n.push({type:Se.REQUIRED_ARG_ADDED,description:`A required argument ${i} was added.`});else n.push({type:at.OPTIONAL_ARG_ADDED,description:`An optional argument ${i} was added.`});return n}function Wi(e,t){if(j(e))return j(t)&&Wi(e.ofType,t.ofType)||w(t)&&Wi(e,t.ofType);if(w(e))return w(t)&&Wi(e.ofType,t.ofType);return rt(t)&&e.name===t.name||w(t)&&Wi(e,t.ofType)}function Gr(e,t){if(j(e))return j(t)&&Gr(e.ofType,t.ofType);if(w(e))return w(t)&&Gr(e.ofType,t.ofType)||!w(t)&&Gr(e.ofType,t);return rt(t)&&e.name===t.name}function op(e){if(ae(e))return"a Scalar type";if(L(e))return"an Object type";if(P(e))return"an Interface type";if(te(e))return"a Union type";if(z(e))return"an Enum type";if(k(e))return"an Input type";U(!1,"Unexpected type: "+y(e))}function jr(e){let t=vr(e);if(t)return ee(cr(t))}function gn(e,t){let n=[],r=[],i=[],o=sn(e,({name:a})=>a),s=sn(t,({name:a})=>a);for(let a of e){let u=s[a.name];if(u===void 0)r.push(a);else i.push([a,u])}for(let a of t)if(o[a.name]===void 0)n.push(a);return{added:n,persisted:i,removed:r}}function up(e,t){return Eu(e,Po(t))}function bm(e,t){let n=t.name.value,r=e.getType(n);if(r==null)return;return{kind:"NamedType",type:r}}function _m(e,t){let n=t.name.value,r=e.getType(n);if(!r)throw Error(`Expected ${y(n)} to be defined as a type in the schema.`);if(!z(r)&&!k(r)&&!L(r)&&!P(r))throw Error(`Expected ${y(n)} to be an Enum, Input Object, Object or Interface type.`);if(z(r)){let s=t.memberName.value,a=r.getValue(s);if(a==null)return;return{kind:"EnumValue",type:r,enumValue:a}}if(k(r)){let s=t.memberName.value,a=r.getFields()[s];if(a==null)return;return{kind:"InputField",type:r,inputField:a}}let i=t.memberName.value,o=e.getField(r,i);if(o==null)return;return{kind:"Field",type:r,field:o}}function Sm(e,t){let n=t.name.value,r=e.getType(n);if(r==null)throw Error(`Expected ${y(n)} to be defined as a type in the schema.`);if(!L(r)&&!P(r))throw Error(`Expected ${y(n)} to be an object type or interface type.`);let i=t.fieldName.value,o=e.getField(r,i);if(o==null)throw Error(`Expected ${y(i)} to exist as a field of type ${y(n)} in the schema.`);let s=t.argumentName.value,a=o.args.find((u)=>u.name===s);if(a==null)return;return{kind:"FieldArgument",type:r,field:o,fieldArgument:a}}function Dm(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)return;return{kind:"Directive",directive:r}}function Om(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)throw Error(`Expected ${y(n)} to be defined as a directive in the schema.`);let{argumentName:{value:i}}=t,o=r.args.find((s)=>s.name===i);if(!o)return;return{kind:"DirectiveArgument",directive:r,directiveArgument:o}}function Eu(e,t){switch(t.kind){case po:return bm(e,t);case fo:return _m(e,t);case mo:return Sm(e,t);case ho:return Dm(e,t);case Eo:return Om(e,t)}}var Js=(e)=>Array.isArray(e)?e:e?[e]:[];function Am(e,t){if(String(e)<String(t))return-1;if(String(e)>String(t))return 1;return 0}function cp(e){let t;if("alias"in e)t=e.alias?.value;if(t==null&&"name"in e)t=e.name?.value;if(t==null)t=e.kind;return t}function $n(e,t,n){let r=cp(e),i=cp(t);if(typeof n==="function")return n(r,i);return Am(r,i)}function Br(e){return e!=null}function Qr(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let o=e(r);return t.set(r,o),o}return i}}function lp(e,t,n=["directives"]){let r={};if(e.extensions){let s=e.extensions;for(let a of n)s=s?.[a];if(s!=null)for(let a in s){let u=s[a],c=a;if(Array.isArray(u))for(let l of u){let p=r[c];if(!p)p=[],r[c]=p;p.push(l)}else{let l=r[c];if(!l)l=[],r[c]=l;l.push(u)}}}let i=Qr((s)=>JSON.stringify(s)),o=[];if(e.astNode)o.push(e.astNode);if(e.extensionASTNodes)o.push(...e.extensionASTNodes);for(let s of o)if(s.directives?.length)for(let a of s.directives){let u=a.name.value,c=r[u];if(!c)c=[],r[u]=c;let l=t?.getDirective(u),p={};if(l)p=_t(l,a);if(a.arguments)for(let f of a.arguments){let d=f.name.value;if(p[d]==null){let E=l?.args.find((I)=>I.name===d);if(E)p[d]=Pn(f.value,E.type)}if(p[d]==null)p[d]=Wt(f.value)}if(o.length>0&&c.length>0){let f=i(p);if(c.some((d)=>i(d)===f))continue}c.push(p)}return r}function Tu(e,t=["directives"]){let n=lp(e,void 0,t);return Object.entries(n).map(([r,i])=>i?.map((o)=>({name:r,args:o}))).flat(1/0).filter(Boolean)}function xm(){let e=globalThis.process?.getBuiltinModule;if(typeof e!=="function")return;try{let t=e("util");if(typeof t?.inspect!=="function")return;return(n)=>t.inspect(n,{depth:3,colors:!1,compact:!0,breakLength:1/0}).replaceAll("[Object: null prototype] ","")}catch{return}}var pp=xm();function yu(e,t=3){if(t>0&&e!=null&&typeof e.toJSON==="function")try{let n=e.toJSON();if(n!==e)return typeof n==="string"?n:yu(n,t-1)}catch{}if(pp)return pp(e);if(typeof e==="string")return JSON.stringify(e);if(typeof e==="function")return e.name?`[function ${e.name}]`:"[function]";if(e===void 0)return"undefined";try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function tn(e){if(w(e)){let t=tn(e.ofType);if(t.kind===cn)throw Error(`Invalid type node ${yu(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:cn,type:t}}else if(j(e))return{kind:Dn,type:tn(e.ofType)};return{kind:Sn,name:{kind:Ne,value:e.name}}}function Nn(e){if(e===null)return{kind:le};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=Nn(n);if(r!=null)t.push(r)}return{kind:Ae,values:t}}if(typeof e==="object"){if(e?.toJSON)return Nn(e.toJSON());let t=[];for(let n in e){let r=e[n],i=Nn(r);if(i)t.push({kind:un,name:{kind:Ne,value:n},value:i})}return{kind:Ve,fields:t}}if(typeof e==="boolean")return{kind:tt,value:e};if(typeof e==="bigint")return{kind:Oe,value:String(e)};if(typeof e==="number"&&isFinite(e)){let t=String(e);return wm.test(t)?{kind:Oe,value:t}:{kind:Bt,value:t}}if(typeof e==="string")return{kind:Ie,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}var wm=/^-?(?:0|[1-9][0-9]*)$/;function fp(e){return e!=null&&typeof e==="object"&&typeof e[Symbol.iterator]==="function"}function dp(e){return typeof e==="object"&&e!==null}function Hi(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function In(e,t){if(w(t)){let n=In(e,t.ofType);if(n?.kind===le)return null;return n}if(e===null)return{kind:le};if(e===void 0)return null;if(j(t)){let n=t.ofType;if(fp(e)){let r=[];for(let i of e){let o=In(i,n);if(o!=null)r.push(o)}return{kind:Ae,values:r}}return In(e,n)}if(k(t)){if(!dp(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=In(e[r.name],r.type);if(i)n.push({kind:un,name:{kind:Ne,value:r.name},value:i})}return{kind:Ve,fields:n}}if(ve(t)){if(z(t)){let n=t.getValues();for(let r of n){if(r.value===e){e=r.name;break}if(r.name===e){e=r.name;break}}return{kind:Ot,value:e}}else e=t.serialize(e);if(e==null)return null;if(t.name==="ID"&&typeof e==="string"&&Rm.test(e))return{kind:Oe,value:e}}return Nn(e)}var Rm=/^-?(?:0|[1-9][0-9]*)$/;var gu=(e)=>{if("default"in e){if(!e.default)return;if("value"in e.default)return Nn(e.default.value)??void 0;let t=Wt(e.default.literal);return In(t,e.type)??void 0}return e.defaultValue!==void 0?In(e.defaultValue,e.type)??void 0:void 0};function mp(e){return e.trim().length>0}function Et(e){if(typeof e.description==="string"){if(!mp(e.description))return;return{kind:Ie,value:e.description,block:!0}}if(e.astNode?.description&&mp(e.astNode.description.value))return{...e.astNode.description,block:!0}}var NR=Qr(function(t){let n=Lm(t);return new Set([...n].map((r)=>r.name))}),Lm=Qr(function(t){let n=Nu(t);return new Set(n.values())}),Nu=Qr(function(t){let n=new Map,r=t.getQueryType();if(r)n.set("query",r);let i=t.getMutationType();if(i)n.set("mutation",i);let o=t.getSubscriptionType();if(o)n.set("subscription",o);return n});function hp(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=km(e,n),o=i!=null?[i]:[],s=e.getDirectives();for(let a of s){if(Vt(a))continue;o.push(Fm(a,e,n))}for(let a in r){let u=r[a],c=Ze(u),l=ht(u);if(c||l)continue;if(L(u))o.push(Cm(u,e,n));else if(P(u))o.push(Vm(u,e,n));else if(te(u))o.push(Mm(u,e,n));else if(k(u))o.push(Um(u,e,n));else if(z(u))o.push(Pm(u,e,n));else if(ae(u))o.push($m(u,e,n));else throw Error(`Unknown type ${u}.`)}return{kind:jt,definitions:o}}function km(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null)r.push(e.astNode);if(e.extensionASTNodes!=null)for(let c of e.extensionASTNodes)r.push(c);for(let c of r)if(c.operationTypes)for(let l of c.operationTypes)n.set(l.operation,l);let i=Nu(e);for(let[c,l]of n){let p=i.get(c);if(p!=null){let f=tn(p);if(l!=null)l.type=f;else n.set(c,{kind:si,operation:c,type:f})}else n.set(c,void 0)}let o=[...n.values()].filter(Br),s=nn(e,e,t);if(!o.length&&!s.length)return null;let a={kind:o.length?Ye:Rt,operationTypes:o,directives:s},u=Et(e);if(u)a.description=u;return a}function Fm(e,t,n){return{kind:pt,description:Et(e),name:{kind:Ne,value:e.name},arguments:e.args?.map((r)=>Ep(r,t,n)),repeatable:e.isRepeatable,locations:e.locations?.map((r)=>({kind:Ne,value:r}))||[]}}function nn(e,t,n){let r=[],i=Tu(e,n),o;if(i!=null)o=yp(t,i);let s=null,a=null,u=null;if(o!=null)r=o.filter((c)=>je.every((l)=>l.name!==c.name.value)),s=o.find((c)=>c.name.value==="deprecated"),a=o.find((c)=>c.name.value==="specifiedBy"),u=o.find((c)=>c.name.value==="oneOf");if(e.deprecationReason!=null&&s==null)s=Bm(e.deprecationReason);if(e.specifiedByUrl!=null||e.specifiedByURL!=null&&a==null){let l={url:e.specifiedByUrl||e.specifiedByURL};a=zi("specifiedBy",l)}if(e.isOneOf&&u==null)u=zi("oneOf");if(s!=null)r.push(s);if(a!=null)r.push(a);if(u!=null)r.push(u);return r}function Ep(e,t,n){return{kind:ai,description:Et(e),name:{kind:Ne,value:e.name},type:tn(e.type),defaultValue:gu(e),directives:nn(e,t,n)}}function Cm(e,t,n){return{kind:At,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((r)=>Tp(r,t,n)),interfaces:Object.values(e.getInterfaces()).map((r)=>tn(r)),directives:nn(e,t,n)}}function Vm(e,t,n){let r={kind:xt,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((i)=>Tp(i,t,n)),directives:nn(e,t,n)};if("getInterfaces"in e)r.interfaces=Object.values(e.getInterfaces()).map((i)=>tn(i));return r}function Mm(e,t,n){return{kind:wt,description:Et(e),name:{kind:Ne,value:e.name},directives:nn(e,t,n),types:e.getTypes().map((r)=>tn(r))}}function Um(e,t,n){return{kind:yt,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((r)=>Gm(r,t,n)),directives:nn(e,t,n)}}function Pm(e,t,n){return{kind:Yt,description:Et(e),name:{kind:Ne,value:e.name},values:Object.values(e.getValues()).map((r)=>jm(r,t,n)),directives:nn(e,t,n)}}function $m(e,t,n){let r=Tu(e,n),i=yp(t,r),o=e.specifiedByUrl||e.specifiedByURL;if(o&&!i.some((s)=>s.name.value==="specifiedBy")){let s={url:o};i.push(zi("specifiedBy",s))}return{kind:Qt,description:Et(e),name:{kind:Ne,value:e.name},directives:i}}function Tp(e,t,n){return{kind:co,description:Et(e),name:{kind:Ne,value:e.name},arguments:e.args.map((r)=>Ep(r,t,n)),type:tn(e.type),directives:nn(e,t,n)}}function Gm(e,t,n){return{kind:ai,description:Et(e),name:{kind:Ne,value:e.name},type:tn(e.type),directives:nn(e,t,n),defaultValue:gu(e)}}function jm(e,t,n){return{kind:lo,description:Et(e),name:{kind:Ne,value:e.name},directives:nn(e,t,n)}}function Bm(e){return zi("deprecated",{reason:e},mn)}function zi(e,t,n){let r=[];for(let i in t){let o=t[i],s;if(n!=null){let a=n.args.find((u)=>u.name===i);if(a)s=In(o,a.type)}if(s==null)s=Nn(o);if(s!=null)r.push({kind:ii,name:{kind:Ne,value:i},value:s})}return{kind:oi,name:{kind:Ne,value:e},arguments:r}}function yp(e,t){let n=[];for(let{name:r,args:i}of t){let o=e?.getDirective(r);n.push(zi(r,i,o))}return n}var Qm=80,Yr={};function Hs(){Yr={}}function vp(e){let t=e.name?.value;if(t==null)return;switch(Ws(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let n of e.values)Ws(n,t,n.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let n of e.fields)if(Ws(n,t,n.name.value),Wm(n)&&n.arguments)for(let r of n.arguments)Ws(r,t,n.name.value,r.name.value)}break}}function Ws(e,t,n,r){let i=Hm(e);if(typeof i!=="string"||i.length===0)return;let o=[t];if(n){if(o.push(n),r)o.push(r)}let s=o.join(".");if(!Yr[s])Yr[s]=[];Yr[s].push(i)}function Ym(e){return`
+# `+e.replace(/\n/g,`
+# `)}function M(e,t){return e?e.filter((n)=>n).join(t||""):""}function gp(e){return e?.some((t)=>t.includes(`
+`))??!1}function qm(e){return(t,n,r,i,o)=>{let s=[],a=i.reduce((l,p)=>{if(["fields","arguments","values"].includes(p)&&l.name)s.push(l.name.value);return l[p]},o[0]),u=[...s,a?.name?.value].filter(Boolean).join("."),c=[];if(t.kind.includes("Definition")&&Yr[u])c.push(...Yr[u]);return M([...c.map(Ym),t.description,e(t,n,r,i,o)],`
+`)}}function Xi(e){return e&&` ${e.replace(/\n/g,`
+ `)}`}function $t(e){return e&&e.length!==0?`{
+${Xi(M(e,`
+`))}
+}`:""}function be(e,t,n){return t?e+t+(n||""):""}function Km(e,t=!1){let n=e.replace(/\\/g,"\\\\").replace(/"""/g,'\\"""');return(e[0]===" "||e[0]==="\t")&&e.indexOf(`
+`)===-1?`"""${n.replace(/"$/,`"
+`)}"""`:`"""
+${t?n:Xi(n)}
+"""`}var Np={Name:{leave:(e)=>e.value},Variable:{leave:(e)=>"$"+e.name},Document:{leave:(e)=>M(e.definitions,`
+
+`)},OperationDefinition:{leave:(e)=>{let t=be("(",M(e.variableDefinitions,", "),")");return M([e.operation,M([e.name,t]),M(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+be(" = ",n)+be(" ",M(r," "))},SelectionSet:{leave:({selections:e})=>$t(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=be("",e,": ")+t,s=o+be("(",M(n,", "),")");if(s.length>Qm)s=o+be(`(
+`,Xi(M(n,`
+`)),`
+)`);return M([s,M(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+be(" ",M(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>M(["...",be("on ",e),M(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${be("(",M(n,", "),")")} on ${t} ${be("",M(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>{if(t)return Km(e);return JSON.stringify(e)}},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+M(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+M(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+be("(",M(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>M(["schema",M(e," "),$t(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>M(["scalar",e,M(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["type",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(gp(t)?be(`(
+`,Xi(M(t,`
+`)),`
+)`):be("(",M(t,", "),")"))+": "+n+be(" ",M(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>M([e+": "+t,be("= ",n),M(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["interface",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>M(["union",e,M(t," "),be("= ",M(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>M(["enum",e,M(t," "),$t(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>M([e,M(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>M(["input",e,M(t," "),$t(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(gp(t)?be(`(
+`,Xi(M(t,`
+`)),`
+)`):be("(",M(t,", "),")"))+(n?" repeatable":"")+" on "+M(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>M(["extend schema",M(e," "),$t(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>M(["extend scalar",e,M(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["extend type",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["extend interface",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>M(["extend union",e,M(t," "),be("= ",M(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>M(["extend enum",e,M(t," "),$t(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>M(["extend input",e,M(t," "),$t(n)]," ")}},Jm=Object.keys(Np).reduce((e,t)=>({...e,[t]:{leave:qm(Np[t].leave)}}),{});function bp(e){return ft(e,Jm)}function Wm(e){return e.kind==="FieldDefinition"}function Hm(e){let t=zm(e);if(t!==void 0)return Xm(`
+${t}`)}function zm(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;while(r!=null&&r.kind===T.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line){let i=String(r.value);n.push(i),r=r.prev}return n.length>0?n.reverse().join(`
+`):void 0}function Xm(e){let t=e.split(/\r\n|[\n\r]/g),n=Zm(t);if(n!==0)for(let r=1;r<t.length;r++)t[r]=t[r].slice(n);while(t.length>0&&Ip(t[0]))t.shift();while(t.length>0&&Ip(t[t.length-1]))t.pop();return t.join(`
+`)}function Zm(e){let t=null;for(let n=1;n<e.length;n++){let r=e[n],i=_p(r);if(i===r.length)continue;if(t===null||i<t){if(t=i,t===0)break}}return t===null?0:t}function _p(e){let t=0;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;return t}function Ip(e){return _p(e)===e.length}var Q;(function(e){e.TYPE="MapperKind.TYPE",e.SCALAR_TYPE="MapperKind.SCALAR_TYPE",e.ENUM_TYPE="MapperKind.ENUM_TYPE",e.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",e.OBJECT_TYPE="MapperKind.OBJECT_TYPE",e.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",e.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",e.UNION_TYPE="MapperKind.UNION_TYPE",e.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",e.ROOT_OBJECT="MapperKind.ROOT_OBJECT",e.QUERY="MapperKind.QUERY",e.MUTATION="MapperKind.MUTATION",e.SUBSCRIPTION="MapperKind.SUBSCRIPTION",e.DIRECTIVE="MapperKind.DIRECTIVE",e.FIELD="MapperKind.FIELD",e.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",e.OBJECT_FIELD="MapperKind.OBJECT_FIELD",e.ROOT_FIELD="MapperKind.ROOT_FIELD",e.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",e.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",e.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",e.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",e.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",e.ARGUMENT="MapperKind.ARGUMENT",e.ENUM_VALUE="MapperKind.ENUM_VALUE"})(Q||(Q={}));function mr(e,t){if(t){let n=e[t.name];if(L(n))return n}}function Sp(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}function Dp(e){switch(e.name){case wn.name:return wn;case Ir.name:return Ir;case ie.name:return ie;case ge.name:return ge;case Rn.name:return Rn;default:return e}}function Op(e,t){let n=Object.create(null);for(let f in e)n[f]=e[f];let r=Object.create(null);for(let f in n){let d=n[f];if(d==null||f.startsWith("__"))continue;let E=d.name;if(E.startsWith("__"))continue;if(r[E]!=null){console.warn(`Duplicate schema type name ${E} found; keeping the existing one found in the schema`);continue}r[E]=d}for(let f in r)r[f]=a(r[f]);let i=t.map((f)=>o(f));return{typeMap:r,directives:i};function o(f){if(Vt(f))return f;let d=f.toConfig();return d.args=s(d.args),new Re(d)}function s(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null)I.type=S,d[E]=I}return d}function a(f){if(L(f)){let d=f.toConfig(),E={...d,fields:()=>u(d.fields),interfaces:()=>l(d.interfaces)};return new Ee(E)}else if(P(f)){let d=f.toConfig(),E={...d,fields:()=>u(d.fields)};if("interfaces"in E)E.interfaces=()=>l(d.interfaces);return new Me(E)}else if(te(f)){let d=f.toConfig(),E={...d,types:()=>l(d.types)};return new it(E)}else if(k(f)){let d=f.toConfig(),E={...d,fields:()=>c(d.fields)};return new Ge(E)}else if(z(f)){let d=f.toConfig();return new we(d)}else if(ae(f)){if(Ze(f))return f;let d=f.toConfig();return new ke(d)}throw Error(`Unexpected schema type: ${f}`)}function u(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null&&I.args)I.type=S,I.args=s(I.args),d[E]=I}return d}function c(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null)I.type=S,d[E]=I}return d}function l(f){let d=[];for(let E of f){let I=p(E);if(I!=null)d.push(I)}return d}function p(f){if(j(f)){let d=p(f.ofType);return d!=null?new oe(d):null}else if(w(f)){let d=p(f.ofType);return d!=null?new V(d):null}else if(rt(f)){let d=n[f.name];if(d===void 0)d=Sp(f)?Dp(f):a(f),r[d.name]=n[f.name]=d;return d!=null?r[d.name]:null}return null}}function zs(e,t,n=null,r=null){if(t==null)return t;let i=gr(e);if(ve(i))return n!=null?n(i,t):t;else if(j(i))return Js(t).map((o)=>zs(i.ofType,o,n,r));else if(k(i)){let o=i.getFields(),s={};for(let a in t){let u=o[a];if(u!=null)s[a]=zs(u.type,t[a],n,r)}return r!=null?r(i,s):s}}function Xs(e,t){return zs(e,t,(n,r)=>{try{return n.serialize(r)}catch{return r}})}function Zs(e,t){return zs(e,t,(n,r)=>{try{return n.parseValue(r)}catch{return r}})}function Zi(e,t={}){let n=wp(xp(Iu(Ap(th(Iu(Ap(e.getTypeMap(),e,Xs),e,t,(a)=>ve(a)),e,t),e,Zs),e,t,(a)=>!ve(a)),e,t),e,t),r=e.getDirectives(),i=nh(r,e,t),{typeMap:o,directives:s}=Op(n,i);return new ot({...e.toConfig(),query:mr(o,mr(n,e.getQueryType())),mutation:mr(o,mr(n,e.getMutationType())),subscription:mr(o,mr(n,e.getSubscriptionType())),types:Object.values(o),directives:s})}var eh=["String","ID","Int","Float","Boolean"];function Iu(e,t,n,r=()=>!0){let i={};for(let o in e)if(!o.startsWith("__")&&!eh.includes(o)){let s=e[o];if(s==null||!r(s)){i[o]=s;continue}let a=ih(t,n,o);if(a==null){i[o]=s;continue}let u=a(s,t);if(u===void 0){i[o]=s;continue}i[o]=u}return i}function th(e,t,n){let r=ch(n);if(!r)return e;return Iu(e,t,{[Q.ENUM_TYPE]:(i)=>{let o=i.toConfig(),s=o.values,a={};for(let u in s){let c=s[u],l=r(c,i.name,t,u);if(l===void 0)a[u]=c;else if(Array.isArray(l)){let[p,f]=l;a[p]=f===void 0?c:f}else if(l!==null)a[u]=l}return ea(new we({...o,values:a}))}},(i)=>z(i))}function Ap(e,t,n){let r=wp(e,t,{[Q.ARGUMENT]:(i)=>{if(i.defaultValue===void 0)return i;let o=ta(e,i.type);if(o!=null)return{...i,defaultValue:n(o,i.defaultValue)}}});return xp(r,t,{[Q.INPUT_OBJECT_FIELD]:(i)=>{if(i.defaultValue===void 0)return i;let o=ta(r,i.type);if(o!=null)return{...i,defaultValue:n(o,i.defaultValue)}}})}function ta(e,t){if(j(t)){let n=ta(e,t.ofType);return n!=null?new oe(n):null}else if(w(t)){let n=ta(e,t.ofType);return n!=null?new V(n):null}else if(rt(t)){let n=e[t.name];return n!=null?n:null}return null}function xp(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!L(o)&&!P(o)&&!k(o)){r[i]=o;continue}let s=sh(t,n,i);if(s==null){r[i]=o;continue}let a=o.toConfig(),u=a.fields,c={};for(let l in u){let p=u[l],f=s(p,l,i,t);if(f===void 0)c[l]=p;else if(Array.isArray(f)){let[d,E]=f;if(E.astNode!=null)E.astNode={...E.astNode,name:{...E.astNode.name,value:d}};c[d]=E===void 0?p:E}else if(f!==null)c[l]=f}if(L(o))r[i]=ea(new Ee({...a,fields:c}));else if(P(o))r[i]=ea(new Me({...a,fields:c}));else r[i]=ea(new Ge({...a,fields:c}))}return r}function wp(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!L(o)&&!P(o)){r[i]=o;continue}let s=ah(n);if(s==null){r[i]=o;continue}let a=o.toConfig(),u=a.fields,c={};for(let l in u){let p=u[l],f=p.args;if(f==null){c[l]=p;continue}let d=Object.keys(f);if(!d.length){c[l]=p;continue}let E={};for(let I of d){let S=f[I],G=s(S,l,i,t);if(G===void 0)E[I]=S;else if(Array.isArray(G)){let[Z,W]=G;E[Z]=W}else if(G!==null)E[I]=G}c[l]={...p,args:E}}if(L(o))r[i]=new Ee({...a,fields:c});else if(P(o))r[i]=new Me({...a,fields:c});else r[i]=new Ge({...a,fields:c})}return r}function nh(e,t,n){let r=uh(n);if(r==null)return e.slice();let i=[];for(let o of e){let s=r(o,t);if(s===void 0)i.push(o);else if(s!==null)i.push(s)}return i}function rh(e,t){let n=e.getType(t),r=[Q.TYPE];if(L(n)){if(r.push(Q.COMPOSITE_TYPE,Q.OBJECT_TYPE),t===e.getQueryType()?.name)r.push(Q.ROOT_OBJECT,Q.QUERY);else if(t===e.getMutationType()?.name)r.push(Q.ROOT_OBJECT,Q.MUTATION);else if(t===e.getSubscriptionType()?.name)r.push(Q.ROOT_OBJECT,Q.SUBSCRIPTION)}else if(k(n))r.push(Q.INPUT_OBJECT_TYPE);else if(P(n))r.push(Q.COMPOSITE_TYPE,Q.ABSTRACT_TYPE,Q.INTERFACE_TYPE);else if(te(n))r.push(Q.COMPOSITE_TYPE,Q.ABSTRACT_TYPE,Q.UNION_TYPE);else if(z(n))r.push(Q.ENUM_TYPE);else if(ae(n))r.push(Q.SCALAR_TYPE);return r}function ih(e,t,n){let r=rh(e,n),i,o=[...r];while(!i&&o.length>0){let s=o.pop();i=t[s]}return i!=null?i:null}function oh(e,t){let n=e.getType(t),r=[Q.FIELD];if(L(n)){if(r.push(Q.COMPOSITE_FIELD,Q.OBJECT_FIELD),t===e.getQueryType()?.name)r.push(Q.ROOT_FIELD,Q.QUERY_ROOT_FIELD);else if(t===e.getMutationType()?.name)r.push(Q.ROOT_FIELD,Q.MUTATION_ROOT_FIELD);else if(t===e.getSubscriptionType()?.name)r.push(Q.ROOT_FIELD,Q.SUBSCRIPTION_ROOT_FIELD)}else if(P(n))r.push(Q.COMPOSITE_FIELD,Q.INTERFACE_FIELD);else if(k(n))r.push(Q.INPUT_OBJECT_FIELD);return r}function sh(e,t,n){let r=oh(e,n),i,o=[...r];while(!i&&o.length>0){let s=o.pop();i=t[s]}return i??null}function ah(e){let t=e[Q.ARGUMENT];return t!=null?t:null}function uh(e){let t=e[Q.DIRECTIVE];return t!=null?t:null}function ch(e){let t=e[Q.ENUM_VALUE];return t!=null?t:null}function ea(e){if(L(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:At,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:qt,fields:void 0}));return new Ee(t)}else if(P(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:xt,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:Kt,fields:void 0}));return new Me(t)}else if(k(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:yt,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:Lt,fields:void 0}));return new Ge(t)}else if(z(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,values:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,values:void 0}));return new we(t)}else return e}function Rp(e){return lh(e.getTypeMap(),e.getDirectives()),e}function lh(e,t){let n=Object.create(null);for(let c in e){let l=e[c];if(l==null||c.startsWith("__"))continue;let p=l.name;if(p.startsWith("__"))continue;if(n[p]!=null){console.warn(`Duplicate schema type name ${p} found; keeping the existing one found in the schema`);continue}n[p]=l}for(let c in n){let l=n[c];e[c]=l}for(let c of t)c.args=c.args.filter((l)=>(l.type=u(l.type),l.type!==null));for(let c in e){let l=e[c];if(!c.startsWith("__")&&c in n){if(l!=null)r(l)}}for(let c in e)if(!c.startsWith("__")&&!(c in n))delete e[c];function r(c){if(L(c)){i(c),o(c);return}else if(P(c)){if(i(c),"getInterfaces"in c)o(c);return}else if(te(c)){a(c);return}else if(k(c)){s(c);return}else if(ve(c))return;throw Error(`Unexpected schema type: ${c}`)}function i(c){let l=c.getFields();for(let[p,f]of Object.entries(l))if(f.args.map((d)=>(d.type=u(d.type),d.type===null?null:d)).filter(Boolean),f.type=u(f.type),f.type===null)delete l[p]}function o(c){if("getInterfaces"in c){let l=c.getInterfaces();l.push(...l.splice(0).map((p)=>u(p)).filter(Boolean))}}function s(c){let l=c.getFields();for(let[p,f]of Object.entries(l))if(f.type=u(f.type),f.type===null)delete l[p]}function a(c){let l=c.getTypes();l.push(...l.splice(0).map((p)=>u(p)).filter(Boolean))}function u(c){if(j(c)){let l=u(c.ofType);return l!=null?new oe(l):null}else if(w(c)){let l=u(c.ofType);return l!=null?new V(l):null}else if(rt(c)){let l=e[c.name];if(l&&c!==l)return l}return c}}function na(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!pe(i).name.startsWith("__")&&L(i)){let o=i.getFields();for(let s in o){let a=o[s];t(a,r,s)}}}}function vu(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!pe(i).name.startsWith("__")){if(L(i)){let o=i.getFields();for(let s in o){let a=o[s];for(let u of a.args)u.defaultValue=t(u.type,u.defaultValue)}}else if(k(i)){let o=i.getFields();for(let s in o){let a=o[s];a.defaultValue=t(a.type,a.defaultValue)}}}}}function ph(e){return e!=null&&typeof e==="object"&&!Array.isArray(e)}function fh(e){return{enumerable:e?.enumerable??!1,nonEnumerable:e?.nonEnumerable??!1}}function dh(e,t=!1,n=!1,r=!1){if(ph(e))return{respectPrototype:e.respectPrototype??!1,respectArrays:e.respectArrays??!1,respectArrayLength:e.respectArrayLength??!1,respectSymbols:fh(e.respectSymbols)};return{respectPrototype:e??!1,respectArrays:t,respectArrayLength:n,respectSymbols:{enumerable:!1,nonEnumerable:r}}}function ra(e,t=!1,n=!1,r=!1,i=!1){let o=dh(t,n,r,i);return eo(e,o)}function eo(e,t){let{respectPrototype:n,respectArrayLength:r,respectSymbols:i}=t,{enumerable:o,nonEnumerable:s}=i;if(e.length===0)return;if(e.length===1)return e[0];let a,u=!0,c=e.every((f)=>{if(Array.isArray(f)){if(a===void 0)return a=f.length,!0;else if(a===f.length)return!0}else u=!1;return!1});if(r&&c)return Array(a).fill(null).map((f,d)=>eo(e.map((E)=>E[d]),t));if(u)return e.flat(1);let l,p;if(n){if(p=e.find((f)=>Lp(f)),p){if(l==null)l={};Object.setPrototypeOf(l,Object.create(Object.getPrototypeOf(p)))}}for(let f of e){if(f===void 0)continue;if(Lp(f)){if(l==null)l={};if(p){let d=Object.getPrototypeOf(l),E=Object.getPrototypeOf(f);if(E)for(let I of Object.getOwnPropertyNames(E)){let S=Object.getOwnPropertyDescriptor(E,I);if(Br(S))Object.defineProperty(d,I,S)}}for(let d in f){if(Hi(d))continue;if(Object.prototype.hasOwnProperty.call(l,d)&&f[d]!==void 0)l[d]=eo([l[d],f[d]],t);else l[d]=f[d]}if(l!=null&&(o||s))for(let d of Object.getOwnPropertySymbols(f)){if(!Object.getOwnPropertyDescriptor(f,d).enumerable){if(s)if(Object.prototype.hasOwnProperty.call(l,d)){let S=Object.getOwnPropertyDescriptor(l,d);if(S.configurable)Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!1,configurable:!0});else if(S.writable||S.set)l[d]=f[d]}else Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!1,configurable:!0});continue}if(!o)continue;let I=Object.prototype.hasOwnProperty.call(l,d);if(I&&f[d]!==void 0){let S=Object.getOwnPropertyDescriptor(l,d),G=eo([l[d],f[d]],t);if(S.writable||S.set)l[d]=G;else if(S.configurable)Object.defineProperty(l,d,{value:G,writable:!0,enumerable:!0,configurable:!0})}else if(!I)l[d]=f[d];else{let S=Object.getOwnPropertyDescriptor(l,d);if(S.writable||S.set)l[d]=f[d];else if(S.configurable)Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!0,configurable:!0})}}}else if(Array.isArray(f))if(!Array.isArray(l))l=f;else l=eo([l,f],t);else l=f}return l}function Lp(e){return e&&typeof e==="object"&&!Array.isArray(e)}function kp(e){return e&&typeof e==="object"&&"kind"in e&&e.kind===jt}function bu(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=[];for(let i of e){if(Array.isArray(i))i=bu(i);if(typeof i==="object"&&i)n.push(i)}let r=ra(n,{respectPrototype:!0,respectSymbols:{enumerable:!0,nonEnumerable:!0}});if(t?.exclusions)for(let i of t.exclusions){let[o,s]=i.split(".");if(Hi(o)||Hi(s))continue;if(!s||s==="*")delete r[o];else if(r[o])delete r[o][s]}return r}function Fp(e,t,n){let r=mh([...t,...e].filter(Br),n);if(n&&n.sort)r.sort($n);return r}function mh(e,t){return e.reduce((n,r)=>{let i=n.findIndex((o)=>o.name.value===r.name.value);if(i===-1)return n.concat([r]);else if(!t?.reverseArguments)n[i]=r;return n},[])}function Cp(e){let t=new Set,n=new Set;for(let r of e){let i=r.name.value;if(t.has(i))n.add(i);else t.add(i)}return n}function hh(e,t,n,r){let i=t?.[e.name.value];if(i)return!!i.repeatable;return!!(n?.has(e.name.value)||r?.has(e.name.value))}function Vp(e,t){return t.some(({value:n})=>n===e.value)}function Eh(e,t){let n=[];for(let r of[...t,...e]){let i=n.findIndex((o)=>o.name.value===r.name.value);if(i===-1)n.push(r);else{let o=n[i];if(o.value.kind==="ListValue"){let s=o.value.values,a=r.value.values;o.value={...o.value,values:Pp(s,a,(u,c)=>{let l=u.value;return!l||!c.some((p)=>p.value===l)})}}else o.value=r.value}}return n}var _u=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case Ae:return e.values.length===t.values.length&&e.values.every((n)=>t.values.find((r)=>_u(n,r)));case Ce:case le:return!0;case Ve:return e.fields.length===t.fields.length&&e.fields.every((n)=>t.fields.find((r)=>n.name.value===r.name.value&&_u(n.value,r.value)));default:return e.value===t.value}return!1},Su=(e)=>e.name.value==="link",Mp=(e)=>{let t=Su(e)?e.arguments?.find((n)=>n.name.value==="url")?.value:void 0;return t?.kind==="StringValue"?t.value:void 0},Th=(e,t)=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&_u(e.value,t.value),yh=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every((r)=>t.arguments?.find((i)=>Th(r,i)))));function $e(e=[],t=[],n,r){let i=n&&n.reverseDirectives,o=i?e:t,s=i?t:e,a=new Set(e.map((p)=>p.name.value)),u=new Set(t.map((p)=>p.name.value)),c=new Set;for(let p of Cp(e))if(!u.has(p))c.add(p);for(let p of Cp(t))if(!a.has(p))c.add(p);let l=[];for(let p of[...o,...s])if(hh(p,r,n?.repeatableLinkImports,c)){if(!l.find((d)=>yh(p,d)))l.push(p)}else{let f=l.findIndex((d)=>d.name.value===p.name.value);if(f===-1)l.push(p);else{if(Su(p)&&Su(l[f])){let E=Mp(p),I=Mp(l[f]);if(E&&I&&E!==I){l.push(p);continue}}let d=Eh(p.arguments??[],l[f].arguments??[]);l[f]={...l[f],arguments:d.length===0?void 0:d}}}return l}function Up(e,t){if(t)return{...e,arguments:Pp(t.arguments||[],e.arguments||[],(n,r)=>!Vp(n.name,r.map((i)=>i.name))),locations:[...t.locations,...e.locations.filter((n)=>!Vp(n,t.locations))]};return e}function Pp(e,t,n){return e.concat(t.filter((r)=>n(r,e)))}function $p(e,t,n,r){if(n?.consistentEnumMerge){let s=[];if(e)s.push(...e);e=t,t=s}let i=new Map;if(e)for(let s of e)i.set(s.name.value,s);if(t)for(let s of t){let a=s.name.value;if(i.has(a)){let u=i.get(a);u.description=s.description||u.description,u.directives=$e(s.directives,u.directives,r)}else i.set(a,s)}let o=[...i.values()];if(n&&n.sort)o.sort($n);return o}function Gp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:$e(e.directives,t.directives,n,r),values:$p(e.values,t.values,n)};return n?.convertExtensions?{...e,kind:Yt}:e}function jp(e){return typeof e==="string"}function Bp(e){return e instanceof Pt}function Du(e){let t=e;while(t.kind===Dn||t.kind==="NonNullType")t=t.type;return t}function Ou(e){return e.kind!==Sn}function ia(e){return e.kind===Dn}function jn(e){return e.kind===cn}function to(e){if(ia(e))return`[${to(e.type)}]`;if(jn(e))return`${to(e.type)}!`;return e.name.value}var Gn;(function(e){e[e.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",e[e.A_EQUALS_B=0]="A_EQUALS_B",e[e.A_GREATER_THAN_B=1]="A_GREATER_THAN_B"})(Gn||(Gn={}));function Qp(e,t){if(e==null&&t==null)return Gn.A_EQUALS_B;if(e==null)return Gn.A_SMALLER_THAN_B;if(t==null)return Gn.A_GREATER_THAN_B;if(e<t)return Gn.A_SMALLER_THAN_B;if(e>t)return Gn.A_GREATER_THAN_B;return Gn.A_EQUALS_B}function gh(e,t){let n=e.findIndex((r)=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function qr(e,t,n,r,i){let o=[];if(n!=null)o.push(...n);if(t!=null)for(let s of t){let[a,u]=gh(o,s);if(a&&!r?.ignoreFieldConflicts){let c=r?.onFieldTypeConflict&&r.onFieldTypeConflict(a,s,e,r?.throwOnConflict)||Nh(e,a,s,r?.throwOnConflict);c.arguments=Fp(s.arguments||[],a.arguments||[],r),c.directives=$e(s.directives,a.directives,r,i),c.description=s.description||a.description,o[u]=c}else o.push(s)}if(r&&r.sort)o.sort($n);if(r&&r.exclusions){let s=r.exclusions;return o.filter((a)=>!s.includes(`${e.name.value}.${a.name.value}`))}return o}function Nh(e,t,n,r=!1){let i=to(t.type),o=to(n.type);if(i!==o){let s=Du(t.type),a=Du(n.type);if(s.name.value!==a.name.value)throw Error(`Field "${n.name.value}" already defined with a different type. Declared as "${s.name.value}", but you tried to override with "${a.name.value}"`);if(!no(t.type,n.type,!r))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${o}'`)}if(jn(n.type)&&!jn(t.type))t.type=n.type;return t}function no(e,t,n=!1){if(!Ou(e)&&!Ou(t))return e.toString()===t.toString();if(jn(t)){let r=jn(e)?e.type:e;return no(r,t.type)}if(jn(e))return no(t,e,n);if(ia(e))return ia(t)&&no(e.type,t.type)||jn(t)&&no(e,t.type);return!1}function Yp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n),directives:$e(e.directives,t.directives,n,r)}}catch(i){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:yt}:e}function Ih(e,t){return!!e.find((n)=>n.name.value===t.name.value)}function Kr(e=[],t=[],n={}){let r=[...t,...e.filter((i)=>!Ih(t,i))];if(n&&n.sort)r.sort($n);return r}function qp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n,r),directives:$e(e.directives,t.directives,n,r),interfaces:e.interfaces?Kr(e.interfaces,t.interfaces,n):void 0}}catch(i){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:xt}:e}function Kp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:$e(e.directives,t.directives,n,r)};return n?.convertExtensions?{...e,kind:Qt}:e}var oa={query:"Query",mutation:"Mutation",subscription:"Subscription"};function vh(e=[],t=[]){let n=[];for(let r in oa){let i=e.find((o)=>o.operation===r)||t.find((o)=>o.operation===r);if(i)n.push(i)}return n}function Jp(e,t,n,r){if(t)return{kind:e.kind===Ye||t.kind===Ye?Ye:Rt,description:e.description||t.description,directives:$e(e.directives,t.directives,n,r),operationTypes:vh(e.operationTypes,t.operationTypes)};return n?.convertExtensions?{...e,kind:Ye}:e}function Wp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n,r),directives:$e(e.directives,t.directives,n,r),interfaces:Kr(e.interfaces,t.interfaces,n)}}catch(i){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:At}:e}function Hp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,directives:$e(e.directives,t.directives,n,r),kind:n?.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?wt:Jt,loc:e.loc,types:Kr(e.types,t.types,n)};return n?.convertExtensions?{...e,kind:wt}:e}var hr="SCHEMA_DEF_SYMBOL";function bh(e){return"name"in e}function Au(e,t,n={}){let r=n;for(let i of e)if(bh(i)){let o=i.name?.value;if(t?.commentDescriptions)vp(i);if(o==null)continue;if(t?.exclusions?.includes(o+".*")||t?.exclusions?.includes(o))delete r[o];else switch(i.kind){case At:case qt:r[o]=Wp(i,r[o],t,n);break;case Yt:case pn:r[o]=Gp(i,r[o],t,n);break;case wt:case Jt:r[o]=Hp(i,r[o],t,n);break;case Qt:case ln:r[o]=Kp(i,r[o],t,n);break;case yt:case Lt:r[o]=Yp(i,r[o],t,n);break;case xt:case Kt:r[o]=qp(i,r[o],t,n);break;case pt:if(r[o]){if(o in{}){if(!_h(r[o]))r[o]=void 0}}r[o]=Up(i,r[o]);break}}else if(i.kind===Ye||i.kind===Rt)r[hr]=Jp(i,r[hr],t,n);return r}function _h(e){return e!=null&&typeof e==="object"&&"kind"in e&&typeof e.kind==="string"}function zp(e){return e.as??e.url.name}function Sh(e){let t=zp(e);return t&&`@${t}`}function sa(e,t){if(e.url.name&&t===`@${e.url.name}`)return Sh(e).substring(1);let n=e.imports.find((i)=>i.name===t),r=n?.as??n?.name??Dh(zp(e),t);return r.startsWith("@")?r.substring(1):r}function Dh(e,t){if(e?.length){if(t.startsWith("@"))return`@${e}__${t.substring(1)}`;return`${e}__${t}`}return t}function Xp(e){let t=[];for(let n of e.definitions)if(n.kind===Rt||n.kind===Ye){let i=n.directives?.filter((a)=>a.name.value==="link")?.map((a)=>Oh(a.arguments??[])).filter((a)=>a!==void 0)??[];t=t.concat(i);let s=n.directives?.filter(({name:a})=>a.value==="core")?.map((a)=>Ah(a.arguments??[])).filter((a)=>a!==void 0);if(s)t=t.concat(...s)}return t}function Oh(e){let t,n=[],r;for(let i of e)switch(i.name.value){case"url":{if(i.value.kind===Ie)t=Zp(i.value.value);break}case"import":{n=xh(i.value);break}case"as":{if(i.value.kind===Ie)r=i.value.value??void 0;break}default:}if(t!==void 0)return{url:t,as:r,imports:n}}function Ah(e){let t=e.find(({name:n,value:r})=>n.value==="feature"&&r.kind===Ie);if(t)return{url:Zp(t.value.value),imports:[]}}function xh(e){if(e.kind===Ae)return e.values.map((n)=>{let r;if(n.kind===Ie)r={name:n.value};else if(n.kind===Ve){let i="",o;for(let s of n.fields)if(s.name.value==="name"){if(s.value.kind===Ie)i=s.value.value}else if(s.name.value==="as"){if(s.value.kind===Ie)o=s.value.value}r={name:i,as:o}}return r}).filter((n)=>n!==void 0);return[]}var wh=/v(\d{1,3})\.(\d{1,4})/i;function Zp(e){let t=new URL(e),n=t.pathname.split("/").filter(Boolean),r=n[n.length-1];if(r){if(wh.test(r)){let i=n[n.length-2];return{identity:t.origin+(i?`/${n.slice(0,n.length-1).join("/")}`:""),name:i??null,version:r}}return{identity:`${t.origin}/${n.join("/")}`,name:r,version:null}}return{identity:t.origin,name:null,version:null}}function xu(e,t){Hs();let n={kind:jt,definitions:Rh(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})},r;if(t?.commentDescriptions)r=bp(n);else r=n;return Hs(),r}function Jr(e,t,n=[],r=[],i=new Set,o=new Set){let s=(a)=>{o.add(a)};if(e&&!i.has(e))if(i.add(e),typeof e==="function")Jr(e(),t,n,r,i,o);else if(Array.isArray(e))for(let a of e)Jr(a,t,n,r,i,o);else if(rr(e)){let a=hp(e,t);Jr(a.definitions,t,n,r,i,o)}else if(jp(e)||Bp(e)){let a=bt(e,t);Jr(a.definitions,t,n,r,i,o)}else if(typeof e==="object"&&Qo(e)){let a=Xp({definitions:[e],kind:jt}),u="https://specs.apollo.dev/federation",c="https://specs.apollo.dev/link",l=a.find((f)=>f.url.identity==="https://specs.apollo.dev/federation");if(l)s(sa(l,"@composeDirective")),s(sa(l,"@key"));let p=a.find((f)=>f.url.identity==="https://specs.apollo.dev/link");if(p)s(sa(p,"@link"));if(e.kind===pt)n.push(e);else r.push(e)}else if(kp(e))Jr(e.definitions,t,n,r,i,o);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r,repeatableLinkImports:o}}function Rh(e,t){Hs();let{allDirectives:n,allNodes:r,repeatableLinkImports:i}=Jr(e,t),o=Au(n,t);t.repeatableLinkImports=i;let s=Au(r,t,o);if(t?.useSchemaDefinition){let u=s[hr]||{kind:Ye,operationTypes:[]},c=u,l=c.operationTypes??=[];for(let p in oa)if(!l.find((d)=>d.operation===p)){let d=oa[p],E=s[d];if(E!=null&&E.name!=null)l.push({kind:si,type:{kind:Sn,name:E.name},operation:p})}if(u?.operationTypes?.length!=null&&u.operationTypes.length>0)s[hr]=u}if(t?.forceSchemaDefinition&&!s[hr]?.operationTypes?.length)s[hr]={kind:Ye,operationTypes:[{kind:si,operation:"query",type:{kind:Sn,name:{kind:Ne,value:"Query"}}}]};let a=Object.values(s);if(t?.sort){let u=typeof t.sort==="function"?t.sort:Qp;a.sort((c,l)=>u(c.name?.value,l.name?.value))}return a}var Lh={respectArrays:!0,respectSymbols:{enumerable:!0,nonEnumerable:!0}};function Wr(e,t){if(!e||!t||t===e.extensions)return;if(!e.extensions){e.extensions=t;return}e.extensions=ra([e.extensions,t],Lh)}function ef(e,t){Wr(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(Wr(i,r.extensions),r.type==="object"||r.type==="interface")for(let[o,s]of Object.entries(r.fields)){let a=i.getFields()[o];if(a){Wr(a,s.extensions);for(let[u,c]of Object.entries(s.arguments))Wr(a.args.find((l)=>l.name===u),c)}}else if(r.type==="input")for(let[o,s]of Object.entries(r.fields)){let a=i.getFields()[o];Wr(a,s.extensions)}else if(r.type==="enum")for(let[o,s]of Object.entries(r.values)){let a=i.getValue(o);Wr(a,s)}}}return e}function tf(e,t){Zi(e,{[Q.ABSTRACT_TYPE]:(n)=>{if(!n.resolveType){let r=`Type "${n.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if(t==="error")throw Error(r);if(t==="warn")console.warn(r)}return}})}function nf(e,t){let n={},r=e.getTypeMap();for(let i in r){let o=r[i];if("getInterfaces"in o){n[i]={};for(let a of o.getInterfaces())if(t[a.name]){for(let u in t[a.name])if(u==="__isTypeOf"||!u.startsWith("__"))n[i][u]=t[a.name][u]}let s=t[i];n[i]={...n[i],...s}}else{let s=t[i];if(s!=null)n[i]=s}}return n}function rf({schema:e,resolvers:t,defaultFieldResolver:n,resolverValidationOptions:r={},inheritResolversFromInterfaces:i=!1,updateResolversInPlace:o=!1}){let{requireResolversToMatchSchema:s="error",requireResolversForResolveType:a}=r,u=i?nf(e,t):t;for(let c in u){let l=u[c];if(typeof l!=="object")throw Error(`"${c}" defined in resolvers, but has invalid value "${l}". The resolver's value must be of type object.`);let f=e.getType(c);if(f==null){let d=`"${c}" defined in resolvers, but not in schema`;if(s&&s!=="error"){if(s==="warn")console.warn(d);continue}throw Error(d)}else if(Ze(f))for(let d in l)if(d.startsWith("__"))Hr(f,d.substring(2),l[d]);else Hr(f,d,l[d]);else if(z(f)){let d=f.getValues();for(let E in l)if(!E.startsWith("__")&&!d.some((I)=>I.name===E)&&s&&s!=="ignore"){let I=`${f.name}.${E} was defined in resolvers, but not present within ${f.name}`;if(s==="error")throw Error(I);else console.warn(I)}}else if(te(f)){for(let d in l)if(!d.startsWith("__")&&s&&s!=="ignore"){let E=`${f.name}.${d} was defined in resolvers, but ${f.name} is not an object or interface type`;if(s==="error")throw Error(E);else console.warn(E)}}else if(L(f)||P(f)){for(let d in l)if(!d.startsWith("__"))if(f.getFields()[d]==null){if(s&&s!=="ignore"){let S=`${c}.${d} defined in resolvers, but not in schema`;if(s==="error")throw Error(S);else console.error(S)}}else{let S=l[d];if(typeof S!=="function"&&typeof S!=="object")throw Error(`Resolver ${c}.${d} must be object or function`)}}}if(e=o?Fh(e,u,n):Ch(e,u,n),a&&a!=="ignore")tf(e,a);return e}var kh={serialize:"coerceOutputValue",parseValue:"coerceInputValue"};function Hr(e,t,n){e[t]=n;let r=kh[t];if(r)e[r]=n}function Fh(e,t,n){let r=e.getTypeMap();for(let i in t){let o=e.getType(i),s=t[i];if(ae(o))for(let a in s)if(a.startsWith("__"))Hr(o,a.substring(2),s[a]);else if(a==="astNode"&&o.astNode!=null)o.astNode={...o.astNode,description:s?.astNode?.description??o.astNode.description,directives:(o.astNode.directives??[]).concat(s?.astNode?.directives??[])};else if(a==="extensionASTNodes"&&o.extensionASTNodes!=null)o.extensionASTNodes=o.extensionASTNodes.concat(s?.extensionASTNodes??[]);else if(a==="extensions"&&o.extensions!=null&&s.extensions!=null)o.extensions=Object.assign(Object.create(null),o.extensions,s.extensions);else Hr(o,a,s[a]);else if(z(o)){let a=o.toConfig(),u=a.values;for(let c in s)if(c.startsWith("__"))a[c.substring(2)]=s[c];else if(c==="astNode"&&a.astNode!=null)a.astNode={...a.astNode,description:s?.astNode?.description??a.astNode.description,directives:(a.astNode.directives??[]).concat(s?.astNode?.directives??[])};else if(c==="extensionASTNodes"&&a.extensionASTNodes!=null)a.extensionASTNodes=a.extensionASTNodes.concat(s?.extensionASTNodes??[]);else if(c==="extensions"&&o.extensions!=null&&s.extensions!=null)o.extensions=Object.assign(Object.create(null),o.extensions,s.extensions);else if(u[c])u[c].value=s[c];r[i]=new we(a)}else if(te(o)){for(let a in s)if(a.startsWith("__"))o[a.substring(2)]=s[a]}else if(L(o)||P(o))for(let a in s){if(a.startsWith("__")){o[a.substring(2)]=s[a];continue}let c=o.getFields()[a];if(c!=null){let l=s[a];if(typeof l==="function")c.resolve=l.bind(s);else of(c,l)}}}if(vu(e,Xs),Rp(e),vu(e,Zs),n!=null)na(e,(i)=>{if(!i.resolve)i.resolve=n});return e}function Ch(e,t,n){if(e=Zi(e,{[Q.SCALAR_TYPE]:(r)=>{let i=r.toConfig(),o=t[r.name];if(!Ze(r)&&o!=null){let s=["parseValue","coerceInputValue"].some((u)=>(u in o)||(`__${u}`in o)),a=["parseLiteral","coerceInputLiteral"].some((u)=>(u in o)||(`__${u}`in o));for(let u in o)if(u.startsWith("__"))Hr(i,u.substring(2),o[u]);else if(u==="astNode"&&i.astNode!=null)i.astNode={...i.astNode,description:o?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(o?.astNode?.directives??[])};else if(u==="extensionASTNodes"&&i.extensionASTNodes!=null)i.extensionASTNodes=i.extensionASTNodes.concat(o?.extensionASTNodes??[]);else if(u==="extensions"&&i.extensions!=null&&o.extensions!=null)i.extensions=Object.assign(Object.create(null),r.extensions,o.extensions);else Hr(i,u,o[u]);if(s&&!a)delete i.parseLiteral;return new ke(i)}},[Q.ENUM_TYPE]:(r)=>{let i=t[r.name],o=r.toConfig(),s=o.values;if(i!=null){for(let a in i)if(a.startsWith("__"))o[a.substring(2)]=i[a];else if(a==="astNode"&&o.astNode!=null)o.astNode={...o.astNode,description:i?.astNode?.description??o.astNode.description,directives:(o.astNode.directives??[]).concat(i?.astNode?.directives??[])};else if(a==="extensionASTNodes"&&o.extensionASTNodes!=null)o.extensionASTNodes=o.extensionASTNodes.concat(i?.extensionASTNodes??[]);else if(a==="extensions"&&o.extensions!=null&&i.extensions!=null)o.extensions=Object.assign(Object.create(null),r.extensions,i.extensions);else if(s[a])s[a].value=i[a];return new we(o)}},[Q.UNION_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__resolveType)o.resolveType=i.__resolveType;return new it(o)}},[Q.OBJECT_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__isTypeOf)o.isTypeOf=i.__isTypeOf;return new Ee(o)}},[Q.INTERFACE_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__resolveType)o.resolveType=i.__resolveType;return new Me(o)}},[Q.COMPOSITE_FIELD]:(r,i,o)=>{let s=t[o];if(s!=null){let a=s[i];if(a!=null){let u={...r};if(typeof a==="function")u.resolve=a.bind(s);else of(u,a);return u}}}}),n!=null)e=Zi(e,{[Q.OBJECT_FIELD]:(r)=>({...r,resolve:r.resolve!=null?r.resolve:n})});return e}function of(e,t){for(let n in t)e[n]=t[n]}function sf(e,t={}){let{requireResolversForArgs:n,requireResolversForNonScalar:r,requireResolversForAllFields:i}=t;if(i&&(n||r))throw TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");na(e,(o,s,a)=>{if(i)wu("requireResolversForAllFields",i,o,s,a);if(n&&o.args.length>0)wu("requireResolversForArgs",n,o,s,a);if(r!=="ignore"&&!ae(pe(o.type)))wu("requireResolversForNonScalar",r,o,s,a)})}function wu(e,t,n,r,i){if(!n.resolve){let o=`Resolver missing for "${r}.${i}".
+To disable this validator, use:
+ resolverValidationOptions: {
+ ${e}: 'ignore'
+ }`;if(t==="error")throw Error(o);if(t==="warn")console.warn(o);return}if(typeof n.resolve!=="function")throw Error(`Resolver "${r}.${i}" must be a function`)}function Vh({typeDefs:e,resolvers:t={},resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:i=!1,schemaExtensions:o,defaultFieldResolver:s,...a}){if(typeof n!=="object")throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error("Must provide typeDefs");let u;if(rr(e))u=e;else if(a?.commentDescriptions){let c=xu(e,{...a,commentDescriptions:!0});u=Ys(c,a)}else{let c=xu(e,a);u=Ki(c,a)}if(u=rf({schema:u,resolvers:bu(t),resolverValidationOptions:n,inheritResolversFromInterfaces:r,updateResolversInPlace:i,defaultFieldResolver:s}),Object.keys(n).length>0)sf(u,n);if(o)for(let c of Js(o))ef(u,c);return u}function ut(e){if(e===null)return"null";if(Array.isArray(e))return"array";return typeof e}function rn(e){return ut(e)==="object"}function af(e){return typeof Object(e)[Symbol.asyncIterator]==="function"}function aa(e){return rn(e)&&typeof Object(e)[Symbol.asyncIterator]==="function"&&typeof e.return==="function"}function Mh(e){return Array.isArray(e)&&e.length>0&&e.every((t)=>("message"in t))}var uf="graphql-transport-ws";var vn=((e)=>(e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",e))(vn||{}),ct=((e)=>(e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",e))(ct||{});function cf(e){if(!rn(e))throw Error(`Message is expected to be an object, but got ${ut(e)}`);if(!e.type)throw Error("Message is missing the 'type' property");if(typeof e.type!=="string")throw Error(`Message is expects the 'type' property to be a string, but got ${ut(e.type)}`);switch(e.type){case"connection_init":case"connection_ack":case"ping":case"pong":{if(e.payload!=null&&!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case"subscribe":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ut(e.payload)}`);if(typeof e.payload.query!=="string")throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${ut(e.payload.query)}`);if(e.payload.variables!=null&&!rn(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ut(e.payload.variables)}`);if(e.payload.operationName!=null&&ut(e.payload.operationName)!=="string")throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ut(e.payload.operationName)}`);if(e.payload.extensions!=null&&!rn(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ut(e.payload.extensions)}`);break}case"next":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ut(e.payload)}`);break}case"error":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Mh(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case"complete":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function lf(e,t){return cf(typeof e==="string"?JSON.parse(e,t):e)}function zr(e,t){return cf(e),JSON.stringify(e,t)}function pf(e){let{schema:t,context:n,roots:r,parse:i,validate:o,execute:s,subscribe:a,connectionInitWaitTimeout:u=3000,onConnect:c,onDisconnect:l,onPing:p,onPong:f,onClose:d,onSubscribe:E,onOperation:I,onNext:S,onError:G,onComplete:Z,jsonMessageReviver:W,jsonMessageReplacer:H}=e;return{opened(Y,ne){let b={connectionInitReceived:!1,acknowledged:!1,subscriptions:Object.create(null),extra:ne};if(Y.protocol!==uf)return Y.close(vn.SubprotocolNotAcceptable,"Subprotocol not acceptable"),async(h,D)=>{await d?.(b,h,D)};let A=u>0&&isFinite(u)?setTimeout(()=>{if(!b.connectionInitReceived)Y.close(vn.ConnectionInitialisationTimeout,"Connection initialisation timeout")},u):null;return Y.onMessage(async function(D){let R;try{R=lf(D,W)}catch(q){return Y.close(vn.BadRequest,"Invalid message received")}switch(R.type){case ct.ConnectionInit:{if(b.connectionInitReceived)return Y.close(vn.TooManyInitialisationRequests,"Too many initialisation requests");if(b.connectionInitReceived=!0,rn(R.payload))b.connectionParams=R.payload;let q=await c?.(b);if(q===!1)return Y.close(vn.Forbidden,"Forbidden");b.acknowledged=!0,await Y.send(zr(rn(q)?{type:ct.ConnectionAck,payload:q}:{type:ct.ConnectionAck},H));return}case ct.Ping:{if(await p?.(b,R.payload),Y.onPing)return await Y.onPing(R.payload);await Y.send(zr(R.payload?{type:ct.Pong,payload:R.payload}:{type:ct.Pong},H));return}case ct.Pong:return await f?.(b,R.payload),await Y.onPong?.(R.payload);case ct.Subscribe:{if(!b.acknowledged)return Y.close(vn.Unauthorized,"Unauthorized");let{id:q,payload:ce}=R;if(q in b.subscriptions)return Y.close(vn.SubscriberAlreadyExists,`Subscriber for ${q} already exists`);b.subscriptions[q]=null;let Ue={next:async(v,{id:O,payload:N},g)=>{let{errors:_,...B}=v,X=await S?.(b,O,N,g,v);await Y.send(zr({id:O,type:ct.Next,payload:X||{...B,..._?{errors:_.map((he)=>he.toJSON())}:{}}},H))},error:async(v,{id:O,payload:N})=>{let g=await G?.(b,O,N,v);await Y.send(zr({id:O,type:ct.Error,payload:g||v.map((_)=>_.toJSON())},H))},complete:async(v,{id:O,payload:N})=>{if(await Z?.(b,O,N),v)await Y.send(zr({id:O,type:ct.Complete},H))}};try{let v,O=await E?.(b,R.id,R.payload);if(O){if(ff(O))return q in b.subscriptions?await Ue.error(O,R):void 0;else if(Array.isArray(O))throw Error("Invalid return value from onSubscribe hook, expected an array of GraphQLError objects");v=O}else{if(!t)throw Error("The GraphQL schema is not provided");let B={operationName:ce.operationName,document:(i??bt)(ce.query),variableValues:ce.variables};v={...B,schema:typeof t==="function"?await t(b,q,ce,B):t};let X=(o??Lr)(v.schema,v.document);if(X.length>0)return q in b.subscriptions?await Ue.error(X,R):void 0}let N=Fr(v.document,v.operationName);if(!N)return q in b.subscriptions?await Ue.error([new m("Unable to identify operation")],R):void 0;if(!("rootValue"in v))v.rootValue=r?.[N.operation];if(!("contextValue"in v))v.contextValue=typeof n==="function"?await n(b,q,ce,v):n;let g;if(N.operation==="subscription")g=await(a??Pr)(v);else g=await(s??Ur)(v);let _=await I?.(b,q,ce,v,g);if(_)g=_;if(af(g))if(!(q in b.subscriptions)){if(aa(g))g.return(void 0)}else{b.subscriptions[q]=g;try{for await(let B of g)await Ue.next(B,R,v)}catch(B){let X=B instanceof Error?B:Error(String(B));await Ue.error([ro.major>=17?new m(X.message,{cause:X}):ro.major>=16?new m(X.message,{originalError:X}):new m(X.message,null,null,null,null,X)],R),delete b.subscriptions[q]}}else if(q in b.subscriptions)await Ue.next(g,R,v);await Ue.complete(q in b.subscriptions,R)}finally{delete b.subscriptions[q]}return}case ct.Complete:{let q=b.subscriptions[R.id];if(delete b.subscriptions[R.id],aa(q))await q.return(void 0);return}default:throw Error(`Unexpected message of type ${R.type} received`)}}),async(h,D)=>{if(A)clearTimeout(A);let R={...b.subscriptions};if(b.subscriptions=Object.create(null),await Promise.all(Object.values(R).filter(aa).map((q)=>q.return(void 0))),b.acknowledged)await l?.(b,h,D);await d?.(b,h,D)}}}}function ff(e){return Array.isArray(e)&&e.length>0&&e.every((t)=>t instanceof m)}export{Bi as AbortedGraphQLExecutionError,Wn as BREAK,Se as BreakingChangeType,yi as DEFAULT_DEPRECATION_REASON,at as DangerousChangeType,$o as DeferStreamDirectiveLabelRule,Go as DeferStreamDirectiveOnRootFieldRule,jo as DeferStreamDirectiveOnValidOperationsRule,F as DirectiveLocation,qo as ExecutableDefinitionsRule,Ko as FieldsOnCorrectTypeRule,Jo as FragmentsOnCompositeTypesRule,er as GRAPHQL_MAX_INT,tr as GRAPHQL_MIN_INT,ge as GraphQLBoolean,Xt as GraphQLDeferDirective,mn as GraphQLDeprecatedDirective,Re as GraphQLDirective,we as GraphQLEnumType,m as GraphQLError,Ir as GraphQLFloat,Rn as GraphQLID,Ln as GraphQLIncludeDirective,Ge as GraphQLInputObjectType,wn as GraphQLInt,Me as GraphQLInterfaceType,oe as GraphQLList,V as GraphQLNonNull,Ee as GraphQLObjectType,Ni as GraphQLOneOfDirective,ke as GraphQLScalarType,ot as GraphQLSchema,kn as GraphQLSkipDirective,gi as GraphQLSpecifiedByDirective,vt as GraphQLStreamDirective,ie as GraphQLString,it as GraphQLUnionType,C as Kind,Wo as KnownArgumentNamesRule,Fi as KnownDirectivesRule,Ho as KnownFragmentNamesRule,zo as KnownOperationTypesRule,Ci as KnownTypeNamesRule,ar as Lexer,ei as Location,Xo as LoneAnonymousOperationRule,Zo as LoneSchemaDefinitionRule,es as MaxIntrospectionDepthRule,Ul as NoDeprecatedCustomRule,ts as NoFragmentCyclesRule,Pl as NoSchemaIntrospectionCustomRule,ns as NoUndefinedVariablesRule,rs as NoUnusedFragmentsRule,is as NoUnusedVariablesRule,re as OperationTypeNode,us as OverlappingFieldsCanBeMergedRule,cs as PossibleFragmentSpreadsRule,ls as PossibleTypeExtensionsRule,ps as ProvidedRequiredArgumentsRule,_e as SafeChangeType,fs as ScalarLeafsRule,Ii as SchemaMetaFieldDef,hs as SingleFieldSubscriptionsRule,Pt as Source,Es as StreamDirectiveOnListFieldRule,bn as Token,T as TokenKind,ur as TypeInfo,ue as TypeKind,vi as TypeMetaFieldDef,bi as TypeNameMetaFieldDef,Ts as UniqueArgumentDefinitionNamesRule,Pi as UniqueArgumentNamesRule,ys as UniqueDirectiveNamesRule,$i as UniqueDirectivesPerLocationRule,gs as UniqueEnumValueNamesRule,Ns as UniqueFieldDefinitionNamesRule,Is as UniqueFragmentNamesRule,Gi as UniqueInputFieldNamesRule,vs as UniqueOperationNamesRule,bs as UniqueOperationTypesRule,_s as UniqueTypeNamesRule,Ss as UniqueVariableNamesRule,ji as ValidationContext,Ds as ValuesOfCorrectTypeRule,Os as VariablesAreInputTypesRule,As as VariablesInAllowedPositionRule,Ao as __Directive,xo as __DirectiveLocation,Ro as __EnumValue,wo as __Field,_r as __InputValue,br as __Schema,mt as __Type,Lo as __TypeKind,yc as assertAbstractType,Zu as assertArgument,Tc as assertCompositeType,wc as assertDirective,ic as assertEnumType,sc as assertEnumValue,Io as assertEnumValueName,zu as assertField,lc as assertInputField,uc as assertInputObjectType,hc as assertInputType,_o as assertInterfaceType,It as assertLeafType,fc as assertListType,He as assertName,Nc as assertNamedType,mc as assertNonNullType,So as assertNullableType,bo as assertObjectType,Ec as assertOutputType,Wu as assertScalarType,Sr as assertSchema,Ku as assertType,nc as assertUnionType,Dr as assertValidSchema,gc as assertWrappingType,Fn as astFromValue,Ki as buildASTSchema,Gl as buildClientSchema,Ys as buildSchema,yn as coerceInputLiteral,Tn as coerceInputValue,Xl as concatAST,iu as createSourceEventStream,Us as defaultFieldResolver,au as defaultHarness,su as defaultTypeResolver,mi as doTypesOverlap,Af as enableDevMode,Ur as execute,tu as executeRootSelectionSet,ru as executeSubscriptionEvent,$s as executeSync,eu as experimentalExecuteIncrementally,nu as experimentalExecuteRootSelectionSet,jl as extendSchema,sp as findBreakingChanges,ap as findDangerousChanges,Ks as findSchemaChanges,_t as getArgumentValues,Zt as getDirectiveValues,Hn as getEnterLeaveForKind,Bs as getIntrospectionQuery,Yn as getLocation,pe as getNamedType,gr as getNullableType,Fr as getOperationAST,Mi as getVariableValues,tm as graphql,nm as graphqlSync,$l as introspectionFromSchema,Mt as introspectionTypes,Ke as isAbstractType,li as isArgument,dt as isCompositeType,Bo as isConstValueNode,Qo as isDefinitionNode,xf as isDevModeEnabled,nr as isDirective,z as isEnumType,ma as isEnumValue,Nr as isEqualType,wi as isExecutableDefinitionNode,da as isField,ha as isInputField,k as isInputObjectType,xe as isInputType,P as isInterfaceType,ht as isIntrospectionType,ve as isLeafType,j as isListType,rt as isNamedType,w as isNonNullType,pi as isNullableType,L as isObjectType,Nt as isOutputType,ze as isRequiredArgument,Xe as isRequiredInputField,ae as isScalarType,rr as isSchema,Xc as isSchemaCoordinateNode,Hc as isSelectionNode,Vt as isSpecifiedDirective,Ze as isSpecifiedScalarType,Yo as isSubscriptionOperationDefinitionNode,yr as isType,En as isTypeDefinitionNode,ki as isTypeExtensionNode,zc as isTypeNode,Ht as isTypeSubTypeOf,Ri as isTypeSystemDefinitionNode,Li as isTypeSystemExtensionNode,te as isUnionType,xa as isValueNode,On as isWrappingType,Ml as legacyExecuteIncrementally,cu as legacyExecuteRootSelectionSet,Bl as lexicographicSortSchema,en as locatedError,Vh as makeExecutableSchema,pf as makeServer,Ps as mapSourceToResponseEvent,bt as parse,Uo as parseConstValue,Po as parseSchemaCoordinate,qc as parseType,Yc as parseValue,ee as print,hu as printDirective,ql as printIntrospectionSchema,so as printLocation,Yl as printSchema,Zr as printSourceLocation,du as printType,Ga as recommendedRules,dn as replaceVariables,Eu as resolveASTSchemaCoordinate,fi as resolveObjMapThunk,Do as resolveReadonlyArrayThunk,up as resolveSchemaCoordinate,fe as responsePathAsArray,ep as separateOperations,je as specifiedDirectives,xs as specifiedRules,Ct as specifiedScalarTypes,np as stripIgnoredCharacters,Pr as subscribe,de as syntaxError,Te as typeFromAST,Lr as validate,fr as validateExecutionArgs,xn as validateInputLiteral,Zn as validateInputValue,Di as validateSchema,ou as validateSubscriptionArgs,Pn as valueFromAST,Wt as valueFromASTUntyped,zt as valueToLiteral,Nf as version,ro as versionInfo,ft as visit,ui as visitInParallel,xr as visitWithTypeInfo};
diff --git a/vendor/deps.ts b/vendor/deps.ts
new file mode 100644
index 0000000..d5388e3
--- /dev/null
+++ b/vendor/deps.ts
@@ -0,0 +1,5 @@
+// deps.ts — re-export exactly what gq imports (grep gq's source for "npm:")
+export * from "graphql";
+export { makeExecutableSchema } from "@graphql-tools/schema";
+export { makeServer } from "graphql-ws";
+export type { ServerOptions } from "graphql-ws";
diff --git a/vendor/package.json b/vendor/package.json
new file mode 100644
index 0000000..fa27fca
--- /dev/null
+++ b/vendor/package.json
@@ -0,0 +1,16 @@
+{
+ "dependencies": {},
+ "devDependencies": {
+ "@graphql-tools/schema": "^11.0.4",
+ "dts-bundle-generator": "^9.5.1",
+ "graphql": "^17.0.2",
+ "graphql-ws": "^6.4.1",
+ "typescript": "^6"
+ },
+ "overrides": {
+ "typescript": "^6.0.3"
+ },
+ "scripts": {
+ "build": "bun build deps.ts --format=esm --target=browser --minify --define process.env.NODE_ENV=\"'production'\" --banner '// @ts-self-types=\"./deps.d.ts\"' --outfile=deps.js && dts-bundle-generator --export-referenced-types=false -o deps.d.ts --external-inlines graphql @graphql-tools/schema @graphql-tools/utils graphql-ws -- deps.ts"
+ }
+}
diff --git a/vendor/tsconfig.json b/vendor/tsconfig.json
new file mode 100644
index 0000000..10148a6
--- /dev/null
+++ b/vendor/tsconfig.json
@@ -0,0 +1,12 @@
+{
+ "compilerOptions": {
+ "declaration": true,
+ "lib": ["esnext", "webworker"],
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "skipLibCheck": true,
+ "strict": true,
+ "target": "esnext"
+ },
+ "files": ["deps.ts"]
+}