{"version":3,"file":"villus.esm.f1f69703.js","sources":["../../../node_modules/graphql/jsutils/devAssert.mjs","../../../node_modules/graphql/jsutils/isObjectLike.mjs","../../../node_modules/graphql/jsutils/invariant.mjs","../../../node_modules/graphql/language/location.mjs","../../../node_modules/graphql/language/printLocation.mjs","../../../node_modules/graphql/error/GraphQLError.mjs","../../../node_modules/graphql/language/ast.mjs","../../../node_modules/graphql/language/kinds.mjs","../../../node_modules/graphql/language/characterClasses.mjs","../../../node_modules/graphql/language/blockString.mjs","../../../node_modules/graphql/jsutils/inspect.mjs","../../../node_modules/graphql/language/printString.mjs","../../../node_modules/graphql/language/visitor.mjs","../../../node_modules/graphql/language/printer.mjs","../../../node_modules/villus/dist/villus.esm.js"],"sourcesContent":["export function devAssert(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport function isObjectLike(value) {\n return typeof value == 'object' && value !== null;\n}\n","export function invariant(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(\n message != null ? message : 'Unexpected invariant triggered.',\n );\n }\n}\n","import { invariant } from '../jsutils/invariant.mjs';\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}\n","import { getLocation } from './location.mjs';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\nexport function printLocation(location) {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines = [];\n\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines.slice(1, subLineIndex + 1).map((subLine) => ['|', subLine]),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(lines) {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n","import { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { getLocation } from '../language/location.mjs';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.mjs';\n\nfunction toNormalizedOptions(args) {\n const firstArg = args[0];\n\n if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {\n return {\n nodes: firstArg,\n source: args[1],\n positions: args[2],\n path: args[3],\n originalError: args[4],\n extensions: args[5],\n };\n }\n\n return firstArg;\n}\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n\n /**\n * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.\n */\n constructor(message, ...rawArgs) {\n var _this$nodes, _nodeLocations$, _ref;\n\n const { nodes, source, positions, path, originalError, extensions } =\n toNormalizedOptions(rawArgs);\n super(message);\n this.name = 'GraphQLError';\n this.path = path !== null && path !== void 0 ? path : undefined;\n this.originalError =\n originalError !== null && originalError !== void 0\n ? originalError\n : undefined; // Compute list of blame nodes.\n\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n const nodeLocations = undefinedIfEmpty(\n (_this$nodes = this.nodes) === null || _this$nodes === void 0\n ? void 0\n : _this$nodes.map((node) => node.loc).filter((loc) => loc != null),\n ); // Compute locations in the source for the given nodes/positions.\n\n this.source =\n source !== null && source !== void 0\n ? source\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : (_nodeLocations$ = nodeLocations[0]) === null ||\n _nodeLocations$ === void 0\n ? void 0\n : _nodeLocations$.source;\n this.positions =\n positions !== null && positions !== void 0\n ? positions\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => loc.start);\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => getLocation(loc.source, loc.start));\n const originalExtensions = isObjectLike(\n originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions,\n )\n ? originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions\n : undefined;\n this.extensions =\n (_ref =\n extensions !== null && extensions !== void 0\n ? extensions\n : originalExtensions) !== null && _ref !== void 0\n ? _ref\n : Object.create(null); // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: {\n enumerable: false,\n },\n nodes: {\n enumerable: false,\n },\n source: {\n enumerable: false,\n },\n positions: {\n enumerable: false,\n },\n originalError: {\n enumerable: false,\n },\n }); // Include (non-enumerable) stack trace.\n\n /* c8 ignore start */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n\n if (\n originalError !== null &&\n originalError !== void 0 &&\n originalError.stack\n ) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n /* c8 ignore stop */\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLError';\n }\n\n toString() {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n toJSON() {\n const formattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * See: https://spec.graphql.org/draft/#sec-Errors\n */\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n *\n * @deprecated Please use `error.toString` instead. Will be removed in v17\n */\nexport function printError(error) {\n return error.toString();\n}\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n *\n * @deprecated Please use `error.toJSON` instead. Will be removed in v17\n */\n\nexport function formatError(error) {\n return error.toJSON();\n}\n","/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n constructor(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n get [Symbol.toStringTag]() {\n return 'Location';\n }\n\n toJSON() {\n return {\n start: this.start,\n end: this.end,\n };\n }\n}\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport class Token {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'Token';\n }\n\n toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n/**\n * The list of all possible AST node types.\n */\n\n/**\n * @internal\n */\nexport const QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: [\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'name', // Note: fragment variable definitions are deprecated and will removed in v17.0.0\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n};\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n const maybeKind =\n maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n/** Name */\n\nvar OperationTypeNode;\n\n(function (OperationTypeNode) {\n OperationTypeNode['QUERY'] = 'query';\n OperationTypeNode['MUTATION'] = 'mutation';\n OperationTypeNode['SUBSCRIPTION'] = 'subscription';\n})(OperationTypeNode || (OperationTypeNode = {}));\n\nexport { OperationTypeNode };\n","/**\n * The set of allowed kind values for AST nodes.\n */\nvar Kind;\n\n(function (Kind) {\n Kind['NAME'] = 'Name';\n Kind['DOCUMENT'] = 'Document';\n Kind['OPERATION_DEFINITION'] = 'OperationDefinition';\n Kind['VARIABLE_DEFINITION'] = 'VariableDefinition';\n Kind['SELECTION_SET'] = 'SelectionSet';\n Kind['FIELD'] = 'Field';\n Kind['ARGUMENT'] = 'Argument';\n Kind['FRAGMENT_SPREAD'] = 'FragmentSpread';\n Kind['INLINE_FRAGMENT'] = 'InlineFragment';\n Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition';\n Kind['VARIABLE'] = 'Variable';\n Kind['INT'] = 'IntValue';\n Kind['FLOAT'] = 'FloatValue';\n Kind['STRING'] = 'StringValue';\n Kind['BOOLEAN'] = 'BooleanValue';\n Kind['NULL'] = 'NullValue';\n Kind['ENUM'] = 'EnumValue';\n Kind['LIST'] = 'ListValue';\n Kind['OBJECT'] = 'ObjectValue';\n Kind['OBJECT_FIELD'] = 'ObjectField';\n Kind['DIRECTIVE'] = 'Directive';\n Kind['NAMED_TYPE'] = 'NamedType';\n Kind['LIST_TYPE'] = 'ListType';\n Kind['NON_NULL_TYPE'] = 'NonNullType';\n Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition';\n Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition';\n Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition';\n Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition';\n Kind['FIELD_DEFINITION'] = 'FieldDefinition';\n Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition';\n Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition';\n Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition';\n Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition';\n Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition';\n Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition';\n Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition';\n Kind['SCHEMA_EXTENSION'] = 'SchemaExtension';\n Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension';\n Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension';\n Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension';\n Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension';\n Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';\n Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';\n})(Kind || (Kind = {}));\n\nexport { Kind };\n/**\n * The enum type representing the possible kind values of AST nodes.\n *\n * @deprecated Please use `Kind`. Will be remove in v17.\n */\n","/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code) {\n return code === 0x0009 || code === 0x0020;\n}\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\n\nexport function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\n\nexport function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameContinue(code) {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n","import { isWhiteSpace } from './characterClasses.mjs';\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\n\nexport function dedentBlockStringLines(lines) {\n var _firstNonEmptyLine2;\n\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n var _firstNonEmptyLine;\n\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine =\n (_firstNonEmptyLine = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine !== void 0\n ? _firstNonEmptyLine\n : i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return lines // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) // Remove leading and trailing blank lines.\n .slice(\n (_firstNonEmptyLine2 = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine2 !== void 0\n ? _firstNonEmptyLine2\n : 0,\n lastNonEmptyLine + 1,\n );\n}\n\nfunction leadingWhitespace(str) {\n let i = 0;\n\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n\n return i;\n}\n/**\n * @internal\n */\n\nexport function isPrintableAsBlockString(value) {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false;\n // Has non-printable characters\n\n case 0x000d:\n // \\r\n return false;\n // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10:\n // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n\n seenNonEmptyLine = true;\n isEmptyLine = true;\n hasIndent = false;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n hasIndent || (hasIndent = isEmptyLine);\n break;\n\n default:\n hasCommonIndent && (hasCommonIndent = hasIndent);\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value, options) {\n const escapedValue = value.replace(/\"\"\"/g, '\\\\\"\"\"'); // Expand a block string's raw value into independent lines.\n\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line\n\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line\n\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"'); // Trailing quote (single or double) or slash forces trailing new line\n\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n const printAsMultipleLines =\n !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n let result = ''; // Format a multi-line block quote to account for leading space.\n\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n","const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n\n case 'object':\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON(); // check for infinite recursion\n\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value) {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(object, seenValues) {\n const entries = Object.entries(object);\n\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object) {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n */\nexport function printString(str) {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n} // eslint-disable-next-line no-control-regex\n\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str) {\n return escapeSequences[str.charCodeAt(0)];\n} // prettier-ignore\n\nconst escapeSequences = [\n '\\\\u0000',\n '\\\\u0001',\n '\\\\u0002',\n '\\\\u0003',\n '\\\\u0004',\n '\\\\u0005',\n '\\\\u0006',\n '\\\\u0007',\n '\\\\b',\n '\\\\t',\n '\\\\n',\n '\\\\u000B',\n '\\\\f',\n '\\\\r',\n '\\\\u000E',\n '\\\\u000F',\n '\\\\u0010',\n '\\\\u0011',\n '\\\\u0012',\n '\\\\u0013',\n '\\\\u0014',\n '\\\\u0015',\n '\\\\u0016',\n '\\\\u0017',\n '\\\\u0018',\n '\\\\u0019',\n '\\\\u001A',\n '\\\\u001B',\n '\\\\u001C',\n '\\\\u001D',\n '\\\\u001E',\n '\\\\u001F',\n '',\n '',\n '\\\\\"',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 2F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 3F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 4F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\\\\\',\n '',\n '',\n '', // 5F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 6F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\u007F',\n '\\\\u0080',\n '\\\\u0081',\n '\\\\u0082',\n '\\\\u0083',\n '\\\\u0084',\n '\\\\u0085',\n '\\\\u0086',\n '\\\\u0087',\n '\\\\u0088',\n '\\\\u0089',\n '\\\\u008A',\n '\\\\u008B',\n '\\\\u008C',\n '\\\\u008D',\n '\\\\u008E',\n '\\\\u008F',\n '\\\\u0090',\n '\\\\u0091',\n '\\\\u0092',\n '\\\\u0093',\n '\\\\u0094',\n '\\\\u0095',\n '\\\\u0096',\n '\\\\u0097',\n '\\\\u0098',\n '\\\\u0099',\n '\\\\u009A',\n '\\\\u009B',\n '\\\\u009C',\n '\\\\u009D',\n '\\\\u009E',\n '\\\\u009F',\n];\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = Object.defineProperties(\n {},\n Object.getOwnPropertyDescriptors(node),\n );\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n","import { printBlockString } from './blockString.mjs';\nimport { printString } from './printString.mjs';\nimport { visit } from './visitor.mjs';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, printDocASTReducer);\n}\nconst MAX_LINE_LENGTH = 80;\nconst printDocASTReducer = {\n Name: {\n leave: (node) => node.value,\n },\n Variable: {\n leave: (node) => '$' + node.name,\n },\n // Document\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n OperationDefinition: {\n leave(node) {\n const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix = join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n ); // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives }) =>\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: {\n leave: ({ selections }) => block(selections),\n },\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = wrap('', alias, ': ') + name;\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n },\n Argument: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Fragments\n FragmentSpread: {\n leave: ({ name, directives }) =>\n '...' + name + wrap(' ', join(directives, ' ')),\n },\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n FragmentDefinition: {\n leave: (\n { name, typeCondition, variableDefinitions, directives, selectionSet }, // Note: fragment variable definitions are experimental and may be changed\n ) =>\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n // Value\n IntValue: {\n leave: ({ value }) => value,\n },\n FloatValue: {\n leave: ({ value }) => value,\n },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString ? printBlockString(value) : printString(value),\n },\n BooleanValue: {\n leave: ({ value }) => (value ? 'true' : 'false'),\n },\n NullValue: {\n leave: () => 'null',\n },\n EnumValue: {\n leave: ({ value }) => value,\n },\n ListValue: {\n leave: ({ values }) => '[' + join(values, ', ') + ']',\n },\n ObjectValue: {\n leave: ({ fields }) => '{' + join(fields, ', ') + '}',\n },\n ObjectField: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Directive\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n // Type\n NamedType: {\n leave: ({ name }) => name,\n },\n ListType: {\n leave: ({ type }) => '[' + type + ']',\n },\n NonNullType: {\n leave: ({ type }) => type + '!',\n },\n // Type System Definitions\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n DirectiveDefinition: {\n leave: ({ description, name, arguments: args, repeatable, locations }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n};\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\nfunction join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n */\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\nfunction wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray) {\n var _maybeArray$some;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n return (_maybeArray$some =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.some((str) => str.includes('\\n'))) !== null &&\n _maybeArray$some !== void 0\n ? _maybeArray$some\n : false;\n}\n","/**\n * villus v3.5.1\n * (c) 2024 Abdelrahman Awad\n * @license MIT\n */\nimport { isRef, toValue, isReactive, nextTick, getCurrentInstance, inject, provide, onBeforeUnmount, ref, watch, onMounted, computed } from 'vue';\nimport { GraphQLError, print } from 'graphql';\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar fastJsonStableStringify = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n\nvar stringify = /*@__PURE__*/getDefaultExportFromCjs(fastJsonStableStringify);\n\nfunction unravel(signal, vars) {\n if (isRef(signal)) {\n return signal.value;\n }\n if (typeof signal === 'function') {\n return signal(toValue(vars));\n }\n return signal;\n}\nfunction isWatchable(val) {\n return isRef(val) || isReactive(val) || typeof val === 'function';\n}\nfunction arrayToExistHash(items) {\n return items.reduce((acc, item) => {\n acc[String(item)] = true;\n return acc;\n }, {});\n}\nfunction debounceAsync(inner) {\n let resolves = [];\n let ticking = false;\n return function (...args) {\n if (!ticking) {\n nextTick(() => {\n const result = inner(...args);\n resolves.forEach(r => r(result));\n resolves = [];\n ticking = false;\n });\n ticking = true;\n }\n return new Promise(resolve => resolves.push(resolve));\n };\n}\nfunction isEqual(lhs, rhs) {\n return stringify(lhs) === stringify(rhs);\n}\nfunction useCallback() {\n const hooks = new Set();\n function on(handler) {\n hooks.add(handler);\n return () => {\n hooks.delete(handler);\n };\n }\n async function run(...args) {\n for (const hook of hooks) {\n await hook(...args);\n }\n }\n return {\n on,\n run,\n };\n}\n\n// https://github.com/FormidableLabs/urql/blob/master/src/utils/error.ts\nconst generateErrorMessage = (networkError, graphqlErrors) => {\n let error = '';\n if (networkError !== undefined) {\n return (error = `[Network] ${networkError.message}`);\n }\n if (graphqlErrors !== undefined) {\n graphqlErrors.forEach(err => {\n error += `[GraphQL] ${err.message}\\n`;\n });\n }\n return error.trim();\n};\nfunction normalizeGqlError(error) {\n if (typeof error === 'string') {\n return new GraphQLError(error);\n }\n if (typeof error === 'object' && error.message) {\n return new GraphQLError(error.message, error.nodes, error.source, error.positions, error.path, error, error.extensions || {});\n }\n return error;\n}\nclass CombinedError extends Error {\n constructor({ response, networkError, graphqlErrors, }) {\n const gqlErrors = graphqlErrors === null || graphqlErrors === void 0 ? void 0 : graphqlErrors.map(normalizeGqlError);\n const message = generateErrorMessage(networkError, gqlErrors);\n super(message);\n this.name = 'CombinedError';\n this.response = response;\n this.message = message;\n this.networkError = networkError;\n this.graphqlErrors = gqlErrors;\n }\n get isGraphQLError() {\n return !!(this.graphqlErrors && this.graphqlErrors.length);\n }\n toString() {\n return this.message;\n }\n}\n\n/**\n * Normalizes a query string or object to a string.\n */\nfunction normalizeQuery(query) {\n if (typeof query === 'string') {\n return query;\n }\n // Supports typed document strings in 3.2\n if (query && query instanceof String) {\n return query.toString();\n }\n if (query && 'kind' in query) {\n return print(query);\n }\n return null;\n}\n\nasync function parseResponse(response) {\n let json;\n const responseData = {\n ok: response.ok,\n statusText: response.statusText,\n status: response.status,\n headers: response.headers,\n };\n try {\n json = await response.json();\n }\n catch (err) {\n return Object.assign(Object.assign({}, responseData), { statusText: err.message, body: null });\n }\n return Object.assign(Object.assign({}, responseData), { body: json });\n}\nfunction resolveGlobalFetch() {\n if (typeof window !== 'undefined' && 'fetch' in window && window.fetch) {\n return window.fetch.bind(window);\n }\n if (typeof global !== 'undefined' && 'fetch' in global) {\n return global.fetch;\n }\n if (typeof self !== 'undefined' && 'fetch' in self) {\n return self.fetch;\n }\n return undefined;\n}\nconst DEFAULT_FETCH_OPTS = {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n};\nfunction mergeFetchOpts(lhs, rhs) {\n return Object.assign(Object.assign(Object.assign({}, lhs), rhs), { method: rhs.method || lhs.method || DEFAULT_FETCH_OPTS.method, headers: Object.assign(Object.assign({}, (lhs.headers || {})), (rhs.headers || {})) });\n}\nfunction makeFetchOptions({ query, variables }, opts) {\n const normalizedQuery = normalizeQuery(query);\n if (!normalizedQuery) {\n throw new Error('A query must be provided.');\n }\n return mergeFetchOpts({ body: JSON.stringify({ query: normalizedQuery, variables }) }, opts);\n}\n\nfunction hash(x) {\n let h, i, l;\n for (h = 5381 | 0, i = 0, l = x.length | 0; i < l; i++) {\n h = (h << 5) + h + x.charCodeAt(i);\n }\n return h >>> 0;\n}\nfunction getQueryKey(operation, ...components) {\n const variables = operation.variables ? stringify(operation.variables) : '';\n const query = normalizeQuery(operation.query);\n return hash(`${query}${variables}${components.join('')}`);\n}\n\nfunction cache() {\n let resultCache = {};\n function setCacheResult({ key, tags }, result) {\n resultCache[key] = { result, tags };\n }\n function getCachedResult({ key }) {\n var _a;\n return (_a = resultCache[key]) === null || _a === void 0 ? void 0 : _a.result;\n }\n function clearCache(tags) {\n if (!tags) {\n resultCache = {};\n return;\n }\n const tagArray = Array.isArray(tags) ? tags : [tags];\n if (!tagArray.length) {\n return;\n }\n const tagsLookup = arrayToExistHash(tagArray);\n // clears cache keys one by one\n Object.keys(resultCache).forEach(key => {\n const cacheItem = resultCache[key];\n if (!cacheItem.tags) {\n return;\n }\n const tagExists = cacheItem.tags.some(t => tagsLookup[t]);\n if (tagExists) {\n delete resultCache[key];\n }\n });\n }\n function cachePlugin({ afterQuery, useResult, operation }) {\n var _a;\n if (operation.type === 'mutation' && ((_a = operation.clearCacheTags) === null || _a === void 0 ? void 0 : _a.length)) {\n afterQuery(result => {\n // only after successful operation\n if (result.data) {\n clearCache(operation.clearCacheTags);\n }\n });\n return;\n }\n if (operation.type !== 'query' || operation.cachePolicy === 'network-only') {\n return;\n }\n // Set the cache result after query is resolved\n afterQuery(result => {\n setCacheResult(operation, result);\n });\n // Get cached item\n const cachedResult = getCachedResult(operation);\n if (operation.cachePolicy === 'cache-only') {\n return useResult(cachedResult || { data: null, error: null }, true);\n }\n // if exists in cache, terminate with result\n if (cachedResult) {\n return useResult(cachedResult, operation.cachePolicy === 'cache-first');\n }\n }\n cachePlugin.clearCache = clearCache;\n return cachePlugin;\n}\n\nfunction fetch(opts) {\n const fetch = (opts === null || opts === void 0 ? void 0 : opts.fetch) || resolveGlobalFetch();\n if (!fetch) {\n throw new Error('Could not resolve a fetch() method, you should provide one.');\n }\n return async function fetchPlugin(ctx) {\n var _a, _b;\n const { useResult, opContext, operation } = ctx;\n const fetchOpts = makeFetchOptions(operation, opContext);\n let response;\n try {\n response = await fetch(opContext.url, fetchOpts).then(parseResponse);\n }\n catch (err) {\n return useResult({\n data: null,\n error: new CombinedError({ response, networkError: err }),\n }, true);\n }\n // Set the response on the context\n ctx.response = response;\n const data = (_a = response.body) === null || _a === void 0 ? void 0 : _a.data;\n if (!response.ok || !response.body) {\n // It is possible than a non-200 response is returned with errors, it should be treated as GraphQL error\n const ctorOptions = {\n response,\n };\n if ((_b = response.body) === null || _b === void 0 ? void 0 : _b.errors) {\n ctorOptions.graphqlErrors = response.body.errors;\n }\n else {\n ctorOptions.networkError = new Error(response.statusText);\n }\n return useResult({\n data,\n error: new CombinedError(ctorOptions),\n }, true);\n }\n useResult({\n data,\n error: response.body.errors ? new CombinedError({ response, graphqlErrors: response.body.errors }) : null,\n }, true);\n };\n}\n\nfunction dedup() {\n // Holds references to pending operations\n const pendingLookup = {};\n return function dedupPlugin(ctx) {\n // Don't dedup mutations or subscriptions\n if (ctx.operation.type !== 'query') {\n return;\n }\n // extract the original useResult function\n const { useResult } = ctx;\n // Clean up pending queries after they are resolved\n ctx.afterQuery(() => {\n delete pendingLookup[ctx.operation.key];\n });\n // If pending, re-route the result to it\n const existingOp = pendingLookup[ctx.operation.key];\n if (existingOp) {\n return existingOp.then(result => {\n useResult(result, true);\n });\n }\n // Hold a resolve fn reference\n let resolveOp;\n // Create a pending operation promise and add it to lookup\n pendingLookup[ctx.operation.key] = new Promise(resolve => {\n resolveOp = resolve;\n });\n // resolve the promise once the result are set via another plugin\n ctx.useResult = function (...args) {\n useResult(...args);\n resolveOp(args[0]);\n };\n };\n}\n\nconst VILLUS_CLIENT = Symbol('villus.client');\n\n/**\n * setActiveClient should be called to solve problem outside setup\n */\nlet activeClient;\n/**\n * Sets or unsets the active client\n *\n * @param client - villus client instance\n */\nconst setActiveClient = (client) => (activeClient = client);\n/**\n * Get the currently active client if there is any.\n */\nconst getActiveClient = () => {\n var _a;\n const vm = getCurrentInstance();\n if (!vm) {\n return activeClient;\n }\n return ((_a = vm.provides) === null || _a === void 0 ? void 0 : _a[VILLUS_CLIENT]) || inject(VILLUS_CLIENT, activeClient);\n};\nconst defaultPlugins = () => [cache(), dedup(), fetch()];\nclass Client {\n constructor(opts) {\n this.install = () => undefined;\n this.url = opts.url;\n this.defaultCachePolicy = opts.cachePolicy || 'cache-first';\n this.plugins = opts.use || [...defaultPlugins()];\n this.taggedQueries = [];\n }\n /**\n * Executes an operation and returns a normalized response.\n */\n async execute(operation, type, queryContext, onResultChanged) {\n let result;\n const opContext = Object.assign(Object.assign({ url: this.url }, DEFAULT_FETCH_OPTS), { headers: Object.assign(Object.assign({}, DEFAULT_FETCH_OPTS.headers), ((queryContext === null || queryContext === void 0 ? void 0 : queryContext.headers) || {})) });\n let terminateSignal = false;\n const afterQuery = [];\n const context = {\n useResult(pluginResult, terminate) {\n if (terminate) {\n terminateSignal = true;\n }\n // this means the `useResult` was called multiple times\n if (result) {\n onResultChanged === null || onResultChanged === void 0 ? void 0 : onResultChanged(pluginResult);\n }\n result = pluginResult;\n },\n afterQuery(cb) {\n afterQuery.push(cb);\n },\n operation: Object.assign(Object.assign({}, operation), { key: getQueryKey(operation), type, cachePolicy: ('cachePolicy' in operation ? operation.cachePolicy : this.defaultCachePolicy) || this.defaultCachePolicy }),\n opContext,\n };\n let lastI = 0;\n for (let i = 0; i < this.plugins.length; i++) {\n const plugin = this.plugins[i];\n await plugin(context);\n if (result) {\n lastI = i;\n break;\n }\n }\n return new Promise((resolve, reject) => {\n if (!result) {\n reject(new Error('Operation result was not set by any plugin, make sure you have default plugins configured or review documentation'));\n return;\n }\n resolve(result);\n (async () => {\n if (!terminateSignal) {\n for (let i = lastI + 1; i < this.plugins.length; i++) {\n const plugin = this.plugins[i];\n await plugin(context);\n }\n }\n const afterQueryCtx = { response: context.response };\n for (let i = 0; i < afterQuery.length; i++) {\n const afterCb = afterQuery[i];\n await afterCb(result, afterQueryCtx);\n }\n })();\n });\n }\n async executeQuery(operation, queryContext, onResultChanged) {\n return this.execute(operation, 'query', queryContext, onResultChanged);\n }\n async executeMutation(operation, queryContext) {\n return this.execute(operation, 'mutation', queryContext);\n }\n async executeSubscription(operation) {\n const result = await this.execute(operation, 'subscription');\n return result;\n }\n registerTaggedQuery(tags, refetch) {\n const id = Symbol('Tagged query');\n this.taggedQueries.push({ id, tags, refetch });\n return id;\n }\n unregisterTaggedQuery(id) {\n const idx = this.taggedQueries.findIndex(tq => tq.id === id);\n if (idx === -1) {\n return;\n }\n this.taggedQueries.splice(idx, 1);\n }\n async refetchTaggedQueries(tags) {\n const tagsLookup = arrayToExistHash(tags);\n const queries = this.taggedQueries.filter(tq => {\n return tq.tags.some(t => tagsLookup[t]);\n });\n return Promise.all(queries.map(q => q.refetch())).then(() => undefined);\n }\n}\nfunction createClient(opts) {\n const client = new Client(opts);\n client.install = (app) => {\n // this allows useQuery() etc useFunctions to get client outside of a component setup after\n setActiveClient(client);\n app.provide(VILLUS_CLIENT, client);\n };\n return client;\n}\nfunction resolveInternalInjection(vm, symbol) {\n var _a, _b, _c, _d;\n // Vue 2 uses `proxy._provided` while Vue 3 has `provides`\n // Vue 2.7's proxy property might be a bug but thats the IRL situation.\n return ((_b = (_a = vm === null || vm === void 0 ? void 0 : vm.proxy) === null || _a === void 0 ? void 0 : _a._provided) === null || _b === void 0 ? void 0 : _b[symbol]) || ((_c = vm === null || vm === void 0 ? void 0 : vm._provided) === null || _c === void 0 ? void 0 : _c[symbol]) || ((_d = vm === null || vm === void 0 ? void 0 : vm.provides) === null || _d === void 0 ? void 0 : _d[symbol]);\n}\nfunction resolveClient() {\n const vm = getCurrentInstance();\n // Uses same component provide as its own injections\n // Due to changes in https://github.com/vuejs/vue-next/pull/2424\n let client = vm && inject(VILLUS_CLIENT, resolveInternalInjection(vm, VILLUS_CLIENT));\n if (client)\n setActiveClient(client);\n client = getActiveClient();\n if (client === null || client === undefined) {\n throw new Error('Cannot detect villus Client, did you forget to call `useClient`? Alternatively, you can explicitly pass a client as the `manualClient` argument.');\n }\n return client;\n}\n\nfunction useClient(opts) {\n const client = createClient(opts);\n if (getCurrentInstance()) {\n provide(VILLUS_CLIENT, client);\n }\n return client;\n}\n\nconst defaultMapper = (val) => val.data;\nfunction useQuery(opts, mapData = defaultMapper) {\n var _a;\n const client = (_a = opts === null || opts === void 0 ? void 0 : opts.client) !== null && _a !== void 0 ? _a : resolveClient();\n if (opts.tags) {\n const id = client.registerTaggedQuery(opts.tags, async () => {\n await execute();\n });\n onBeforeUnmount(() => {\n client.unregisterTaggedQuery(id);\n });\n }\n const { query, variables, cachePolicy, fetchOnMount, paused, skip, onData: dataHook, onError: errorHook, } = normalizeOptions(opts);\n let currentFetchOnMount = fetchOnMount;\n const data = ref(defaultMapper({ data: null, error: null }));\n let lastResult = { data: null, error: null };\n const isFetching = ref(fetchOnMount !== null && fetchOnMount !== void 0 ? fetchOnMount : false);\n const isDone = ref(false);\n const isStale = ref(true);\n const error = ref(null);\n const { on: onData, run: executeDataHooks } = useCallback();\n const { on: onError, run: executeErrorHooks } = useCallback();\n if (dataHook) {\n onData(dataHook);\n }\n if (errorHook) {\n onError(errorHook);\n }\n // This is to prevent state mutation for racing requests, basically favoring the very last one\n let lastPendingOperation;\n const isCurrentlyPaused = () => unravel(paused, (variables || {}));\n function onResultChanged(result) {\n if (result.data) {\n executeDataHooks(result.data);\n }\n if (result.error) {\n executeErrorHooks(result.error);\n }\n data.value = mapData(result);\n error.value = result.error;\n }\n async function execute(overrideOpts) {\n const vars = toValue(variables) || {};\n // result won't change if execution is skipped\n if (unravel(skip, vars)) {\n isFetching.value = false;\n return {\n data: (lastResult === null || lastResult === void 0 ? void 0 : lastResult.data) || null,\n error: (lastResult === null || lastResult === void 0 ? void 0 : lastResult.error) || null,\n };\n }\n isFetching.value = true;\n const pendingExecution = client.executeQuery({\n query: toValue(query),\n variables: toValue((overrideOpts === null || overrideOpts === void 0 ? void 0 : overrideOpts.variables) || vars),\n cachePolicy: (overrideOpts === null || overrideOpts === void 0 ? void 0 : overrideOpts.cachePolicy) || cachePolicy,\n tags: opts === null || opts === void 0 ? void 0 : opts.tags,\n }, toValue(opts === null || opts === void 0 ? void 0 : opts.context), onResultChanged);\n lastPendingOperation = pendingExecution;\n const res = await pendingExecution;\n // Avoid state mutation if the pendingExecution isn't the last pending operation\n if (pendingExecution !== lastPendingOperation) {\n // we still return this result to preserve the integrity of \"execute\" calls\n return { data: res.data, error: res.error };\n }\n lastResult = res;\n onResultChanged(res);\n isDone.value = true;\n isFetching.value = false;\n isStale.value = false;\n lastPendingOperation = undefined;\n return { data: res.data, error: res.error };\n }\n function executeIfNotPaused() {\n const isPaused = isCurrentlyPaused();\n if (!isPaused) {\n execute();\n }\n }\n if (isWatchable(query)) {\n watch(query, executeIfNotPaused);\n }\n if (isWatchable(paused)) {\n watch(() => !isCurrentlyPaused(), shouldExecute => {\n if (shouldExecute && isStale.value) {\n execute();\n }\n });\n }\n function initVarWatchers() {\n let oldCache;\n if (!variables || !isWatchable(variables)) {\n return;\n }\n watch(() => toValue(variables), newValue => {\n const id = hash(stringify(newValue));\n // prevents duplicate queries.\n if (id === oldCache) {\n return;\n }\n oldCache = id;\n isStale.value = true;\n executeIfNotPaused();\n }, { deep: true });\n }\n initVarWatchers();\n const api = { data, isFetching, isDone, error, execute, onData, onError };\n /**\n * if can not getCurrentInstance, the func use outside of setup, cannot get onMounted\n * when outside of setup and fetchOnMount is true, execute immediately, but a little confused\n * todo: maybe better to add a new param decide execute immediately, but it's ok also now\n */\n const vm = getCurrentInstance();\n if (currentFetchOnMount) {\n if (!paused || !isCurrentlyPaused()) {\n vm ? onMounted(() => execute()) : execute();\n }\n }\n return Object.assign(Object.assign({}, api), { async then(onFulfilled) {\n currentFetchOnMount = false;\n await api.execute();\n return onFulfilled(api);\n } });\n}\nfunction normalizeOptions(opts) {\n const defaultOpts = {\n variables: {},\n fetchOnMount: true,\n };\n return Object.assign(Object.assign(Object.assign({}, defaultOpts), opts), { query: opts.query });\n}\n\nfunction useMutation(query, opts) {\n var _a;\n const client = (_a = opts === null || opts === void 0 ? void 0 : opts.client) !== null && _a !== void 0 ? _a : resolveClient();\n const data = ref(null);\n const isFetching = ref(false);\n const isDone = ref(false);\n const error = ref(null);\n // This is to prevent state mutation for racing requests, basically favoring the very last one\n let lastPendingOperation;\n async function execute(variables) {\n var _a, _b;\n isFetching.value = true;\n const vars = variables || {};\n const pendingExecution = client.executeMutation({\n query,\n variables: vars, // FIXME: fix this casting\n clearCacheTags: [...((opts === null || opts === void 0 ? void 0 : opts.clearCacheTags) || []), ...((opts === null || opts === void 0 ? void 0 : opts.refetchTags) || [])],\n }, toValue(opts === null || opts === void 0 ? void 0 : opts.context));\n lastPendingOperation = pendingExecution;\n const res = await pendingExecution;\n nextTick(() => {\n if (opts === null || opts === void 0 ? void 0 : opts.refetchTags) {\n client.refetchTaggedQueries(opts.refetchTags);\n }\n });\n // Avoid state mutation if the pendingExecution isn't the last pending operation\n if (pendingExecution !== lastPendingOperation) {\n // we still return this result to preserve the integrity of \"execute\" calls\n return { data: res.data, error: res.error };\n }\n if (res.data)\n (_a = opts === null || opts === void 0 ? void 0 : opts.onData) === null || _a === void 0 ? void 0 : _a.call(opts, res.data);\n if (res.error)\n (_b = opts === null || opts === void 0 ? void 0 : opts.onError) === null || _b === void 0 ? void 0 : _b.call(opts, res.error);\n data.value = res.data;\n error.value = res.error;\n isDone.value = true;\n isFetching.value = false;\n lastPendingOperation = undefined;\n return { data: data.value, error: error.value };\n }\n return { data, isFetching, isDone, error, execute };\n}\n\nconst defaultReducer = val => val.data;\nfunction useSubscription(opts, reduce = defaultReducer) {\n var _a, _b, _c, _d;\n const client = (_a = opts.client) !== null && _a !== void 0 ? _a : resolveClient();\n const { query, variables, paused, skip } = opts;\n const subscribeOnMount = (_b = opts.subscribeOnMount) !== null && _b !== void 0 ? _b : true;\n const unsubscribeOnUnmount = (_c = opts.unsubscribeOnUnmount) !== null && _c !== void 0 ? _c : true;\n const data = ref((_d = opts === null || opts === void 0 ? void 0 : opts.initialData) !== null && _d !== void 0 ? _d : reduce({ data: null, error: null }, null));\n const error = ref(null);\n const isPaused = computed(() => unravel(paused, variables));\n const isFetching = ref(true);\n function handleResponse(result) {\n data.value = reduce(result, data.value);\n error.value = result.error;\n }\n /**\n * if can not getCurrentInstance, the func use outside of setup, cannot get onMounted\n * when outside of setup initObserver immediately.\n */\n let observer;\n const subscribe = debounceAsync(async function subscribe() {\n unsubscribe();\n if (shouldSkip()) {\n return;\n }\n isFetching.value = true;\n const result = await client.executeSubscription({\n query: toValue(query),\n variables: toValue(variables),\n });\n observer = result.subscribe({\n next(result) {\n if (isPaused.value) {\n return;\n }\n const response = transformResult(result);\n isFetching.value = false;\n handleResponse(response);\n },\n complete() { },\n error(err) {\n if (isPaused.value) {\n return;\n }\n const response = { data: null, error: new CombinedError({ networkError: err, response: null }) };\n isFetching.value = false;\n return handleResponse(response);\n },\n });\n return observer;\n });\n function unsubscribe() {\n observer === null || observer === void 0 ? void 0 : observer.unsubscribe();\n observer = undefined;\n }\n const vm = getCurrentInstance();\n if (!isPaused.value && !shouldSkip() && subscribeOnMount) {\n vm ? onMounted(subscribe) : subscribe();\n }\n if (vm && unsubscribeOnUnmount) {\n // TODO: if outside of setup, it should be recommend manually pause it(or some action else)\n onBeforeUnmount(unsubscribe);\n }\n function shouldSkip() {\n return unravel(skip, toValue(variables) || {});\n }\n if (isWatchable(paused)) {\n watch(paused, val => {\n if (!val) {\n subscribe();\n }\n });\n }\n if (isWatchable(query)) {\n watch(query, subscribe);\n }\n if (isWatchable(variables)) {\n watch(variables, (value, oldValue) => {\n if (!isEqual(value, oldValue)) {\n subscribe();\n }\n });\n }\n if (isWatchable(skip)) {\n watch(shouldSkip, (value, oldValue) => {\n if (value === oldValue) {\n return;\n }\n value ? unsubscribe() : subscribe();\n });\n }\n function isSubscribed() {\n return !!observer;\n }\n return {\n data,\n error,\n paused: isPaused,\n isFetching,\n subscribe: () => {\n subscribe();\n },\n unsubscribe,\n isSubscribed,\n };\n}\n/**\n * Transforms the result from a standard operation result to villus result\n */\nfunction transformResult(result) {\n if (!result.errors) {\n return { data: result.data || null, error: null };\n }\n return {\n data: result.data || null,\n error: new CombinedError({ graphqlErrors: [...result.errors], response: null }),\n };\n}\n\nfunction handleSubscriptions(forwarder) {\n const forward = forwarder;\n return async function subscriptionsHandlerPlugin({ operation, useResult }) {\n if (operation.type !== 'subscription') {\n return;\n }\n if (!forward) {\n throw new Error('No subscription forwarder was set.');\n }\n const normalizedQuery = normalizeQuery(operation.query);\n if (!normalizedQuery) {\n throw new Error('A query must be provided.');\n }\n const result = await forward(Object.assign(Object.assign({}, operation), { query: normalizedQuery }));\n useResult(result, true);\n };\n}\n\nfunction definePlugin(fn) {\n return fn;\n}\n\nexport { Client, CombinedError, VILLUS_CLIENT, cache, createClient, dedup, defaultPlugins, definePlugin, fetch, getActiveClient, getQueryKey, handleSubscriptions, makeFetchOptions, mergeFetchOpts, normalizeQuery, parseResponse, setActiveClient, useClient, useMutation, useQuery, useSubscription };\n"],"names":["devAssert","condition","message","isObjectLike","value","invariant","LineRegExp","getLocation","source","position","lastLineStart","line","match","printLocation","location","printSourceLocation","sourceLocation","firstLineColumnOffset","body","lineIndex","lineOffset","lineNum","columnOffset","columnNum","locationStr","lines","locationLine","subLineIndex","subLineColumnNum","subLines","i","printPrefixedLines","subLine","existingLines","_","padLen","prefix","toNormalizedOptions","args","firstArg","GraphQLError","rawArgs","_this$nodes","_nodeLocations$","_ref","nodes","positions","path","originalError","extensions","undefinedIfEmpty","nodeLocations","node","loc","pos","originalExtensions","output","formattedError","array","Location","startToken","endToken","Token","kind","start","end","column","QueryDocumentKeys","kindValues","isNode","maybeNode","maybeKind","OperationTypeNode","Kind","isWhiteSpace","code","isDigit","isLetter","isNameStart","isNameContinue","dedentBlockStringLines","_firstNonEmptyLine2","commonIndent","firstNonEmptyLine","lastNonEmptyLine","_firstNonEmptyLine","indent","leadingWhitespace","str","printBlockString","options","escapedValue","isSingleLine","forceLeadingNewLine","hasTrailingTripleQuotes","hasTrailingQuote","hasTrailingSlash","forceTrailingNewline","printAsMultipleLines","result","skipLeadingNewLine","MAX_ARRAY_LENGTH","MAX_RECURSIVE_DEPTH","inspect","formatValue","seenValues","formatObjectValue","previouslySeenValues","isJSONable","jsonValue","formatArray","formatObject","object","entries","getObjectTag","properties","key","len","remaining","items","tag","name","printString","escapedRegExp","escapedReplacer","escapeSequences","BREAK","visit","root","visitor","visitorKeys","enterLeaveMap","getEnterLeaveForKind","stack","inArray","keys","index","edits","parent","ancestors","isLeaving","isEdited","editOffset","editKey","editValue","arrayKey","_enterLeaveMap$get","_enterLeaveMap$get2","visitFn","_node$kind","kindVisitor","print","ast","printDocASTReducer","MAX_LINE_LENGTH","join","varDefs","wrap","variable","type","defaultValue","directives","selections","block","alias","selectionSet","argsLine","typeCondition","variableDefinitions","isBlockString","values","fields","description","operationTypes","operation","interfaces","hasMultilineItems","types","repeatable","locations","maybeArray","separator","_maybeArray$filter$jo","x","maybeString","_maybeArray$some","getDefaultExportFromCjs","fastJsonStableStringify","data","opts","cycles","cmp","f","a","b","aobj","bobj","seen","stringify","out","seenIndex","unravel","signal","vars","isRef","toValue","isWatchable","val","isReactive","arrayToExistHash","acc","item","useCallback","hooks","on","handler","run","hook","generateErrorMessage","networkError","graphqlErrors","error","err","normalizeGqlError","CombinedError","response","gqlErrors","normalizeQuery","query","parseResponse","json","responseData","resolveGlobalFetch","DEFAULT_FETCH_OPTS","mergeFetchOpts","lhs","rhs","makeFetchOptions","variables","normalizedQuery","hash","h","l","getQueryKey","components","cache","resultCache","setCacheResult","tags","getCachedResult","_a","clearCache","tagArray","tagsLookup","cacheItem","t","cachePlugin","afterQuery","useResult","cachedResult","fetch","ctx","_b","opContext","fetchOpts","ctorOptions","dedup","pendingLookup","existingOp","resolveOp","resolve","VILLUS_CLIENT","activeClient","setActiveClient","client","getActiveClient","vm","getCurrentInstance","inject","defaultPlugins","Client","queryContext","onResultChanged","terminateSignal","context","pluginResult","terminate","cb","lastI","plugin","reject","afterQueryCtx","afterCb","refetch","id","idx","tq","queries","q","createClient","app","resolveInternalInjection","symbol","_c","_d","resolveClient","defaultMapper","useQuery","mapData","execute","onBeforeUnmount","cachePolicy","fetchOnMount","paused","skip","dataHook","errorHook","normalizeOptions","currentFetchOnMount","ref","lastResult","isFetching","isDone","isStale","onData","executeDataHooks","onError","executeErrorHooks","lastPendingOperation","isCurrentlyPaused","overrideOpts","pendingExecution","res","executeIfNotPaused","watch","shouldExecute","initVarWatchers","oldCache","newValue","api","onMounted","onFulfilled"],"mappings":";;qGAAO,SAASA,GAAUC,EAAWC,EAAS,CAG5C,GAAI,CAFqB,QAAQD,CAAS,EAGxC,MAAM,IAAI,MAAMC,CAAO,CAE3B,CCFO,SAASC,GAAaC,EAAO,CAClC,OAAO,OAAOA,GAAS,UAAYA,IAAU,IAC/C,CCNO,SAASC,GAAUJ,EAAWC,EAAS,CAG5C,GAAI,CAFqB,QAAQD,CAAS,EAGxC,MAAM,IAAI,MACRC,GAAW,KAAOA,EAAU,iCAClC,CAEA,CCPA,MAAMI,GAAa,eASZ,SAASC,EAAYC,EAAQC,EAAU,CAC5C,IAAIC,EAAgB,EAChBC,EAAO,EAEX,UAAWC,KAASJ,EAAO,KAAK,SAASF,EAAU,EAAG,CAGpD,GAFA,OAAOM,EAAM,OAAU,UAAYP,GAAU,EAAK,EAE9CO,EAAM,OAASH,EACjB,MAGFC,EAAgBE,EAAM,MAAQA,EAAM,GAAG,OACvCD,GAAQ,CACT,CAED,MAAO,CACL,KAAAA,EACA,OAAQF,EAAW,EAAIC,CAC3B,CACA,CCxBO,SAASG,GAAcC,EAAU,CACtC,OAAOC,GACLD,EAAS,OACTP,EAAYO,EAAS,OAAQA,EAAS,KAAK,CAC/C,CACA,CAKO,SAASC,GAAoBP,EAAQQ,EAAgB,CAC1D,MAAMC,EAAwBT,EAAO,eAAe,OAAS,EACvDU,EAAO,GAAG,SAASD,CAAqB,EAAIT,EAAO,KACnDW,EAAYH,EAAe,KAAO,EAClCI,EAAaZ,EAAO,eAAe,KAAO,EAC1Ca,EAAUL,EAAe,KAAOI,EAChCE,EAAeN,EAAe,OAAS,EAAIC,EAAwB,EACnEM,EAAYP,EAAe,OAASM,EACpCE,EAAc,GAAGhB,EAAO,QAAQa,KAAWE;AAAA,EAC3CE,EAAQP,EAAK,MAAM,cAAc,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,MACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,GACA,GACA,MACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,OACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACF,ECtKaC,GAAQ,OAAO,OAAO,CAAA,CAAE,EAgF9B,SAASC,GAAMC,EAAMC,EAASC,EAAc/D,GAAmB,CACpE,MAAMgE,EAAgB,IAAI,IAE1B,UAAWpE,KAAQ,OAAO,OAAOU,CAAI,EACnC0D,EAAc,IAAIpE,EAAMqE,GAAqBH,EAASlE,CAAI,CAAC,EAI7D,IAAIsE,EACAC,EAAU,MAAM,QAAQN,CAAI,EAC5BO,EAAO,CAACP,CAAI,EACZQ,EAAQ,GACRC,EAAQ,CAAA,EACRrF,EAAO4E,EACPZ,EACAsB,EACJ,MAAM3F,EAAO,CAAA,EACP4F,EAAY,CAAA,EAGlB,EAAG,CACDH,IACA,MAAMI,EAAYJ,IAAUD,EAAK,OAC3BM,EAAWD,GAAaH,EAAM,SAAW,EAE/C,GAAIG,EAAW,CAKb,GAJAxB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