@launchdarkly/o11y 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"common-BkAGcE30.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/error/syntaxError.mjs","../../../../node_modules/graphql/language/ast.mjs","../../../../node_modules/graphql/language/directiveLocation.mjs","../../../../node_modules/graphql/language/kinds.mjs","../../../../node_modules/graphql/language/characterClasses.mjs","../../../../node_modules/graphql/language/blockString.mjs","../../../../node_modules/graphql/language/tokenKind.mjs","../../../../node_modules/graphql/language/lexer.mjs","../../../../node_modules/graphql/jsutils/inspect.mjs","../../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../../node_modules/graphql/language/source.mjs","../../../../node_modules/graphql/language/parser.mjs","../../../../node_modules/graphql/language/printString.mjs","../../../../node_modules/graphql/language/visitor.mjs","../../../../node_modules/graphql/language/printer.mjs","../../../../node_modules/graphql-request/build/esm/defaultJsonSerializer.js","../../../../node_modules/graphql-request/build/esm/helpers.js","../../../../node_modules/graphql-request/build/esm/parseArgs.js","../../../../node_modules/graphql-request/build/esm/resolveRequestDocument.js","../../../../node_modules/graphql-request/build/esm/types.js","../../../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../../../node_modules/graphql-request/build/esm/index.js","../../../../node_modules/json-stringify-safe/stringify.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/graphql-tag/lib/index.js","../src/client/graph/generated/operations.ts","../src/client/utils/utils.ts","../../../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js","../src/client/constants/sessions.ts","../../../../node_modules/js-cookie/dist/js.cookie.mjs","../src/client/utils/storage.ts","../src/client/utils/sessionStorage/sessionStorageKeys.ts","../src/client/utils/sessionStorage/highlightSession.ts","../src/client/graph/generated/schemas.ts","../src/client/utils/graph.ts","../src/integrations/launchdarkly/index.ts","../src/client/listeners/path-listener.tsx","../src/version.ts","../src/client/utils/dom/index.ts","../src/client/listeners/viewport-resize-listener.tsx","../../../../node_modules/imurmurhash/imurmurhash.js","../src/client/utils/secure-id.ts","../src/plugins/common.ts"],"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","import { GraphQLError } from './GraphQLError.mjs';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\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. <SOF> is always the first node and <EOF>\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 directive location values.\n */\nvar DirectiveLocation;\n\n(function (DirectiveLocation) {\n DirectiveLocation['QUERY'] = 'QUERY';\n DirectiveLocation['MUTATION'] = 'MUTATION';\n DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION';\n DirectiveLocation['FIELD'] = 'FIELD';\n DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION';\n DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD';\n DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT';\n DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION';\n DirectiveLocation['SCHEMA'] = 'SCHEMA';\n DirectiveLocation['SCALAR'] = 'SCALAR';\n DirectiveLocation['OBJECT'] = 'OBJECT';\n DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION';\n DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION';\n DirectiveLocation['INTERFACE'] = 'INTERFACE';\n DirectiveLocation['UNION'] = 'UNION';\n DirectiveLocation['ENUM'] = 'ENUM';\n DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE';\n DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';\n DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';\n})(DirectiveLocation || (DirectiveLocation = {}));\n\nexport { DirectiveLocation };\n/**\n * The enum type representing the directive location values.\n *\n * @deprecated Please use `DirectiveLocation`. Will be remove in v17.\n */\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 // <space>\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","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind;\n\n(function (TokenKind) {\n TokenKind['SOF'] = '<SOF>';\n TokenKind['EOF'] = '<EOF>';\n TokenKind['BANG'] = '!';\n TokenKind['DOLLAR'] = '$';\n TokenKind['AMP'] = '&';\n TokenKind['PAREN_L'] = '(';\n TokenKind['PAREN_R'] = ')';\n TokenKind['SPREAD'] = '...';\n TokenKind['COLON'] = ':';\n TokenKind['EQUALS'] = '=';\n TokenKind['AT'] = '@';\n TokenKind['BRACKET_L'] = '[';\n TokenKind['BRACKET_R'] = ']';\n TokenKind['BRACE_L'] = '{';\n TokenKind['PIPE'] = '|';\n TokenKind['BRACE_R'] = '}';\n TokenKind['NAME'] = 'Name';\n TokenKind['INT'] = 'Int';\n TokenKind['FLOAT'] = 'Float';\n TokenKind['STRING'] = 'String';\n TokenKind['BLOCK_STRING'] = 'BlockString';\n TokenKind['COMMENT'] = 'Comment';\n})(TokenKind || (TokenKind = {}));\n\nexport { TokenKind };\n/**\n * The enum type representing the token kinds values.\n *\n * @deprecated Please use `TokenKind`. Will be remove in v17.\n */\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { dedentBlockStringLines } from './blockString.mjs';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport class Lexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n get [Symbol.toStringTag]() {\n return 'Lexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n }\n}\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n */\n\nfunction isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n */\n\nfunction isSupplementaryCodePoint(body, location) {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code) {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code) {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n */\n\nfunction printCodePointAt(lexer, location) {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n } // Unicode code point\n\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n/**\n * Create a token with line and column location information.\n */\n\nfunction createToken(lexer, kind, start, end, value) {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // SourceCharacter\n\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // <BOM>\n\n case 0x0009: // \\t\n\n case 0x0020: // <space>\n\n case 0x002c:\n // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n\n case 0x000a:\n // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n\n case 0x000d:\n // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n\n case 0x0023:\n // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n\n case 0x0021:\n // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n\n case 0x0024:\n // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n\n case 0x0026:\n // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x002e:\n // .\n if (\n body.charCodeAt(position + 1) === 0x002e &&\n body.charCodeAt(position + 2) === 0x002e\n ) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n\n break;\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x003d:\n // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n\n case 0x005b:\n // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n\n case 0x005d:\n // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n\n case 0x007b:\n // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n\n case 0x007c:\n // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n\n case 0x007d:\n // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n\n case 0x0022:\n // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n\n return readString(lexer, position);\n } // IntValue | FloatValue (Digit | -)\n\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n */\n\nfunction readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n */\n\nfunction readNumber(lexer, start, firstCode) {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false; // NegativeSign (-)\n\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n } // Zero (0)\n\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Full stop (.)\n\n if (code === 0x002e) {\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // E e\n\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n code = body.charCodeAt(++position); // + -\n\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n/**\n * Returns the new position in the source after reading one or more digits.\n */\n\nfunction readDigits(lexer, start, firstCode) {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n */\n\nfunction readString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Quote (\")\n\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n } // Escape Sequence (\\)\n\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n } // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n} // The string value and lexed size of an escape sequence.\n\nfunction readEscapedUnicodeVariableWidth(lexer, position) {\n const body = lexer.source.body;\n let point = 0;\n let size = 3; // Cannot be larger than 12 chars (\\u{00000000}).\n\n while (size < 12) {\n const code = body.charCodeAt(position + size++); // Closing Brace (})\n\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n\n return {\n value: String.fromCodePoint(point),\n size,\n };\n } // Append this hex digit to the code point.\n\n point = (point << 4) | readHexDigit(code);\n\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(lexer, position) {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return {\n value: String.fromCodePoint(code),\n size: 6,\n };\n } // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return {\n value: String.fromCodePoint(code, trailingCode),\n size: 12,\n };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n */\n\nfunction read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n */\n\nfunction readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n */\n\nfunction readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n */\n\nfunction readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n */\n\nfunction readName(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\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","import { inspect } from './inspect.mjs';\n/* c8 ignore next 3 */\n\nconst isProduction =\n globalThis.process && // eslint-disable-next-line no-undef\n process.env.NODE_ENV === 'production';\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\n\nexport const instanceOf =\n /* c8 ignore next 6 */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n isProduction\n ? function instanceOf(value, constructor) {\n return value instanceof constructor;\n }\n : function instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (typeof value === 'object' && value !== null) {\n var _value$constructor;\n\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n ? value[Symbol.toStringTag]\n : (_value$constructor = value.constructor) === null ||\n _value$constructor === void 0\n ? void 0\n : _value$constructor.name;\n\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(`Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`);\n }\n }\n\n return false;\n };\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n constructor(\n body,\n name = 'GraphQL request',\n locationOffset = {\n line: 1,\n column: 1,\n },\n ) {\n typeof body === 'string' ||\n devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 ||\n devAssert(\n false,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n this.locationOffset.column > 0 ||\n devAssert(\n false,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'Source';\n }\n}\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Location, OperationTypeNode } from './ast.mjs';\nimport { DirectiveLocation } from './directiveLocation.mjs';\nimport { Kind } from './kinds.mjs';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.mjs';\nimport { isSource, Source } from './source.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n */\n\nexport function parseConstValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport class Parser {\n constructor(source, options = {}) {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n this._tokenCounter = 0;\n }\n\n get tokenCount() {\n return this._tokenCounter;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n\n parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\n parseDefinition() {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } // Many definitions begin with a description and require a lookahead.\n\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are supported only on type definitions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n const operation = this.parseOperationType();\n let name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * OperationType : one of query mutation subscription\n */\n\n parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n /**\n * Variable : $ Name\n */\n\n parseVariable() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n */\n\n parseSelectionSet() {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n parseArguments(isConst) {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n\n parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument() {\n return this.parseArgument(true);\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n });\n }\n\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n parseFragmentDefinition() {\n const start = this._lexer.token;\n this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (this._options.allowLegacyFragmentVariables === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentName : Name but not `on`\n */\n\n parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this.advanceLexer();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral() {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral() {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n */\n\n parseObject(isConst) {\n const item = () => this.parseObjectField(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n parseObjectField(isConst) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n\n parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n\n parseConstDirectives() {\n return this.parseDirectives(true);\n }\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n */\n\n parseDirective(isConst) {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n parseTypeReference() {\n const start = this._lexer.token;\n let type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n\n parseNamedType() {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n } // Implements the parsing rules in the Type Definition section.\n\n peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n\n parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n */\n\n parseSchemaDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n */\n\n parseFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n */\n\n parseEnumValuesDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n */\n\n parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseEnumValueName() {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n\n return this.parseName();\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n */\n\n parseInputFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n parseTypeSystemExtension() {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n */\n\n parseSchemaExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n\n parseInterfaceTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n * ```\n */\n\n parseDirectiveDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n repeatable,\n locations,\n });\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n parseDirectiveLocation() {\n const start = this._lexer.token;\n const name = this.parseName();\n\n if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n */\n\n node(startToken, node) {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n\n return node;\n }\n /**\n * Determines if the next token is of a given kind\n */\n\n peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n\n unexpected(atToken) {\n const token =\n atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n\n delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n }\n\n advanceLexer() {\n const { maxTokens } = this._options;\n\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more that ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\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 = { ...node };\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","export const defaultJsonSerializer = JSON;\n//# sourceMappingURL=defaultJsonSerializer.js.map","export const uppercase = (str) => str.toUpperCase();\n/**\n * Convert Headers instance into regular object\n */\nexport const HeadersInstanceToPlainObject = (headers) => {\n const o = {};\n headers.forEach((v, k) => {\n o[k] = v;\n });\n return o;\n};\n//# sourceMappingURL=helpers.js.map","export const parseRequestArgs = (documentOrOptions, variables, requestHeaders) => {\n return documentOrOptions.document\n ? documentOrOptions\n : {\n document: documentOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestArgs = (queryOrOptions, variables, requestHeaders) => {\n return queryOrOptions.query\n ? queryOrOptions\n : {\n query: queryOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseBatchRequestArgs = (documentsOrOptions, requestHeaders) => {\n return documentsOrOptions.documents\n ? documentsOrOptions\n : {\n documents: documentsOrOptions,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRequestExtendedArgs = (urlOrOptions, document, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.document\n ? urlOrOptions\n : {\n url: urlOrOptions,\n document: document,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestExtendedArgs = (urlOrOptions, query, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.query\n ? urlOrOptions\n : {\n url: urlOrOptions,\n query: query,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\n//# sourceMappingURL=parseArgs.js.map","import { parse, print } from 'graphql';\n/**\n * helpers\n */\nconst extractOperationName = (document) => {\n let operationName = undefined;\n const operationDefinitions = document.definitions.filter((definition) => definition.kind === `OperationDefinition`);\n if (operationDefinitions.length === 1) {\n operationName = operationDefinitions[0]?.name?.value;\n }\n return operationName;\n};\nexport const resolveRequestDocument = (document) => {\n if (typeof document === `string`) {\n let operationName = undefined;\n try {\n const parsedDocument = parse(document);\n operationName = extractOperationName(parsedDocument);\n }\n catch (err) {\n // Failed parsing the document, the operationName will be undefined\n }\n return { query: document, operationName };\n }\n const operationName = extractOperationName(document);\n return { query: print(document), operationName };\n};\n//# sourceMappingURL=resolveRequestDocument.js.map","export class ClientError extends Error {\n constructor(response, request) {\n const message = `${ClientError.extractMessage(response)}: ${JSON.stringify({\n response,\n request,\n })}`;\n super(message);\n Object.setPrototypeOf(this, ClientError.prototype);\n this.response = response;\n this.request = request;\n // this is needed as Safari doesn't support .captureStackTrace\n if (typeof Error.captureStackTrace === `function`) {\n Error.captureStackTrace(this, ClientError);\n }\n }\n static extractMessage(response) {\n return response.errors?.[0]?.message ?? `GraphQL Error (Code: ${response.status})`;\n }\n}\n//# sourceMappingURL=types.js.map","var global = typeof self !== 'undefined' ? self : this;\nvar __self__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = global.DOMException\n}\nF.prototype = global;\nreturn new F();\n})();\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","import { defaultJsonSerializer } from './defaultJsonSerializer.js';\nimport { HeadersInstanceToPlainObject, uppercase } from './helpers.js';\nimport { parseBatchRequestArgs, parseRawRequestArgs, parseRawRequestExtendedArgs, parseRequestArgs, parseRequestExtendedArgs, } from './parseArgs.js';\nimport { resolveRequestDocument } from './resolveRequestDocument.js';\nimport { ClientError, } from './types.js';\nimport crossFetch, * as CrossFetch from 'cross-fetch';\n/**\n * Convert the given headers configuration into a plain object.\n */\nconst resolveHeaders = (headers) => {\n let oHeaders = {};\n if (headers) {\n if ((typeof Headers !== `undefined` && headers instanceof Headers) ||\n (CrossFetch && CrossFetch.Headers && headers instanceof CrossFetch.Headers)) {\n oHeaders = HeadersInstanceToPlainObject(headers);\n }\n else if (Array.isArray(headers)) {\n headers.forEach(([name, value]) => {\n if (name && value !== undefined) {\n oHeaders[name] = value;\n }\n });\n }\n else {\n oHeaders = headers;\n }\n }\n return oHeaders;\n};\n/**\n * Clean a GraphQL document to send it via a GET query\n */\nconst cleanQuery = (str) => str.replace(/([\\s,]|#[^\\n\\r]+)+/g, ` `).trim();\n/**\n * Create query string for GraphQL request\n */\nconst buildRequestConfig = (params) => {\n if (!Array.isArray(params.query)) {\n const params_ = params;\n const search = [`query=${encodeURIComponent(cleanQuery(params_.query))}`];\n if (params.variables) {\n search.push(`variables=${encodeURIComponent(params_.jsonSerializer.stringify(params_.variables))}`);\n }\n if (params_.operationName) {\n search.push(`operationName=${encodeURIComponent(params_.operationName)}`);\n }\n return search.join(`&`);\n }\n if (typeof params.variables !== `undefined` && !Array.isArray(params.variables)) {\n throw new Error(`Cannot create query with given variable type, array expected`);\n }\n // Batch support\n const params_ = params;\n const payload = params.query.reduce((acc, currentQuery, index) => {\n acc.push({\n query: cleanQuery(currentQuery),\n variables: params_.variables ? params_.jsonSerializer.stringify(params_.variables[index]) : undefined,\n });\n return acc;\n }, []);\n return `query=${encodeURIComponent(params_.jsonSerializer.stringify(payload))}`;\n};\nconst createHttpMethodFetcher = (method) => async (params) => {\n const { url, query, variables, operationName, fetch, fetchOptions, middleware } = params;\n const headers = { ...params.headers };\n let queryParams = ``;\n let body = undefined;\n if (method === `POST`) {\n body = createRequestBody(query, variables, operationName, fetchOptions.jsonSerializer);\n if (typeof body === `string`) {\n // @ts-expect-error todo\n headers[`Content-Type`] = `application/json`;\n }\n }\n else {\n // @ts-expect-error todo needs ADT for TS to understand the different states\n queryParams = buildRequestConfig({\n query,\n variables,\n operationName,\n jsonSerializer: fetchOptions.jsonSerializer ?? defaultJsonSerializer,\n });\n }\n const init = {\n method,\n headers,\n body,\n ...fetchOptions,\n };\n let urlResolved = url;\n let initResolved = init;\n if (middleware) {\n const result = await Promise.resolve(middleware({ ...init, url, operationName, variables }));\n const { url: urlNew, ...initNew } = result;\n urlResolved = urlNew;\n initResolved = initNew;\n }\n if (queryParams) {\n urlResolved = `${urlResolved}?${queryParams}`;\n }\n return await fetch(urlResolved, initResolved);\n};\n/**\n * GraphQL Client.\n */\nclass GraphQLClient {\n constructor(url, requestConfig = {}) {\n this.url = url;\n this.requestConfig = requestConfig;\n /**\n * Send a GraphQL query to the server.\n */\n this.rawRequest = async (...args) => {\n const [queryOrOptions, variables, requestHeaders] = args;\n const rawRequestOptions = parseRawRequestArgs(queryOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (rawRequestOptions.signal !== undefined) {\n fetchOptions.signal = rawRequestOptions.signal;\n }\n const { operationName } = resolveRequestDocument(rawRequestOptions.query);\n return makeRequest({\n url,\n query: rawRequestOptions.query,\n variables: rawRequestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(rawRequestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n };\n }\n async request(documentOrOptions, ...variablesAndRequestHeaders) {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n const requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (requestOptions.signal !== undefined) {\n fetchOptions.signal = requestOptions.signal;\n }\n const { query, operationName } = resolveRequestDocument(requestOptions.document);\n return makeRequest({\n url,\n query,\n variables: requestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(requestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n }\n // prettier-ignore\n batchRequests(documentsOrOptions, requestHeaders) {\n const batchRequestOptions = parseBatchRequestArgs(documentsOrOptions, requestHeaders);\n const { headers, ...fetchOptions } = this.requestConfig;\n if (batchRequestOptions.signal !== undefined) {\n fetchOptions.signal = batchRequestOptions.signal;\n }\n const queries = batchRequestOptions.documents.map(({ document }) => resolveRequestDocument(document).query);\n const variables = batchRequestOptions.documents.map(({ variables }) => variables);\n return makeRequest({\n url: this.url,\n query: queries,\n // @ts-expect-error TODO reconcile batch variables into system.\n variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(batchRequestOptions.requestHeaders),\n },\n operationName: undefined,\n fetch: this.requestConfig.fetch ?? crossFetch,\n method: this.requestConfig.method || `POST`,\n fetchOptions,\n middleware: this.requestConfig.requestMiddleware,\n })\n .then((response) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(error);\n }\n throw error;\n });\n }\n setHeaders(headers) {\n this.requestConfig.headers = headers;\n return this;\n }\n /**\n * Attach a header to the client. All subsequent requests will have this header.\n */\n setHeader(key, value) {\n const { headers } = this.requestConfig;\n if (headers) {\n // todo what if headers is in nested array form... ?\n //@ts-expect-error todo\n headers[key] = value;\n }\n else {\n this.requestConfig.headers = { [key]: value };\n }\n return this;\n }\n /**\n * Change the client endpoint. All subsequent requests will send to this endpoint.\n */\n setEndpoint(value) {\n this.url = value;\n return this;\n }\n}\nconst makeRequest = async (params) => {\n const { query, variables, fetchOptions } = params;\n const fetcher = createHttpMethodFetcher(uppercase(params.method ?? `post`));\n const isBatchingQuery = Array.isArray(params.query);\n const response = await fetcher(params);\n const result = await getResult(response, fetchOptions.jsonSerializer ?? defaultJsonSerializer);\n const successfullyReceivedData = Array.isArray(result)\n ? !result.some(({ data }) => !data)\n : Boolean(result.data);\n const successfullyPassedErrorPolicy = Array.isArray(result) ||\n !result.errors ||\n (Array.isArray(result.errors) && !result.errors.length) ||\n fetchOptions.errorPolicy === `all` ||\n fetchOptions.errorPolicy === `ignore`;\n if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {\n // @ts-expect-error TODO fixme\n const { errors: _, ...rest } = Array.isArray(result) ? result : result;\n const data = fetchOptions.errorPolicy === `ignore` ? rest : result;\n const dataEnvelope = isBatchingQuery ? { data } : data;\n // @ts-expect-error TODO\n return {\n ...dataEnvelope,\n headers: response.headers,\n status: response.status,\n };\n }\n else {\n const errorResult = typeof result === `string`\n ? {\n error: result,\n }\n : result;\n throw new ClientError(\n // @ts-expect-error TODO\n { ...errorResult, status: response.status, headers: response.headers }, { query, variables });\n }\n};\n/**\n * Send a GraphQL Query to the GraphQL server for execution.\n */\nconst rawRequest = async (...args) => {\n const [urlOrOptions, query, ...variablesAndRequestHeaders] = args;\n const requestOptions = parseRawRequestExtendedArgs(urlOrOptions, query, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.rawRequest({\n ...requestOptions,\n });\n};\n// prettier-ignore\n// eslint-disable-next-line\nasync function request(urlOrOptions, document, ...variablesAndRequestHeaders) {\n const requestOptions = parseRequestExtendedArgs(urlOrOptions, document, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.request({\n ...requestOptions,\n });\n}\n/**\n * Send a batch of GraphQL Document to the GraphQL server for execution.\n *\n * @example\n *\n * ```ts\n * // You can pass a raw string\n *\n * await batchRequests('https://foo.bar/graphql', [\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * },\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * }])\n *\n * // You can also pass a GraphQL DocumentNode as query. Convenient if you\n * // are using graphql-tag package.\n *\n * import gql from 'graphql-tag'\n *\n * await batchRequests('https://foo.bar/graphql', [{ query: gql`...` }])\n * ```\n */\nconst batchRequests = async (...args) => {\n const params = parseBatchRequestsArgsExtended(args);\n const client = new GraphQLClient(params.url);\n return client.batchRequests(params);\n};\nconst parseBatchRequestsArgsExtended = (args) => {\n if (args.length === 1) {\n return args[0];\n }\n else {\n return {\n url: args[0],\n documents: args[1],\n requestHeaders: args[2],\n signal: undefined,\n };\n }\n};\nconst createRequestBody = (query, variables, operationName, jsonSerializer) => {\n const jsonSerializer_ = jsonSerializer ?? defaultJsonSerializer;\n if (!Array.isArray(query)) {\n return jsonSerializer_.stringify({ query, variables, operationName });\n }\n if (typeof variables !== `undefined` && !Array.isArray(variables)) {\n throw new Error(`Cannot create request body with given variable type, array expected`);\n }\n // Batch support\n const payload = query.reduce((acc, currentQuery, index) => {\n acc.push({ query: currentQuery, variables: variables ? variables[index] : undefined });\n return acc;\n }, []);\n return jsonSerializer_.stringify(payload);\n};\nconst getResult = async (response, jsonSerializer) => {\n let contentType;\n response.headers.forEach((value, key) => {\n if (key.toLowerCase() === `content-type`) {\n contentType = value;\n }\n });\n if (contentType &&\n (contentType.toLowerCase().startsWith(`application/json`) ||\n contentType.toLowerCase().startsWith(`application/graphql+json`) ||\n contentType.toLowerCase().startsWith(`application/graphql-response+json`))) {\n return jsonSerializer.parse(await response.text());\n }\n else {\n return response.text();\n }\n};\nconst callOrIdentity = (value) => {\n return typeof value === `function` ? value() : value;\n};\n/**\n * Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.\n *\n * @example\n * ```\n * import { gql } from 'graphql-request'\n *\n * await request('https://foo.bar/graphql', gql`...`)\n * ```\n *\n * @remarks\n *\n * Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named \"gql\". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.\n */\nexport const gql = (chunks, ...variables) => {\n return chunks.reduce((acc, chunk, index) => `${acc}${chunk}${index in variables ? String(variables[index]) : ``}`, ``);\n};\nexport { GraphQLWebSocketClient } from './graphql-ws.js';\nexport { resolveRequestDocument } from './resolveRequestDocument.js';\nexport { batchRequests, ClientError, GraphQLClient, rawRequest, request, };\nexport default request;\n//# sourceMappingURL=index.js.map","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import { GraphQLClient } from 'graphql-request'\nimport { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'\nimport gql from 'graphql-tag'\nexport type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]?: Maybe<T[SubKey]>\n}\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]: Maybe<T[SubKey]>\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental<T> =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tInt64ID: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\n/** An attribute match configuration which can match an attribute key and value. */\nexport type AttributeMatchConfig = {\n\t__typename?: 'AttributeMatchConfig'\n\tattribute: MatchConfig\n\tkey: MatchConfig\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlog_cursor?: InputMaybe<Scalars['String']['input']>\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\trequest_id?: InputMaybe<Scalars['String']['input']>\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tstackTrace: Array<InputMaybe<StackFrameInput>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsampling?: Maybe<SamplingConfig>\n\tsecure_id: Scalars['String']['output']\n}\n\n/**\n * A match based log sampling configuration. A log matches if each specified matching configuration matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type LogSamplingConfig = {\n\t__typename?: 'LogSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** Matches against the log message. */\n\tmessage?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of logs to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 logs will be sampled. Setting the ratio to 0 will disable sampling for the log.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n\t/** Matches against the severity of the log. */\n\tseverityText?: Maybe<MatchConfig>\n}\n\n/**\n * A match configuration. Each field of this type represents a different type of match\n * configuration. One and only 1 field should be populated.\n *\n * This is effectively a sum type/discriminated union, but isn't implemented as such to avoid\n * this bug: https://github.com/99designs/gqlgen/issues/2741\n */\nexport type MatchConfig = {\n\t__typename?: 'MatchConfig'\n\t/** A match configuration which does an exact match against any value. */\n\tmatchValue?: Maybe<Scalars['Any']['output']>\n\t/**\n\t * A match configuration which matches against a regular expression.\n\t * Can only match string attributes.\n\t */\n\tregexValue?: Maybe<Scalars['String']['output']>\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe<Scalars['String']['input']>\n\tgroup?: InputMaybe<Scalars['String']['input']>\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\ttags?: InputMaybe<Array<MetricTag>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe<Scalars['Any']['output']>\n\tpushBackendPayload?: Maybe<Scalars['Any']['output']>\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe<Scalars['Any']['output']>\n\tpushSessionEvents?: Maybe<Scalars['Any']['output']>\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<Array<Scalars['String']['input']>>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe<Scalars['String']['input']>\n\tserviceName?: InputMaybe<Scalars['String']['input']>\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\ttype?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array<InputMaybe<BackendErrorObjectInput>>\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array<InputMaybe<MetricInput>>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array<InputMaybe<ErrorObjectInput>>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe<Scalars['ID']['input']>\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationPushSessionEventsArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe<Scalars['Any']['output']>\n\tsampling: SamplingConfig\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type QuerySamplingArgs = {\n\torganization_verbose_id: Scalars['String']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array<InputMaybe<ReplayEventInput>>\n}\n\nexport type SamplingConfig = {\n\t__typename?: 'SamplingConfig'\n\tlogs?: Maybe<Array<LogSamplingConfig>>\n\tspans?: Maybe<Array<SpanSamplingConfig>>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe<Scalars['Int64ID']['output']>\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\n/** An event matcher configuration which matches span events within a span. */\nexport type SpanEventMatchConfig = {\n\t__typename?: 'SpanEventMatchConfig'\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\tname?: Maybe<MatchConfig>\n}\n\n/**\n * A match based span sampling configuration. A span matches if each specified matching configuration\n * matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type SpanSamplingConfig = {\n\t__typename?: 'SpanSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** A list of span event match configs. */\n\tevents?: Maybe<Array<SpanEventMatchConfig>>\n\tname?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of spans to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 spans will be sampled. Setting the ratio to 0 will disable sampling for the span.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe<Array<InputMaybe<Scalars['Any']['input']>>>\n\tcolumnNumber?: InputMaybe<Scalars['Int']['input']>\n\tfileName?: InputMaybe<Scalars['String']['input']>\n\tfunctionName?: InputMaybe<Scalars['String']['input']>\n\tisEval?: InputMaybe<Scalars['Boolean']['input']>\n\tisNative?: InputMaybe<Scalars['Boolean']['input']>\n\tlineNumber?: InputMaybe<Scalars['Int']['input']>\n\tsource?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type PushPayloadMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tevents: ReplayEventsInput\n\tmessages: Scalars['String']['input']\n\tresources: Scalars['String']['input']\n\tweb_socket_events: Scalars['String']['input']\n\terrors: Array<InputMaybe<ErrorObjectInput>> | InputMaybe<ErrorObjectInput>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n}>\n\nexport type PushPayloadMutation = {\n\t__typename?: 'Mutation'\n\tpushPayload: number\n}\n\nexport type PushSessionEventsMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tdata: Scalars['String']['input']\n}>\n\nexport type PushSessionEventsMutation = {\n\t__typename?: 'Mutation'\n\tpushSessionEvents?: any | null\n}\n\nexport type IdentifySessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}>\n\nexport type IdentifySessionMutation = {\n\t__typename?: 'Mutation'\n\tidentifySession: string\n}\n\nexport type AddSessionPropertiesMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n}>\n\nexport type AddSessionPropertiesMutation = {\n\t__typename?: 'Mutation'\n\taddSessionProperties: string\n}\n\nexport type PushMetricsMutationVariables = Exact<{\n\tmetrics: Array<InputMaybe<MetricInput>> | InputMaybe<MetricInput>\n}>\n\nexport type PushMetricsMutation = {\n\t__typename?: 'Mutation'\n\tpushMetrics: number\n}\n\nexport type AddSessionFeedbackMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n}>\n\nexport type AddSessionFeedbackMutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: string\n}\n\nexport type MatchPartsFragment = {\n\t__typename?: 'MatchConfig'\n\tregexValue?: string | null\n\tmatchValue?: any | null\n}\n\nexport type InitializeSessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\torganization_verbose_id: Scalars['String']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tprivacy_setting: Scalars['String']['input']\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tclientVersion: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tclientConfig: Scalars['String']['input']\n\tenvironment: Scalars['String']['input']\n\tid: Scalars['String']['input']\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tserviceName: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<\n\t\tArray<Scalars['String']['input']> | Scalars['String']['input']\n\t>\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n}>\n\nexport type InitializeSessionMutation = {\n\t__typename?: 'Mutation'\n\tinitializeSession: {\n\t\t__typename?: 'InitializeSessionResponse'\n\t\tsecure_id: string\n\t\tproject_id: string\n\t\tsampling?: {\n\t\t\t__typename?: 'SamplingConfig'\n\t\t\tspans?: Array<{\n\t\t\t\t__typename?: 'SpanSamplingConfig'\n\t\t\t\tsamplingRatio: number\n\t\t\t\tname?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t\tevents?: Array<{\n\t\t\t\t\t__typename?: 'SpanEventMatchConfig'\n\t\t\t\t\tname?: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t} | null\n\t\t\t\t\tattributes?: Array<{\n\t\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\t\tkey: {\n\t\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute: {\n\t\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t\t}\n\t\t\t\t\t}> | null\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t\tlogs?: Array<{\n\t\t\t\t__typename?: 'LogSamplingConfig'\n\t\t\t\tsamplingRatio: number\n\t\t\t\tmessage?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tseverityText?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t} | null\n\t}\n}\n\nexport type IgnoreQueryVariables = Exact<{\n\tid: Scalars['ID']['input']\n}>\n\nexport type IgnoreQuery = { __typename?: 'Query'; ignore?: any | null }\n\nexport type GetSamplingConfigQueryVariables = Exact<{\n\torganization_verbose_id: Scalars['String']['input']\n}>\n\nexport type GetSamplingConfigQuery = {\n\t__typename?: 'Query'\n\tsampling: {\n\t\t__typename?: 'SamplingConfig'\n\t\tspans?: Array<{\n\t\t\t__typename?: 'SpanSamplingConfig'\n\t\t\tsamplingRatio: number\n\t\t\tname?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tattributes?: Array<{\n\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\tkey: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t\tattribute: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t}> | null\n\t\t\tevents?: Array<{\n\t\t\t\t__typename?: 'SpanEventMatchConfig'\n\t\t\t\tname?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t}> | null\n\t\tlogs?: Array<{\n\t\t\t__typename?: 'LogSamplingConfig'\n\t\t\tsamplingRatio: number\n\t\t\tmessage?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tseverityText?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tattributes?: Array<{\n\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\tkey: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t\tattribute: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t}> | null\n\t\t}> | null\n\t}\n}\n\nexport const MatchPartsFragmentDoc = gql`\n\tfragment MatchParts on MatchConfig {\n\t\tregexValue\n\t\tmatchValue\n\t}\n`\nexport const PushPayloadDocument = gql`\n\tmutation PushPayload(\n\t\t$session_secure_id: String!\n\t\t$payload_id: ID!\n\t\t$events: ReplayEventsInput!\n\t\t$messages: String!\n\t\t$resources: String!\n\t\t$web_socket_events: String!\n\t\t$errors: [ErrorObjectInput]!\n\t\t$is_beacon: Boolean\n\t\t$has_session_unloaded: Boolean\n\t\t$highlight_logs: String\n\t) {\n\t\tpushPayload(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tevents: $events\n\t\t\tmessages: $messages\n\t\t\tresources: $resources\n\t\t\tweb_socket_events: $web_socket_events\n\t\t\terrors: $errors\n\t\t\tis_beacon: $is_beacon\n\t\t\thas_session_unloaded: $has_session_unloaded\n\t\t\thighlight_logs: $highlight_logs\n\t\t)\n\t}\n`\nexport const PushSessionEventsDocument = gql`\n\tmutation PushSessionEvents(\n\t\t$session_secure_id: String!\n\t\t$payload_id: Int64ID!\n\t\t$data: String!\n\t) {\n\t\tpushSessionEvents(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tdata: $data\n\t\t)\n\t}\n`\nexport const IdentifySessionDocument = gql`\n\tmutation identifySession(\n\t\t$session_secure_id: String!\n\t\t$user_identifier: String!\n\t\t$user_object: Any\n\t) {\n\t\tidentifySession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_identifier: $user_identifier\n\t\t\tuser_object: $user_object\n\t\t)\n\t}\n`\nexport const AddSessionPropertiesDocument = gql`\n\tmutation addSessionProperties(\n\t\t$session_secure_id: String!\n\t\t$properties_object: Any\n\t) {\n\t\taddSessionProperties(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tproperties_object: $properties_object\n\t\t)\n\t}\n`\nexport const PushMetricsDocument = gql`\n\tmutation pushMetrics($metrics: [MetricInput]!) {\n\t\tpushMetrics(metrics: $metrics)\n\t}\n`\nexport const AddSessionFeedbackDocument = gql`\n\tmutation addSessionFeedback(\n\t\t$session_secure_id: String!\n\t\t$user_name: String\n\t\t$user_email: String\n\t\t$verbatim: String!\n\t\t$timestamp: Timestamp!\n\t) {\n\t\taddSessionFeedback(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_name: $user_name\n\t\t\tuser_email: $user_email\n\t\t\tverbatim: $verbatim\n\t\t\ttimestamp: $timestamp\n\t\t)\n\t}\n`\nexport const InitializeSessionDocument = gql`\n\tmutation initializeSession(\n\t\t$session_secure_id: String!\n\t\t$session_key: String\n\t\t$organization_verbose_id: String!\n\t\t$enable_strict_privacy: Boolean!\n\t\t$privacy_setting: String!\n\t\t$enable_recording_network_contents: Boolean!\n\t\t$clientVersion: String!\n\t\t$firstloadVersion: String!\n\t\t$clientConfig: String!\n\t\t$environment: String!\n\t\t$id: String!\n\t\t$appVersion: String\n\t\t$serviceName: String!\n\t\t$client_id: String!\n\t\t$network_recording_domains: [String!]\n\t\t$disable_session_recording: Boolean\n\t) {\n\t\tinitializeSession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tsession_key: $session_key\n\t\t\torganization_verbose_id: $organization_verbose_id\n\t\t\tenable_strict_privacy: $enable_strict_privacy\n\t\t\tenable_recording_network_contents: $enable_recording_network_contents\n\t\t\tclientVersion: $clientVersion\n\t\t\tfirstloadVersion: $firstloadVersion\n\t\t\tclientConfig: $clientConfig\n\t\t\tenvironment: $environment\n\t\t\tappVersion: $appVersion\n\t\t\tserviceName: $serviceName\n\t\t\tfingerprint: $id\n\t\t\tclient_id: $client_id\n\t\t\tnetwork_recording_domains: $network_recording_domains\n\t\t\tdisable_session_recording: $disable_session_recording\n\t\t\tprivacy_setting: $privacy_setting\n\t\t) {\n\t\t\tsecure_id\n\t\t\tproject_id\n\t\t\tsampling {\n\t\t\t\tspans {\n\t\t\t\t\tname {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevents {\n\t\t\t\t\t\tname {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattributes {\n\t\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsamplingRatio\n\t\t\t\t}\n\t\t\t\tlogs {\n\t\t\t\t\tmessage {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tseverityText {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsamplingRatio\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t${MatchPartsFragmentDoc}\n`\nexport const IgnoreDocument = gql`\n\tquery Ignore($id: ID!) {\n\t\tignore(id: $id)\n\t}\n`\nexport const GetSamplingConfigDocument = gql`\n\tquery GetSamplingConfig($organization_verbose_id: String!) {\n\t\tsampling(organization_verbose_id: $organization_verbose_id) {\n\t\t\tspans {\n\t\t\t\tname {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tattributes {\n\t\t\t\t\tkey {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattribute {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tevents {\n\t\t\t\t\tname {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsamplingRatio\n\t\t\t}\n\t\t\tlogs {\n\t\t\t\tmessage {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tseverityText {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tattributes {\n\t\t\t\t\tkey {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattribute {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsamplingRatio\n\t\t\t}\n\t\t}\n\t}\n\t${MatchPartsFragmentDoc}\n`\n\nexport type SdkFunctionWrapper = <T>(\n\taction: (requestHeaders?: Record<string, string>) => Promise<T>,\n\toperationName: string,\n\toperationType?: string,\n\tvariables?: any,\n) => Promise<T>\n\nconst defaultWrapper: SdkFunctionWrapper = (\n\taction,\n\t_operationName,\n\t_operationType,\n\tvariables,\n) => action()\n\nexport function getSdk(\n\tclient: GraphQLClient,\n\twithWrapper: SdkFunctionWrapper = defaultWrapper,\n) {\n\treturn {\n\t\tPushPayload(\n\t\t\tvariables: PushPayloadMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushPayloadMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushPayloadMutation>(\n\t\t\t\t\t\tPushPayloadDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushPayload',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tPushSessionEvents(\n\t\t\tvariables: PushSessionEventsMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushSessionEventsMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushSessionEventsMutation>(\n\t\t\t\t\t\tPushSessionEventsDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushSessionEvents',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tidentifySession(\n\t\t\tvariables: IdentifySessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<IdentifySessionMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<IdentifySessionMutation>(\n\t\t\t\t\t\tIdentifySessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'identifySession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionProperties(\n\t\t\tvariables: AddSessionPropertiesMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<AddSessionPropertiesMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<AddSessionPropertiesMutation>(\n\t\t\t\t\t\tAddSessionPropertiesDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionProperties',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tpushMetrics(\n\t\t\tvariables: PushMetricsMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushMetricsMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushMetricsMutation>(\n\t\t\t\t\t\tPushMetricsDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'pushMetrics',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionFeedback(\n\t\t\tvariables: AddSessionFeedbackMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<AddSessionFeedbackMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<AddSessionFeedbackMutation>(\n\t\t\t\t\t\tAddSessionFeedbackDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionFeedback',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tinitializeSession(\n\t\t\tvariables: InitializeSessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<InitializeSessionMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<InitializeSessionMutation>(\n\t\t\t\t\t\tInitializeSessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'initializeSession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tIgnore(\n\t\t\tvariables: IgnoreQueryVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<IgnoreQuery> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<IgnoreQuery>(IgnoreDocument, variables, {\n\t\t\t\t\t\t...requestHeaders,\n\t\t\t\t\t\t...wrappedRequestHeaders,\n\t\t\t\t\t}),\n\t\t\t\t'Ignore',\n\t\t\t\t'query',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tGetSamplingConfig(\n\t\t\tvariables: GetSamplingConfigQueryVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<GetSamplingConfigQuery> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<GetSamplingConfigQuery>(\n\t\t\t\t\t\tGetSamplingConfigDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'GetSamplingConfig',\n\t\t\t\t'query',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t}\n}\nexport type Sdk = ReturnType<typeof getSdk>\n","import { StringifyOptions } from '../listeners/console-listener'\n\nexport function patch(\n\t// tslint:disable-next-line:no-any\n\tsource: { [key: string]: any },\n\tname: string,\n\t// tslint:disable-next-line:no-any\n\treplacement: (...args: any[]) => any,\n): () => void {\n\ttry {\n\t\tif (!(name in source)) {\n\t\t\treturn () => {}\n\t\t}\n\n\t\tconst original = source[name] as () => unknown\n\t\tconst wrapped = replacement(original)\n\n\t\t// Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n\t\t// otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n\t\t// tslint:disable-next-line:strict-type-predicates\n\t\tif (typeof wrapped === 'function') {\n\t\t\twrapped.prototype = wrapped.prototype || {}\n\t\t\tObject.defineProperties(wrapped, {\n\t\t\t\t__rrweb_original__: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: original,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\n\t\tsource[name] = wrapped\n\n\t\treturn () => {\n\t\t\tsource[name] = original\n\t\t}\n\t} catch {\n\t\treturn () => {}\n\t}\n}\n\n/**\n * transfer the node path in Event to string\n * @param node the first node in a node path array\n */\nfunction pathToSelector(node: HTMLElement): string | '' {\n\tif (!node || !node.outerHTML) {\n\t\treturn ''\n\t}\n\n\tlet path = ''\n\twhile (node.parentElement) {\n\t\tlet name = node.localName\n\t\tif (!name) {\n\t\t\tbreak\n\t\t}\n\t\tname = name.toLowerCase()\n\t\tlet parent = node.parentElement\n\n\t\tlet domSiblings = []\n\n\t\tif (parent.children && parent.children.length > 0) {\n\t\t\t// tslint:disable-next-line:prefer-for-of\n\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\tlet sibling = parent.children[i]\n\t\t\t\tif (sibling.localName && sibling.localName.toLowerCase) {\n\t\t\t\t\tif (sibling.localName.toLowerCase() === name) {\n\t\t\t\t\t\tdomSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (domSiblings.length > 1) {\n\t\t\tname += ':eq(' + domSiblings.indexOf(node) + ')'\n\t\t}\n\t\tpath = name + (path ? '>' + path : '')\n\t\tnode = parent\n\t}\n\n\treturn path\n}\n\n/**\n * judge is object\n */\nfunction isObject(obj: any): boolean {\n\treturn Object.prototype.toString.call(obj) === '[object Object]'\n}\n\n/**\n * judge the object's depth\n */\nfunction isObjTooDeep(obj: any, limit: number): boolean {\n\tif (limit === 0) {\n\t\treturn true\n\t}\n\n\tconst keys = Object.keys(obj)\n\tfor (const key of keys) {\n\t\tif (isObject(obj[key]) && isObjTooDeep(obj[key], limit - 1)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * stringify any js object\n * @param obj the object to stringify\n */\nexport function stringify(\n\tobj: any,\n\tstringifyOptions?: StringifyOptions,\n): string {\n\tconst options: StringifyOptions = {\n\t\tnumOfKeysLimit: 50,\n\t\tdepthOfLimit: 4,\n\t}\n\tObject.assign(options, stringifyOptions)\n\tconst stack: any[] = []\n\tconst keys: any[] = []\n\treturn JSON.stringify(obj, function (key, value) {\n\t\t/**\n\t\t * forked from https://github.com/moll/json-stringify-safe/blob/master/stringify.js\n\t\t * to deCycle the object\n\t\t */\n\t\tif (stack.length > 0) {\n\t\t\tconst thisPos = stack.indexOf(this)\n\t\t\t~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n\t\t\t~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n\t\t\tif (~stack.indexOf(value)) {\n\t\t\t\tif (stack[0] === value) {\n\t\t\t\t\tvalue = '[Circular ~]'\n\t\t\t\t} else {\n\t\t\t\t\tvalue =\n\t\t\t\t\t\t'[Circular ~.' +\n\t\t\t\t\t\tkeys.slice(0, stack.indexOf(value)).join('.') +\n\t\t\t\t\t\t']'\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tstack.push(value)\n\t\t}\n\t\t/* END of the FORK */\n\n\t\tif (value === null || value === undefined) {\n\t\t\treturn value\n\t\t}\n\t\tif (shouldIgnore(value)) {\n\t\t\treturn toString(value)\n\t\t}\n\t\tif (value instanceof Event) {\n\t\t\tconst eventResult: any = {}\n\t\t\tfor (const eventKey in value) {\n\t\t\t\tconst eventValue = (value as any)[eventKey]\n\t\t\t\tif (Array.isArray(eventValue)) {\n\t\t\t\t\teventResult[eventKey] = pathToSelector(\n\t\t\t\t\t\teventValue.length ? eventValue[0] : null,\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\teventResult[eventKey] = eventValue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn eventResult\n\t\t} else if (value instanceof Node) {\n\t\t\tif (value instanceof HTMLElement) {\n\t\t\t\treturn value ? value.outerHTML : ''\n\t\t\t}\n\t\t\treturn value.nodeName\n\t\t} else if (value instanceof Error) {\n\t\t\treturn value.name + ': ' + value.message\n\t\t}\n\t\treturn value\n\t})\n\n\t/**\n\t * whether we should ignore obj's info and call toString() function instead\n\t */\n\tfunction shouldIgnore(_obj: object): boolean {\n\t\t// outof keys limit\n\t\tif (\n\t\t\tisObject(_obj) &&\n\t\t\tObject.keys(_obj).length > options.numOfKeysLimit\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\t// is function\n\t\tif (typeof _obj === 'function') {\n\t\t\treturn true\n\t\t}\n\n\t\t// if a non-user event with only the `isTrusted` key\n\t\t// We ignore this because some frameworks/library can output these non-stop.\n\t\t// There's no value in recording/showing these to the end user so we ignore.\n\t\tif (_obj instanceof Event && _obj.isTrusted === false) {\n\t\t\tconst eventKeys = Object.keys(_obj)\n\n\t\t\treturn eventKeys.length === 1\n\t\t}\n\n\t\t/**\n\t\t * judge object's depth to avoid browser's OOM\n\t\t *\n\t\t * issues: https://github.com/rrweb-io/rrweb/issues/653\n\t\t */\n\t\tif (isObject(_obj) && isObjTooDeep(_obj, options.depthOfLimit)) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * limit the toString() result according to option\n\t */\n\tfunction toString(_obj: object): string {\n\t\tlet str = _obj.toString()\n\t\tif (\n\t\t\toptions.stringLengthLimit &&\n\t\t\tstr.length > options.stringLengthLimit\n\t\t) {\n\t\t\tstr = `${str.slice(0, options.stringLengthLimit)}...`\n\t\t}\n\t\treturn str\n\t}\n}\n\nfunction supportsWebP(): boolean {\n\tvar elem = document.createElement('canvas')\n\tif (!!(elem.getContext && elem.getContext('2d'))) {\n\t\treturn elem.toDataURL('image/webp').indexOf('data:image/webp') == 0\n\t}\n\treturn false\n}\n\nexport function getDefaultDataURLOptions(): {\n\ttype: string\n\tquality: number\n} {\n\tif (supportsWebP()) {\n\t\treturn {\n\t\t\ttype: 'image/webp',\n\t\t\tquality: 0.9,\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'image/jpeg',\n\t\tquality: 0.6,\n\t}\n}\n\n/**\n * Check that a value is safe to use as a metric.\n *\n * This means the number must be a number, be finite, and not NaN.\n * NaN and Infinity serialize to null, which produces an invalid metric\n * payload.\n * @param value The value to check.\n * @returns True if the value is safe to use as a metric, false otherwise.\n */\nexport function isMetricSafeNumber(value: unknown): boolean {\n\treturn typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2\n//----------------------------------------------------------------------------------------------------------\n/**\n * ASP.NET Core exception middleware handling result.\n *\n * @example handled\n * @example unhandled\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result';\n/**\n * Enum value \"aborted\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling didn't run because the request was aborted.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = \"aborted\";\n/**\n * Enum value \"handled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = \"handled\";\n/**\n * Enum value \"skipped\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling was skipped because the response had started.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = \"skipped\";\n/**\n * Enum value \"unhandled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was not handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = \"unhandled\";\n/**\n * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.\n *\n * @example Contoso.MyHandler\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type';\n/**\n * Rate limiting policy name.\n *\n * @example fixed\n * @example sliding\n * @example token\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy';\n/**\n * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason\n *\n * @example acquired\n * @example request_canceled\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result';\n/**\n * Enum value \"acquired\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease was acquired\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = \"acquired\";\n/**\n * Enum value \"endpoint_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the endpoint limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = \"endpoint_limiter\";\n/**\n * Enum value \"global_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the global limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = \"global_limiter\";\n/**\n * Enum value \"request_canceled\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was canceled\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = \"request_canceled\";\n/**\n * Flag indicating if request was handled by the application pipeline.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled';\n/**\n * A value that indicates whether the matched route is a fallback route.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback';\n/**\n * Match result - success or failure\n *\n * @example success\n * @example failure\n */\nexport const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status';\n/**\n * Enum value \"failure\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match failed\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = \"failure\";\n/**\n * Enum value \"success\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match succeeded\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = \"success\";\n/**\n * A value that indicates whether the user is authenticated.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated';\n/**\n * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example client.example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_ADDRESS = 'client.address';\n/**\n * Client port number.\n *\n * @example 65123\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_PORT = 'client.port';\n/**\n * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 16\n */\nexport const ATTR_CODE_COLUMN_NUMBER = 'code.column.number';\n/**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"/usr/local/MyApplication/content_root/app/index.php\"\n */\nexport const ATTR_CODE_FILE_PATH = 'code.file.path';\n/**\n * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example com.example.MyHttpService.serveRequest\n * @example GuzzleHttp\\\\Client::transfer\n * @example fopen\n *\n * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.\n * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in\n * `code.stacktrace` without information on arguments.\n *\n * Examples:\n *\n * - Java method: `com.example.MyHttpService.serveRequest`\n * - Java anonymous class method: `com.mycompany.Main$1.myMethod`\n * - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`\n * - PHP function: `GuzzleHttp\\Client::transfer`\n * - Go function: `github.com/my/repo/pkg.foo.func5`\n * - Elixir: `OpenTelemetry.Ctx.new`\n * - Erlang: `opentelemetry_ctx:new`\n * - Rust: `playground::my_module::my_cool_func`\n * - C function: `fopen`\n */\nexport const ATTR_CODE_FUNCTION_NAME = 'code.function.name';\n/**\n * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 42\n */\nexport const ATTR_CODE_LINE_NUMBER = 'code.line.number';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_CODE_STACKTRACE = 'code.stacktrace';\n/**\n * The name of a collection (table, container) within the database.\n *\n * @example public.users\n * @example customers\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The collection name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple collections\n * in non-batch operations.\n *\n * For batch operations, if the individual operations are known to have the same\n * collection name then that collection name **SHOULD** be used.\n */\nexport const ATTR_DB_COLLECTION_NAME = 'db.collection.name';\n/**\n * The name of the database, fully qualified within the server address and port.\n *\n * @example customers\n * @example test.users\n *\n * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted.\n * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.\n * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.\n */\nexport const ATTR_DB_NAMESPACE = 'db.namespace';\n/**\n * The number of queries included in a batch operation.\n *\n * @example 2\n * @example 3\n * @example 4\n *\n * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`.\n */\nexport const ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size';\n/**\n * The name of the operation or command being executed.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The operation name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple operations\n * in non-batch operations.\n *\n * If spaces can occur in the operation name, multiple consecutive spaces\n * **SHOULD** be normalized to a single space.\n *\n * For batch operations, if the individual operations are known to have the same operation name\n * then that operation name **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_OPERATION_NAME = 'db.operation.name';\n/**\n * Low cardinality summary of a database query.\n *\n * @example SELECT wuser_table\n * @example INSERT shipping_details SELECT orders\n * @example get user by id\n *\n * @note The query summary describes a class of database queries and is useful\n * as a grouping key, especially when analyzing telemetry for database\n * calls involving complex queries.\n *\n * Summary may be available to the instrumentation through\n * instrumentation hooks or other means. If it is not available, instrumentations\n * that support query parsing **SHOULD** generate a summary following\n * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query)\n * section.\n *\n * For batch operations, if the individual operations are known to have the same query summary\n * then that query summary **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_QUERY_SUMMARY = 'db.query.summary';\n/**\n * The database query being executed.\n *\n * @example SELECT * FROM wuser_table where username = ?\n * @example SET mykey ?\n *\n * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext).\n * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable.\n * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.\n */\nexport const ATTR_DB_QUERY_TEXT = 'db.query.text';\n/**\n * Database response status code.\n *\n * @example 102\n * @example ORA-17002\n * @example 08P01\n * @example 404\n *\n * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.\n * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system.\n */\nexport const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code';\n/**\n * The name of a stored procedure within the database.\n *\n * @example GetCustomer\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * For batch operations, if the individual operations are known to have the same\n * stored procedure name then that stored procedure name **SHOULD** be used.\n */\nexport const ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name';\n/**\n * The database management system (DBMS) product as identified by the client instrumentation.\n *\n * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge.\n */\nexport const ATTR_DB_SYSTEM_NAME = 'db.system.name';\n/**\n * Enum value \"mariadb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MariaDB](https://mariadb.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MARIADB = \"mariadb\";\n/**\n * Enum value \"microsoft.sql_server\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Microsoft SQL Server](https://www.microsoft.com/sql-server)\n */\nexport const DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = \"microsoft.sql_server\";\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MySQL](https://www.mysql.com/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MYSQL = \"mysql\";\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [PostgreSQL](https://www.postgresql.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_POSTGRESQL = \"postgresql\";\n/**\n * Name of the garbage collector managed heap generation.\n *\n * @example gen0\n * @example gen1\n * @example gen2\n */\nexport const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation';\n/**\n * Enum value \"gen0\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 0\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = \"gen0\";\n/**\n * Enum value \"gen1\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 1\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = \"gen1\";\n/**\n * Enum value \"gen2\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 2\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = \"gen2\";\n/**\n * Enum value \"loh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Large Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = \"loh\";\n/**\n * Enum value \"poh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Pinned Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_POH = \"poh\";\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_ERROR_TYPE}.\n *\n * A fallback error value to be used when the instrumentation doesn't define a custom value.\n */\nexport const ERROR_TYPE_VALUE_OTHER = \"_OTHER\";\n/**\n * Indicates that the exception is escaping the scope of the span.\n *\n * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.\n */\nexport const ATTR_EXCEPTION_ESCAPED = 'exception.escaped';\n/**\n * The exception message.\n *\n * @example Division by zero\n * @example Can't convert 'int' object to str implicitly\n *\n * @note > [!WARNING]\n *\n * > This attribute may contain sensitive information.\n */\nexport const ATTR_EXCEPTION_MESSAGE = 'exception.message';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n *\n * @example \"Exception in thread \"main\" java.lang.RuntimeException: Test exception\\\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';\n/**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n *\n * @example java.net.ConnectException\n * @example OSError\n */\nexport const ATTR_EXCEPTION_TYPE = 'exception.type';\n/**\n * HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"1.2.3.4\", \"1.2.3.5\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * The `User-Agent` header is already captured in the `user_agent.original` attribute.\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for`\n * attribute with value `[\"1.2.3.4\", \"1.2.3.5\"]` or `[\"1.2.3.4, 1.2.3.5\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;\n/**\n * HTTP request method.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @note HTTP request method value **SHOULD** be \"known\" to the instrumentation.\n * By default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods),\n * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html)\n * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1).\n *\n * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.\n *\n * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override\n * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named\n * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods.\n *\n *\n * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property\n * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or\n * `.instrumentation/development.general.http.server`.\n *\n * In either case, this list **MUST** be a full override of the default known methods,\n * it is not a list of known methods in addition to the defaults.\n *\n * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.\n * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.\n * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.\n */\nexport const ATTR_HTTP_REQUEST_METHOD = 'http.request.method';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * Any HTTP method that the instrumentation has no prior knowledge of.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OTHER = \"_OTHER\";\n/**\n * Enum value \"CONNECT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * CONNECT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_CONNECT = \"CONNECT\";\n/**\n * Enum value \"DELETE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * DELETE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_DELETE = \"DELETE\";\n/**\n * Enum value \"GET\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * GET method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_GET = \"GET\";\n/**\n * Enum value \"HEAD\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * HEAD method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_HEAD = \"HEAD\";\n/**\n * Enum value \"OPTIONS\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * OPTIONS method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OPTIONS = \"OPTIONS\";\n/**\n * Enum value \"PATCH\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PATCH method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PATCH = \"PATCH\";\n/**\n * Enum value \"POST\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * POST method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_POST = \"POST\";\n/**\n * Enum value \"PUT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PUT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PUT = \"PUT\";\n/**\n * Enum value \"TRACE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * TRACE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_TRACE = \"TRACE\";\n/**\n * Original HTTP method sent by the client in the request line.\n *\n * @example GeT\n * @example ACL\n * @example foo\n */\nexport const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original';\n/**\n * The ordinal number of request resending attempt (for any reason, including redirects).\n *\n * @example 3\n *\n * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n */\nexport const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count';\n/**\n * HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"abc\", \"def\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header`\n * attribute with value `[\"abc\", \"def\"]` or `[\"abc, def\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`;\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';\n/**\n * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.\n *\n * @example /users/:userID?\n * @example my-controller/my-action/{id?}\n *\n * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\n * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.\n *\n * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that\n * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`.\n *\n * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.\n *\n * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY**\n * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string.\n */\nexport const ATTR_HTTP_ROUTE = 'http.route';\n/**\n * Name of the garbage collector action.\n *\n * @example end of minor GC\n * @example end of major GC\n *\n * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n */\nexport const ATTR_JVM_GC_ACTION = 'jvm.gc.action';\n/**\n * Name of the garbage collector.\n *\n * @example G1 Young Generation\n * @example G1 Old Generation\n *\n * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n */\nexport const ATTR_JVM_GC_NAME = 'jvm.gc.name';\n/**\n * Name of the memory pool.\n *\n * @example G1 Old Gen\n * @example G1 Eden space\n * @example G1 Survivor Space\n *\n * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n */\nexport const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name';\n/**\n * The type of memory.\n *\n * @example heap\n * @example non_heap\n */\nexport const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type';\n/**\n * Enum value \"heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Heap memory.\n */\nexport const JVM_MEMORY_TYPE_VALUE_HEAP = \"heap\";\n/**\n * Enum value \"non_heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Non-heap memory\n */\nexport const JVM_MEMORY_TYPE_VALUE_NON_HEAP = \"non_heap\";\n/**\n * Whether the thread is daemon or not.\n */\nexport const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon';\n/**\n * State of the thread.\n *\n * @example runnable\n * @example blocked\n */\nexport const ATTR_JVM_THREAD_STATE = 'jvm.thread.state';\n/**\n * Enum value \"blocked\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is blocked waiting for a monitor lock is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_BLOCKED = \"blocked\";\n/**\n * Enum value \"new\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has not yet started is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_NEW = \"new\";\n/**\n * Enum value \"runnable\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread executing in the Java virtual machine is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_RUNNABLE = \"runnable\";\n/**\n * Enum value \"terminated\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has exited is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TERMINATED = \"terminated\";\n/**\n * Enum value \"timed_waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TIMED_WAITING = \"timed_waiting\";\n/**\n * Enum value \"waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting indefinitely for another thread to perform a particular action is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_WAITING = \"waiting\";\n/**\n * Local address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address';\n/**\n * Local port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_LOCAL_PORT = 'network.local.port';\n/**\n * Peer address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address';\n/**\n * Peer port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_PEER_PORT = 'network.peer.port';\n/**\n * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent.\n *\n * @example amqp\n * @example http\n * @example mqtt\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name';\n/**\n * The actual version of the protocol used for network communication.\n *\n * @example 1.1\n * @example 2\n *\n * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD NOT** be set.\n */\nexport const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version';\n/**\n * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n *\n * @example tcp\n * @example udp\n *\n * @note The value **SHOULD** be normalized to lowercase.\n *\n * Consider always setting the transport when setting a port number, since\n * a port number is ambiguous without knowing the transport. For example\n * different processes could be listening on TCP port 12345 and UDP port 12345.\n */\nexport const ATTR_NETWORK_TRANSPORT = 'network.transport';\n/**\n * Enum value \"pipe\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Named or anonymous pipe.\n */\nexport const NETWORK_TRANSPORT_VALUE_PIPE = \"pipe\";\n/**\n * Enum value \"quic\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * QUIC\n */\nexport const NETWORK_TRANSPORT_VALUE_QUIC = \"quic\";\n/**\n * Enum value \"tcp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * TCP\n */\nexport const NETWORK_TRANSPORT_VALUE_TCP = \"tcp\";\n/**\n * Enum value \"udp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * UDP\n */\nexport const NETWORK_TRANSPORT_VALUE_UDP = \"udp\";\n/**\n * Enum value \"unix\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Unix domain socket\n */\nexport const NETWORK_TRANSPORT_VALUE_UNIX = \"unix\";\n/**\n * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent.\n *\n * @example ipv4\n * @example ipv6\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_TYPE = 'network.type';\n/**\n * Enum value \"ipv4\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv4\n */\nexport const NETWORK_TYPE_VALUE_IPV4 = \"ipv4\";\n/**\n * Enum value \"ipv6\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv6\n */\nexport const NETWORK_TYPE_VALUE_IPV6 = \"ipv6\";\n/**\n * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).\n *\n * @example io.opentelemetry.contrib.mongodb\n */\nexport const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name';\n/**\n * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).\n *\n * @example 1.0.0\n */\nexport const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version';\n/**\n * Name of the code, either \"OK\" or \"ERROR\". **MUST NOT** be set if the status code is UNSET.\n */\nexport const ATTR_OTEL_STATUS_CODE = 'otel.status_code';\n/**\n * Enum value \"ERROR\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation contains an error.\n */\nexport const OTEL_STATUS_CODE_VALUE_ERROR = \"ERROR\";\n/**\n * Enum value \"OK\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation has been validated by an Application developer or Operator to have completed successfully.\n */\nexport const OTEL_STATUS_CODE_VALUE_OK = \"OK\";\n/**\n * Description of the Status if it has a value, otherwise not set.\n *\n * @example resource not found\n */\nexport const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description';\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address';\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port';\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id';\n/**\n * Logical name of the service.\n *\n * @example shoppingcart\n *\n * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`.\n */\nexport const ATTR_SERVICE_NAME = 'service.name';\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace';\n/**\n * The version string of the service component. The format is not defined by these conventions.\n *\n * @example 2.0.0\n * @example a01dbef8a\n */\nexport const ATTR_SERVICE_VERSION = 'service.version';\n/**\n * SignalR HTTP connection closure status.\n *\n * @example app_shutdown\n * @example timeout\n */\nexport const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status';\n/**\n * Enum value \"app_shutdown\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed because the app is shutting down.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = \"app_shutdown\";\n/**\n * Enum value \"normal_closure\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed normally.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = \"normal_closure\";\n/**\n * Enum value \"timeout\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed due to a timeout.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = \"timeout\";\n/**\n * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)\n *\n * @example web_sockets\n * @example long_polling\n */\nexport const ATTR_SIGNALR_TRANSPORT = 'signalr.transport';\n/**\n * Enum value \"long_polling\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * LongPolling protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = \"long_polling\";\n/**\n * Enum value \"server_sent_events\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * ServerSentEvents protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = \"server_sent_events\";\n/**\n * Enum value \"web_sockets\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * WebSockets protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = \"web_sockets\";\n/**\n * The language of the telemetry SDK.\n */\nexport const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';\n/**\n * Enum value \"cpp\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = \"cpp\";\n/**\n * Enum value \"dotnet\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = \"dotnet\";\n/**\n * Enum value \"erlang\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = \"erlang\";\n/**\n * Enum value \"go\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_GO = \"go\";\n/**\n * Enum value \"java\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = \"java\";\n/**\n * Enum value \"nodejs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = \"nodejs\";\n/**\n * Enum value \"php\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = \"php\";\n/**\n * Enum value \"python\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = \"python\";\n/**\n * Enum value \"ruby\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = \"ruby\";\n/**\n * Enum value \"rust\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = \"rust\";\n/**\n * Enum value \"swift\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = \"swift\";\n/**\n * Enum value \"webjs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = \"webjs\";\n/**\n * The name of the telemetry SDK as defined above.\n *\n * @example opentelemetry\n *\n * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.\n * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the\n * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point\n * or another suitable identifier depending on the language.\n * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.\n * All custom identifiers **SHOULD** be stable across different versions of an implementation.\n */\nexport const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';\n/**\n * The version string of the telemetry SDK.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';\n/**\n * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component\n *\n * @example SemConv\n */\nexport const ATTR_URL_FRAGMENT = 'url.fragment';\n/**\n * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n * @example //localhost\n *\n * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment\n * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.\n *\n * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`.\n * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.\n *\n * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed).\n *\n * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the\n * value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `https://www.example.com/path?color=blue&sig=REDACTED`.\n */\nexport const ATTR_URL_FULL = 'url.full';\n/**\n * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component\n *\n * @example /search\n *\n * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.\n */\nexport const ATTR_URL_PATH = 'url.path';\n/**\n * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component\n *\n * @example q=OpenTelemetry\n *\n * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `q=OpenTelemetry&sig=REDACTED`.\n */\nexport const ATTR_URL_QUERY = 'url.query';\n/**\n * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.\n *\n * @example https\n * @example ftp\n * @example telnet\n */\nexport const ATTR_URL_SCHEME = 'url.scheme';\n/**\n * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2\n */\nexport const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original';\n//# sourceMappingURL=stable_attributes.js.map","/**\n * The amount of time to wait until sending the first payload.\n */\nexport const FIRST_SEND_FREQUENCY = 1000\n/**\n * The amount of time between sending the client-side payload to Highlight backend client.\n * In milliseconds.\n */\nexport const SEND_FREQUENCY = 1000 * 2\n\n/**\n * Maximum length of a session\n */\nexport const MAX_SESSION_LENGTH = 4 * 60 * 60 * 1000\n\n/**\n * The amount of time allowed after the last push before creating a new session.\n * In milliseconds.\n */\nexport const SESSION_PUSH_THRESHOLD = 15 * 60 * 1000\n\n/*\n * Don't take another full snapshot unless it's been at least\n * 4 minutes AND the cumulative payload size since the last\n * snapshot is > 10MB.\n */\nexport const SNAPSHOT_SETTINGS = {\n\tnormal: {\n\t\tbytes: 10e6,\n\t\ttime: 4 * 60 * 1000,\n\t},\n\tcanvas: {\n\t\tbytes: 16e6,\n\t\ttime: 5000,\n\t},\n} as const\n\n// Debounce duplicate visibility events\nexport const VISIBILITY_DEBOUNCE_MS = 100\n\n// Max allowed time to upload to public graph before triggering recording kill switch\nexport const UPLOAD_TIMEOUT = 1000 * 15\n\nexport const HIGHLIGHT_URL = 'app.highlight.io'\nexport const LAUNCHDARKLY_URL = 'https://app.launchdarkly.com'\nexport const LAUNCHDARKLY_ENV_APPS = {\n\t'observability.ld-stg.launchdarkly.com': 'ld-stg.launchdarkly.com',\n\t'observability.app.launchdarkly.com': 'app.launchdarkly.com',\n\t'observability.app.ld.catamorphic.com': 'app.ld.catamorphic.com',\n} as const\nexport const LAUNCHDARKLY_PATH_PREFIX = '/projects/default'\nexport const LAUNCHDARKLY_BACKEND_REGEX = /pub\\.(?<domain>.+)/\n","/*! js-cookie v3.0.8 | MIT */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (key === '__proto__') continue\n target[key] = source[key];\n }\n }\n return target\n}\n\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n\nfunction init(converter, defaultAttributes) {\n function set(name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get(name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n if (!(found in jar)) jar[found] = converter.read(value, found);\n if (name === found) {\n break\n }\n } catch (_e) {\n // Do nothing...\n }\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n\nexport { api as default };\n","import Cookies from 'js-cookie'\nimport { SESSION_PUSH_THRESHOLD } from '../constants/sessions'\nimport { internalLogOnce } from '../../sdk/util'\n\nexport enum LocalStorageKeys {\n\tCLIENT_ID = 'highlightClientID',\n}\n\ntype Mode = 'localStorage' | 'sessionStorage'\n\nlet mode: Mode = 'localStorage'\nlet cookieWriteEnabled: boolean = true\n\nclass Storage {\n\tprivate storage: { [key: string]: string } = {}\n\n\tpublic get length(): number {\n\t\treturn Object.keys(this.storage).length\n\t}\n\n\tpublic key(index: number): string | null {\n\t\tconst keys = Object.keys(this.storage)\n\t\treturn keys[index] ?? null\n\t}\n\n\tpublic getItem(key: string) {\n\t\treturn this.storage[key] ?? ''\n\t}\n\tpublic setItem(key: string, value: string) {\n\t\tthis.storage[key] = value\n\t}\n\tpublic removeItem(key: string) {\n\t\tdelete this.storage[key]\n\t}\n}\n\nexport class CookieStorage {\n\tpublic getItem(key: string) {\n\t\treturn Cookies.get(key) ?? ''\n\t}\n\n\tpublic setItem(key: string, value: string) {\n\t\tif (!cookieWriteEnabled) {\n\t\t\treturn\n\t\t}\n\t\tconst expires = new Date()\n\t\texpires.setTime(expires.getTime() + SESSION_PUSH_THRESHOLD)\n\t\tCookies.set(key, value, { expires })\n\t}\n\n\tpublic removeItem(key: string) {\n\t\tif (!cookieWriteEnabled) {\n\t\t\treturn\n\t\t}\n\t\tCookies.remove(key)\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn Object.keys(Cookies.get() ?? {})\n\t}\n}\n\nexport const globalStorage = new Storage()\nexport const cookieStorage = new CookieStorage()\n\nexport const getPersistentStorage = () => {\n\tlet storage:\n\t\t| Storage\n\t\t| typeof window.localStorage\n\t\t| typeof window.sessionStorage\n\t\t| null = null\n\n\tif (typeof window === 'undefined') {\n\t\treturn globalStorage\n\t}\n\n\ttry {\n\t\tswitch (mode) {\n\t\t\tcase 'localStorage':\n\t\t\t\tstorage = window.localStorage\n\t\t\t\tbreak\n\t\t\tcase 'sessionStorage':\n\t\t\t\tstorage = window.sessionStorage\n\t\t\t\tbreak\n\t\t}\n\t\tif (!storage) {\n\t\t\tinternalLogOnce(\n\t\t\t\t'storage',\n\t\t\t\t'getPersistentStorage',\n\t\t\t\t'debug',\n\t\t\t\t`persistent storage was not found for mode ${mode}; using global storage`,\n\t\t\t)\n\t\t\tstorage = globalStorage\n\t\t}\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t'storage',\n\t\t\t'getPersistentStorage',\n\t\t\t'debug',\n\t\t\t`failed to get persistent storage; using global storage`,\n\t\t\te,\n\t\t)\n\t\tstorage = globalStorage\n\t}\n\treturn storage\n}\n\nexport const setStorageMode = (m: Mode) => {\n\tmode = m\n}\n\nexport const setCookieWriteEnabled = (enabled: boolean) => {\n\tcookieWriteEnabled = enabled\n}\n\nexport const getItem = (key: string) => {\n\ttry {\n\t\treturn getPersistentStorage().getItem(key)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'getItem',\n\t\t\t'debug',\n\t\t\t`failed to get item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.getItem(key)\n\t}\n}\n\nexport const setItem = (key: string, value: string) => {\n\tcookieStorage.setItem(key, value)\n\ttry {\n\t\treturn getPersistentStorage().setItem(key, value)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'setItem',\n\t\t\t'debug',\n\t\t\t`failed to set item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.setItem(key, value)\n\t}\n}\n\nexport const removeItem = (key: string) => {\n\tcookieStorage.removeItem(key)\n\ttry {\n\t\treturn getPersistentStorage().removeItem(key)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'removeItem',\n\t\t\t'debug',\n\t\t\t`failed to remove item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.removeItem(key)\n\t}\n}\n\nexport const monkeyPatchLocalStorage = (\n\tonSetItemHandler: ({\n\t\tkeyName,\n\t\tkeyValue,\n\t}: {\n\t\tkeyName: string\n\t\tkeyValue: string\n\t}) => void,\n) => {\n\tif (mode === 'sessionStorage') {\n\t\tconsole.warn(\n\t\t\t`highlight.io cannot use local storage; segment integration will not work`,\n\t\t)\n\t\treturn\n\t}\n\tif (typeof window === 'undefined') {\n\t\tconsole.warn(\n\t\t\t`highlight.io cannot use local storage (not a window); segment integration will not work`,\n\t\t)\n\t\treturn\n\t}\n\n\tconst originalSetItem = window.localStorage.setItem\n\twindow.localStorage.setItem = function () {\n\t\tconst [keyName, keyValue] = arguments as unknown as [\n\t\t\tkey: string,\n\t\t\tvalue: string,\n\t\t]\n\t\tonSetItemHandler({ keyName, keyValue })\n\t\toriginalSetItem.apply(this, [keyName, keyValue])\n\t}\n}\n","export enum SESSION_STORAGE_KEYS {\n\tSEGMENT_LAST_SENT_HASH_KEY = 'HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY',\n\tSESSION_ID = 'sessionID',\n\tSESSION_DATA = 'sessionData',\n\tUSER_IDENTIFIER = 'highlightIdentifier',\n\tUSER_OBJECT = 'highlightUserObject',\n}\n","import { SESSION_PUSH_THRESHOLD } from '../../constants/sessions'\nimport {\n\tcookieStorage,\n\tgetItem,\n\tremoveItem,\n\tsetItem,\n\tgetPersistentStorage,\n} from '../storage'\nimport { SESSION_STORAGE_KEYS } from './sessionStorageKeys'\nimport { internalLogOnce } from '../../../sdk/util'\n\nexport type SessionData = {\n\tsessionSecureID: string\n\tsessionKey?: string\n\tprojectID: number\n\tsessionStartTime?: number\n\tlastPushTime?: number\n\tuserIdentifier?: string\n\tuserObject?: Object\n}\n\nconst getSessionDataKey = (sessionID: string): string => {\n\treturn `${SESSION_STORAGE_KEYS.SESSION_DATA}_${sessionID}`\n}\n\ninterface GlobalThis {\n\tpersistentSessionSecureID?: string\n}\ndeclare var globalThis: GlobalThis | undefined\n\nexport const getPersistentSessionSecureID = (): string => {\n\tif (\n\t\ttypeof globalThis !== 'undefined' &&\n\t\tglobalThis.persistentSessionSecureID?.length\n\t) {\n\t\treturn globalThis.persistentSessionSecureID\n\t}\n\treturn getSessionSecureID()\n}\n\nexport const setPersistentSessionSecureID = (secureID: string) => {\n\t// for duplicate tab functionality, secureID is ''\n\t// avoid clearing the local secureID used for network request instrumentation\n\tif (typeof globalThis !== 'undefined' && secureID?.length) {\n\t\tglobalThis.persistentSessionSecureID = secureID\n\t}\n}\n\nexport const getSessionSecureID = (): string => {\n\treturn getItem(SESSION_STORAGE_KEYS.SESSION_ID) ?? ''\n}\n\nexport const setSessionSecureID = (secureID: string) => {\n\t// for duplicate tab functionality, secureID is ''\n\tsetItem(SESSION_STORAGE_KEYS.SESSION_ID, secureID)\n}\n\nconst getSessionData = (sessionID: string): SessionData | undefined => {\n\tconst key = getSessionDataKey(sessionID)\n\tlet storedSessionData = JSON.parse(getItem(key) || '{}')\n\treturn storedSessionData as SessionData\n}\n\nexport const getPreviousSessionData = (\n\tsessionID?: string,\n): SessionData | undefined => {\n\tif (!sessionID) {\n\t\tsessionID = getSessionSecureID()\n\t}\n\tlet storedSessionData = getSessionData(sessionID)\n\tif (\n\t\tstoredSessionData &&\n\t\tstoredSessionData.lastPushTime &&\n\t\tDate.now() - storedSessionData.lastPushTime < SESSION_PUSH_THRESHOLD\n\t) {\n\t\treturn storedSessionData as SessionData\n\t} else {\n\t\tremoveItem(getSessionDataKey(sessionID))\n\t}\n}\n\nexport const setSessionData = function (sessionData?: SessionData) {\n\tif (!sessionData?.sessionSecureID) return\n\tconst secureID = sessionData.sessionSecureID!\n\tsetPersistentSessionSecureID(secureID)\n\tconst key = getSessionDataKey(secureID)\n\tsetItem(key, JSON.stringify(sessionData))\n\t// delete old session data\n\tpruneSessionData(key)\n}\n\nexport const loadCookieSessionData = function () {\n\tconst sessionSecureID = cookieStorage.getItem(\n\t\tSESSION_STORAGE_KEYS.SESSION_ID,\n\t)\n\tsetSessionSecureID(sessionSecureID)\n\tconst sessionDataKey = getSessionDataKey(sessionSecureID)\n\tconst sessionDataStr = cookieStorage.getItem(sessionDataKey)\n\ttry {\n\t\tsetSessionData(JSON.parse(sessionDataStr) as SessionData)\n\t} catch (e) {}\n}\n\nfunction pruneSessionData(keepKey: string): void {\n\tconst prefix = `${SESSION_STORAGE_KEYS.SESSION_DATA}_`\n\tconst candidates = new Set<string>()\n\n\tconst storage = getPersistentStorage()\n\tfor (let i = storage.length - 1; i >= 0; i--) {\n\t\tconst key = storage.key(i)\n\t\tif (key && key.startsWith(prefix) && key !== keepKey) {\n\t\t\tcandidates.add(key)\n\t\t}\n\t}\n\n\t// Cookies are written alongside localStorage but persist independently\n\t// (they survive localStorage being cleared, and outlive many sessions\n\t// via the SESSION_PUSH_THRESHOLD expiry). Without enumerating them here,\n\t// sessionData_* cookies pile up over time and bloat the Cookie header\n\t// enough to break unrelated API calls.\n\tfor (const key of cookieStorage.keys()) {\n\t\tif (key.startsWith(prefix) && key !== keepKey) {\n\t\t\tcandidates.add(key)\n\t\t}\n\t}\n\n\tfor (const key of candidates) {\n\t\tlet stale = true\n\t\ttry {\n\t\t\t// Cookie-only entries (e.g. from a parallel tab that hasn't\n\t\t\t// hydrated localStorage in this context) won't be found by\n\t\t\t// getItem, which only reads persistent storage. Fall back to\n\t\t\t// the cookie value so we don't unconditionally prune fresh\n\t\t\t// data belonging to active sessions.\n\t\t\tconst raw = getItem(key) || cookieStorage.getItem(key) || '{}'\n\t\t\tconst sessionData = JSON.parse(raw) as SessionData\n\t\t\t// Fall back to sessionStartTime so entries from sessions that\n\t\t\t// ended before the first push still age out. Entries with no\n\t\t\t// usable timestamp (foreign / corrupt / truncated) are stale.\n\t\t\tconst ts = sessionData.lastPushTime ?? sessionData.sessionStartTime\n\t\t\tstale =\n\t\t\t\tts === undefined || Date.now() - ts >= SESSION_PUSH_THRESHOLD\n\t\t} catch {\n\t\t\t// Truncated past the 4KB cookie limit or otherwise corrupt —\n\t\t\t// drop silently rather than logging on every page load.\n\t\t}\n\t\tif (stale) {\n\t\t\tinternalLogOnce(\n\t\t\t\t'highlightSession',\n\t\t\t\t'pruneSessionData',\n\t\t\t\t'debug',\n\t\t\t\t`removing session data for stale key ${key}`,\n\t\t\t)\n\t\t\tremoveItem(key)\n\t\t}\n\t}\n}\n","export type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]?: Maybe<T[SubKey]>\n}\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]: Maybe<T[SubKey]>\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental<T> =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tInt64ID: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\n/** An attribute match configuration which can match an attribute key and value. */\nexport type AttributeMatchConfig = {\n\t__typename?: 'AttributeMatchConfig'\n\tattribute: MatchConfig\n\tkey: MatchConfig\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlog_cursor?: InputMaybe<Scalars['String']['input']>\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\trequest_id?: InputMaybe<Scalars['String']['input']>\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tstackTrace: Array<InputMaybe<StackFrameInput>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsampling?: Maybe<SamplingConfig>\n\tsecure_id: Scalars['String']['output']\n}\n\n/**\n * A match based log sampling configuration. A log matches if each specified matching configuration matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type LogSamplingConfig = {\n\t__typename?: 'LogSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** Matches against the log message. */\n\tmessage?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of logs to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 logs will be sampled. Setting the ratio to 0 will disable sampling for the log.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n\t/** Matches against the severity of the log. */\n\tseverityText?: Maybe<MatchConfig>\n}\n\n/**\n * A match configuration. Each field of this type represents a different type of match\n * configuration. One and only 1 field should be populated.\n *\n * This is effectively a sum type/discriminated union, but isn't implemented as such to avoid\n * this bug: https://github.com/99designs/gqlgen/issues/2741\n */\nexport type MatchConfig = {\n\t__typename?: 'MatchConfig'\n\t/** A match configuration which does an exact match against any value. */\n\tmatchValue?: Maybe<Scalars['Any']['output']>\n\t/**\n\t * A match configuration which matches against a regular expression.\n\t * Can only match string attributes.\n\t */\n\tregexValue?: Maybe<Scalars['String']['output']>\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe<Scalars['String']['input']>\n\tgroup?: InputMaybe<Scalars['String']['input']>\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\ttags?: InputMaybe<Array<MetricTag>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe<Scalars['Any']['output']>\n\tpushBackendPayload?: Maybe<Scalars['Any']['output']>\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe<Scalars['Any']['output']>\n\tpushSessionEvents?: Maybe<Scalars['Any']['output']>\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<Array<Scalars['String']['input']>>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe<Scalars['String']['input']>\n\tserviceName?: InputMaybe<Scalars['String']['input']>\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\ttype?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array<InputMaybe<BackendErrorObjectInput>>\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array<InputMaybe<MetricInput>>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array<InputMaybe<ErrorObjectInput>>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe<Scalars['ID']['input']>\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationPushSessionEventsArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe<Scalars['Any']['output']>\n\tsampling: SamplingConfig\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type QuerySamplingArgs = {\n\torganization_verbose_id: Scalars['String']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array<InputMaybe<ReplayEventInput>>\n}\n\nexport type SamplingConfig = {\n\t__typename?: 'SamplingConfig'\n\tlogs?: Maybe<Array<LogSamplingConfig>>\n\tspans?: Maybe<Array<SpanSamplingConfig>>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe<Scalars['Int64ID']['output']>\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\n/** An event matcher configuration which matches span events within a span. */\nexport type SpanEventMatchConfig = {\n\t__typename?: 'SpanEventMatchConfig'\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\tname?: Maybe<MatchConfig>\n}\n\n/**\n * A match based span sampling configuration. A span matches if each specified matching configuration\n * matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type SpanSamplingConfig = {\n\t__typename?: 'SpanSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** A list of span event match configs. */\n\tevents?: Maybe<Array<SpanEventMatchConfig>>\n\tname?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of spans to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 spans will be sampled. Setting the ratio to 0 will disable sampling for the span.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe<Array<InputMaybe<Scalars['Any']['input']>>>\n\tcolumnNumber?: InputMaybe<Scalars['Int']['input']>\n\tfileName?: InputMaybe<Scalars['String']['input']>\n\tfunctionName?: InputMaybe<Scalars['String']['input']>\n\tisEval?: InputMaybe<Scalars['Boolean']['input']>\n\tisNative?: InputMaybe<Scalars['Boolean']['input']>\n\tlineNumber?: InputMaybe<Scalars['Int']['input']>\n\tsource?: InputMaybe<Scalars['String']['input']>\n}\n","import { ClientError } from 'graphql-request'\nimport { PublicGraphError } from '../graph/generated/schemas'\n\nexport const MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS = 3\n\n// Initial backoff for retrying graphql requests.\nexport const BASE_DELAY_MS = 1000\nexport const BACKOFF_DELAY_MS = 500\n\n// Do not retry if any of these public graph errors are thrown\nconst NON_RETRYABLE_ERRORS = [PublicGraphError.BillingQuotaExceeded.toString()]\n\n// A `ClientError` is retryable if none of the response errors is non-retryable\nconst isErrorRetryable = (error: ClientError): boolean => {\n\tconst match = error.response.errors?.find((e) =>\n\t\tNON_RETRYABLE_ERRORS.includes(e.message),\n\t)\n\treturn match === undefined\n}\n\nexport const getGraphQLRequestWrapper = () => {\n\tconst graphQLRequestWrapper = async <T>(\n\t\trequestFn: () => Promise<T>,\n\t\toperationName: string,\n\t\toperationType?: string,\n\t\tvariables?: any,\n\t\tretries: number = 0,\n\t): Promise<T> => {\n\t\ttry {\n\t\t\treturn await requestFn()\n\t\t} catch (error: any) {\n\t\t\tif (error instanceof ClientError && !isErrorRetryable(error)) {\n\t\t\t\tthrow error\n\t\t\t}\n\n\t\t\tif (retries < MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS) {\n\t\t\t\tawait new Promise((resolve) =>\n\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\tBASE_DELAY_MS + BACKOFF_DELAY_MS * Math.pow(2, retries),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn await graphQLRequestWrapper(\n\t\t\t\t\trequestFn,\n\t\t\t\t\toperationName,\n\t\t\t\t\toperationType,\n\t\t\t\t\tvariables,\n\t\t\t\t\tretries + 1,\n\t\t\t\t)\n\t\t\t}\n\t\t\tconsole.error(\n\t\t\t\t`highlight.io: data request failed after ${retries} retries`,\n\t\t\t)\n\t\t\tthrow error\n\t\t}\n\t}\n\treturn graphQLRequestWrapper\n}\n","import { type HighlightPublicInterface } from '../../client'\nimport type { ErrorMessage, Source } from '../../client/types/shared-types'\nimport type { IntegrationClient } from '../index'\nimport type { LDClientMin as LDClient } from './types/LDClient'\nimport type { Hook } from './types/Hooks'\nimport type { RecordMetric } from '../../client/types/types'\nimport { BufferedClass } from '../../sdk/buffer'\nimport { LDPluginEnvironmentMetadata } from '../../plugins/plugin'\nimport type { Attributes } from '@opentelemetry/api'\nimport type {\n\tIdentifySeriesContext,\n\tIdentifySeriesData,\n\tIdentifySeriesResult,\n\tLDContextStrict,\n\tLDContextCommon,\n\tLDMultiKindContext,\n} from '@launchdarkly/js-client-sdk'\nimport { LDEvaluationReason } from '@launchdarkly/js-sdk-common/dist/cjs/api/data/LDEvaluationReason'\n\nexport type { Hook, LDClient, LDContextStrict }\n\nexport const FEATURE_FLAG_SCOPE = 'feature_flag'\nexport const LD_SCOPE = 'launchdarkly'\nexport const FEATURE_FLAG_SPAN_NAME = 'evaluation'\nexport const FEATURE_FLAG_EVENT_NAME = `${FEATURE_FLAG_SCOPE}.${FEATURE_FLAG_SPAN_NAME}`\n\nexport const FEATURE_FLAG_ENV_ATTR = `${FEATURE_FLAG_SCOPE}.set.id`\nexport const FEATURE_FLAG_KEY_ATTR = `${FEATURE_FLAG_SCOPE}.key`\nexport const FEATURE_FLAG_CONTEXT_ATTR = `${FEATURE_FLAG_SCOPE}.contextKeys`\nexport const FEATURE_FLAG_CONTEXT_ID_ATTR = `${FEATURE_FLAG_SCOPE}.context.id`\nexport const FEATURE_FLAG_VALUE_ATTR = `${FEATURE_FLAG_SCOPE}.result.value`\nexport const FEATURE_FLAG_PROVIDER_ATTR = `${FEATURE_FLAG_SCOPE}.provider.name`\nexport const FEATURE_FLAG_REASON_ATTRS: {\n\t[key in keyof LDEvaluationReason]: string\n} = {\n\tkind: `${FEATURE_FLAG_SCOPE}.result.reason.kind`,\n\terrorKind: `${FEATURE_FLAG_SCOPE}.result.reason.errorKind`,\n\truleIndex: `${FEATURE_FLAG_SCOPE}.result.reason.ruleIndex`,\n\truleId: `${FEATURE_FLAG_SCOPE}.result.reason.ruleId`,\n\tprerequisiteKey: `${FEATURE_FLAG_SCOPE}.result.reason.prerequisiteKey`,\n\tinExperiment: `${FEATURE_FLAG_SCOPE}.result.reason.inExperiment`,\n\tbigSegmentsStatus: `${FEATURE_FLAG_SCOPE}.result.reason.bigSegmentsStatus`,\n}\nexport const FEATURE_FLAG_VARIATION_INDEX_ATTR = `${FEATURE_FLAG_SCOPE}.result.variationIndex`\nexport const FEATURE_FLAG_APP_ID_ATTR = `${LD_SCOPE}.application.id`\nexport const FEATURE_FLAG_APP_VERSION_ATTR = `${LD_SCOPE}.application.version`\n\nexport const CONTEXT_SCOPE = 'context'\nexport const CONTEXT_SCOPE_CONTEXT_KEYS_ATTR = `${CONTEXT_SCOPE}.contextKeys`\n\nexport const LD_INITIALIZE_EVENT = '$ld:telemetry:session:init'\nexport const LD_TRACK_EVENT = '$ld:telemetry:track'\nexport const LD_TRACK_SPAN_NAME = 'launchdarkly.track'\nexport const LD_PAGE_VIEW_SPAN_NAME = 'page_view'\n\nexport const LD_METRIC_NAME_DOCUMENT_LOAD = 'document_load'\n\nexport const LD_IDENTIFY_RESULT_STATUS = 'result.status'\n\nfunction encodeKey(key: string): string {\n\tif (key.includes('%') || key.includes(':')) {\n\t\treturn key.replace(/%/g, '%25').replace(/:/g, '%3A')\n\t}\n\treturn key\n}\n\nfunction isMultiContext(context: any): context is LDMultiKindContext {\n\treturn context.kind === 'multi'\n}\n\n/**\n * Get a canonical key for a given context. The canonical key contains an encoded version of the context\n * keys.\n *\n * This format should be stable and consistent. It isn't for presentation only purposes.\n * It allows linking to a context instance.\n * @param context The context to get a canonical key for.\n * @returns The canonical context key.\n */\nexport function getCanonicalKey(context: LDContextStrict) {\n\tif (isMultiContext(context)) {\n\t\treturn Object.keys(context)\n\t\t\t.sort()\n\t\t\t.filter((key) => key !== 'kind')\n\t\t\t.map((key) => {\n\t\t\t\treturn `${key}:${encodeKey((context[key] as LDContextCommon).key)}`\n\t\t\t})\n\t\t\t.join(':')\n\t} else if ('kind' in context && context.kind === 'user') {\n\t\t// If the kind is a user, then the key is directly the user key.\n\t\treturn context.key\n\t} else if (!('kind' in context)) {\n\t\t// Legacy user.\n\t\treturn context.key\n\t}\n\n\treturn `${context.kind}:${encodeKey(context.key)}`\n}\n\nexport function getContextKeys(context: LDContextStrict) {\n\tif (isMultiContext(context)) {\n\t\treturn Object.keys(context)\n\t\t\t.sort()\n\t\t\t.filter((key) => key !== 'kind')\n\t\t\t.map((key) => {\n\t\t\t\treturn {\n\t\t\t\t\t[key]: (context[key] as LDContextCommon).key,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.reduce((acc, obj) => {\n\t\t\t\treturn { ...acc, ...obj }\n\t\t\t}, {} as Attributes)\n\t}\n\n\t// Legacy user.\n\tif (!('kind' in context)) {\n\t\t// Legacy user.\n\t\treturn {\n\t\t\tuser: context.key,\n\t\t}\n\t}\n\n\t// Single kind context.\n\treturn {\n\t\t[context.kind]: context.key,\n\t}\n}\n\nexport function setupLaunchDarklyIntegration(\n\thClient: HighlightPublicInterface,\n\tldClient: LDClient,\n\toptions?: {\n\t\tcontextFriendlyName?: (context: LDContextStrict) => string | undefined\n\t},\n) {\n\tldClient.addHook({\n\t\tgetMetadata: () => {\n\t\t\treturn {\n\t\t\t\tname: 'highlight.run',\n\t\t\t}\n\t\t},\n\t\tafterIdentify: (hookContext, data, result) => {\n\t\t\tconst metadata = {\n\t\t\t\t...getContextKeys(hookContext.context),\n\t\t\t\tkey:\n\t\t\t\t\toptions?.contextFriendlyName?.(hookContext.context) ??\n\t\t\t\t\tgetCanonicalKey(hookContext.context),\n\t\t\t}\n\t\t\thClient.log('LD.identify', 'INFO', metadata)\n\t\t\tif (result.status === 'completed') {\n\t\t\t\thClient.identify(metadata.key, metadata, 'LaunchDarkly')\n\t\t\t}\n\t\t\treturn data\n\t\t},\n\t\tafterEvaluation: (hookContext, data, detail) => {\n\t\t\tconst eventAttributes: Attributes = {\n\t\t\t\t[FEATURE_FLAG_PROVIDER_ATTR]: 'LaunchDarkly',\n\t\t\t\t[FEATURE_FLAG_KEY_ATTR]: hookContext.flagKey,\n\t\t\t\t[FEATURE_FLAG_VALUE_ATTR]: JSON.stringify(detail.value),\n\t\t\t\t// only set the following keys when values are defined\n\t\t\t\t...(detail.variationIndex !== undefined &&\n\t\t\t\tdetail.variationIndex !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t[FEATURE_FLAG_VARIATION_INDEX_ATTR]:\n\t\t\t\t\t\t\t\tdetail.variationIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t}\n\t\t\tif (detail.reason) {\n\t\t\t\tfor (const attr in FEATURE_FLAG_REASON_ATTRS) {\n\t\t\t\t\tconst k = attr as keyof LDEvaluationReason\n\t\t\t\t\tconst value = detail.reason[k]\n\t\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\t\teventAttributes[FEATURE_FLAG_REASON_ATTRS[k]!] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hookContext.context) {\n\t\t\t\teventAttributes[FEATURE_FLAG_CONTEXT_ATTR] = JSON.stringify(\n\t\t\t\t\tgetContextKeys(hookContext.context),\n\t\t\t\t)\n\t\t\t\teventAttributes[FEATURE_FLAG_CONTEXT_ID_ATTR] = getCanonicalKey(\n\t\t\t\t\thookContext.context,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\thClient.startSpan(FEATURE_FLAG_SPAN_NAME, (s) => {\n\t\t\t\tif (s) {\n\t\t\t\t\ts.addEvent(FEATURE_FLAG_EVENT_NAME, eventAttributes)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\treturn data\n\t\t},\n\t})\n}\n\nexport class LaunchDarklyIntegrationSDK implements IntegrationClient {\n\tclient: LDClient\n\tmetadata?: LDPluginEnvironmentMetadata\n\tconstructor(client: LDClient, metadata?: LDPluginEnvironmentMetadata) {\n\t\tthis.client = client\n\t\tthis.metadata = metadata\n\t}\n\n\tgetHooks(_: LDPluginEnvironmentMetadata): Hook[] {\n\t\treturn []\n\t}\n\n\tinit(sessionSecureID: string) {\n\t\tthis.client.track(LD_INITIALIZE_EVENT, {\n\t\t\tsessionID: sessionSecureID,\n\t\t})\n\t}\n\n\trecordGauge(sessionSecureID: string, metric: RecordMetric) {\n\t\t// noop - metric forwarding is handled upon data ingest\n\t}\n\n\tidentify(\n\t\t_sessionSecureID: string,\n\t\t_user_identifier: string,\n\t\t_user_object = {},\n\t\t_source?: Source,\n\t) {\n\t\t// noop - no highlight forwarding of identify call\n\t}\n\n\terror(sessionSecureID: string, error: ErrorMessage) {\n\t\t// noop - metric forwarding is handled upon data ingest\n\t}\n\n\ttrack(sessionSecureID: string, metadata: object) {\n\t\tconst event = (metadata as unknown as { event?: string }).event\n\t\tthis.client.track(\n\t\t\tevent ? `${LD_TRACK_EVENT}:${event}` : LD_TRACK_EVENT,\n\t\t\t{\n\t\t\t\t...metadata,\n\t\t\t\tsessionID: sessionSecureID,\n\t\t\t},\n\t\t)\n\t}\n}\n\nexport class LaunchDarklyIntegration\n\textends BufferedClass<IntegrationClient>\n\timplements IntegrationClient\n{\n\tclient: LaunchDarklyIntegrationSDK\n\tconstructor(client: LDClient, metadata?: LDPluginEnvironmentMetadata) {\n\t\tsuper()\n\t\tthis.client = new LaunchDarklyIntegrationSDK(client, metadata)\n\t}\n\n\tgetHooks(metadata: LDPluginEnvironmentMetadata): Hook[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tgetMetadata: () => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: 'highlight.run/ld',\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tafterIdentify: (\n\t\t\t\t\thookContext: IdentifySeriesContext,\n\t\t\t\t\tdata: IdentifySeriesData,\n\t\t\t\t\t_result: IdentifySeriesResult,\n\t\t\t\t) => {\n\t\t\t\t\tthis.load(this.client)\n\t\t\t\t\treturn data\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\t}\n\n\tinit(sessionSecureID: string) {\n\t\treturn this._bufferCall('init', [sessionSecureID])\n\t}\n\n\trecordGauge(sessionSecureID: string, metric: RecordMetric) {\n\t\treturn this._bufferCall('recordGauge', [sessionSecureID, metric])\n\t}\n\n\tidentify(\n\t\tsessionSecureID: string,\n\t\tuser_identifier: string,\n\t\tuser_object = {},\n\t\tsource?: Source,\n\t) {\n\t\treturn this._bufferCall('identify', [\n\t\t\tsessionSecureID,\n\t\t\tuser_identifier,\n\t\t\tuser_object,\n\t\t\tsource,\n\t\t])\n\t}\n\n\terror(sessionSecureID: string, error: ErrorMessage) {\n\t\treturn this._bufferCall('error', [sessionSecureID, error])\n\t}\n\n\ttrack(sessionSecureID: string, metadata: object) {\n\t\treturn this._bufferCall('track', [sessionSecureID, metadata])\n\t}\n}\n","// taken from: https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-hash-in-javascript/52809105#52809105\nexport const PathListener = (callback: (url: string) => void) => {\n\tcallback(window.location.href)\n\tconst initialPushState = history.pushState\n\thistory.pushState = ((f) =>\n\t\tfunction pushState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('pushstate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.pushState)\n\n\tconst initialReplaceState = history.replaceState\n\thistory.replaceState = ((f) =>\n\t\tfunction replaceState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('replacestate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.replaceState)\n\n\tconst onPopState = () => {\n\t\twindow.dispatchEvent(new Event('locationchange'))\n\t}\n\twindow.addEventListener('popstate', onPopState)\n\n\tconst onLocationChange = function () {\n\t\tcallback(window.location.href)\n\t}\n\twindow.addEventListener('locationchange', onLocationChange)\n\n\treturn () => {\n\t\twindow.removeEventListener('popstate', onPopState)\n\t\twindow.removeEventListener('locationchange', onLocationChange)\n\t\thistory.pushState = initialPushState\n\t\thistory.replaceState = initialReplaceState\n\t}\n}\n","import pkg from '../package.json' assert { type: 'json' }\nexport default pkg.version\n","type Node = {\n\tname: string\n\tpenalty: number\n\tlevel?: number\n}\n\ntype Path = Node[]\n\nenum Limit {\n\tAll,\n\tTwo,\n\tOne,\n}\n\nexport type Options = {\n\troot: Element\n\tidName: (name: string) => boolean\n\tclassName: (name: string) => boolean\n\ttagName: (name: string) => boolean\n\tattr: (name: string, value: string) => boolean\n\tseedMinLength: number\n\toptimizedMinLength: number\n\tthreshold: number\n\tmaxNumberOfTries: number\n\toptimized: boolean\n}\n\nlet config: Options\n\nlet rootDocument: Document | Element\n\n/**\n * Gets a CSS selector for a given element. Will default to the element's tag name if there are no class name or id.\n * Source: https://github.com/antonmedv/finder\n */\nexport function getElementSelector(input: Element, options?: Partial<Options>) {\n\tconst useOldLogic = true\n\tif (input.nodeType !== Node.ELEMENT_NODE || useOldLogic) {\n\t\treturn getElementSelectorFallback(input)\n\t}\n\n\treturn getElementSelectorNew(input, options)\n}\n\n/*\n * Create a simple selector string for the element using its id or class names if available.\n * Defaults to generic nodeName for the element if not.\n * This does not attempt to create the 'best' selector but should be used\n * when a general identified of an Element is necessary.\n */\nexport function getSimpleSelector(input: Element) {\n\tif (input.id.length) {\n\t\treturn `#${input.id}`\n\t} else if (input.classList.length) {\n\t\tlet classes = []\n\t\tfor (const c of input.classList) {\n\t\t\tclasses.push(`.${c}`)\n\t\t}\n\t\treturn `${input.nodeName.toLowerCase()}${classes.join(',')}`\n\t}\n\treturn input.nodeName.toLowerCase()\n}\n\nexport function getElementSelectorNew(\n\tinput: Element,\n\toptions?: Partial<Options>,\n) {\n\tif ('html' === input.tagName.toLowerCase()) {\n\t\treturn 'html'\n\t}\n\n\ttry {\n\t\tconst defaults: Options = {\n\t\t\troot: document.body,\n\t\t\tidName: (_name: string) => true,\n\t\t\tclassName: (_name: string) => true,\n\t\t\ttagName: (_name: string) => true,\n\t\t\tattr: (_name: string, _value: string) => false,\n\t\t\tseedMinLength: 1,\n\t\t\toptimizedMinLength: 2,\n\t\t\tthreshold: 50,\n\t\t\tmaxNumberOfTries: 1000,\n\t\t\toptimized: true,\n\t\t}\n\n\t\tconfig = { ...defaults, ...options }\n\n\t\trootDocument = findRootDocument(config.root, defaults)\n\n\t\tlet path = bottomUpSearch(input, Limit.All, () =>\n\t\t\tbottomUpSearch(input, Limit.Two, () =>\n\t\t\t\tbottomUpSearch(input, Limit.One),\n\t\t\t),\n\t\t)\n\n\t\tif (path) {\n\t\t\tif (config.optimized) {\n\t\t\t\tconst optimized = sort(optimize(path, input))\n\n\t\t\t\tif (optimized.length > 0) {\n\t\t\t\t\tpath = optimized[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn selector(path)\n\t\t} else {\n\t\t\treturn getElementSelectorFallback(input)\n\t\t}\n\t} catch {\n\t\treturn getElementSelectorFallback(input)\n\t}\n}\n\nfunction findRootDocument(rootNode: Element | Document, defaults: Options) {\n\tif (rootNode.nodeType === Node.DOCUMENT_NODE) {\n\t\treturn rootNode\n\t}\n\tif (rootNode === defaults.root) {\n\t\treturn rootNode.ownerDocument as Document\n\t}\n\treturn rootNode\n}\n\nfunction bottomUpSearch(\n\tinput: Element,\n\tlimit: Limit,\n\tfallback?: () => Path | null,\n): Path | null {\n\tlet path: Path | null = null\n\tlet stack: Node[][] = []\n\tlet current: Element | null = input\n\tlet i = 0\n\n\twhile (current && current !== config.root.parentElement) {\n\t\tlet level: Node[] = maybe(id(current)) ||\n\t\t\tmaybe(...attr(current)) ||\n\t\t\tmaybe(...classNames(current)) ||\n\t\t\tmaybe(tagName(current)) || [any()]\n\n\t\tconst nth = index(current)\n\n\t\tif (limit === Limit.All) {\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.Two) {\n\t\t\tlevel = level.slice(0, 1)\n\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.One) {\n\t\t\tconst [node] = (level = level.slice(0, 1))\n\n\t\t\tif (nth && dispensableNth(node)) {\n\t\t\t\tlevel = [nthChild(node, nth)]\n\t\t\t}\n\t\t}\n\n\t\tfor (let node of level) {\n\t\t\tnode.level = i\n\t\t}\n\n\t\tstack.push(level)\n\n\t\tif (stack.length >= config.seedMinLength) {\n\t\t\tpath = findUniquePath(stack, fallback)\n\t\t\tif (path) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tcurrent = current.parentElement\n\t\ti++\n\t}\n\n\tif (!path) {\n\t\tpath = findUniquePath(stack, fallback)\n\t}\n\n\treturn path\n}\n\nfunction findUniquePath(\n\tstack: Node[][],\n\tfallback?: () => Path | null,\n): Path | null {\n\tconst paths = sort(combinations(stack))\n\n\tif (paths.length > config.threshold) {\n\t\treturn fallback ? fallback() : null\n\t}\n\n\tfor (let candidate of paths) {\n\t\tif (unique(candidate)) {\n\t\t\treturn candidate\n\t\t}\n\t}\n\n\treturn null\n}\n\nfunction selector(path: Path): string {\n\tlet node = path[0]\n\tlet query = node.name\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst level = path[i].level || 0\n\n\t\tif (node.level === level - 1) {\n\t\t\tquery = `${path[i].name} > ${query}`\n\t\t} else {\n\t\t\tquery = `${path[i].name} ${query}`\n\t\t}\n\n\t\tnode = path[i]\n\t}\n\treturn query\n}\n\nfunction penalty(path: Path): number {\n\treturn path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0)\n}\n\nfunction unique(path: Path) {\n\tswitch (rootDocument.querySelectorAll(selector(path)).length) {\n\t\tcase 0:\n\t\t\treturn true\n\t\tcase 1:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunction id(input: Element): Node | null {\n\tconst elementId = input.getAttribute('id')\n\tif (elementId && config.idName(elementId)) {\n\t\treturn {\n\t\t\tname: '#' + cssesc(elementId, { isIdentifier: true }),\n\t\t\tpenalty: 0,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction attr(input: Element): Node[] {\n\tconst attrs = Array.from(input.attributes).filter((attr) =>\n\t\tconfig.attr(attr.name, attr.value),\n\t)\n\n\treturn attrs.map(\n\t\t(attr): Node => ({\n\t\t\tname:\n\t\t\t\t'[' +\n\t\t\t\tcssesc(attr.name, { isIdentifier: true }) +\n\t\t\t\t'=\"' +\n\t\t\t\tcssesc(attr.value) +\n\t\t\t\t'\"]',\n\t\t\tpenalty: 0.5,\n\t\t}),\n\t)\n}\n\nfunction classNames(input: Element): Node[] {\n\tconst names = Array.from(input.classList).filter(config.className)\n\n\treturn names.map(\n\t\t(name): Node => ({\n\t\t\tname: '.' + cssesc(name, { isIdentifier: true }),\n\t\t\tpenalty: 1,\n\t\t}),\n\t)\n}\n\nfunction tagName(input: Element): Node | null {\n\tconst name = input.tagName.toLowerCase()\n\tif (config.tagName(name)) {\n\t\treturn {\n\t\t\tname,\n\t\t\tpenalty: 2,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction any(): Node {\n\treturn {\n\t\tname: '*',\n\t\tpenalty: 3,\n\t}\n}\n\nfunction index(input: Element): number | null {\n\tconst parent = input.parentNode\n\tif (!parent) {\n\t\treturn null\n\t}\n\n\tlet child = parent.firstChild\n\tif (!child) {\n\t\treturn null\n\t}\n\n\tlet i = 0\n\twhile (child) {\n\t\tif (child.nodeType === Node.ELEMENT_NODE) {\n\t\t\ti++\n\t\t}\n\n\t\tif (child === input) {\n\t\t\tbreak\n\t\t}\n\n\t\tchild = child.nextSibling\n\t}\n\n\treturn i\n}\n\nfunction nthChild(node: Node, i: number): Node {\n\treturn {\n\t\tname: node.name + `:nth-child(${i})`,\n\t\tpenalty: node.penalty + 1,\n\t}\n}\n\nfunction dispensableNth(node: Node) {\n\treturn node.name !== 'html' && !node.name.startsWith('#')\n}\n\nfunction maybe(...level: (Node | null)[]): Node[] | null {\n\tconst list = level.filter(notEmpty)\n\tif (list.length > 0) {\n\t\treturn list\n\t}\n\treturn null\n}\n\nfunction notEmpty<T>(value: T | null | undefined): value is T {\n\treturn value !== null && value !== undefined\n}\n\nfunction* combinations(stack: Node[][], path: Node[] = []): Generator<Node[]> {\n\tif (stack.length > 0) {\n\t\tfor (let node of stack[0]) {\n\t\t\tyield* combinations(stack.slice(1, stack.length), path.concat(node))\n\t\t}\n\t} else {\n\t\tyield path\n\t}\n}\n\nfunction sort(paths: Iterable<Path>): Path[] {\n\treturn Array.from(paths).sort((a, b) => penalty(a) - penalty(b))\n}\n\ntype Scope = {\n\tcounter: number\n\tvisited: Map<string, boolean>\n}\n\nfunction* optimize(\n\tpath: Path,\n\tinput: Element,\n\tscope: Scope = {\n\t\tcounter: 0,\n\t\tvisited: new Map<string, boolean>(),\n\t},\n): Generator<Node[]> {\n\tif (path.length > 2 && path.length > config.optimizedMinLength) {\n\t\tfor (let i = 1; i < path.length - 1; i++) {\n\t\t\tif (scope.counter > config.maxNumberOfTries) {\n\t\t\t\treturn // Okay At least I tried!\n\t\t\t}\n\t\t\tscope.counter += 1\n\t\t\tconst newPath = [...path]\n\t\t\tnewPath.splice(i, 1)\n\t\t\tconst newPathKey = selector(newPath)\n\t\t\tif (scope.visited.has(newPathKey)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (unique(newPath) && same(newPath, input)) {\n\t\t\t\tyield newPath\n\t\t\t\tscope.visited.set(newPathKey, true)\n\t\t\t\tyield* optimize(newPath, input, scope)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction same(path: Path, input: Element) {\n\treturn rootDocument.querySelector(selector(path)) === input\n}\n\nconst regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/\nconst regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/\nconst regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g\n\nconst defaultOptions = {\n\tescapeEverything: false,\n\tisIdentifier: false,\n\tquotes: 'single',\n\twrap: false,\n}\n\nfunction cssesc(string: string, opt: Partial<typeof defaultOptions> = {}) {\n\tconst options = { ...defaultOptions, ...opt }\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single'\n\t}\n\tconst quote = options.quotes == 'double' ? '\"' : \"'\"\n\tconst isIdentifier = options.isIdentifier\n\n\tconst firstChar = string.charAt(0)\n\tlet output = ''\n\tlet counter = 0\n\tconst length = string.length\n\twhile (counter < length) {\n\t\tconst character = string.charAt(counter++)\n\t\tlet codePoint = character.charCodeAt(0)\n\t\tlet value: string | undefined = void 0\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7e) {\n\t\t\tif (\n\t\t\t\tcodePoint >= 0xd800 &&\n\t\t\t\tcodePoint <= 0xdbff &&\n\t\t\t\tcounter < length\n\t\t\t) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tconst extra = string.charCodeAt(counter++)\n\t\t\t\tif ((extra & 0xfc00) == 0xdc00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint =\n\t\t\t\t\t\t((codePoint & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t} else if (\n\t\t\t\tcharacter == '\\\\' ||\n\t\t\t\t(!isIdentifier &&\n\t\t\t\t\t((character == '\"' && quote == character) ||\n\t\t\t\t\t\t(character == \"'\" && quote == character))) ||\n\t\t\t\t(isIdentifier && regexSingleEscape.test(character))\n\t\t\t) {\n\t\t\t\tvalue = '\\\\' + character\n\t\t\t} else {\n\t\t\t\tvalue = character\n\t\t\t}\n\t\t}\n\t\toutput += value\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1)\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1)\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2\n\t})\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote\n\t}\n\treturn output\n}\n\nconst getElementSelectorFallback = (element: Element) => {\n\tlet selector = ''\n\tconst classNames = element.getAttribute('class')\n\tconst ids = element.getAttribute('id')\n\n\tif (ids) {\n\t\tselector = selector.concat(getSelectorString(ids, '#'))\n\t}\n\tif (classNames) {\n\t\tselector = selector.concat(getSelectorString(classNames, '.'))\n\t}\n\n\t// Default to the element's tag if the element doesn't have ids or class names.\n\tif (selector === '') {\n\t\tselector = selector.concat(element.tagName.toLowerCase())\n\t}\n\n\treturn selector\n}\n\nconst getSelectorString = (selector: string, delimiter: string) => {\n\treturn `${delimiter}${selector.trim().split(' ').join(delimiter)}`\n}\n","export type ViewportResizeListenerArgs = Omit<Screen, 'orientation'> & {\n\torientation: number\n}\n\nexport const ViewportResizeListener = (\n\tcallback: (args: ViewportResizeListenerArgs) => void,\n) => {\n\tlet id: ReturnType<typeof setTimeout>\n\tconst DELAY = 500\n\n\tconst onResize = () => {\n\t\tclearTimeout(id)\n\t\tid = setTimeout(() => {\n\t\t\tcallback({\n\t\t\t\theight: window.innerHeight,\n\t\t\t\twidth: window.innerWidth,\n\t\t\t\tavailHeight: window.screen.availHeight,\n\t\t\t\tavailWidth: window.screen.availWidth,\n\t\t\t\tcolorDepth: window.screen.colorDepth,\n\t\t\t\tpixelDepth: window.screen.pixelDepth,\n\t\t\t\torientation: window.screen.orientation?.angle ?? 0,\n\t\t\t})\n\t\t}, DELAY)\n\t}\n\twindow.addEventListener('resize', onResize)\n\n\t// call on initial listener creation\n\tonResize()\n\treturn () => window.removeEventListener('resize', onResize)\n}\n","/**\n * @preserve\n * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)\n *\n * @author <a href=\"mailto:jensyt@gmail.com\">Jens Taylor</a>\n * @see http://github.com/homebrewing/brauhaus-diff\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n */\n(function(){\n var cache;\n\n // Call this function without `new` to use the cached object (good for\n // single-threaded environments), or with `new` to create a new object.\n //\n // @param {string} key A UTF-16 or ASCII string\n // @param {number} seed An optional positive integer\n // @return {object} A MurmurHash3 object for incremental hashing\n function MurmurHash3(key, seed) {\n var m = this instanceof MurmurHash3 ? this : cache;\n m.reset(seed)\n if (typeof key === 'string' && key.length > 0) {\n m.hash(key);\n }\n\n if (m !== this) {\n return m;\n }\n };\n\n // Incrementally add a string to this hash\n //\n // @param {string} key A UTF-16 or ASCII string\n // @return {object} this\n MurmurHash3.prototype.hash = function(key) {\n var h1, k1, i, top, len;\n\n len = key.length;\n this.len += len;\n\n k1 = this.k1;\n i = 0;\n switch (this.rem) {\n case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;\n case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;\n case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;\n case 3:\n k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;\n k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;\n }\n\n this.rem = (len + this.rem) & 3; // & 3 is same as % 4\n len -= this.rem;\n if (len > 0) {\n h1 = this.h1;\n while (1) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;\n\n if (i >= len) {\n break;\n }\n\n k1 = ((key.charCodeAt(i++) & 0xffff)) ^\n ((key.charCodeAt(i++) & 0xffff) << 8) ^\n ((key.charCodeAt(i++) & 0xffff) << 16);\n top = key.charCodeAt(i++);\n k1 ^= ((top & 0xff) << 24) ^\n ((top & 0xff00) >> 8);\n }\n\n k1 = 0;\n switch (this.rem) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xffff);\n }\n\n this.h1 = h1;\n }\n\n this.k1 = k1;\n return this;\n };\n\n // Get the result of this hash\n //\n // @return {number} The 32-bit hash\n MurmurHash3.prototype.result = function() {\n var k1, h1;\n \n k1 = this.k1;\n h1 = this.h1;\n\n if (k1 > 0) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= this.len;\n\n h1 ^= h1 >>> 16;\n h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n };\n\n // Reset the hash object for reuse\n //\n // @param {number} seed An optional positive integer\n MurmurHash3.prototype.reset = function(seed) {\n this.h1 = typeof seed === 'number' ? seed : 0;\n this.rem = this.k1 = this.len = 0;\n return this;\n };\n\n // A cached object to use. This can be safely used if you're in a single-\n // threaded environment, otherwise you need to create new hashes to use.\n cache = new MurmurHash3();\n\n if (typeof(module) != 'undefined') {\n module.exports = MurmurHash3;\n } else {\n this.MurmurHash3 = MurmurHash3;\n }\n}());\n","import MurmurHash3 from 'imurmurhash'\n\nconst ID_LENGTH = 28\n// base 62 character set\nconst CHARACTER_SET =\n\t'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n\nconst MIXER_PRIME = 0x85ebca6b\n\nexport const GenerateSecureID = (key?: string): string => {\n\tvar secureID = ''\n\n\tif (key) {\n\t\t// UseMurmurHash3 for fast, high-quality deterministic hashing\n\t\t// Note: not crypto secure, but we only need it to create a deterministic ID\n\t\tconst keyHash = MurmurHash3(key).result()\n\t\tfor (let i = 0; i < ID_LENGTH; i++) {\n\t\t\tconst charHash = (keyHash ^ (i * MIXER_PRIME)) >>> 0\n\t\t\tconst charIndex = charHash % CHARACTER_SET.length\n\t\t\tsecureID += CHARACTER_SET.charAt(charIndex)\n\t\t}\n\t} else {\n\t\tconst hasCrypto =\n\t\t\ttypeof window !== 'undefined' && window.crypto?.getRandomValues\n\t\tconst cryptoRandom = new Uint32Array(ID_LENGTH)\n\t\tif (hasCrypto) {\n\t\t\twindow.crypto.getRandomValues(cryptoRandom)\n\t\t}\n\n\t\tfor (let i = 0; i < ID_LENGTH; i++) {\n\t\t\tif (hasCrypto) {\n\t\t\t\tsecureID += CHARACTER_SET.charAt(\n\t\t\t\t\tcryptoRandom[i] % CHARACTER_SET.length,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tsecureID += CHARACTER_SET.charAt(\n\t\t\t\t\tMath.floor(Math.random() * CHARACTER_SET.length),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn secureID\n}\n","import type { RecordOptions } from '../client/types/record'\nimport type { ObserveOptions } from '../client/types/observe'\nimport { setCookieWriteEnabled, setStorageMode } from '../client/utils/storage'\nimport {\n\tgetPersistentSessionSecureID,\n\tgetPreviousSessionData,\n\tloadCookieSessionData,\n\tsetSessionData,\n\tsetSessionSecureID,\n} from '../client/utils/sessionStorage/highlightSession'\nimport { GenerateSecureID } from '../client'\nimport { internalLog } from '../sdk/util'\n\nexport class Plugin<T extends RecordOptions | ObserveOptions> {\n\tprotected sessionSecureID!: string\n\tconstructor(options?: T) {\n\t\ttry {\n\t\t\tif (options?.storageMode) {\n\t\t\t\tsetStorageMode(options?.storageMode)\n\t\t\t}\n\t\t\tsetCookieWriteEnabled(!!options?.sessionCookie)\n\n\t\t\tif (options?.sessionCookie) {\n\t\t\t\tloadCookieSessionData()\n\t\t\t} else {\n\t\t\t\tsetCookieWriteEnabled(false)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tinternalLog(\n\t\t\t\t`Error initializing @launchdarkly observability plugin`,\n\t\t\t\t'error',\n\t\t\t\terror,\n\t\t\t)\n\t\t}\n\t}\n\n\tconfigureSession(ldCredential: string, options?: T) {\n\t\ttry {\n\t\t\tconst persistentSessionSecureID = getPersistentSessionSecureID()\n\t\t\tlet previousSession = getPreviousSessionData(\n\t\t\t\tpersistentSessionSecureID,\n\t\t\t)\n\t\t\tif (previousSession?.sessionSecureID) {\n\t\t\t\tthis.sessionSecureID = previousSession.sessionSecureID\n\t\t\t} else {\n\t\t\t\tif (options?.sessionKey) {\n\t\t\t\t\tthis.sessionSecureID = GenerateSecureID(\n\t\t\t\t\t\t`${ldCredential}-${options.sessionKey}`,\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tthis.sessionSecureID = GenerateSecureID()\n\t\t\t\t}\n\t\t\t\tsetSessionSecureID(this.sessionSecureID)\n\t\t\t\tsetSessionData({\n\t\t\t\t\tsessionSecureID: this.sessionSecureID,\n\t\t\t\t\tsessionKey: options?.sessionKey,\n\t\t\t\t\tprojectID: 0,\n\t\t\t\t\tsessionStartTime: Date.now(),\n\t\t\t\t\tlastPushTime: Date.now(),\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tinternalLog(\n\t\t\t\t`Error configuring session in @launchdarkly observability plugin`,\n\t\t\t\t'error',\n\t\t\t\terror,\n\t\t\t)\n\t\t}\n\t}\n}\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","syntaxError","description","Location","startToken","endToken","Token","kind","start","end","column","QueryDocumentKeys","kindValues","isNode","maybeNode","maybeKind","OperationTypeNode","DirectiveLocation","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","TokenKind","Lexer","startOfFileToken","token","nextToken","readNextToken","isPunctuatorTokenKind","isUnicodeScalarValue","isSupplementaryCodePoint","isLeadingSurrogate","isTrailingSurrogate","printCodePointAt","lexer","char","createToken","col","bodyLength","readComment","readBlockString","readString","readNumber","readName","firstCode","isFloat","readDigits","chunkStart","escape","readEscapedUnicodeVariableWidth","readEscapedUnicodeFixedWidth","readEscapedCharacter","point","size","readHexDigit","read16BitHexCode","trailingCode","lineStart","currentLine","blockLines","MAX_ARRAY_LENGTH","MAX_RECURSIVE_DEPTH","inspect","formatValue","seenValues","formatObjectValue","previouslySeenValues","isJSONable","jsonValue","formatArray","formatObject","object","entries","getObjectTag","key","len","remaining","items","tag","name","isProduction","instanceOf","constructor","_value$constructor","className","valueClassName","stringifiedValue","Source","locationOffset","isSource","parse","parser","Parser","document","sourceObj","hasDescription","keywordToken","operation","operationToken","nameOrAlias","alias","isConst","item","hasTypeCondition","varName","directives","type","innerType","operationTypes","interfaces","fields","defaultValue","types","values","getTokenDesc","repeatable","locations","getTokenKindDesc","atToken","openKind","parseFn","closeKind","delimiterKind","maxTokens","printString","escapedRegExp","escapedReplacer","escapeSequences","BREAK","visit","root","visitor","visitorKeys","enterLeaveMap","getEnterLeaveForKind","stack","inArray","keys","index","edits","parent","ancestors","isLeaving","isEdited","editOffset","editKey","editValue","arrayKey","__spreadValues","_enterLeaveMap$get","_enterLeaveMap$get2","visitFn","_node$kind","kindVisitor","print","ast","printDocASTReducer","MAX_LINE_LENGTH","join","varDefs","wrap","variable","selections","block","selectionSet","argsLine","typeCondition","variableDefinitions","isBlockString","hasMultilineItems","maybeArray","separator","_maybeArray$filter$jo","x","maybeString","_maybeArray$some","defaultJsonSerializer","uppercase","HeadersInstanceToPlainObject","headers","o","v","k","parseRequestArgs","documentOrOptions","variables","requestHeaders","parseRawRequestArgs","queryOrOptions","parseBatchRequestArgs","documentsOrOptions","extractOperationName","operationName","operationDefinitions","definition","_b","_a","resolveRequestDocument","parsedDocument","err","ClientError","response","request","_c","global","this","__self__","F","self","exports","support","e","isDataView","obj","viewClasses","isArrayBufferView","normalizeName","normalizeValue","iteratorFor","iterator","Headers","header","oldValue","callback","thisArg","consumed","fileReaderReady","reader","resolve","reject","readBlobAsArrayBuffer","blob","promise","readBlobAsText","readArrayBufferAsText","buf","view","chars","bufferClone","Body","rejected","decode","methods","normalizeMethod","method","upcased","Request","input","form","bytes","split","parseHeaders","rawHeaders","preProcessedHeaders","parts","Response","bodyInit","redirectStatuses","url","status","error","fetch","init","xhr","abortXhr","ctx","module","resolveHeaders","oHeaders","CrossFetch","CrossFetch.Headers","cleanQuery","buildRequestConfig","params","params_","search","payload","acc","currentQuery","createHttpMethodFetcher","__async","query","fetchOptions","middleware","queryParams","createRequestBody","urlResolved","initResolved","__spreadProps","urlNew","initNew","__objRest","GraphQLClient","requestConfig","rawRequestOptions","crossFetch","requestMiddleware","responseMiddleware","makeRequest","callOrIdentity","variablesAndRequestHeaders","requestOptions","batchRequestOptions","queries","fetcher","isBatchingQuery","getResult","successfullyReceivedData","data","successfullyPassedErrorPolicy","rest","errorResult","jsonSerializer","jsonSerializer_","contentType","stringify","serializer","replacer","spaces","cycleReplacer","thisPos","__assign","s","n","p","docCache","fragmentSourceMap","printFragmentWarnings","experimentalFragmentVariables","normalize","string","cacheKeyFromLoc","processFragments","seenKeys","definitions","fragmentDefinition","fragmentName","sourceKey","sourceKeySet","stripLoc","doc","workSet","parseDocument","cacheKey","parsed","gql","literals","_i","arg","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","extras","gql_1","MatchPartsFragmentDoc","PushPayloadDocument","PushSessionEventsDocument","IdentifySessionDocument","AddSessionPropertiesDocument","PushMetricsDocument","AddSessionFeedbackDocument","InitializeSessionDocument","IgnoreDocument","GetSamplingConfigDocument","defaultWrapper","action","_operationName","_operationType","getSdk","client","withWrapper","wrappedRequestHeaders","patch","replacement","original","wrapped","pathToSelector","domSiblings","sibling","isObject","isObjTooDeep","limit","stringifyOptions","shouldIgnore","toString","eventResult","eventKey","eventValue","_obj","supportsWebP","elem","getDefaultDataURLOptions","isMetricSafeNumber","ATTR_EXCEPTION_MESSAGE","ATTR_EXCEPTION_STACKTRACE","ATTR_EXCEPTION_TYPE","ATTR_HTTP_RESPONSE_STATUS_CODE","ATTR_SERVER_ADDRESS","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","ATTR_TELEMETRY_SDK_NAME","ATTR_TELEMETRY_SDK_VERSION","ATTR_URL_FULL","ATTR_URL_PATH","ATTR_URL_QUERY","ATTR_USER_AGENT_ORIGINAL","FIRST_SEND_FREQUENCY","SEND_FREQUENCY","MAX_SESSION_LENGTH","SESSION_PUSH_THRESHOLD","SNAPSHOT_SETTINGS","VISIBILITY_DEBOUNCE_MS","HIGHLIGHT_URL","LAUNCHDARKLY_URL","LAUNCHDARKLY_ENV_APPS","LAUNCHDARKLY_PATH_PREFIX","LAUNCHDARKLY_BACKEND_REGEX","assign","target","defaultConverter","converter","defaultAttributes","set","attributes","stringifiedAttributes","attributeName","get","cookies","jar","found","_e","api","LocalStorageKeys","mode","cookieWriteEnabled","Storage","__publicField","CookieStorage","Cookies","expires","globalStorage","cookieStorage","getPersistentStorage","storage","internalLogOnce","setStorageMode","m","setCookieWriteEnabled","enabled","getItem","setItem","removeItem","monkeyPatchLocalStorage","onSetItemHandler","originalSetItem","keyName","keyValue","SESSION_STORAGE_KEYS","getSessionDataKey","sessionID","getPersistentSessionSecureID","getSessionSecureID","setPersistentSessionSecureID","secureID","setSessionSecureID","getSessionData","getPreviousSessionData","storedSessionData","setSessionData","sessionData","pruneSessionData","loadCookieSessionData","sessionSecureID","sessionDataKey","sessionDataStr","keepKey","candidates","stale","raw","ts","PublicGraphError","MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS","BASE_DELAY_MS","BACKOFF_DELAY_MS","NON_RETRYABLE_ERRORS","isErrorRetryable","getGraphQLRequestWrapper","graphQLRequestWrapper","requestFn","operationType","retries","FEATURE_FLAG_SCOPE","LD_SCOPE","FEATURE_FLAG_SPAN_NAME","FEATURE_FLAG_EVENT_NAME","FEATURE_FLAG_ENV_ATTR","FEATURE_FLAG_KEY_ATTR","FEATURE_FLAG_CONTEXT_ATTR","FEATURE_FLAG_CONTEXT_ID_ATTR","FEATURE_FLAG_VALUE_ATTR","FEATURE_FLAG_PROVIDER_ATTR","FEATURE_FLAG_REASON_ATTRS","FEATURE_FLAG_VARIATION_INDEX_ATTR","FEATURE_FLAG_APP_ID_ATTR","FEATURE_FLAG_APP_VERSION_ATTR","CONTEXT_SCOPE","CONTEXT_SCOPE_CONTEXT_KEYS_ATTR","LD_INITIALIZE_EVENT","LD_TRACK_EVENT","LD_TRACK_SPAN_NAME","LD_PAGE_VIEW_SPAN_NAME","LD_METRIC_NAME_DOCUMENT_LOAD","LD_IDENTIFY_RESULT_STATUS","encodeKey","isMultiContext","context","getCanonicalKey","getContextKeys","setupLaunchDarklyIntegration","hClient","ldClient","hookContext","metadata","detail","eventAttributes","attr","LaunchDarklyIntegrationSDK","metric","_sessionSecureID","_user_identifier","_user_object","_source","event","LaunchDarklyIntegration","BufferedClass","_result","user_identifier","user_object","PathListener","initialPushState","f","ret","initialReplaceState","onPopState","onLocationChange","version","pkg","config","rootDocument","getElementSelector","getElementSelectorFallback","getElementSelectorNew","getSimpleSelector","classes","c","defaults","_name","_value","findRootDocument","bottomUpSearch","optimized","sort","optimize","selector","rootNode","fallback","current","level","maybe","id","classNames","tagName","any","nth","dispensableNth","nthChild","findUniquePath","paths","combinations","candidate","unique","penalty","elementId","cssesc","child","list","notEmpty","__yieldStar","a","b","scope","newPath","newPathKey","same","regexAnySingleEscape","regexSingleEscape","regexExcessiveSpaces","defaultOptions","opt","quote","isIdentifier","firstChar","counter","length","character","codePoint","extra","$0","$1","$2","element","ids","getSelectorString","delimiter","ViewportResizeListener","onResize","cache","MurmurHash3","seed","h1","k1","top","ID_LENGTH","CHARACTER_SET","MIXER_PRIME","GenerateSecureID","keyHash","charIndex","hasCrypto","cryptoRandom","Plugin","internalLog","ldCredential","persistentSessionSecureID","previousSession"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAUC,GAAWC,GAAS;AAG5C,MAAI,CAFqB,EAAQD;AAG/B,UAAM,IAAI,MAAMC,CAAO;AAE3B;ACFO,SAASC,GAAaC,GAAO;AAClC,SAAO,OAAOA,KAAS,YAAYA,MAAU;AAC/C;ACNO,SAASC,GAAUJ,GAAWC,GAAS;AAG5C,MAAI,CAFqB,EAAQD;AAG/B,UAAM,IAAI;AAAA,MACoB;AAAA,IAClC;AAEA;ACPA,MAAMK,KAAa;AASZ,SAASC,GAAYC,GAAQC,GAAU;AAC5C,MAAIC,IAAgB,GAChBC,IAAO;AAEX,aAAWC,KAASJ,EAAO,KAAK,SAASF,EAAU,GAAG;AAGpD,QAFA,OAAOM,EAAM,SAAU,Y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EACD;AAAA,EAEA,iBAAiBqX,GAAsB9mB,GAAa;AACnD,QAAI;AACH,YAAM+mB,IAA4B7K,GAAA;AAClC,UAAI8K,IAAkBxK;AAAA,QACrBuK;AAAA,MAAA;AAED,MAAIC,KAAA,QAAAA,EAAiB,kBACpB,KAAK,kBAAkBA,EAAgB,mBAEnChnB,KAAA,QAAAA,EAAS,aACZ,KAAK,kBAAkBumB;AAAA,QACtB,GAAGO,CAAY,IAAI9mB,EAAQ,UAAU;AAAA,MAAA,IAGtC,KAAK,kBAAkBumB,GAAA,GAExBjK,GAAmB,KAAK,eAAe,GACvCI,GAAe;AAAA,QACd,iBAAiB,KAAK;AAAA,QACtB,YAAY1c,KAAA,gBAAAA,EAAS;AAAA,QACrB,WAAW;AAAA,QACX,kBAAkB,KAAK,IAAA;AAAA,QACvB,cAAc,KAAK,IAAA;AAAA,MAAI,CACvB;AAAA,IAEH,SAASyP,GAAO;AACf,MAAAoX;AAAA,QACC;AAAA,QACA;AAAA,QACApX;AAAA,MAAA;AAAA,IAEF;AAAA,EACD;AACD;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,35,46]}
1
+ {"version":3,"file":"common-BjaGmQrE.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/error/syntaxError.mjs","../../../../node_modules/graphql/language/ast.mjs","../../../../node_modules/graphql/language/directiveLocation.mjs","../../../../node_modules/graphql/language/kinds.mjs","../../../../node_modules/graphql/language/characterClasses.mjs","../../../../node_modules/graphql/language/blockString.mjs","../../../../node_modules/graphql/language/tokenKind.mjs","../../../../node_modules/graphql/language/lexer.mjs","../../../../node_modules/graphql/jsutils/inspect.mjs","../../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../../node_modules/graphql/language/source.mjs","../../../../node_modules/graphql/language/parser.mjs","../../../../node_modules/graphql/language/printString.mjs","../../../../node_modules/graphql/language/visitor.mjs","../../../../node_modules/graphql/language/printer.mjs","../../../../node_modules/graphql-request/build/esm/defaultJsonSerializer.js","../../../../node_modules/graphql-request/build/esm/helpers.js","../../../../node_modules/graphql-request/build/esm/parseArgs.js","../../../../node_modules/graphql-request/build/esm/resolveRequestDocument.js","../../../../node_modules/graphql-request/build/esm/types.js","../../../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../../../node_modules/graphql-request/build/esm/index.js","../../../../node_modules/json-stringify-safe/stringify.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/graphql-tag/lib/index.js","../src/client/graph/generated/operations.ts","../src/client/utils/utils.ts","../../../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js","../src/client/constants/sessions.ts","../../../../node_modules/js-cookie/dist/js.cookie.mjs","../src/client/utils/storage.ts","../src/client/utils/sessionStorage/sessionStorageKeys.ts","../src/client/utils/sessionStorage/highlightSession.ts","../src/client/graph/generated/schemas.ts","../src/client/utils/graph.ts","../src/integrations/launchdarkly/index.ts","../src/client/listeners/path-listener.tsx","../src/version.ts","../src/client/utils/dom/index.ts","../src/client/listeners/viewport-resize-listener.tsx","../../../../node_modules/imurmurhash/imurmurhash.js","../src/client/utils/secure-id.ts","../src/plugins/common.ts"],"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","import { GraphQLError } from './GraphQLError.mjs';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\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. <SOF> is always the first node and <EOF>\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 directive location values.\n */\nvar DirectiveLocation;\n\n(function (DirectiveLocation) {\n DirectiveLocation['QUERY'] = 'QUERY';\n DirectiveLocation['MUTATION'] = 'MUTATION';\n DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION';\n DirectiveLocation['FIELD'] = 'FIELD';\n DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION';\n DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD';\n DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT';\n DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION';\n DirectiveLocation['SCHEMA'] = 'SCHEMA';\n DirectiveLocation['SCALAR'] = 'SCALAR';\n DirectiveLocation['OBJECT'] = 'OBJECT';\n DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION';\n DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION';\n DirectiveLocation['INTERFACE'] = 'INTERFACE';\n DirectiveLocation['UNION'] = 'UNION';\n DirectiveLocation['ENUM'] = 'ENUM';\n DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE';\n DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';\n DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';\n})(DirectiveLocation || (DirectiveLocation = {}));\n\nexport { DirectiveLocation };\n/**\n * The enum type representing the directive location values.\n *\n * @deprecated Please use `DirectiveLocation`. Will be remove in v17.\n */\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 // <space>\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","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind;\n\n(function (TokenKind) {\n TokenKind['SOF'] = '<SOF>';\n TokenKind['EOF'] = '<EOF>';\n TokenKind['BANG'] = '!';\n TokenKind['DOLLAR'] = '$';\n TokenKind['AMP'] = '&';\n TokenKind['PAREN_L'] = '(';\n TokenKind['PAREN_R'] = ')';\n TokenKind['SPREAD'] = '...';\n TokenKind['COLON'] = ':';\n TokenKind['EQUALS'] = '=';\n TokenKind['AT'] = '@';\n TokenKind['BRACKET_L'] = '[';\n TokenKind['BRACKET_R'] = ']';\n TokenKind['BRACE_L'] = '{';\n TokenKind['PIPE'] = '|';\n TokenKind['BRACE_R'] = '}';\n TokenKind['NAME'] = 'Name';\n TokenKind['INT'] = 'Int';\n TokenKind['FLOAT'] = 'Float';\n TokenKind['STRING'] = 'String';\n TokenKind['BLOCK_STRING'] = 'BlockString';\n TokenKind['COMMENT'] = 'Comment';\n})(TokenKind || (TokenKind = {}));\n\nexport { TokenKind };\n/**\n * The enum type representing the token kinds values.\n *\n * @deprecated Please use `TokenKind`. Will be remove in v17.\n */\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { dedentBlockStringLines } from './blockString.mjs';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport class Lexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n get [Symbol.toStringTag]() {\n return 'Lexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n }\n}\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n */\n\nfunction isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n */\n\nfunction isSupplementaryCodePoint(body, location) {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code) {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code) {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n */\n\nfunction printCodePointAt(lexer, location) {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n } // Unicode code point\n\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n/**\n * Create a token with line and column location information.\n */\n\nfunction createToken(lexer, kind, start, end, value) {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // SourceCharacter\n\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // <BOM>\n\n case 0x0009: // \\t\n\n case 0x0020: // <space>\n\n case 0x002c:\n // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n\n case 0x000a:\n // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n\n case 0x000d:\n // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n\n case 0x0023:\n // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n\n case 0x0021:\n // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n\n case 0x0024:\n // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n\n case 0x0026:\n // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x002e:\n // .\n if (\n body.charCodeAt(position + 1) === 0x002e &&\n body.charCodeAt(position + 2) === 0x002e\n ) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n\n break;\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x003d:\n // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n\n case 0x005b:\n // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n\n case 0x005d:\n // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n\n case 0x007b:\n // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n\n case 0x007c:\n // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n\n case 0x007d:\n // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n\n case 0x0022:\n // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n\n return readString(lexer, position);\n } // IntValue | FloatValue (Digit | -)\n\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n */\n\nfunction readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n */\n\nfunction readNumber(lexer, start, firstCode) {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false; // NegativeSign (-)\n\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n } // Zero (0)\n\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Full stop (.)\n\n if (code === 0x002e) {\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // E e\n\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n code = body.charCodeAt(++position); // + -\n\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n/**\n * Returns the new position in the source after reading one or more digits.\n */\n\nfunction readDigits(lexer, start, firstCode) {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n */\n\nfunction readString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Quote (\")\n\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n } // Escape Sequence (\\)\n\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n } // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n} // The string value and lexed size of an escape sequence.\n\nfunction readEscapedUnicodeVariableWidth(lexer, position) {\n const body = lexer.source.body;\n let point = 0;\n let size = 3; // Cannot be larger than 12 chars (\\u{00000000}).\n\n while (size < 12) {\n const code = body.charCodeAt(position + size++); // Closing Brace (})\n\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n\n return {\n value: String.fromCodePoint(point),\n size,\n };\n } // Append this hex digit to the code point.\n\n point = (point << 4) | readHexDigit(code);\n\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(lexer, position) {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return {\n value: String.fromCodePoint(code),\n size: 6,\n };\n } // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return {\n value: String.fromCodePoint(code, trailingCode),\n size: 12,\n };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n */\n\nfunction read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n */\n\nfunction readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n */\n\nfunction readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n */\n\nfunction readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n */\n\nfunction readName(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\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","import { inspect } from './inspect.mjs';\n/* c8 ignore next 3 */\n\nconst isProduction =\n globalThis.process && // eslint-disable-next-line no-undef\n process.env.NODE_ENV === 'production';\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\n\nexport const instanceOf =\n /* c8 ignore next 6 */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n isProduction\n ? function instanceOf(value, constructor) {\n return value instanceof constructor;\n }\n : function instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (typeof value === 'object' && value !== null) {\n var _value$constructor;\n\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n ? value[Symbol.toStringTag]\n : (_value$constructor = value.constructor) === null ||\n _value$constructor === void 0\n ? void 0\n : _value$constructor.name;\n\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(`Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`);\n }\n }\n\n return false;\n };\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n constructor(\n body,\n name = 'GraphQL request',\n locationOffset = {\n line: 1,\n column: 1,\n },\n ) {\n typeof body === 'string' ||\n devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 ||\n devAssert(\n false,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n this.locationOffset.column > 0 ||\n devAssert(\n false,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'Source';\n }\n}\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Location, OperationTypeNode } from './ast.mjs';\nimport { DirectiveLocation } from './directiveLocation.mjs';\nimport { Kind } from './kinds.mjs';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.mjs';\nimport { isSource, Source } from './source.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n */\n\nexport function parseConstValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport class Parser {\n constructor(source, options = {}) {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n this._tokenCounter = 0;\n }\n\n get tokenCount() {\n return this._tokenCounter;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n\n parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\n parseDefinition() {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } // Many definitions begin with a description and require a lookahead.\n\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are supported only on type definitions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n const operation = this.parseOperationType();\n let name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * OperationType : one of query mutation subscription\n */\n\n parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n /**\n * Variable : $ Name\n */\n\n parseVariable() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n */\n\n parseSelectionSet() {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n parseArguments(isConst) {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n\n parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument() {\n return this.parseArgument(true);\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n });\n }\n\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n parseFragmentDefinition() {\n const start = this._lexer.token;\n this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (this._options.allowLegacyFragmentVariables === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentName : Name but not `on`\n */\n\n parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this.advanceLexer();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral() {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral() {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n */\n\n parseObject(isConst) {\n const item = () => this.parseObjectField(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n parseObjectField(isConst) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n\n parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n\n parseConstDirectives() {\n return this.parseDirectives(true);\n }\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n */\n\n parseDirective(isConst) {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n parseTypeReference() {\n const start = this._lexer.token;\n let type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n\n parseNamedType() {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n } // Implements the parsing rules in the Type Definition section.\n\n peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n\n parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n */\n\n parseSchemaDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n */\n\n parseFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n */\n\n parseEnumValuesDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n */\n\n parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseEnumValueName() {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n\n return this.parseName();\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n */\n\n parseInputFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n parseTypeSystemExtension() {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n */\n\n parseSchemaExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n\n parseInterfaceTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n * ```\n */\n\n parseDirectiveDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n repeatable,\n locations,\n });\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n parseDirectiveLocation() {\n const start = this._lexer.token;\n const name = this.parseName();\n\n if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n */\n\n node(startToken, node) {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n\n return node;\n }\n /**\n * Determines if the next token is of a given kind\n */\n\n peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n\n unexpected(atToken) {\n const token =\n atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n\n delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n }\n\n advanceLexer() {\n const { maxTokens } = this._options;\n\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more that ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\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 = { ...node };\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","export const defaultJsonSerializer = JSON;\n//# sourceMappingURL=defaultJsonSerializer.js.map","export const uppercase = (str) => str.toUpperCase();\n/**\n * Convert Headers instance into regular object\n */\nexport const HeadersInstanceToPlainObject = (headers) => {\n const o = {};\n headers.forEach((v, k) => {\n o[k] = v;\n });\n return o;\n};\n//# sourceMappingURL=helpers.js.map","export const parseRequestArgs = (documentOrOptions, variables, requestHeaders) => {\n return documentOrOptions.document\n ? documentOrOptions\n : {\n document: documentOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestArgs = (queryOrOptions, variables, requestHeaders) => {\n return queryOrOptions.query\n ? queryOrOptions\n : {\n query: queryOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseBatchRequestArgs = (documentsOrOptions, requestHeaders) => {\n return documentsOrOptions.documents\n ? documentsOrOptions\n : {\n documents: documentsOrOptions,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRequestExtendedArgs = (urlOrOptions, document, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.document\n ? urlOrOptions\n : {\n url: urlOrOptions,\n document: document,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestExtendedArgs = (urlOrOptions, query, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.query\n ? urlOrOptions\n : {\n url: urlOrOptions,\n query: query,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\n//# sourceMappingURL=parseArgs.js.map","import { parse, print } from 'graphql';\n/**\n * helpers\n */\nconst extractOperationName = (document) => {\n let operationName = undefined;\n const operationDefinitions = document.definitions.filter((definition) => definition.kind === `OperationDefinition`);\n if (operationDefinitions.length === 1) {\n operationName = operationDefinitions[0]?.name?.value;\n }\n return operationName;\n};\nexport const resolveRequestDocument = (document) => {\n if (typeof document === `string`) {\n let operationName = undefined;\n try {\n const parsedDocument = parse(document);\n operationName = extractOperationName(parsedDocument);\n }\n catch (err) {\n // Failed parsing the document, the operationName will be undefined\n }\n return { query: document, operationName };\n }\n const operationName = extractOperationName(document);\n return { query: print(document), operationName };\n};\n//# sourceMappingURL=resolveRequestDocument.js.map","export class ClientError extends Error {\n constructor(response, request) {\n const message = `${ClientError.extractMessage(response)}: ${JSON.stringify({\n response,\n request,\n })}`;\n super(message);\n Object.setPrototypeOf(this, ClientError.prototype);\n this.response = response;\n this.request = request;\n // this is needed as Safari doesn't support .captureStackTrace\n if (typeof Error.captureStackTrace === `function`) {\n Error.captureStackTrace(this, ClientError);\n }\n }\n static extractMessage(response) {\n return response.errors?.[0]?.message ?? `GraphQL Error (Code: ${response.status})`;\n }\n}\n//# sourceMappingURL=types.js.map","var global = typeof self !== 'undefined' ? self : this;\nvar __self__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = global.DOMException\n}\nF.prototype = global;\nreturn new F();\n})();\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","import { defaultJsonSerializer } from './defaultJsonSerializer.js';\nimport { HeadersInstanceToPlainObject, uppercase } from './helpers.js';\nimport { parseBatchRequestArgs, parseRawRequestArgs, parseRawRequestExtendedArgs, parseRequestArgs, parseRequestExtendedArgs, } from './parseArgs.js';\nimport { resolveRequestDocument } from './resolveRequestDocument.js';\nimport { ClientError, } from './types.js';\nimport crossFetch, * as CrossFetch from 'cross-fetch';\n/**\n * Convert the given headers configuration into a plain object.\n */\nconst resolveHeaders = (headers) => {\n let oHeaders = {};\n if (headers) {\n if ((typeof Headers !== `undefined` && headers instanceof Headers) ||\n (CrossFetch && CrossFetch.Headers && headers instanceof CrossFetch.Headers)) {\n oHeaders = HeadersInstanceToPlainObject(headers);\n }\n else if (Array.isArray(headers)) {\n headers.forEach(([name, value]) => {\n if (name && value !== undefined) {\n oHeaders[name] = value;\n }\n });\n }\n else {\n oHeaders = headers;\n }\n }\n return oHeaders;\n};\n/**\n * Clean a GraphQL document to send it via a GET query\n */\nconst cleanQuery = (str) => str.replace(/([\\s,]|#[^\\n\\r]+)+/g, ` `).trim();\n/**\n * Create query string for GraphQL request\n */\nconst buildRequestConfig = (params) => {\n if (!Array.isArray(params.query)) {\n const params_ = params;\n const search = [`query=${encodeURIComponent(cleanQuery(params_.query))}`];\n if (params.variables) {\n search.push(`variables=${encodeURIComponent(params_.jsonSerializer.stringify(params_.variables))}`);\n }\n if (params_.operationName) {\n search.push(`operationName=${encodeURIComponent(params_.operationName)}`);\n }\n return search.join(`&`);\n }\n if (typeof params.variables !== `undefined` && !Array.isArray(params.variables)) {\n throw new Error(`Cannot create query with given variable type, array expected`);\n }\n // Batch support\n const params_ = params;\n const payload = params.query.reduce((acc, currentQuery, index) => {\n acc.push({\n query: cleanQuery(currentQuery),\n variables: params_.variables ? params_.jsonSerializer.stringify(params_.variables[index]) : undefined,\n });\n return acc;\n }, []);\n return `query=${encodeURIComponent(params_.jsonSerializer.stringify(payload))}`;\n};\nconst createHttpMethodFetcher = (method) => async (params) => {\n const { url, query, variables, operationName, fetch, fetchOptions, middleware } = params;\n const headers = { ...params.headers };\n let queryParams = ``;\n let body = undefined;\n if (method === `POST`) {\n body = createRequestBody(query, variables, operationName, fetchOptions.jsonSerializer);\n if (typeof body === `string`) {\n // @ts-expect-error todo\n headers[`Content-Type`] = `application/json`;\n }\n }\n else {\n // @ts-expect-error todo needs ADT for TS to understand the different states\n queryParams = buildRequestConfig({\n query,\n variables,\n operationName,\n jsonSerializer: fetchOptions.jsonSerializer ?? defaultJsonSerializer,\n });\n }\n const init = {\n method,\n headers,\n body,\n ...fetchOptions,\n };\n let urlResolved = url;\n let initResolved = init;\n if (middleware) {\n const result = await Promise.resolve(middleware({ ...init, url, operationName, variables }));\n const { url: urlNew, ...initNew } = result;\n urlResolved = urlNew;\n initResolved = initNew;\n }\n if (queryParams) {\n urlResolved = `${urlResolved}?${queryParams}`;\n }\n return await fetch(urlResolved, initResolved);\n};\n/**\n * GraphQL Client.\n */\nclass GraphQLClient {\n constructor(url, requestConfig = {}) {\n this.url = url;\n this.requestConfig = requestConfig;\n /**\n * Send a GraphQL query to the server.\n */\n this.rawRequest = async (...args) => {\n const [queryOrOptions, variables, requestHeaders] = args;\n const rawRequestOptions = parseRawRequestArgs(queryOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (rawRequestOptions.signal !== undefined) {\n fetchOptions.signal = rawRequestOptions.signal;\n }\n const { operationName } = resolveRequestDocument(rawRequestOptions.query);\n return makeRequest({\n url,\n query: rawRequestOptions.query,\n variables: rawRequestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(rawRequestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n };\n }\n async request(documentOrOptions, ...variablesAndRequestHeaders) {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n const requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (requestOptions.signal !== undefined) {\n fetchOptions.signal = requestOptions.signal;\n }\n const { query, operationName } = resolveRequestDocument(requestOptions.document);\n return makeRequest({\n url,\n query,\n variables: requestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(requestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n }\n // prettier-ignore\n batchRequests(documentsOrOptions, requestHeaders) {\n const batchRequestOptions = parseBatchRequestArgs(documentsOrOptions, requestHeaders);\n const { headers, ...fetchOptions } = this.requestConfig;\n if (batchRequestOptions.signal !== undefined) {\n fetchOptions.signal = batchRequestOptions.signal;\n }\n const queries = batchRequestOptions.documents.map(({ document }) => resolveRequestDocument(document).query);\n const variables = batchRequestOptions.documents.map(({ variables }) => variables);\n return makeRequest({\n url: this.url,\n query: queries,\n // @ts-expect-error TODO reconcile batch variables into system.\n variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(batchRequestOptions.requestHeaders),\n },\n operationName: undefined,\n fetch: this.requestConfig.fetch ?? crossFetch,\n method: this.requestConfig.method || `POST`,\n fetchOptions,\n middleware: this.requestConfig.requestMiddleware,\n })\n .then((response) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(error);\n }\n throw error;\n });\n }\n setHeaders(headers) {\n this.requestConfig.headers = headers;\n return this;\n }\n /**\n * Attach a header to the client. All subsequent requests will have this header.\n */\n setHeader(key, value) {\n const { headers } = this.requestConfig;\n if (headers) {\n // todo what if headers is in nested array form... ?\n //@ts-expect-error todo\n headers[key] = value;\n }\n else {\n this.requestConfig.headers = { [key]: value };\n }\n return this;\n }\n /**\n * Change the client endpoint. All subsequent requests will send to this endpoint.\n */\n setEndpoint(value) {\n this.url = value;\n return this;\n }\n}\nconst makeRequest = async (params) => {\n const { query, variables, fetchOptions } = params;\n const fetcher = createHttpMethodFetcher(uppercase(params.method ?? `post`));\n const isBatchingQuery = Array.isArray(params.query);\n const response = await fetcher(params);\n const result = await getResult(response, fetchOptions.jsonSerializer ?? defaultJsonSerializer);\n const successfullyReceivedData = Array.isArray(result)\n ? !result.some(({ data }) => !data)\n : Boolean(result.data);\n const successfullyPassedErrorPolicy = Array.isArray(result) ||\n !result.errors ||\n (Array.isArray(result.errors) && !result.errors.length) ||\n fetchOptions.errorPolicy === `all` ||\n fetchOptions.errorPolicy === `ignore`;\n if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {\n // @ts-expect-error TODO fixme\n const { errors: _, ...rest } = Array.isArray(result) ? result : result;\n const data = fetchOptions.errorPolicy === `ignore` ? rest : result;\n const dataEnvelope = isBatchingQuery ? { data } : data;\n // @ts-expect-error TODO\n return {\n ...dataEnvelope,\n headers: response.headers,\n status: response.status,\n };\n }\n else {\n const errorResult = typeof result === `string`\n ? {\n error: result,\n }\n : result;\n throw new ClientError(\n // @ts-expect-error TODO\n { ...errorResult, status: response.status, headers: response.headers }, { query, variables });\n }\n};\n/**\n * Send a GraphQL Query to the GraphQL server for execution.\n */\nconst rawRequest = async (...args) => {\n const [urlOrOptions, query, ...variablesAndRequestHeaders] = args;\n const requestOptions = parseRawRequestExtendedArgs(urlOrOptions, query, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.rawRequest({\n ...requestOptions,\n });\n};\n// prettier-ignore\n// eslint-disable-next-line\nasync function request(urlOrOptions, document, ...variablesAndRequestHeaders) {\n const requestOptions = parseRequestExtendedArgs(urlOrOptions, document, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.request({\n ...requestOptions,\n });\n}\n/**\n * Send a batch of GraphQL Document to the GraphQL server for execution.\n *\n * @example\n *\n * ```ts\n * // You can pass a raw string\n *\n * await batchRequests('https://foo.bar/graphql', [\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * },\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * }])\n *\n * // You can also pass a GraphQL DocumentNode as query. Convenient if you\n * // are using graphql-tag package.\n *\n * import gql from 'graphql-tag'\n *\n * await batchRequests('https://foo.bar/graphql', [{ query: gql`...` }])\n * ```\n */\nconst batchRequests = async (...args) => {\n const params = parseBatchRequestsArgsExtended(args);\n const client = new GraphQLClient(params.url);\n return client.batchRequests(params);\n};\nconst parseBatchRequestsArgsExtended = (args) => {\n if (args.length === 1) {\n return args[0];\n }\n else {\n return {\n url: args[0],\n documents: args[1],\n requestHeaders: args[2],\n signal: undefined,\n };\n }\n};\nconst createRequestBody = (query, variables, operationName, jsonSerializer) => {\n const jsonSerializer_ = jsonSerializer ?? defaultJsonSerializer;\n if (!Array.isArray(query)) {\n return jsonSerializer_.stringify({ query, variables, operationName });\n }\n if (typeof variables !== `undefined` && !Array.isArray(variables)) {\n throw new Error(`Cannot create request body with given variable type, array expected`);\n }\n // Batch support\n const payload = query.reduce((acc, currentQuery, index) => {\n acc.push({ query: currentQuery, variables: variables ? variables[index] : undefined });\n return acc;\n }, []);\n return jsonSerializer_.stringify(payload);\n};\nconst getResult = async (response, jsonSerializer) => {\n let contentType;\n response.headers.forEach((value, key) => {\n if (key.toLowerCase() === `content-type`) {\n contentType = value;\n }\n });\n if (contentType &&\n (contentType.toLowerCase().startsWith(`application/json`) ||\n contentType.toLowerCase().startsWith(`application/graphql+json`) ||\n contentType.toLowerCase().startsWith(`application/graphql-response+json`))) {\n return jsonSerializer.parse(await response.text());\n }\n else {\n return response.text();\n }\n};\nconst callOrIdentity = (value) => {\n return typeof value === `function` ? value() : value;\n};\n/**\n * Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.\n *\n * @example\n * ```\n * import { gql } from 'graphql-request'\n *\n * await request('https://foo.bar/graphql', gql`...`)\n * ```\n *\n * @remarks\n *\n * Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named \"gql\". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.\n */\nexport const gql = (chunks, ...variables) => {\n return chunks.reduce((acc, chunk, index) => `${acc}${chunk}${index in variables ? String(variables[index]) : ``}`, ``);\n};\nexport { GraphQLWebSocketClient } from './graphql-ws.js';\nexport { resolveRequestDocument } from './resolveRequestDocument.js';\nexport { batchRequests, ClientError, GraphQLClient, rawRequest, request, };\nexport default request;\n//# sourceMappingURL=index.js.map","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import { GraphQLClient } from 'graphql-request'\nimport { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'\nimport gql from 'graphql-tag'\nexport type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]?: Maybe<T[SubKey]>\n}\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]: Maybe<T[SubKey]>\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental<T> =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tInt64ID: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\n/** An attribute match configuration which can match an attribute key and value. */\nexport type AttributeMatchConfig = {\n\t__typename?: 'AttributeMatchConfig'\n\tattribute: MatchConfig\n\tkey: MatchConfig\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlog_cursor?: InputMaybe<Scalars['String']['input']>\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\trequest_id?: InputMaybe<Scalars['String']['input']>\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tstackTrace: Array<InputMaybe<StackFrameInput>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsampling?: Maybe<SamplingConfig>\n\tsecure_id: Scalars['String']['output']\n}\n\n/**\n * A match based log sampling configuration. A log matches if each specified matching configuration matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type LogSamplingConfig = {\n\t__typename?: 'LogSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** Matches against the log message. */\n\tmessage?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of logs to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 logs will be sampled. Setting the ratio to 0 will disable sampling for the log.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n\t/** Matches against the severity of the log. */\n\tseverityText?: Maybe<MatchConfig>\n}\n\n/**\n * A match configuration. Each field of this type represents a different type of match\n * configuration. One and only 1 field should be populated.\n *\n * This is effectively a sum type/discriminated union, but isn't implemented as such to avoid\n * this bug: https://github.com/99designs/gqlgen/issues/2741\n */\nexport type MatchConfig = {\n\t__typename?: 'MatchConfig'\n\t/** A match configuration which does an exact match against any value. */\n\tmatchValue?: Maybe<Scalars['Any']['output']>\n\t/**\n\t * A match configuration which matches against a regular expression.\n\t * Can only match string attributes.\n\t */\n\tregexValue?: Maybe<Scalars['String']['output']>\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe<Scalars['String']['input']>\n\tgroup?: InputMaybe<Scalars['String']['input']>\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\ttags?: InputMaybe<Array<MetricTag>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe<Scalars['Any']['output']>\n\tpushBackendPayload?: Maybe<Scalars['Any']['output']>\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe<Scalars['Any']['output']>\n\tpushSessionEvents?: Maybe<Scalars['Any']['output']>\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<Array<Scalars['String']['input']>>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe<Scalars['String']['input']>\n\tserviceName?: InputMaybe<Scalars['String']['input']>\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\ttype?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array<InputMaybe<BackendErrorObjectInput>>\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array<InputMaybe<MetricInput>>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array<InputMaybe<ErrorObjectInput>>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe<Scalars['ID']['input']>\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationPushSessionEventsArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe<Scalars['Any']['output']>\n\tsampling: SamplingConfig\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type QuerySamplingArgs = {\n\torganization_verbose_id: Scalars['String']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array<InputMaybe<ReplayEventInput>>\n}\n\nexport type SamplingConfig = {\n\t__typename?: 'SamplingConfig'\n\tlogs?: Maybe<Array<LogSamplingConfig>>\n\tspans?: Maybe<Array<SpanSamplingConfig>>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe<Scalars['Int64ID']['output']>\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\n/** An event matcher configuration which matches span events within a span. */\nexport type SpanEventMatchConfig = {\n\t__typename?: 'SpanEventMatchConfig'\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\tname?: Maybe<MatchConfig>\n}\n\n/**\n * A match based span sampling configuration. A span matches if each specified matching configuration\n * matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type SpanSamplingConfig = {\n\t__typename?: 'SpanSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** A list of span event match configs. */\n\tevents?: Maybe<Array<SpanEventMatchConfig>>\n\tname?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of spans to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 spans will be sampled. Setting the ratio to 0 will disable sampling for the span.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe<Array<InputMaybe<Scalars['Any']['input']>>>\n\tcolumnNumber?: InputMaybe<Scalars['Int']['input']>\n\tfileName?: InputMaybe<Scalars['String']['input']>\n\tfunctionName?: InputMaybe<Scalars['String']['input']>\n\tisEval?: InputMaybe<Scalars['Boolean']['input']>\n\tisNative?: InputMaybe<Scalars['Boolean']['input']>\n\tlineNumber?: InputMaybe<Scalars['Int']['input']>\n\tsource?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type PushPayloadMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tevents: ReplayEventsInput\n\tmessages: Scalars['String']['input']\n\tresources: Scalars['String']['input']\n\tweb_socket_events: Scalars['String']['input']\n\terrors: Array<InputMaybe<ErrorObjectInput>> | InputMaybe<ErrorObjectInput>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n}>\n\nexport type PushPayloadMutation = {\n\t__typename?: 'Mutation'\n\tpushPayload: number\n}\n\nexport type PushSessionEventsMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tdata: Scalars['String']['input']\n}>\n\nexport type PushSessionEventsMutation = {\n\t__typename?: 'Mutation'\n\tpushSessionEvents?: any | null\n}\n\nexport type IdentifySessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}>\n\nexport type IdentifySessionMutation = {\n\t__typename?: 'Mutation'\n\tidentifySession: string\n}\n\nexport type AddSessionPropertiesMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n}>\n\nexport type AddSessionPropertiesMutation = {\n\t__typename?: 'Mutation'\n\taddSessionProperties: string\n}\n\nexport type PushMetricsMutationVariables = Exact<{\n\tmetrics: Array<InputMaybe<MetricInput>> | InputMaybe<MetricInput>\n}>\n\nexport type PushMetricsMutation = {\n\t__typename?: 'Mutation'\n\tpushMetrics: number\n}\n\nexport type AddSessionFeedbackMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n}>\n\nexport type AddSessionFeedbackMutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: string\n}\n\nexport type MatchPartsFragment = {\n\t__typename?: 'MatchConfig'\n\tregexValue?: string | null\n\tmatchValue?: any | null\n}\n\nexport type InitializeSessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\torganization_verbose_id: Scalars['String']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tprivacy_setting: Scalars['String']['input']\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tclientVersion: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tclientConfig: Scalars['String']['input']\n\tenvironment: Scalars['String']['input']\n\tid: Scalars['String']['input']\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tserviceName: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<\n\t\tArray<Scalars['String']['input']> | Scalars['String']['input']\n\t>\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n}>\n\nexport type InitializeSessionMutation = {\n\t__typename?: 'Mutation'\n\tinitializeSession: {\n\t\t__typename?: 'InitializeSessionResponse'\n\t\tsecure_id: string\n\t\tproject_id: string\n\t\tsampling?: {\n\t\t\t__typename?: 'SamplingConfig'\n\t\t\tspans?: Array<{\n\t\t\t\t__typename?: 'SpanSamplingConfig'\n\t\t\t\tsamplingRatio: number\n\t\t\t\tname?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t\tevents?: Array<{\n\t\t\t\t\t__typename?: 'SpanEventMatchConfig'\n\t\t\t\t\tname?: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t} | null\n\t\t\t\t\tattributes?: Array<{\n\t\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\t\tkey: {\n\t\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute: {\n\t\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t\t}\n\t\t\t\t\t}> | null\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t\tlogs?: Array<{\n\t\t\t\t__typename?: 'LogSamplingConfig'\n\t\t\t\tsamplingRatio: number\n\t\t\t\tmessage?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tseverityText?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t} | null\n\t}\n}\n\nexport type IgnoreQueryVariables = Exact<{\n\tid: Scalars['ID']['input']\n}>\n\nexport type IgnoreQuery = { __typename?: 'Query'; ignore?: any | null }\n\nexport type GetSamplingConfigQueryVariables = Exact<{\n\torganization_verbose_id: Scalars['String']['input']\n}>\n\nexport type GetSamplingConfigQuery = {\n\t__typename?: 'Query'\n\tsampling: {\n\t\t__typename?: 'SamplingConfig'\n\t\tspans?: Array<{\n\t\t\t__typename?: 'SpanSamplingConfig'\n\t\t\tsamplingRatio: number\n\t\t\tname?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tattributes?: Array<{\n\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\tkey: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t\tattribute: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t}> | null\n\t\t\tevents?: Array<{\n\t\t\t\t__typename?: 'SpanEventMatchConfig'\n\t\t\t\tname?: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t} | null\n\t\t\t\tattributes?: Array<{\n\t\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\t\tkey: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t\tattribute: {\n\t\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t\t}\n\t\t\t\t}> | null\n\t\t\t}> | null\n\t\t}> | null\n\t\tlogs?: Array<{\n\t\t\t__typename?: 'LogSamplingConfig'\n\t\t\tsamplingRatio: number\n\t\t\tmessage?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tseverityText?: {\n\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\tregexValue?: string | null\n\t\t\t\tmatchValue?: any | null\n\t\t\t} | null\n\t\t\tattributes?: Array<{\n\t\t\t\t__typename?: 'AttributeMatchConfig'\n\t\t\t\tkey: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t\tattribute: {\n\t\t\t\t\t__typename?: 'MatchConfig'\n\t\t\t\t\tregexValue?: string | null\n\t\t\t\t\tmatchValue?: any | null\n\t\t\t\t}\n\t\t\t}> | null\n\t\t}> | null\n\t}\n}\n\nexport const MatchPartsFragmentDoc = gql`\n\tfragment MatchParts on MatchConfig {\n\t\tregexValue\n\t\tmatchValue\n\t}\n`\nexport const PushPayloadDocument = gql`\n\tmutation PushPayload(\n\t\t$session_secure_id: String!\n\t\t$payload_id: ID!\n\t\t$events: ReplayEventsInput!\n\t\t$messages: String!\n\t\t$resources: String!\n\t\t$web_socket_events: String!\n\t\t$errors: [ErrorObjectInput]!\n\t\t$is_beacon: Boolean\n\t\t$has_session_unloaded: Boolean\n\t\t$highlight_logs: String\n\t) {\n\t\tpushPayload(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tevents: $events\n\t\t\tmessages: $messages\n\t\t\tresources: $resources\n\t\t\tweb_socket_events: $web_socket_events\n\t\t\terrors: $errors\n\t\t\tis_beacon: $is_beacon\n\t\t\thas_session_unloaded: $has_session_unloaded\n\t\t\thighlight_logs: $highlight_logs\n\t\t)\n\t}\n`\nexport const PushSessionEventsDocument = gql`\n\tmutation PushSessionEvents(\n\t\t$session_secure_id: String!\n\t\t$payload_id: Int64ID!\n\t\t$data: String!\n\t) {\n\t\tpushSessionEvents(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tdata: $data\n\t\t)\n\t}\n`\nexport const IdentifySessionDocument = gql`\n\tmutation identifySession(\n\t\t$session_secure_id: String!\n\t\t$user_identifier: String!\n\t\t$user_object: Any\n\t) {\n\t\tidentifySession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_identifier: $user_identifier\n\t\t\tuser_object: $user_object\n\t\t)\n\t}\n`\nexport const AddSessionPropertiesDocument = gql`\n\tmutation addSessionProperties(\n\t\t$session_secure_id: String!\n\t\t$properties_object: Any\n\t) {\n\t\taddSessionProperties(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tproperties_object: $properties_object\n\t\t)\n\t}\n`\nexport const PushMetricsDocument = gql`\n\tmutation pushMetrics($metrics: [MetricInput]!) {\n\t\tpushMetrics(metrics: $metrics)\n\t}\n`\nexport const AddSessionFeedbackDocument = gql`\n\tmutation addSessionFeedback(\n\t\t$session_secure_id: String!\n\t\t$user_name: String\n\t\t$user_email: String\n\t\t$verbatim: String!\n\t\t$timestamp: Timestamp!\n\t) {\n\t\taddSessionFeedback(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_name: $user_name\n\t\t\tuser_email: $user_email\n\t\t\tverbatim: $verbatim\n\t\t\ttimestamp: $timestamp\n\t\t)\n\t}\n`\nexport const InitializeSessionDocument = gql`\n\tmutation initializeSession(\n\t\t$session_secure_id: String!\n\t\t$session_key: String\n\t\t$organization_verbose_id: String!\n\t\t$enable_strict_privacy: Boolean!\n\t\t$privacy_setting: String!\n\t\t$enable_recording_network_contents: Boolean!\n\t\t$clientVersion: String!\n\t\t$firstloadVersion: String!\n\t\t$clientConfig: String!\n\t\t$environment: String!\n\t\t$id: String!\n\t\t$appVersion: String\n\t\t$serviceName: String!\n\t\t$client_id: String!\n\t\t$network_recording_domains: [String!]\n\t\t$disable_session_recording: Boolean\n\t) {\n\t\tinitializeSession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tsession_key: $session_key\n\t\t\torganization_verbose_id: $organization_verbose_id\n\t\t\tenable_strict_privacy: $enable_strict_privacy\n\t\t\tenable_recording_network_contents: $enable_recording_network_contents\n\t\t\tclientVersion: $clientVersion\n\t\t\tfirstloadVersion: $firstloadVersion\n\t\t\tclientConfig: $clientConfig\n\t\t\tenvironment: $environment\n\t\t\tappVersion: $appVersion\n\t\t\tserviceName: $serviceName\n\t\t\tfingerprint: $id\n\t\t\tclient_id: $client_id\n\t\t\tnetwork_recording_domains: $network_recording_domains\n\t\t\tdisable_session_recording: $disable_session_recording\n\t\t\tprivacy_setting: $privacy_setting\n\t\t) {\n\t\t\tsecure_id\n\t\t\tproject_id\n\t\t\tsampling {\n\t\t\t\tspans {\n\t\t\t\t\tname {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevents {\n\t\t\t\t\t\tname {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattributes {\n\t\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsamplingRatio\n\t\t\t\t}\n\t\t\t\tlogs {\n\t\t\t\t\tmessage {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tseverityText {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsamplingRatio\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t${MatchPartsFragmentDoc}\n`\nexport const IgnoreDocument = gql`\n\tquery Ignore($id: ID!) {\n\t\tignore(id: $id)\n\t}\n`\nexport const GetSamplingConfigDocument = gql`\n\tquery GetSamplingConfig($organization_verbose_id: String!) {\n\t\tsampling(organization_verbose_id: $organization_verbose_id) {\n\t\t\tspans {\n\t\t\t\tname {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tattributes {\n\t\t\t\t\tkey {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattribute {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tevents {\n\t\t\t\t\tname {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattributes {\n\t\t\t\t\t\tkey {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattribute {\n\t\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsamplingRatio\n\t\t\t}\n\t\t\tlogs {\n\t\t\t\tmessage {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tseverityText {\n\t\t\t\t\t...MatchParts\n\t\t\t\t}\n\t\t\t\tattributes {\n\t\t\t\t\tkey {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t\tattribute {\n\t\t\t\t\t\t...MatchParts\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsamplingRatio\n\t\t\t}\n\t\t}\n\t}\n\t${MatchPartsFragmentDoc}\n`\n\nexport type SdkFunctionWrapper = <T>(\n\taction: (requestHeaders?: Record<string, string>) => Promise<T>,\n\toperationName: string,\n\toperationType?: string,\n\tvariables?: any,\n) => Promise<T>\n\nconst defaultWrapper: SdkFunctionWrapper = (\n\taction,\n\t_operationName,\n\t_operationType,\n\tvariables,\n) => action()\n\nexport function getSdk(\n\tclient: GraphQLClient,\n\twithWrapper: SdkFunctionWrapper = defaultWrapper,\n) {\n\treturn {\n\t\tPushPayload(\n\t\t\tvariables: PushPayloadMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushPayloadMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushPayloadMutation>(\n\t\t\t\t\t\tPushPayloadDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushPayload',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tPushSessionEvents(\n\t\t\tvariables: PushSessionEventsMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushSessionEventsMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushSessionEventsMutation>(\n\t\t\t\t\t\tPushSessionEventsDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushSessionEvents',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tidentifySession(\n\t\t\tvariables: IdentifySessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<IdentifySessionMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<IdentifySessionMutation>(\n\t\t\t\t\t\tIdentifySessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'identifySession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionProperties(\n\t\t\tvariables: AddSessionPropertiesMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<AddSessionPropertiesMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<AddSessionPropertiesMutation>(\n\t\t\t\t\t\tAddSessionPropertiesDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionProperties',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tpushMetrics(\n\t\t\tvariables: PushMetricsMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<PushMetricsMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<PushMetricsMutation>(\n\t\t\t\t\t\tPushMetricsDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'pushMetrics',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionFeedback(\n\t\t\tvariables: AddSessionFeedbackMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<AddSessionFeedbackMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<AddSessionFeedbackMutation>(\n\t\t\t\t\t\tAddSessionFeedbackDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionFeedback',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tinitializeSession(\n\t\t\tvariables: InitializeSessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<InitializeSessionMutation> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<InitializeSessionMutation>(\n\t\t\t\t\t\tInitializeSessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'initializeSession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tIgnore(\n\t\t\tvariables: IgnoreQueryVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<IgnoreQuery> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<IgnoreQuery>(IgnoreDocument, variables, {\n\t\t\t\t\t\t...requestHeaders,\n\t\t\t\t\t\t...wrappedRequestHeaders,\n\t\t\t\t\t}),\n\t\t\t\t'Ignore',\n\t\t\t\t'query',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tGetSamplingConfig(\n\t\t\tvariables: GetSamplingConfigQueryVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise<GetSamplingConfigQuery> {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request<GetSamplingConfigQuery>(\n\t\t\t\t\t\tGetSamplingConfigDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'GetSamplingConfig',\n\t\t\t\t'query',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t}\n}\nexport type Sdk = ReturnType<typeof getSdk>\n","import { StringifyOptions } from '../listeners/console-listener'\n\nexport function patch(\n\t// tslint:disable-next-line:no-any\n\tsource: { [key: string]: any },\n\tname: string,\n\t// tslint:disable-next-line:no-any\n\treplacement: (...args: any[]) => any,\n): () => void {\n\ttry {\n\t\tif (!(name in source)) {\n\t\t\treturn () => {}\n\t\t}\n\n\t\tconst original = source[name] as () => unknown\n\t\tconst wrapped = replacement(original)\n\n\t\t// Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n\t\t// otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n\t\t// tslint:disable-next-line:strict-type-predicates\n\t\tif (typeof wrapped === 'function') {\n\t\t\twrapped.prototype = wrapped.prototype || {}\n\t\t\tObject.defineProperties(wrapped, {\n\t\t\t\t__rrweb_original__: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: original,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\n\t\tsource[name] = wrapped\n\n\t\treturn () => {\n\t\t\tsource[name] = original\n\t\t}\n\t} catch {\n\t\treturn () => {}\n\t}\n}\n\n/**\n * transfer the node path in Event to string\n * @param node the first node in a node path array\n */\nfunction pathToSelector(node: HTMLElement): string | '' {\n\tif (!node || !node.outerHTML) {\n\t\treturn ''\n\t}\n\n\tlet path = ''\n\twhile (node.parentElement) {\n\t\tlet name = node.localName\n\t\tif (!name) {\n\t\t\tbreak\n\t\t}\n\t\tname = name.toLowerCase()\n\t\tlet parent = node.parentElement\n\n\t\tlet domSiblings = []\n\n\t\tif (parent.children && parent.children.length > 0) {\n\t\t\t// tslint:disable-next-line:prefer-for-of\n\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\tlet sibling = parent.children[i]\n\t\t\t\tif (sibling.localName && sibling.localName.toLowerCase) {\n\t\t\t\t\tif (sibling.localName.toLowerCase() === name) {\n\t\t\t\t\t\tdomSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (domSiblings.length > 1) {\n\t\t\tname += ':eq(' + domSiblings.indexOf(node) + ')'\n\t\t}\n\t\tpath = name + (path ? '>' + path : '')\n\t\tnode = parent\n\t}\n\n\treturn path\n}\n\n/**\n * judge is object\n */\nfunction isObject(obj: any): boolean {\n\treturn Object.prototype.toString.call(obj) === '[object Object]'\n}\n\n/**\n * judge the object's depth\n */\nfunction isObjTooDeep(obj: any, limit: number): boolean {\n\tif (limit === 0) {\n\t\treturn true\n\t}\n\n\tconst keys = Object.keys(obj)\n\tfor (const key of keys) {\n\t\tif (isObject(obj[key]) && isObjTooDeep(obj[key], limit - 1)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * stringify any js object\n * @param obj the object to stringify\n */\nexport function stringify(\n\tobj: any,\n\tstringifyOptions?: StringifyOptions,\n): string {\n\tconst options: StringifyOptions = {\n\t\tnumOfKeysLimit: 50,\n\t\tdepthOfLimit: 4,\n\t}\n\tObject.assign(options, stringifyOptions)\n\tconst stack: any[] = []\n\tconst keys: any[] = []\n\treturn JSON.stringify(obj, function (key, value) {\n\t\t/**\n\t\t * forked from https://github.com/moll/json-stringify-safe/blob/master/stringify.js\n\t\t * to deCycle the object\n\t\t */\n\t\tif (stack.length > 0) {\n\t\t\tconst thisPos = stack.indexOf(this)\n\t\t\t~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n\t\t\t~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n\t\t\tif (~stack.indexOf(value)) {\n\t\t\t\tif (stack[0] === value) {\n\t\t\t\t\tvalue = '[Circular ~]'\n\t\t\t\t} else {\n\t\t\t\t\tvalue =\n\t\t\t\t\t\t'[Circular ~.' +\n\t\t\t\t\t\tkeys.slice(0, stack.indexOf(value)).join('.') +\n\t\t\t\t\t\t']'\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tstack.push(value)\n\t\t}\n\t\t/* END of the FORK */\n\n\t\tif (value === null || value === undefined) {\n\t\t\treturn value\n\t\t}\n\t\tif (shouldIgnore(value)) {\n\t\t\treturn toString(value)\n\t\t}\n\t\tif (value instanceof Event) {\n\t\t\tconst eventResult: any = {}\n\t\t\tfor (const eventKey in value) {\n\t\t\t\tconst eventValue = (value as any)[eventKey]\n\t\t\t\tif (Array.isArray(eventValue)) {\n\t\t\t\t\teventResult[eventKey] = pathToSelector(\n\t\t\t\t\t\teventValue.length ? eventValue[0] : null,\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\teventResult[eventKey] = eventValue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn eventResult\n\t\t} else if (value instanceof Node) {\n\t\t\tif (value instanceof HTMLElement) {\n\t\t\t\treturn value ? value.outerHTML : ''\n\t\t\t}\n\t\t\treturn value.nodeName\n\t\t} else if (value instanceof Error) {\n\t\t\treturn value.name + ': ' + value.message\n\t\t}\n\t\treturn value\n\t})\n\n\t/**\n\t * whether we should ignore obj's info and call toString() function instead\n\t */\n\tfunction shouldIgnore(_obj: object): boolean {\n\t\t// outof keys limit\n\t\tif (\n\t\t\tisObject(_obj) &&\n\t\t\tObject.keys(_obj).length > options.numOfKeysLimit\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\t// is function\n\t\tif (typeof _obj === 'function') {\n\t\t\treturn true\n\t\t}\n\n\t\t// if a non-user event with only the `isTrusted` key\n\t\t// We ignore this because some frameworks/library can output these non-stop.\n\t\t// There's no value in recording/showing these to the end user so we ignore.\n\t\tif (_obj instanceof Event && _obj.isTrusted === false) {\n\t\t\tconst eventKeys = Object.keys(_obj)\n\n\t\t\treturn eventKeys.length === 1\n\t\t}\n\n\t\t/**\n\t\t * judge object's depth to avoid browser's OOM\n\t\t *\n\t\t * issues: https://github.com/rrweb-io/rrweb/issues/653\n\t\t */\n\t\tif (isObject(_obj) && isObjTooDeep(_obj, options.depthOfLimit)) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * limit the toString() result according to option\n\t */\n\tfunction toString(_obj: object): string {\n\t\tlet str = _obj.toString()\n\t\tif (\n\t\t\toptions.stringLengthLimit &&\n\t\t\tstr.length > options.stringLengthLimit\n\t\t) {\n\t\t\tstr = `${str.slice(0, options.stringLengthLimit)}...`\n\t\t}\n\t\treturn str\n\t}\n}\n\nfunction supportsWebP(): boolean {\n\tvar elem = document.createElement('canvas')\n\tif (!!(elem.getContext && elem.getContext('2d'))) {\n\t\treturn elem.toDataURL('image/webp').indexOf('data:image/webp') == 0\n\t}\n\treturn false\n}\n\nexport function getDefaultDataURLOptions(): {\n\ttype: string\n\tquality: number\n} {\n\tif (supportsWebP()) {\n\t\treturn {\n\t\t\ttype: 'image/webp',\n\t\t\tquality: 0.9,\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'image/jpeg',\n\t\tquality: 0.6,\n\t}\n}\n\n/**\n * Check that a value is safe to use as a metric.\n *\n * This means the number must be a number, be finite, and not NaN.\n * NaN and Infinity serialize to null, which produces an invalid metric\n * payload.\n * @param value The value to check.\n * @returns True if the value is safe to use as a metric, false otherwise.\n */\nexport function isMetricSafeNumber(value: unknown): boolean {\n\treturn typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2\n//----------------------------------------------------------------------------------------------------------\n/**\n * ASP.NET Core exception middleware handling result.\n *\n * @example handled\n * @example unhandled\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result';\n/**\n * Enum value \"aborted\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling didn't run because the request was aborted.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = \"aborted\";\n/**\n * Enum value \"handled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = \"handled\";\n/**\n * Enum value \"skipped\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling was skipped because the response had started.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = \"skipped\";\n/**\n * Enum value \"unhandled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was not handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = \"unhandled\";\n/**\n * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.\n *\n * @example Contoso.MyHandler\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type';\n/**\n * Rate limiting policy name.\n *\n * @example fixed\n * @example sliding\n * @example token\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy';\n/**\n * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason\n *\n * @example acquired\n * @example request_canceled\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result';\n/**\n * Enum value \"acquired\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease was acquired\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = \"acquired\";\n/**\n * Enum value \"endpoint_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the endpoint limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = \"endpoint_limiter\";\n/**\n * Enum value \"global_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the global limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = \"global_limiter\";\n/**\n * Enum value \"request_canceled\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was canceled\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = \"request_canceled\";\n/**\n * Flag indicating if request was handled by the application pipeline.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled';\n/**\n * A value that indicates whether the matched route is a fallback route.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback';\n/**\n * Match result - success or failure\n *\n * @example success\n * @example failure\n */\nexport const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status';\n/**\n * Enum value \"failure\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match failed\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = \"failure\";\n/**\n * Enum value \"success\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match succeeded\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = \"success\";\n/**\n * A value that indicates whether the user is authenticated.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated';\n/**\n * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example client.example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_ADDRESS = 'client.address';\n/**\n * Client port number.\n *\n * @example 65123\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_PORT = 'client.port';\n/**\n * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 16\n */\nexport const ATTR_CODE_COLUMN_NUMBER = 'code.column.number';\n/**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"/usr/local/MyApplication/content_root/app/index.php\"\n */\nexport const ATTR_CODE_FILE_PATH = 'code.file.path';\n/**\n * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example com.example.MyHttpService.serveRequest\n * @example GuzzleHttp\\\\Client::transfer\n * @example fopen\n *\n * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.\n * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in\n * `code.stacktrace` without information on arguments.\n *\n * Examples:\n *\n * - Java method: `com.example.MyHttpService.serveRequest`\n * - Java anonymous class method: `com.mycompany.Main$1.myMethod`\n * - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`\n * - PHP function: `GuzzleHttp\\Client::transfer`\n * - Go function: `github.com/my/repo/pkg.foo.func5`\n * - Elixir: `OpenTelemetry.Ctx.new`\n * - Erlang: `opentelemetry_ctx:new`\n * - Rust: `playground::my_module::my_cool_func`\n * - C function: `fopen`\n */\nexport const ATTR_CODE_FUNCTION_NAME = 'code.function.name';\n/**\n * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 42\n */\nexport const ATTR_CODE_LINE_NUMBER = 'code.line.number';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_CODE_STACKTRACE = 'code.stacktrace';\n/**\n * The name of a collection (table, container) within the database.\n *\n * @example public.users\n * @example customers\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The collection name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple collections\n * in non-batch operations.\n *\n * For batch operations, if the individual operations are known to have the same\n * collection name then that collection name **SHOULD** be used.\n */\nexport const ATTR_DB_COLLECTION_NAME = 'db.collection.name';\n/**\n * The name of the database, fully qualified within the server address and port.\n *\n * @example customers\n * @example test.users\n *\n * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted.\n * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.\n * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.\n */\nexport const ATTR_DB_NAMESPACE = 'db.namespace';\n/**\n * The number of queries included in a batch operation.\n *\n * @example 2\n * @example 3\n * @example 4\n *\n * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`.\n */\nexport const ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size';\n/**\n * The name of the operation or command being executed.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The operation name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple operations\n * in non-batch operations.\n *\n * If spaces can occur in the operation name, multiple consecutive spaces\n * **SHOULD** be normalized to a single space.\n *\n * For batch operations, if the individual operations are known to have the same operation name\n * then that operation name **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_OPERATION_NAME = 'db.operation.name';\n/**\n * Low cardinality summary of a database query.\n *\n * @example SELECT wuser_table\n * @example INSERT shipping_details SELECT orders\n * @example get user by id\n *\n * @note The query summary describes a class of database queries and is useful\n * as a grouping key, especially when analyzing telemetry for database\n * calls involving complex queries.\n *\n * Summary may be available to the instrumentation through\n * instrumentation hooks or other means. If it is not available, instrumentations\n * that support query parsing **SHOULD** generate a summary following\n * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query)\n * section.\n *\n * For batch operations, if the individual operations are known to have the same query summary\n * then that query summary **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_QUERY_SUMMARY = 'db.query.summary';\n/**\n * The database query being executed.\n *\n * @example SELECT * FROM wuser_table where username = ?\n * @example SET mykey ?\n *\n * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext).\n * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable.\n * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.\n */\nexport const ATTR_DB_QUERY_TEXT = 'db.query.text';\n/**\n * Database response status code.\n *\n * @example 102\n * @example ORA-17002\n * @example 08P01\n * @example 404\n *\n * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.\n * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system.\n */\nexport const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code';\n/**\n * The name of a stored procedure within the database.\n *\n * @example GetCustomer\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * For batch operations, if the individual operations are known to have the same\n * stored procedure name then that stored procedure name **SHOULD** be used.\n */\nexport const ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name';\n/**\n * The database management system (DBMS) product as identified by the client instrumentation.\n *\n * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge.\n */\nexport const ATTR_DB_SYSTEM_NAME = 'db.system.name';\n/**\n * Enum value \"mariadb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MariaDB](https://mariadb.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MARIADB = \"mariadb\";\n/**\n * Enum value \"microsoft.sql_server\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Microsoft SQL Server](https://www.microsoft.com/sql-server)\n */\nexport const DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = \"microsoft.sql_server\";\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MySQL](https://www.mysql.com/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MYSQL = \"mysql\";\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [PostgreSQL](https://www.postgresql.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_POSTGRESQL = \"postgresql\";\n/**\n * Name of the garbage collector managed heap generation.\n *\n * @example gen0\n * @example gen1\n * @example gen2\n */\nexport const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation';\n/**\n * Enum value \"gen0\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 0\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = \"gen0\";\n/**\n * Enum value \"gen1\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 1\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = \"gen1\";\n/**\n * Enum value \"gen2\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 2\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = \"gen2\";\n/**\n * Enum value \"loh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Large Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = \"loh\";\n/**\n * Enum value \"poh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Pinned Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_POH = \"poh\";\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_ERROR_TYPE}.\n *\n * A fallback error value to be used when the instrumentation doesn't define a custom value.\n */\nexport const ERROR_TYPE_VALUE_OTHER = \"_OTHER\";\n/**\n * Indicates that the exception is escaping the scope of the span.\n *\n * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.\n */\nexport const ATTR_EXCEPTION_ESCAPED = 'exception.escaped';\n/**\n * The exception message.\n *\n * @example Division by zero\n * @example Can't convert 'int' object to str implicitly\n *\n * @note > [!WARNING]\n *\n * > This attribute may contain sensitive information.\n */\nexport const ATTR_EXCEPTION_MESSAGE = 'exception.message';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n *\n * @example \"Exception in thread \"main\" java.lang.RuntimeException: Test exception\\\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';\n/**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n *\n * @example java.net.ConnectException\n * @example OSError\n */\nexport const ATTR_EXCEPTION_TYPE = 'exception.type';\n/**\n * HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"1.2.3.4\", \"1.2.3.5\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * The `User-Agent` header is already captured in the `user_agent.original` attribute.\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for`\n * attribute with value `[\"1.2.3.4\", \"1.2.3.5\"]` or `[\"1.2.3.4, 1.2.3.5\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;\n/**\n * HTTP request method.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @note HTTP request method value **SHOULD** be \"known\" to the instrumentation.\n * By default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods),\n * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html)\n * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1).\n *\n * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.\n *\n * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override\n * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named\n * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods.\n *\n *\n * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property\n * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or\n * `.instrumentation/development.general.http.server`.\n *\n * In either case, this list **MUST** be a full override of the default known methods,\n * it is not a list of known methods in addition to the defaults.\n *\n * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.\n * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.\n * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.\n */\nexport const ATTR_HTTP_REQUEST_METHOD = 'http.request.method';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * Any HTTP method that the instrumentation has no prior knowledge of.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OTHER = \"_OTHER\";\n/**\n * Enum value \"CONNECT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * CONNECT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_CONNECT = \"CONNECT\";\n/**\n * Enum value \"DELETE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * DELETE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_DELETE = \"DELETE\";\n/**\n * Enum value \"GET\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * GET method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_GET = \"GET\";\n/**\n * Enum value \"HEAD\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * HEAD method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_HEAD = \"HEAD\";\n/**\n * Enum value \"OPTIONS\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * OPTIONS method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OPTIONS = \"OPTIONS\";\n/**\n * Enum value \"PATCH\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PATCH method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PATCH = \"PATCH\";\n/**\n * Enum value \"POST\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * POST method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_POST = \"POST\";\n/**\n * Enum value \"PUT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PUT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PUT = \"PUT\";\n/**\n * Enum value \"TRACE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * TRACE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_TRACE = \"TRACE\";\n/**\n * Original HTTP method sent by the client in the request line.\n *\n * @example GeT\n * @example ACL\n * @example foo\n */\nexport const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original';\n/**\n * The ordinal number of request resending attempt (for any reason, including redirects).\n *\n * @example 3\n *\n * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n */\nexport const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count';\n/**\n * HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"abc\", \"def\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header`\n * attribute with value `[\"abc\", \"def\"]` or `[\"abc, def\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`;\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';\n/**\n * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.\n *\n * @example /users/:userID?\n * @example my-controller/my-action/{id?}\n *\n * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\n * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.\n *\n * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that\n * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`.\n *\n * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.\n *\n * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY**\n * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string.\n */\nexport const ATTR_HTTP_ROUTE = 'http.route';\n/**\n * Name of the garbage collector action.\n *\n * @example end of minor GC\n * @example end of major GC\n *\n * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n */\nexport const ATTR_JVM_GC_ACTION = 'jvm.gc.action';\n/**\n * Name of the garbage collector.\n *\n * @example G1 Young Generation\n * @example G1 Old Generation\n *\n * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n */\nexport const ATTR_JVM_GC_NAME = 'jvm.gc.name';\n/**\n * Name of the memory pool.\n *\n * @example G1 Old Gen\n * @example G1 Eden space\n * @example G1 Survivor Space\n *\n * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n */\nexport const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name';\n/**\n * The type of memory.\n *\n * @example heap\n * @example non_heap\n */\nexport const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type';\n/**\n * Enum value \"heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Heap memory.\n */\nexport const JVM_MEMORY_TYPE_VALUE_HEAP = \"heap\";\n/**\n * Enum value \"non_heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Non-heap memory\n */\nexport const JVM_MEMORY_TYPE_VALUE_NON_HEAP = \"non_heap\";\n/**\n * Whether the thread is daemon or not.\n */\nexport const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon';\n/**\n * State of the thread.\n *\n * @example runnable\n * @example blocked\n */\nexport const ATTR_JVM_THREAD_STATE = 'jvm.thread.state';\n/**\n * Enum value \"blocked\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is blocked waiting for a monitor lock is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_BLOCKED = \"blocked\";\n/**\n * Enum value \"new\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has not yet started is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_NEW = \"new\";\n/**\n * Enum value \"runnable\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread executing in the Java virtual machine is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_RUNNABLE = \"runnable\";\n/**\n * Enum value \"terminated\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has exited is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TERMINATED = \"terminated\";\n/**\n * Enum value \"timed_waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TIMED_WAITING = \"timed_waiting\";\n/**\n * Enum value \"waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting indefinitely for another thread to perform a particular action is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_WAITING = \"waiting\";\n/**\n * Local address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address';\n/**\n * Local port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_LOCAL_PORT = 'network.local.port';\n/**\n * Peer address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address';\n/**\n * Peer port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_PEER_PORT = 'network.peer.port';\n/**\n * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent.\n *\n * @example amqp\n * @example http\n * @example mqtt\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name';\n/**\n * The actual version of the protocol used for network communication.\n *\n * @example 1.1\n * @example 2\n *\n * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD NOT** be set.\n */\nexport const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version';\n/**\n * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n *\n * @example tcp\n * @example udp\n *\n * @note The value **SHOULD** be normalized to lowercase.\n *\n * Consider always setting the transport when setting a port number, since\n * a port number is ambiguous without knowing the transport. For example\n * different processes could be listening on TCP port 12345 and UDP port 12345.\n */\nexport const ATTR_NETWORK_TRANSPORT = 'network.transport';\n/**\n * Enum value \"pipe\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Named or anonymous pipe.\n */\nexport const NETWORK_TRANSPORT_VALUE_PIPE = \"pipe\";\n/**\n * Enum value \"quic\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * QUIC\n */\nexport const NETWORK_TRANSPORT_VALUE_QUIC = \"quic\";\n/**\n * Enum value \"tcp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * TCP\n */\nexport const NETWORK_TRANSPORT_VALUE_TCP = \"tcp\";\n/**\n * Enum value \"udp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * UDP\n */\nexport const NETWORK_TRANSPORT_VALUE_UDP = \"udp\";\n/**\n * Enum value \"unix\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Unix domain socket\n */\nexport const NETWORK_TRANSPORT_VALUE_UNIX = \"unix\";\n/**\n * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent.\n *\n * @example ipv4\n * @example ipv6\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_TYPE = 'network.type';\n/**\n * Enum value \"ipv4\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv4\n */\nexport const NETWORK_TYPE_VALUE_IPV4 = \"ipv4\";\n/**\n * Enum value \"ipv6\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv6\n */\nexport const NETWORK_TYPE_VALUE_IPV6 = \"ipv6\";\n/**\n * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).\n *\n * @example io.opentelemetry.contrib.mongodb\n */\nexport const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name';\n/**\n * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).\n *\n * @example 1.0.0\n */\nexport const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version';\n/**\n * Name of the code, either \"OK\" or \"ERROR\". **MUST NOT** be set if the status code is UNSET.\n */\nexport const ATTR_OTEL_STATUS_CODE = 'otel.status_code';\n/**\n * Enum value \"ERROR\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation contains an error.\n */\nexport const OTEL_STATUS_CODE_VALUE_ERROR = \"ERROR\";\n/**\n * Enum value \"OK\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation has been validated by an Application developer or Operator to have completed successfully.\n */\nexport const OTEL_STATUS_CODE_VALUE_OK = \"OK\";\n/**\n * Description of the Status if it has a value, otherwise not set.\n *\n * @example resource not found\n */\nexport const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description';\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address';\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port';\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id';\n/**\n * Logical name of the service.\n *\n * @example shoppingcart\n *\n * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`.\n */\nexport const ATTR_SERVICE_NAME = 'service.name';\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace';\n/**\n * The version string of the service component. The format is not defined by these conventions.\n *\n * @example 2.0.0\n * @example a01dbef8a\n */\nexport const ATTR_SERVICE_VERSION = 'service.version';\n/**\n * SignalR HTTP connection closure status.\n *\n * @example app_shutdown\n * @example timeout\n */\nexport const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status';\n/**\n * Enum value \"app_shutdown\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed because the app is shutting down.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = \"app_shutdown\";\n/**\n * Enum value \"normal_closure\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed normally.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = \"normal_closure\";\n/**\n * Enum value \"timeout\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed due to a timeout.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = \"timeout\";\n/**\n * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)\n *\n * @example web_sockets\n * @example long_polling\n */\nexport const ATTR_SIGNALR_TRANSPORT = 'signalr.transport';\n/**\n * Enum value \"long_polling\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * LongPolling protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = \"long_polling\";\n/**\n * Enum value \"server_sent_events\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * ServerSentEvents protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = \"server_sent_events\";\n/**\n * Enum value \"web_sockets\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * WebSockets protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = \"web_sockets\";\n/**\n * The language of the telemetry SDK.\n */\nexport const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';\n/**\n * Enum value \"cpp\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = \"cpp\";\n/**\n * Enum value \"dotnet\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = \"dotnet\";\n/**\n * Enum value \"erlang\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = \"erlang\";\n/**\n * Enum value \"go\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_GO = \"go\";\n/**\n * Enum value \"java\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = \"java\";\n/**\n * Enum value \"nodejs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = \"nodejs\";\n/**\n * Enum value \"php\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = \"php\";\n/**\n * Enum value \"python\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = \"python\";\n/**\n * Enum value \"ruby\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = \"ruby\";\n/**\n * Enum value \"rust\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = \"rust\";\n/**\n * Enum value \"swift\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = \"swift\";\n/**\n * Enum value \"webjs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = \"webjs\";\n/**\n * The name of the telemetry SDK as defined above.\n *\n * @example opentelemetry\n *\n * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.\n * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the\n * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point\n * or another suitable identifier depending on the language.\n * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.\n * All custom identifiers **SHOULD** be stable across different versions of an implementation.\n */\nexport const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';\n/**\n * The version string of the telemetry SDK.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';\n/**\n * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component\n *\n * @example SemConv\n */\nexport const ATTR_URL_FRAGMENT = 'url.fragment';\n/**\n * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n * @example //localhost\n *\n * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment\n * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.\n *\n * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`.\n * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.\n *\n * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed).\n *\n * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the\n * value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `https://www.example.com/path?color=blue&sig=REDACTED`.\n */\nexport const ATTR_URL_FULL = 'url.full';\n/**\n * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component\n *\n * @example /search\n *\n * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.\n */\nexport const ATTR_URL_PATH = 'url.path';\n/**\n * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component\n *\n * @example q=OpenTelemetry\n *\n * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `q=OpenTelemetry&sig=REDACTED`.\n */\nexport const ATTR_URL_QUERY = 'url.query';\n/**\n * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.\n *\n * @example https\n * @example ftp\n * @example telnet\n */\nexport const ATTR_URL_SCHEME = 'url.scheme';\n/**\n * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2\n */\nexport const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original';\n//# sourceMappingURL=stable_attributes.js.map","/**\n * The amount of time to wait until sending the first payload.\n */\nexport const FIRST_SEND_FREQUENCY = 1000\n/**\n * The amount of time between sending the client-side payload to Highlight backend client.\n * In milliseconds.\n */\nexport const SEND_FREQUENCY = 1000 * 2\n\n/**\n * Maximum length of a session\n */\nexport const MAX_SESSION_LENGTH = 4 * 60 * 60 * 1000\n\n/**\n * The amount of time allowed after the last push before creating a new session.\n * In milliseconds.\n */\nexport const SESSION_PUSH_THRESHOLD = 15 * 60 * 1000\n\n/*\n * Don't take another full snapshot unless it's been at least\n * 4 minutes AND the cumulative payload size since the last\n * snapshot is > 10MB.\n */\nexport const SNAPSHOT_SETTINGS = {\n\tnormal: {\n\t\tbytes: 10e6,\n\t\ttime: 4 * 60 * 1000,\n\t},\n\tcanvas: {\n\t\tbytes: 16e6,\n\t\ttime: 5000,\n\t},\n} as const\n\n// Debounce duplicate visibility events\nexport const VISIBILITY_DEBOUNCE_MS = 100\n\n// Max allowed time to upload to public graph before triggering recording kill switch\nexport const UPLOAD_TIMEOUT = 1000 * 15\n\nexport const HIGHLIGHT_URL = 'app.highlight.io'\nexport const LAUNCHDARKLY_URL = 'https://app.launchdarkly.com'\nexport const LAUNCHDARKLY_ENV_APPS = {\n\t'observability.ld-stg.launchdarkly.com': 'ld-stg.launchdarkly.com',\n\t'observability.app.launchdarkly.com': 'app.launchdarkly.com',\n\t'observability.app.ld.catamorphic.com': 'app.ld.catamorphic.com',\n} as const\nexport const LAUNCHDARKLY_PATH_PREFIX = '/projects/default'\nexport const LAUNCHDARKLY_BACKEND_REGEX = /pub\\.(?<domain>.+)/\n","/*! js-cookie v3.0.8 | MIT */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (key === '__proto__') continue\n target[key] = source[key];\n }\n }\n return target\n}\n\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n\nfunction init(converter, defaultAttributes) {\n function set(name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get(name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n if (!(found in jar)) jar[found] = converter.read(value, found);\n if (name === found) {\n break\n }\n } catch (_e) {\n // Do nothing...\n }\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n\nexport { api as default };\n","import Cookies from 'js-cookie'\nimport { SESSION_PUSH_THRESHOLD } from '../constants/sessions'\nimport { internalLogOnce } from '../../sdk/util'\n\nexport enum LocalStorageKeys {\n\tCLIENT_ID = 'highlightClientID',\n}\n\ntype Mode = 'localStorage' | 'sessionStorage'\n\nlet mode: Mode = 'localStorage'\nlet cookieWriteEnabled: boolean = true\n\nclass Storage {\n\tprivate storage: { [key: string]: string } = {}\n\n\tpublic get length(): number {\n\t\treturn Object.keys(this.storage).length\n\t}\n\n\tpublic key(index: number): string | null {\n\t\tconst keys = Object.keys(this.storage)\n\t\treturn keys[index] ?? null\n\t}\n\n\tpublic getItem(key: string) {\n\t\treturn this.storage[key] ?? ''\n\t}\n\tpublic setItem(key: string, value: string) {\n\t\tthis.storage[key] = value\n\t}\n\tpublic removeItem(key: string) {\n\t\tdelete this.storage[key]\n\t}\n}\n\nexport class CookieStorage {\n\tpublic getItem(key: string) {\n\t\treturn Cookies.get(key) ?? ''\n\t}\n\n\tpublic setItem(key: string, value: string) {\n\t\tif (!cookieWriteEnabled) {\n\t\t\treturn\n\t\t}\n\t\tconst expires = new Date()\n\t\texpires.setTime(expires.getTime() + SESSION_PUSH_THRESHOLD)\n\t\tCookies.set(key, value, { expires })\n\t}\n\n\tpublic removeItem(key: string) {\n\t\tif (!cookieWriteEnabled) {\n\t\t\treturn\n\t\t}\n\t\tCookies.remove(key)\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn Object.keys(Cookies.get() ?? {})\n\t}\n}\n\nexport const globalStorage = new Storage()\nexport const cookieStorage = new CookieStorage()\n\nexport const getPersistentStorage = () => {\n\tlet storage:\n\t\t| Storage\n\t\t| typeof window.localStorage\n\t\t| typeof window.sessionStorage\n\t\t| null = null\n\n\tif (typeof window === 'undefined') {\n\t\treturn globalStorage\n\t}\n\n\ttry {\n\t\tswitch (mode) {\n\t\t\tcase 'localStorage':\n\t\t\t\tstorage = window.localStorage\n\t\t\t\tbreak\n\t\t\tcase 'sessionStorage':\n\t\t\t\tstorage = window.sessionStorage\n\t\t\t\tbreak\n\t\t}\n\t\tif (!storage) {\n\t\t\tinternalLogOnce(\n\t\t\t\t'storage',\n\t\t\t\t'getPersistentStorage',\n\t\t\t\t'debug',\n\t\t\t\t`persistent storage was not found for mode ${mode}; using global storage`,\n\t\t\t)\n\t\t\tstorage = globalStorage\n\t\t}\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t'storage',\n\t\t\t'getPersistentStorage',\n\t\t\t'debug',\n\t\t\t`failed to get persistent storage; using global storage`,\n\t\t\te,\n\t\t)\n\t\tstorage = globalStorage\n\t}\n\treturn storage\n}\n\nexport const setStorageMode = (m: Mode) => {\n\tmode = m\n}\n\nexport const setCookieWriteEnabled = (enabled: boolean) => {\n\tcookieWriteEnabled = enabled\n}\n\nexport const getItem = (key: string) => {\n\ttry {\n\t\treturn getPersistentStorage().getItem(key)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'getItem',\n\t\t\t'debug',\n\t\t\t`failed to get item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.getItem(key)\n\t}\n}\n\nexport const setItem = (key: string, value: string) => {\n\tcookieStorage.setItem(key, value)\n\ttry {\n\t\treturn getPersistentStorage().setItem(key, value)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'setItem',\n\t\t\t'debug',\n\t\t\t`failed to set item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.setItem(key, value)\n\t}\n}\n\nexport const removeItem = (key: string) => {\n\tcookieStorage.removeItem(key)\n\ttry {\n\t\treturn getPersistentStorage().removeItem(key)\n\t} catch (e) {\n\t\tinternalLogOnce(\n\t\t\t`storage`,\n\t\t\t'removeItem',\n\t\t\t'debug',\n\t\t\t`failed to remove item ${key}; using global storage`,\n\t\t\te,\n\t\t)\n\t\treturn globalStorage.removeItem(key)\n\t}\n}\n\nexport const monkeyPatchLocalStorage = (\n\tonSetItemHandler: ({\n\t\tkeyName,\n\t\tkeyValue,\n\t}: {\n\t\tkeyName: string\n\t\tkeyValue: string\n\t}) => void,\n) => {\n\tif (mode === 'sessionStorage') {\n\t\tinternalLogOnce(\n\t\t\t'segment',\n\t\t\t'sessionStorage',\n\t\t\t'warn',\n\t\t\t`highlight.io cannot use local storage; segment integration will not work`,\n\t\t)\n\t\treturn\n\t}\n\tif (typeof window === 'undefined') {\n\t\tinternalLogOnce(\n\t\t\t'segment',\n\t\t\t'no-window',\n\t\t\t'warn',\n\t\t\t`highlight.io cannot use local storage (not a window); segment integration will not work`,\n\t\t)\n\t\treturn\n\t}\n\n\tconst originalSetItem = window.localStorage.setItem\n\twindow.localStorage.setItem = function () {\n\t\tconst [keyName, keyValue] = arguments as unknown as [\n\t\t\tkey: string,\n\t\t\tvalue: string,\n\t\t]\n\t\tonSetItemHandler({ keyName, keyValue })\n\t\toriginalSetItem.apply(this, [keyName, keyValue])\n\t}\n}\n","export enum SESSION_STORAGE_KEYS {\n\tSEGMENT_LAST_SENT_HASH_KEY = 'HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY',\n\tSESSION_ID = 'sessionID',\n\tSESSION_DATA = 'sessionData',\n\tUSER_IDENTIFIER = 'highlightIdentifier',\n\tUSER_OBJECT = 'highlightUserObject',\n}\n","import { SESSION_PUSH_THRESHOLD } from '../../constants/sessions'\nimport {\n\tcookieStorage,\n\tgetItem,\n\tremoveItem,\n\tsetItem,\n\tgetPersistentStorage,\n} from '../storage'\nimport { SESSION_STORAGE_KEYS } from './sessionStorageKeys'\nimport { internalLogOnce } from '../../../sdk/util'\n\nexport type SessionData = {\n\tsessionSecureID: string\n\tsessionKey?: string\n\tprojectID: number\n\tsessionStartTime?: number\n\tlastPushTime?: number\n\tuserIdentifier?: string\n\tuserObject?: Object\n}\n\nconst getSessionDataKey = (sessionID: string): string => {\n\treturn `${SESSION_STORAGE_KEYS.SESSION_DATA}_${sessionID}`\n}\n\ninterface GlobalThis {\n\tpersistentSessionSecureID?: string\n}\ndeclare var globalThis: GlobalThis | undefined\n\nexport const getPersistentSessionSecureID = (): string => {\n\tif (\n\t\ttypeof globalThis !== 'undefined' &&\n\t\tglobalThis.persistentSessionSecureID?.length\n\t) {\n\t\treturn globalThis.persistentSessionSecureID\n\t}\n\treturn getSessionSecureID()\n}\n\nexport const setPersistentSessionSecureID = (secureID: string) => {\n\t// for duplicate tab functionality, secureID is ''\n\t// avoid clearing the local secureID used for network request instrumentation\n\tif (typeof globalThis !== 'undefined' && secureID?.length) {\n\t\tglobalThis.persistentSessionSecureID = secureID\n\t}\n}\n\nexport const getSessionSecureID = (): string => {\n\treturn getItem(SESSION_STORAGE_KEYS.SESSION_ID) ?? ''\n}\n\nexport const setSessionSecureID = (secureID: string) => {\n\t// for duplicate tab functionality, secureID is ''\n\tsetItem(SESSION_STORAGE_KEYS.SESSION_ID, secureID)\n}\n\nconst getSessionData = (sessionID: string): SessionData | undefined => {\n\tconst key = getSessionDataKey(sessionID)\n\tlet storedSessionData = JSON.parse(getItem(key) || '{}')\n\treturn storedSessionData as SessionData\n}\n\nexport const getPreviousSessionData = (\n\tsessionID?: string,\n): SessionData | undefined => {\n\tif (!sessionID) {\n\t\tsessionID = getSessionSecureID()\n\t}\n\tlet storedSessionData = getSessionData(sessionID)\n\tif (\n\t\tstoredSessionData &&\n\t\tstoredSessionData.lastPushTime &&\n\t\tDate.now() - storedSessionData.lastPushTime < SESSION_PUSH_THRESHOLD\n\t) {\n\t\treturn storedSessionData as SessionData\n\t} else {\n\t\tremoveItem(getSessionDataKey(sessionID))\n\t}\n}\n\nexport const setSessionData = function (sessionData?: SessionData) {\n\tif (!sessionData?.sessionSecureID) return\n\tconst secureID = sessionData.sessionSecureID!\n\tsetPersistentSessionSecureID(secureID)\n\tconst key = getSessionDataKey(secureID)\n\tsetItem(key, JSON.stringify(sessionData))\n\t// delete old session data\n\tpruneSessionData(key)\n}\n\nexport const loadCookieSessionData = function () {\n\tconst sessionSecureID = cookieStorage.getItem(\n\t\tSESSION_STORAGE_KEYS.SESSION_ID,\n\t)\n\tsetSessionSecureID(sessionSecureID)\n\tconst sessionDataKey = getSessionDataKey(sessionSecureID)\n\tconst sessionDataStr = cookieStorage.getItem(sessionDataKey)\n\ttry {\n\t\tsetSessionData(JSON.parse(sessionDataStr) as SessionData)\n\t} catch (e) {}\n}\n\nfunction pruneSessionData(keepKey: string): void {\n\tconst prefix = `${SESSION_STORAGE_KEYS.SESSION_DATA}_`\n\tconst candidates = new Set<string>()\n\n\tconst storage = getPersistentStorage()\n\tfor (let i = storage.length - 1; i >= 0; i--) {\n\t\tconst key = storage.key(i)\n\t\tif (key && key.startsWith(prefix) && key !== keepKey) {\n\t\t\tcandidates.add(key)\n\t\t}\n\t}\n\n\t// Cookies are written alongside localStorage but persist independently\n\t// (they survive localStorage being cleared, and outlive many sessions\n\t// via the SESSION_PUSH_THRESHOLD expiry). Without enumerating them here,\n\t// sessionData_* cookies pile up over time and bloat the Cookie header\n\t// enough to break unrelated API calls.\n\tfor (const key of cookieStorage.keys()) {\n\t\tif (key.startsWith(prefix) && key !== keepKey) {\n\t\t\tcandidates.add(key)\n\t\t}\n\t}\n\n\tfor (const key of candidates) {\n\t\tlet stale = true\n\t\ttry {\n\t\t\t// Cookie-only entries (e.g. from a parallel tab that hasn't\n\t\t\t// hydrated localStorage in this context) won't be found by\n\t\t\t// getItem, which only reads persistent storage. Fall back to\n\t\t\t// the cookie value so we don't unconditionally prune fresh\n\t\t\t// data belonging to active sessions.\n\t\t\tconst raw = getItem(key) || cookieStorage.getItem(key) || '{}'\n\t\t\tconst sessionData = JSON.parse(raw) as SessionData\n\t\t\t// Fall back to sessionStartTime so entries from sessions that\n\t\t\t// ended before the first push still age out. Entries with no\n\t\t\t// usable timestamp (foreign / corrupt / truncated) are stale.\n\t\t\tconst ts = sessionData.lastPushTime ?? sessionData.sessionStartTime\n\t\t\tstale =\n\t\t\t\tts === undefined || Date.now() - ts >= SESSION_PUSH_THRESHOLD\n\t\t} catch {\n\t\t\t// Truncated past the 4KB cookie limit or otherwise corrupt —\n\t\t\t// drop silently rather than logging on every page load.\n\t\t}\n\t\tif (stale) {\n\t\t\tinternalLogOnce(\n\t\t\t\t'highlightSession',\n\t\t\t\t'pruneSessionData',\n\t\t\t\t'debug',\n\t\t\t\t`removing session data for stale key ${key}`,\n\t\t\t)\n\t\t\tremoveItem(key)\n\t\t}\n\t}\n}\n","export type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]?: Maybe<T[SubKey]>\n}\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n\t[SubKey in K]: Maybe<T[SubKey]>\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental<T> =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tInt64ID: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\n/** An attribute match configuration which can match an attribute key and value. */\nexport type AttributeMatchConfig = {\n\t__typename?: 'AttributeMatchConfig'\n\tattribute: MatchConfig\n\tkey: MatchConfig\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlog_cursor?: InputMaybe<Scalars['String']['input']>\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\trequest_id?: InputMaybe<Scalars['String']['input']>\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tid?: InputMaybe<Scalars['String']['input']>\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe<Scalars['String']['input']>\n\tsource: Scalars['String']['input']\n\tstackTrace: Array<InputMaybe<StackFrameInput>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsampling?: Maybe<SamplingConfig>\n\tsecure_id: Scalars['String']['output']\n}\n\n/**\n * A match based log sampling configuration. A log matches if each specified matching configuration matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type LogSamplingConfig = {\n\t__typename?: 'LogSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** Matches against the log message. */\n\tmessage?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of logs to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 logs will be sampled. Setting the ratio to 0 will disable sampling for the log.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n\t/** Matches against the severity of the log. */\n\tseverityText?: Maybe<MatchConfig>\n}\n\n/**\n * A match configuration. Each field of this type represents a different type of match\n * configuration. One and only 1 field should be populated.\n *\n * This is effectively a sum type/discriminated union, but isn't implemented as such to avoid\n * this bug: https://github.com/99designs/gqlgen/issues/2741\n */\nexport type MatchConfig = {\n\t__typename?: 'MatchConfig'\n\t/** A match configuration which does an exact match against any value. */\n\tmatchValue?: Maybe<Scalars['Any']['output']>\n\t/**\n\t * A match configuration which matches against a regular expression.\n\t * Can only match string attributes.\n\t */\n\tregexValue?: Maybe<Scalars['String']['output']>\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe<Scalars['String']['input']>\n\tgroup?: InputMaybe<Scalars['String']['input']>\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe<Scalars['String']['input']>\n\ttags?: InputMaybe<Array<MetricTag>>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe<Scalars['String']['input']>\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe<Scalars['Any']['output']>\n\tpushBackendPayload?: Maybe<Scalars['Any']['output']>\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe<Scalars['Any']['output']>\n\tpushSessionEvents?: Maybe<Scalars['Any']['output']>\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe<Scalars['String']['input']>\n\tuser_name?: InputMaybe<Scalars['String']['input']>\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe<Scalars['Any']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe<Scalars['Any']['input']>\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe<Scalars['String']['input']>\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe<Scalars['Boolean']['input']>\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<Array<Scalars['String']['input']>>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe<Scalars['String']['input']>\n\tserviceName?: InputMaybe<Scalars['String']['input']>\n\tsession_key?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n\tsession_secure_id?: InputMaybe<Scalars['String']['input']>\n\ttype?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array<InputMaybe<BackendErrorObjectInput>>\n\tproject_id?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array<InputMaybe<MetricInput>>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array<InputMaybe<ErrorObjectInput>>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe<Scalars['Boolean']['input']>\n\thighlight_logs?: InputMaybe<Scalars['String']['input']>\n\tis_beacon?: InputMaybe<Scalars['Boolean']['input']>\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe<Scalars['ID']['input']>\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe<Scalars['String']['input']>\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationPushSessionEventsArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['Int64ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe<Scalars['Any']['output']>\n\tsampling: SamplingConfig\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type QuerySamplingArgs = {\n\torganization_verbose_id: Scalars['String']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array<InputMaybe<ReplayEventInput>>\n}\n\nexport type SamplingConfig = {\n\t__typename?: 'SamplingConfig'\n\tlogs?: Maybe<Array<LogSamplingConfig>>\n\tspans?: Maybe<Array<SpanSamplingConfig>>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe<Scalars['Int64ID']['output']>\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\n/** An event matcher configuration which matches span events within a span. */\nexport type SpanEventMatchConfig = {\n\t__typename?: 'SpanEventMatchConfig'\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\tname?: Maybe<MatchConfig>\n}\n\n/**\n * A match based span sampling configuration. A span matches if each specified matching configuration\n * matches.\n * If no matching configuration is specified, then all spans will match.\n * The sampling ratio will be applied to all matching spans.\n */\nexport type SpanSamplingConfig = {\n\t__typename?: 'SpanSamplingConfig'\n\t/**\n\t * A list of attribute match configs.\n\t * In order to match each attribute listed must match. This is an implicit AND operation.\n\t */\n\tattributes?: Maybe<Array<AttributeMatchConfig>>\n\t/** A list of span event match configs. */\n\tevents?: Maybe<Array<SpanEventMatchConfig>>\n\tname?: Maybe<MatchConfig>\n\t/**\n\t * The ratio of spans to sample. Expressed in the form 1/n. So if the ratio is 10, then 1 out of\n\t * every 10 spans will be sampled. Setting the ratio to 0 will disable sampling for the span.\n\t */\n\tsamplingRatio: Scalars['Int']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe<Array<InputMaybe<Scalars['Any']['input']>>>\n\tcolumnNumber?: InputMaybe<Scalars['Int']['input']>\n\tfileName?: InputMaybe<Scalars['String']['input']>\n\tfunctionName?: InputMaybe<Scalars['String']['input']>\n\tisEval?: InputMaybe<Scalars['Boolean']['input']>\n\tisNative?: InputMaybe<Scalars['Boolean']['input']>\n\tlineNumber?: InputMaybe<Scalars['Int']['input']>\n\tsource?: InputMaybe<Scalars['String']['input']>\n}\n","import { ClientError } from 'graphql-request'\nimport { PublicGraphError } from '../graph/generated/schemas'\nimport { sdkLog } from './sdkLogger'\n\nexport const MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS = 3\n\n// Initial backoff for retrying graphql requests.\nexport const BASE_DELAY_MS = 1000\nexport const BACKOFF_DELAY_MS = 500\n\n// Do not retry if any of these public graph errors are thrown\nconst NON_RETRYABLE_ERRORS = [PublicGraphError.BillingQuotaExceeded.toString()]\n\n// A `ClientError` is retryable if none of the response errors is non-retryable\nconst isErrorRetryable = (error: ClientError): boolean => {\n\tconst match = error.response.errors?.find((e) =>\n\t\tNON_RETRYABLE_ERRORS.includes(e.message),\n\t)\n\treturn match === undefined\n}\n\nexport const getGraphQLRequestWrapper = () => {\n\tconst graphQLRequestWrapper = async <T>(\n\t\trequestFn: () => Promise<T>,\n\t\toperationName: string,\n\t\toperationType?: string,\n\t\tvariables?: any,\n\t\tretries: number = 0,\n\t): Promise<T> => {\n\t\ttry {\n\t\t\treturn await requestFn()\n\t\t} catch (error: any) {\n\t\t\tif (error instanceof ClientError && !isErrorRetryable(error)) {\n\t\t\t\tthrow error\n\t\t\t}\n\n\t\t\tif (retries < MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS) {\n\t\t\t\tawait new Promise((resolve) =>\n\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\tBASE_DELAY_MS + BACKOFF_DELAY_MS * Math.pow(2, retries),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn await graphQLRequestWrapper(\n\t\t\t\t\trequestFn,\n\t\t\t\t\toperationName,\n\t\t\t\t\toperationType,\n\t\t\t\t\tvariables,\n\t\t\t\t\tretries + 1,\n\t\t\t\t)\n\t\t\t}\n\t\t\tsdkLog(\n\t\t\t\t'error',\n\t\t\t\t`highlight.io: data request failed after ${retries} retries`,\n\t\t\t)\n\t\t\tthrow error\n\t\t}\n\t}\n\treturn graphQLRequestWrapper\n}\n","import { type HighlightPublicInterface } from '../../client'\nimport type { ErrorMessage, Source } from '../../client/types/shared-types'\nimport type { IntegrationClient } from '../index'\nimport type { LDClientMin as LDClient } from './types/LDClient'\nimport type { Hook } from './types/Hooks'\nimport type { RecordMetric } from '../../client/types/types'\nimport { BufferedClass } from '../../sdk/buffer'\nimport { LDPluginEnvironmentMetadata } from '../../plugins/plugin'\nimport type { Attributes } from '@opentelemetry/api'\nimport type {\n\tIdentifySeriesContext,\n\tIdentifySeriesData,\n\tIdentifySeriesResult,\n\tLDContextStrict,\n\tLDContextCommon,\n\tLDMultiKindContext,\n} from '@launchdarkly/js-client-sdk'\nimport { LDEvaluationReason } from '@launchdarkly/js-sdk-common/dist/cjs/api/data/LDEvaluationReason'\n\nexport type { Hook, LDClient, LDContextStrict }\n\nexport const FEATURE_FLAG_SCOPE = 'feature_flag'\nexport const LD_SCOPE = 'launchdarkly'\nexport const FEATURE_FLAG_SPAN_NAME = 'evaluation'\nexport const FEATURE_FLAG_EVENT_NAME = `${FEATURE_FLAG_SCOPE}.${FEATURE_FLAG_SPAN_NAME}`\n\nexport const FEATURE_FLAG_ENV_ATTR = `${FEATURE_FLAG_SCOPE}.set.id`\nexport const FEATURE_FLAG_KEY_ATTR = `${FEATURE_FLAG_SCOPE}.key`\nexport const FEATURE_FLAG_CONTEXT_ATTR = `${FEATURE_FLAG_SCOPE}.contextKeys`\nexport const FEATURE_FLAG_CONTEXT_ID_ATTR = `${FEATURE_FLAG_SCOPE}.context.id`\nexport const FEATURE_FLAG_VALUE_ATTR = `${FEATURE_FLAG_SCOPE}.result.value`\nexport const FEATURE_FLAG_PROVIDER_ATTR = `${FEATURE_FLAG_SCOPE}.provider.name`\nexport const FEATURE_FLAG_REASON_ATTRS: {\n\t[key in keyof LDEvaluationReason]: string\n} = {\n\tkind: `${FEATURE_FLAG_SCOPE}.result.reason.kind`,\n\terrorKind: `${FEATURE_FLAG_SCOPE}.result.reason.errorKind`,\n\truleIndex: `${FEATURE_FLAG_SCOPE}.result.reason.ruleIndex`,\n\truleId: `${FEATURE_FLAG_SCOPE}.result.reason.ruleId`,\n\tprerequisiteKey: `${FEATURE_FLAG_SCOPE}.result.reason.prerequisiteKey`,\n\tinExperiment: `${FEATURE_FLAG_SCOPE}.result.reason.inExperiment`,\n\tbigSegmentsStatus: `${FEATURE_FLAG_SCOPE}.result.reason.bigSegmentsStatus`,\n}\nexport const FEATURE_FLAG_VARIATION_INDEX_ATTR = `${FEATURE_FLAG_SCOPE}.result.variationIndex`\nexport const FEATURE_FLAG_APP_ID_ATTR = `${LD_SCOPE}.application.id`\nexport const FEATURE_FLAG_APP_VERSION_ATTR = `${LD_SCOPE}.application.version`\n\nexport const CONTEXT_SCOPE = 'context'\nexport const CONTEXT_SCOPE_CONTEXT_KEYS_ATTR = `${CONTEXT_SCOPE}.contextKeys`\n\nexport const LD_INITIALIZE_EVENT = '$ld:telemetry:session:init'\nexport const LD_TRACK_EVENT = '$ld:telemetry:track'\nexport const LD_TRACK_SPAN_NAME = 'launchdarkly.track'\nexport const LD_PAGE_VIEW_SPAN_NAME = 'page_view'\n\nexport const LD_METRIC_NAME_DOCUMENT_LOAD = 'document_load'\n\nexport const LD_IDENTIFY_RESULT_STATUS = 'result.status'\n\nfunction encodeKey(key: string): string {\n\tif (key.includes('%') || key.includes(':')) {\n\t\treturn key.replace(/%/g, '%25').replace(/:/g, '%3A')\n\t}\n\treturn key\n}\n\nfunction isMultiContext(context: any): context is LDMultiKindContext {\n\treturn context.kind === 'multi'\n}\n\n/**\n * Get a canonical key for a given context. The canonical key contains an encoded version of the context\n * keys.\n *\n * This format should be stable and consistent. It isn't for presentation only purposes.\n * It allows linking to a context instance.\n * @param context The context to get a canonical key for.\n * @returns The canonical context key.\n */\nexport function getCanonicalKey(context: LDContextStrict) {\n\tif (isMultiContext(context)) {\n\t\treturn Object.keys(context)\n\t\t\t.sort()\n\t\t\t.filter((key) => key !== 'kind')\n\t\t\t.map((key) => {\n\t\t\t\treturn `${key}:${encodeKey((context[key] as LDContextCommon).key)}`\n\t\t\t})\n\t\t\t.join(':')\n\t} else if ('kind' in context && context.kind === 'user') {\n\t\t// If the kind is a user, then the key is directly the user key.\n\t\treturn context.key\n\t} else if (!('kind' in context)) {\n\t\t// Legacy user.\n\t\treturn context.key\n\t}\n\n\treturn `${context.kind}:${encodeKey(context.key)}`\n}\n\nexport function getContextKeys(context: LDContextStrict) {\n\tif (isMultiContext(context)) {\n\t\treturn Object.keys(context)\n\t\t\t.sort()\n\t\t\t.filter((key) => key !== 'kind')\n\t\t\t.map((key) => {\n\t\t\t\treturn {\n\t\t\t\t\t[key]: (context[key] as LDContextCommon).key,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.reduce((acc, obj) => {\n\t\t\t\treturn { ...acc, ...obj }\n\t\t\t}, {} as Attributes)\n\t}\n\n\t// Legacy user.\n\tif (!('kind' in context)) {\n\t\t// Legacy user.\n\t\treturn {\n\t\t\tuser: context.key,\n\t\t}\n\t}\n\n\t// Single kind context.\n\treturn {\n\t\t[context.kind]: context.key,\n\t}\n}\n\nexport function setupLaunchDarklyIntegration(\n\thClient: HighlightPublicInterface,\n\tldClient: LDClient,\n\toptions?: {\n\t\tcontextFriendlyName?: (context: LDContextStrict) => string | undefined\n\t},\n) {\n\tldClient.addHook({\n\t\tgetMetadata: () => {\n\t\t\treturn {\n\t\t\t\tname: 'highlight.run',\n\t\t\t}\n\t\t},\n\t\tafterIdentify: (hookContext, data, result) => {\n\t\t\tconst metadata = {\n\t\t\t\t...getContextKeys(hookContext.context),\n\t\t\t\tkey:\n\t\t\t\t\toptions?.contextFriendlyName?.(hookContext.context) ??\n\t\t\t\t\tgetCanonicalKey(hookContext.context),\n\t\t\t}\n\t\t\thClient.log('LD.identify', 'INFO', metadata)\n\t\t\tif (result.status === 'completed') {\n\t\t\t\thClient.identify(metadata.key, metadata, 'LaunchDarkly')\n\t\t\t}\n\t\t\treturn data\n\t\t},\n\t\tafterEvaluation: (hookContext, data, detail) => {\n\t\t\tconst eventAttributes: Attributes = {\n\t\t\t\t[FEATURE_FLAG_PROVIDER_ATTR]: 'LaunchDarkly',\n\t\t\t\t[FEATURE_FLAG_KEY_ATTR]: hookContext.flagKey,\n\t\t\t\t[FEATURE_FLAG_VALUE_ATTR]: JSON.stringify(detail.value),\n\t\t\t\t// only set the following keys when values are defined\n\t\t\t\t...(detail.variationIndex !== undefined &&\n\t\t\t\tdetail.variationIndex !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t[FEATURE_FLAG_VARIATION_INDEX_ATTR]:\n\t\t\t\t\t\t\t\tdetail.variationIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t}\n\t\t\tif (detail.reason) {\n\t\t\t\tfor (const attr in FEATURE_FLAG_REASON_ATTRS) {\n\t\t\t\t\tconst k = attr as keyof LDEvaluationReason\n\t\t\t\t\tconst value = detail.reason[k]\n\t\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\t\teventAttributes[FEATURE_FLAG_REASON_ATTRS[k]!] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hookContext.context) {\n\t\t\t\teventAttributes[FEATURE_FLAG_CONTEXT_ATTR] = JSON.stringify(\n\t\t\t\t\tgetContextKeys(hookContext.context),\n\t\t\t\t)\n\t\t\t\teventAttributes[FEATURE_FLAG_CONTEXT_ID_ATTR] = getCanonicalKey(\n\t\t\t\t\thookContext.context,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\thClient.startSpan(FEATURE_FLAG_SPAN_NAME, (s) => {\n\t\t\t\tif (s) {\n\t\t\t\t\ts.addEvent(FEATURE_FLAG_EVENT_NAME, eventAttributes)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\treturn data\n\t\t},\n\t})\n}\n\nexport class LaunchDarklyIntegrationSDK implements IntegrationClient {\n\tclient: LDClient\n\tmetadata?: LDPluginEnvironmentMetadata\n\tconstructor(client: LDClient, metadata?: LDPluginEnvironmentMetadata) {\n\t\tthis.client = client\n\t\tthis.metadata = metadata\n\t}\n\n\tgetHooks(_: LDPluginEnvironmentMetadata): Hook[] {\n\t\treturn []\n\t}\n\n\tinit(sessionSecureID: string) {\n\t\tthis.client.track(LD_INITIALIZE_EVENT, {\n\t\t\tsessionID: sessionSecureID,\n\t\t})\n\t}\n\n\trecordGauge(sessionSecureID: string, metric: RecordMetric) {\n\t\t// noop - metric forwarding is handled upon data ingest\n\t}\n\n\tidentify(\n\t\t_sessionSecureID: string,\n\t\t_user_identifier: string,\n\t\t_user_object = {},\n\t\t_source?: Source,\n\t) {\n\t\t// noop - no highlight forwarding of identify call\n\t}\n\n\terror(sessionSecureID: string, error: ErrorMessage) {\n\t\t// noop - metric forwarding is handled upon data ingest\n\t}\n\n\ttrack(sessionSecureID: string, metadata: object) {\n\t\tconst event = (metadata as unknown as { event?: string }).event\n\t\tthis.client.track(\n\t\t\tevent ? `${LD_TRACK_EVENT}:${event}` : LD_TRACK_EVENT,\n\t\t\t{\n\t\t\t\t...metadata,\n\t\t\t\tsessionID: sessionSecureID,\n\t\t\t},\n\t\t)\n\t}\n}\n\nexport class LaunchDarklyIntegration\n\textends BufferedClass<IntegrationClient>\n\timplements IntegrationClient\n{\n\tclient: LaunchDarklyIntegrationSDK\n\tconstructor(client: LDClient, metadata?: LDPluginEnvironmentMetadata) {\n\t\tsuper()\n\t\tthis.client = new LaunchDarklyIntegrationSDK(client, metadata)\n\t}\n\n\tgetHooks(metadata: LDPluginEnvironmentMetadata): Hook[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tgetMetadata: () => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: 'highlight.run/ld',\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tafterIdentify: (\n\t\t\t\t\thookContext: IdentifySeriesContext,\n\t\t\t\t\tdata: IdentifySeriesData,\n\t\t\t\t\t_result: IdentifySeriesResult,\n\t\t\t\t) => {\n\t\t\t\t\tthis.load(this.client)\n\t\t\t\t\treturn data\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\t}\n\n\tinit(sessionSecureID: string) {\n\t\treturn this._bufferCall('init', [sessionSecureID])\n\t}\n\n\trecordGauge(sessionSecureID: string, metric: RecordMetric) {\n\t\treturn this._bufferCall('recordGauge', [sessionSecureID, metric])\n\t}\n\n\tidentify(\n\t\tsessionSecureID: string,\n\t\tuser_identifier: string,\n\t\tuser_object = {},\n\t\tsource?: Source,\n\t) {\n\t\treturn this._bufferCall('identify', [\n\t\t\tsessionSecureID,\n\t\t\tuser_identifier,\n\t\t\tuser_object,\n\t\t\tsource,\n\t\t])\n\t}\n\n\terror(sessionSecureID: string, error: ErrorMessage) {\n\t\treturn this._bufferCall('error', [sessionSecureID, error])\n\t}\n\n\ttrack(sessionSecureID: string, metadata: object) {\n\t\treturn this._bufferCall('track', [sessionSecureID, metadata])\n\t}\n}\n","// taken from: https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-hash-in-javascript/52809105#52809105\nexport const PathListener = (callback: (url: string) => void) => {\n\tcallback(window.location.href)\n\tconst initialPushState = history.pushState\n\thistory.pushState = ((f) =>\n\t\tfunction pushState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('pushstate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.pushState)\n\n\tconst initialReplaceState = history.replaceState\n\thistory.replaceState = ((f) =>\n\t\tfunction replaceState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('replacestate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.replaceState)\n\n\tconst onPopState = () => {\n\t\twindow.dispatchEvent(new Event('locationchange'))\n\t}\n\twindow.addEventListener('popstate', onPopState)\n\n\tconst onLocationChange = function () {\n\t\tcallback(window.location.href)\n\t}\n\twindow.addEventListener('locationchange', onLocationChange)\n\n\treturn () => {\n\t\twindow.removeEventListener('popstate', onPopState)\n\t\twindow.removeEventListener('locationchange', onLocationChange)\n\t\thistory.pushState = initialPushState\n\t\thistory.replaceState = initialReplaceState\n\t}\n}\n","import pkg from '../package.json' assert { type: 'json' }\nexport default pkg.version\n","type Node = {\n\tname: string\n\tpenalty: number\n\tlevel?: number\n}\n\ntype Path = Node[]\n\nenum Limit {\n\tAll,\n\tTwo,\n\tOne,\n}\n\nexport type Options = {\n\troot: Element\n\tidName: (name: string) => boolean\n\tclassName: (name: string) => boolean\n\ttagName: (name: string) => boolean\n\tattr: (name: string, value: string) => boolean\n\tseedMinLength: number\n\toptimizedMinLength: number\n\tthreshold: number\n\tmaxNumberOfTries: number\n\toptimized: boolean\n}\n\nlet config: Options\n\nlet rootDocument: Document | Element\n\n/**\n * Gets a CSS selector for a given element. Will default to the element's tag name if there are no class name or id.\n * Source: https://github.com/antonmedv/finder\n */\nexport function getElementSelector(input: Element, options?: Partial<Options>) {\n\tconst useOldLogic = true\n\tif (input.nodeType !== Node.ELEMENT_NODE || useOldLogic) {\n\t\treturn getElementSelectorFallback(input)\n\t}\n\n\treturn getElementSelectorNew(input, options)\n}\n\n/*\n * Create a simple selector string for the element using its id or class names if available.\n * Defaults to generic nodeName for the element if not.\n * This does not attempt to create the 'best' selector but should be used\n * when a general identified of an Element is necessary.\n */\nexport function getSimpleSelector(input: Element) {\n\tif (input.id.length) {\n\t\treturn `#${input.id}`\n\t} else if (input.classList.length) {\n\t\tlet classes = []\n\t\tfor (const c of input.classList) {\n\t\t\tclasses.push(`.${c}`)\n\t\t}\n\t\treturn `${input.nodeName.toLowerCase()}${classes.join(',')}`\n\t}\n\treturn input.nodeName.toLowerCase()\n}\n\nexport function getElementSelectorNew(\n\tinput: Element,\n\toptions?: Partial<Options>,\n) {\n\tif ('html' === input.tagName.toLowerCase()) {\n\t\treturn 'html'\n\t}\n\n\ttry {\n\t\tconst defaults: Options = {\n\t\t\troot: document.body,\n\t\t\tidName: (_name: string) => true,\n\t\t\tclassName: (_name: string) => true,\n\t\t\ttagName: (_name: string) => true,\n\t\t\tattr: (_name: string, _value: string) => false,\n\t\t\tseedMinLength: 1,\n\t\t\toptimizedMinLength: 2,\n\t\t\tthreshold: 50,\n\t\t\tmaxNumberOfTries: 1000,\n\t\t\toptimized: true,\n\t\t}\n\n\t\tconfig = { ...defaults, ...options }\n\n\t\trootDocument = findRootDocument(config.root, defaults)\n\n\t\tlet path = bottomUpSearch(input, Limit.All, () =>\n\t\t\tbottomUpSearch(input, Limit.Two, () =>\n\t\t\t\tbottomUpSearch(input, Limit.One),\n\t\t\t),\n\t\t)\n\n\t\tif (path) {\n\t\t\tif (config.optimized) {\n\t\t\t\tconst optimized = sort(optimize(path, input))\n\n\t\t\t\tif (optimized.length > 0) {\n\t\t\t\t\tpath = optimized[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn selector(path)\n\t\t} else {\n\t\t\treturn getElementSelectorFallback(input)\n\t\t}\n\t} catch {\n\t\treturn getElementSelectorFallback(input)\n\t}\n}\n\nfunction findRootDocument(rootNode: Element | Document, defaults: Options) {\n\tif (rootNode.nodeType === Node.DOCUMENT_NODE) {\n\t\treturn rootNode\n\t}\n\tif (rootNode === defaults.root) {\n\t\treturn rootNode.ownerDocument as Document\n\t}\n\treturn rootNode\n}\n\nfunction bottomUpSearch(\n\tinput: Element,\n\tlimit: Limit,\n\tfallback?: () => Path | null,\n): Path | null {\n\tlet path: Path | null = null\n\tlet stack: Node[][] = []\n\tlet current: Element | null = input\n\tlet i = 0\n\n\twhile (current && current !== config.root.parentElement) {\n\t\tlet level: Node[] = maybe(id(current)) ||\n\t\t\tmaybe(...attr(current)) ||\n\t\t\tmaybe(...classNames(current)) ||\n\t\t\tmaybe(tagName(current)) || [any()]\n\n\t\tconst nth = index(current)\n\n\t\tif (limit === Limit.All) {\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.Two) {\n\t\t\tlevel = level.slice(0, 1)\n\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.One) {\n\t\t\tconst [node] = (level = level.slice(0, 1))\n\n\t\t\tif (nth && dispensableNth(node)) {\n\t\t\t\tlevel = [nthChild(node, nth)]\n\t\t\t}\n\t\t}\n\n\t\tfor (let node of level) {\n\t\t\tnode.level = i\n\t\t}\n\n\t\tstack.push(level)\n\n\t\tif (stack.length >= config.seedMinLength) {\n\t\t\tpath = findUniquePath(stack, fallback)\n\t\t\tif (path) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tcurrent = current.parentElement\n\t\ti++\n\t}\n\n\tif (!path) {\n\t\tpath = findUniquePath(stack, fallback)\n\t}\n\n\treturn path\n}\n\nfunction findUniquePath(\n\tstack: Node[][],\n\tfallback?: () => Path | null,\n): Path | null {\n\tconst paths = sort(combinations(stack))\n\n\tif (paths.length > config.threshold) {\n\t\treturn fallback ? fallback() : null\n\t}\n\n\tfor (let candidate of paths) {\n\t\tif (unique(candidate)) {\n\t\t\treturn candidate\n\t\t}\n\t}\n\n\treturn null\n}\n\nfunction selector(path: Path): string {\n\tlet node = path[0]\n\tlet query = node.name\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst level = path[i].level || 0\n\n\t\tif (node.level === level - 1) {\n\t\t\tquery = `${path[i].name} > ${query}`\n\t\t} else {\n\t\t\tquery = `${path[i].name} ${query}`\n\t\t}\n\n\t\tnode = path[i]\n\t}\n\treturn query\n}\n\nfunction penalty(path: Path): number {\n\treturn path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0)\n}\n\nfunction unique(path: Path) {\n\tswitch (rootDocument.querySelectorAll(selector(path)).length) {\n\t\tcase 0:\n\t\t\treturn true\n\t\tcase 1:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunction id(input: Element): Node | null {\n\tconst elementId = input.getAttribute('id')\n\tif (elementId && config.idName(elementId)) {\n\t\treturn {\n\t\t\tname: '#' + cssesc(elementId, { isIdentifier: true }),\n\t\t\tpenalty: 0,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction attr(input: Element): Node[] {\n\tconst attrs = Array.from(input.attributes).filter((attr) =>\n\t\tconfig.attr(attr.name, attr.value),\n\t)\n\n\treturn attrs.map(\n\t\t(attr): Node => ({\n\t\t\tname:\n\t\t\t\t'[' +\n\t\t\t\tcssesc(attr.name, { isIdentifier: true }) +\n\t\t\t\t'=\"' +\n\t\t\t\tcssesc(attr.value) +\n\t\t\t\t'\"]',\n\t\t\tpenalty: 0.5,\n\t\t}),\n\t)\n}\n\nfunction classNames(input: Element): Node[] {\n\tconst names = Array.from(input.classList).filter(config.className)\n\n\treturn names.map(\n\t\t(name): Node => ({\n\t\t\tname: '.' + cssesc(name, { isIdentifier: true }),\n\t\t\tpenalty: 1,\n\t\t}),\n\t)\n}\n\nfunction tagName(input: Element): Node | null {\n\tconst name = input.tagName.toLowerCase()\n\tif (config.tagName(name)) {\n\t\treturn {\n\t\t\tname,\n\t\t\tpenalty: 2,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction any(): Node {\n\treturn {\n\t\tname: '*',\n\t\tpenalty: 3,\n\t}\n}\n\nfunction index(input: Element): number | null {\n\tconst parent = input.parentNode\n\tif (!parent) {\n\t\treturn null\n\t}\n\n\tlet child = parent.firstChild\n\tif (!child) {\n\t\treturn null\n\t}\n\n\tlet i = 0\n\twhile (child) {\n\t\tif (child.nodeType === Node.ELEMENT_NODE) {\n\t\t\ti++\n\t\t}\n\n\t\tif (child === input) {\n\t\t\tbreak\n\t\t}\n\n\t\tchild = child.nextSibling\n\t}\n\n\treturn i\n}\n\nfunction nthChild(node: Node, i: number): Node {\n\treturn {\n\t\tname: node.name + `:nth-child(${i})`,\n\t\tpenalty: node.penalty + 1,\n\t}\n}\n\nfunction dispensableNth(node: Node) {\n\treturn node.name !== 'html' && !node.name.startsWith('#')\n}\n\nfunction maybe(...level: (Node | null)[]): Node[] | null {\n\tconst list = level.filter(notEmpty)\n\tif (list.length > 0) {\n\t\treturn list\n\t}\n\treturn null\n}\n\nfunction notEmpty<T>(value: T | null | undefined): value is T {\n\treturn value !== null && value !== undefined\n}\n\nfunction* combinations(stack: Node[][], path: Node[] = []): Generator<Node[]> {\n\tif (stack.length > 0) {\n\t\tfor (let node of stack[0]) {\n\t\t\tyield* combinations(stack.slice(1, stack.length), path.concat(node))\n\t\t}\n\t} else {\n\t\tyield path\n\t}\n}\n\nfunction sort(paths: Iterable<Path>): Path[] {\n\treturn Array.from(paths).sort((a, b) => penalty(a) - penalty(b))\n}\n\ntype Scope = {\n\tcounter: number\n\tvisited: Map<string, boolean>\n}\n\nfunction* optimize(\n\tpath: Path,\n\tinput: Element,\n\tscope: Scope = {\n\t\tcounter: 0,\n\t\tvisited: new Map<string, boolean>(),\n\t},\n): Generator<Node[]> {\n\tif (path.length > 2 && path.length > config.optimizedMinLength) {\n\t\tfor (let i = 1; i < path.length - 1; i++) {\n\t\t\tif (scope.counter > config.maxNumberOfTries) {\n\t\t\t\treturn // Okay At least I tried!\n\t\t\t}\n\t\t\tscope.counter += 1\n\t\t\tconst newPath = [...path]\n\t\t\tnewPath.splice(i, 1)\n\t\t\tconst newPathKey = selector(newPath)\n\t\t\tif (scope.visited.has(newPathKey)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (unique(newPath) && same(newPath, input)) {\n\t\t\t\tyield newPath\n\t\t\t\tscope.visited.set(newPathKey, true)\n\t\t\t\tyield* optimize(newPath, input, scope)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction same(path: Path, input: Element) {\n\treturn rootDocument.querySelector(selector(path)) === input\n}\n\nconst regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/\nconst regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/\nconst regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g\n\nconst defaultOptions = {\n\tescapeEverything: false,\n\tisIdentifier: false,\n\tquotes: 'single',\n\twrap: false,\n}\n\nfunction cssesc(string: string, opt: Partial<typeof defaultOptions> = {}) {\n\tconst options = { ...defaultOptions, ...opt }\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single'\n\t}\n\tconst quote = options.quotes == 'double' ? '\"' : \"'\"\n\tconst isIdentifier = options.isIdentifier\n\n\tconst firstChar = string.charAt(0)\n\tlet output = ''\n\tlet counter = 0\n\tconst length = string.length\n\twhile (counter < length) {\n\t\tconst character = string.charAt(counter++)\n\t\tlet codePoint = character.charCodeAt(0)\n\t\tlet value: string | undefined = void 0\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7e) {\n\t\t\tif (\n\t\t\t\tcodePoint >= 0xd800 &&\n\t\t\t\tcodePoint <= 0xdbff &&\n\t\t\t\tcounter < length\n\t\t\t) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tconst extra = string.charCodeAt(counter++)\n\t\t\t\tif ((extra & 0xfc00) == 0xdc00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint =\n\t\t\t\t\t\t((codePoint & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t} else if (\n\t\t\t\tcharacter == '\\\\' ||\n\t\t\t\t(!isIdentifier &&\n\t\t\t\t\t((character == '\"' && quote == character) ||\n\t\t\t\t\t\t(character == \"'\" && quote == character))) ||\n\t\t\t\t(isIdentifier && regexSingleEscape.test(character))\n\t\t\t) {\n\t\t\t\tvalue = '\\\\' + character\n\t\t\t} else {\n\t\t\t\tvalue = character\n\t\t\t}\n\t\t}\n\t\toutput += value\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1)\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1)\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2\n\t})\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote\n\t}\n\treturn output\n}\n\nconst getElementSelectorFallback = (element: Element) => {\n\tlet selector = ''\n\tconst classNames = element.getAttribute('class')\n\tconst ids = element.getAttribute('id')\n\n\tif (ids) {\n\t\tselector = selector.concat(getSelectorString(ids, '#'))\n\t}\n\tif (classNames) {\n\t\tselector = selector.concat(getSelectorString(classNames, '.'))\n\t}\n\n\t// Default to the element's tag if the element doesn't have ids or class names.\n\tif (selector === '') {\n\t\tselector = selector.concat(element.tagName.toLowerCase())\n\t}\n\n\treturn selector\n}\n\nconst getSelectorString = (selector: string, delimiter: string) => {\n\treturn `${delimiter}${selector.trim().split(' ').join(delimiter)}`\n}\n","export type ViewportResizeListenerArgs = Omit<Screen, 'orientation'> & {\n\torientation: number\n}\n\nexport const ViewportResizeListener = (\n\tcallback: (args: ViewportResizeListenerArgs) => void,\n) => {\n\tlet id: ReturnType<typeof setTimeout>\n\tconst DELAY = 500\n\n\tconst onResize = () => {\n\t\tclearTimeout(id)\n\t\tid = setTimeout(() => {\n\t\t\tcallback({\n\t\t\t\theight: window.innerHeight,\n\t\t\t\twidth: window.innerWidth,\n\t\t\t\tavailHeight: window.screen.availHeight,\n\t\t\t\tavailWidth: window.screen.availWidth,\n\t\t\t\tcolorDepth: window.screen.colorDepth,\n\t\t\t\tpixelDepth: window.screen.pixelDepth,\n\t\t\t\torientation: window.screen.orientation?.angle ?? 0,\n\t\t\t})\n\t\t}, DELAY)\n\t}\n\twindow.addEventListener('resize', onResize)\n\n\t// call on initial listener creation\n\tonResize()\n\treturn () => window.removeEventListener('resize', onResize)\n}\n","/**\n * @preserve\n * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)\n *\n * @author <a href=\"mailto:jensyt@gmail.com\">Jens Taylor</a>\n * @see http://github.com/homebrewing/brauhaus-diff\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n */\n(function(){\n var cache;\n\n // Call this function without `new` to use the cached object (good for\n // single-threaded environments), or with `new` to create a new object.\n //\n // @param {string} key A UTF-16 or ASCII string\n // @param {number} seed An optional positive integer\n // @return {object} A MurmurHash3 object for incremental hashing\n function MurmurHash3(key, seed) {\n var m = this instanceof MurmurHash3 ? this : cache;\n m.reset(seed)\n if (typeof key === 'string' && key.length > 0) {\n m.hash(key);\n }\n\n if (m !== this) {\n return m;\n }\n };\n\n // Incrementally add a string to this hash\n //\n // @param {string} key A UTF-16 or ASCII string\n // @return {object} this\n MurmurHash3.prototype.hash = function(key) {\n var h1, k1, i, top, len;\n\n len = key.length;\n this.len += len;\n\n k1 = this.k1;\n i = 0;\n switch (this.rem) {\n case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;\n case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;\n case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;\n case 3:\n k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;\n k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;\n }\n\n this.rem = (len + this.rem) & 3; // & 3 is same as % 4\n len -= this.rem;\n if (len > 0) {\n h1 = this.h1;\n while (1) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;\n\n if (i >= len) {\n break;\n }\n\n k1 = ((key.charCodeAt(i++) & 0xffff)) ^\n ((key.charCodeAt(i++) & 0xffff) << 8) ^\n ((key.charCodeAt(i++) & 0xffff) << 16);\n top = key.charCodeAt(i++);\n k1 ^= ((top & 0xff) << 24) ^\n ((top & 0xff00) >> 8);\n }\n\n k1 = 0;\n switch (this.rem) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xffff);\n }\n\n this.h1 = h1;\n }\n\n this.k1 = k1;\n return this;\n };\n\n // Get the result of this hash\n //\n // @return {number} The 32-bit hash\n MurmurHash3.prototype.result = function() {\n var k1, h1;\n \n k1 = this.k1;\n h1 = this.h1;\n\n if (k1 > 0) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= this.len;\n\n h1 ^= h1 >>> 16;\n h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n };\n\n // Reset the hash object for reuse\n //\n // @param {number} seed An optional positive integer\n MurmurHash3.prototype.reset = function(seed) {\n this.h1 = typeof seed === 'number' ? seed : 0;\n this.rem = this.k1 = this.len = 0;\n return this;\n };\n\n // A cached object to use. This can be safely used if you're in a single-\n // threaded environment, otherwise you need to create new hashes to use.\n cache = new MurmurHash3();\n\n if (typeof(module) != 'undefined') {\n module.exports = MurmurHash3;\n } else {\n this.MurmurHash3 = MurmurHash3;\n }\n}());\n","import MurmurHash3 from 'imurmurhash'\n\nconst ID_LENGTH = 28\n// base 62 character set\nconst CHARACTER_SET =\n\t'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n\nconst MIXER_PRIME = 0x85ebca6b\n\nexport const GenerateSecureID = (key?: string): string => {\n\tvar secureID = ''\n\n\tif (key) {\n\t\t// UseMurmurHash3 for fast, high-quality deterministic hashing\n\t\t// Note: not crypto secure, but we only need it to create a deterministic ID\n\t\tconst keyHash = MurmurHash3(key).result()\n\t\tfor (let i = 0; i < ID_LENGTH; i++) {\n\t\t\tconst charHash = (keyHash ^ (i * MIXER_PRIME)) >>> 0\n\t\t\tconst charIndex = charHash % CHARACTER_SET.length\n\t\t\tsecureID += CHARACTER_SET.charAt(charIndex)\n\t\t}\n\t} else {\n\t\tconst hasCrypto =\n\t\t\ttypeof window !== 'undefined' && window.crypto?.getRandomValues\n\t\tconst cryptoRandom = new Uint32Array(ID_LENGTH)\n\t\tif (hasCrypto) {\n\t\t\twindow.crypto.getRandomValues(cryptoRandom)\n\t\t}\n\n\t\tfor (let i = 0; i < ID_LENGTH; i++) {\n\t\t\tif (hasCrypto) {\n\t\t\t\tsecureID += CHARACTER_SET.charAt(\n\t\t\t\t\tcryptoRandom[i] % CHARACTER_SET.length,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tsecureID += CHARACTER_SET.charAt(\n\t\t\t\t\tMath.floor(Math.random() * CHARACTER_SET.length),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn secureID\n}\n","import type { RecordOptions } from '../client/types/record'\nimport type { ObserveOptions } from '../client/types/observe'\nimport { setCookieWriteEnabled, setStorageMode } from '../client/utils/storage'\nimport {\n\tgetPersistentSessionSecureID,\n\tgetPreviousSessionData,\n\tloadCookieSessionData,\n\tsetSessionData,\n\tsetSessionSecureID,\n} from '../client/utils/sessionStorage/highlightSession'\nimport { GenerateSecureID } from '../client'\nimport { internalLog } from '../sdk/util'\n\nexport class Plugin<T extends RecordOptions | ObserveOptions> {\n\tprotected sessionSecureID!: string\n\tconstructor(options?: T) {\n\t\ttry {\n\t\t\tif (options?.storageMode) {\n\t\t\t\tsetStorageMode(options?.storageMode)\n\t\t\t}\n\t\t\tsetCookieWriteEnabled(!!options?.sessionCookie)\n\n\t\t\tif (options?.sessionCookie) {\n\t\t\t\tloadCookieSessionData()\n\t\t\t} else {\n\t\t\t\tsetCookieWriteEnabled(false)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tinternalLog(\n\t\t\t\t`Error initializing @launchdarkly observability plugin`,\n\t\t\t\t'error',\n\t\t\t\terror,\n\t\t\t)\n\t\t}\n\t}\n\n\tconfigureSession(ldCredential: string, options?: T) {\n\t\ttry {\n\t\t\tconst persistentSessionSecureID = getPersistentSessionSecureID()\n\t\t\tlet previousSession = getPreviousSessionData(\n\t\t\t\tpersistentSessionSecureID,\n\t\t\t)\n\t\t\tif (previousSession?.sessionSecureID) {\n\t\t\t\tthis.sessionSecureID = previousSession.sessionSecureID\n\t\t\t} else {\n\t\t\t\tif (options?.sessionKey) {\n\t\t\t\t\tthis.sessionSecureID = GenerateSecureID(\n\t\t\t\t\t\t`${ldCredential}-${options.sessionKey}`,\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tthis.sessionSecureID = GenerateSecureID()\n\t\t\t\t}\n\t\t\t\tsetSessionSecureID(this.sessionSecureID)\n\t\t\t\tsetSessionData({\n\t\t\t\t\tsessionSecureID: this.sessionSecureID,\n\t\t\t\t\tsessionKey: options?.sessionKey,\n\t\t\t\t\tprojectID: 0,\n\t\t\t\t\tsessionStartTime: Date.now(),\n\t\t\t\t\tlastPushTime: Date.now(),\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tinternalLog(\n\t\t\t\t`Error configuring session in @launchdarkly observability plugin`,\n\t\t\t\t'error',\n\t\t\t\terror,\n\t\t\t)\n\t\t}\n\t}\n}\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","syntaxError","description","Location","startToken","endToken","Token","kind","start","end","column","QueryDocumentKeys","kindValues","isNode","maybeNode","maybeKind","OperationTypeNode","DirectiveLocation","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","TokenKind","Lexer","startOfFileToken","token","nextToken","readNextToken","isPunctuatorTokenKind","isUnicodeScalarValue","isSupplementaryCodePoint","isLeadingSurrogate","isTrailingSurrogate","printCodePointAt","lexer","char","createToken","col","bodyLength","readComment","readBlockString","readString","readNumber","readName","firstCode","isFloat","readDigits","chunkStart","escape","readEscapedUnicodeVariableWidth","readEscapedUnicodeFixedWidth","readEscapedCharacter","point","size","readHexDigit","read16BitHexCode","trailingCode","lineStart","currentLine","blockLines","MAX_ARRAY_LENGTH","MAX_RECURSIVE_DEPTH","inspect","formatValue","seenValues","formatObjectValue","previouslySeenValues","isJSONable","jsonValue","formatArray","formatObject","object","entries","getObjectTag","key","len","remaining","items","tag","name","isProduction","instanceOf","constructor","_value$constructor","className","valueClassName","stringifiedValue","Source","locationOffset","isSource","parse","parser","Parser","document","sourceObj","hasDescription","keywordToken","operation","operationToken","nameOrAlias","alias","isConst","item","hasTypeCondition","varName","directives","type","innerType","operationTypes","interfaces","fields","defaultValue","types","values","getTokenDesc","repeatable","locations","getTokenKindDesc","atToken","openKind","parseFn","closeKind","delimiterKind","maxTokens","printString","escapedRegExp","escapedReplacer","escapeSequences","BREAK","visit","root","visitor","visitorKeys","enterLeaveMap","getEnterLeaveForKind","stack","inArray","keys","index","edits","parent","ancestors","isLeaving","isEdited","editOffset","editKey","editValue","arrayKey","__spreadValues","_enterLeaveMap$get","_enterLeaveMap$get2","visitFn","_node$kind","kindVisitor","print","ast","printDocASTReducer","MAX_LINE_LENGTH","join","varDefs","wrap","variable","selections","block","selectionSet","argsLine","typeCondition","variableDefinitions","isBlockString","hasMultilineItems","maybeArray","separator","_maybeArray$filter$jo","x","maybeString","_maybeArray$some","defaultJsonSerializer","uppercase","HeadersInstanceToPlainObject","headers","o","v","k","parseRequestArgs","documentOrOptions","variables","requestHeaders","parseRawRequestArgs","queryOrOptions","parseBatchRequestArgs","documentsOrOptions","extractOperationName","operationName","operationDefinitions","definition","_b","_a","resolveRequestDocument","parsedDocument","err","ClientError","response","request","_c","global","this","__self__","F","self","exports","support","e","isDataView","obj","viewClasses","isArrayBufferView","normalizeName","normalizeValue","iteratorFor","iterator","Headers","header","oldValue","callback","thisArg","consumed","fileReaderReady","reader","resolve","reject","readBlobAsArrayBuffer","blob","promise","readBlobAsText","readArrayBufferAsText","buf","view","chars","bufferClone","Body","rejected","decode","methods","normalizeMethod","method","upcased","Request","input","form","bytes","split","parseHeaders","rawHeaders","preProcessedHeaders","parts","Response","bodyInit","redirectStatuses","url","status","error","fetch","init","xhr","abortXhr","ctx","module","resolveHeaders","oHeaders","CrossFetch","CrossFetch.Headers","cleanQuery","buildRequestConfig","params","params_","search","payload","acc","currentQuery","createHttpMethodFetcher","__async","query","fetchOptions","middleware","queryParams","createRequestBody","urlResolved","initResolved","__spreadProps","urlNew","initNew","__objRest","GraphQLClient","requestConfig","rawRequestOptions","crossFetch","requestMiddleware","responseMiddleware","makeRequest","callOrIdentity","variablesAndRequestHeaders","requestOptions","batchRequestOptions","queries","fetcher","isBatchingQuery","getResult","successfullyReceivedData","data","successfullyPassedErrorPolicy","rest","errorResult","jsonSerializer","jsonSerializer_","contentType","stringify","serializer","replacer","spaces","cycleReplacer","thisPos","__assign","s","n","p","docCache","fragmentSourceMap","printFragmentWarnings","experimentalFragmentVariables","normalize","string","cacheKeyFromLoc","processFragments","seenKeys","definitions","fragmentDefinition","fragmentName","sourceKey","sourceKeySet","stripLoc","doc","workSet","parseDocument","cacheKey","parsed","gql","literals","_i","arg","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","extras","gql_1","MatchPartsFragmentDoc","PushPayloadDocument","PushSessionEventsDocument","IdentifySessionDocument","AddSessionPropertiesDocument","PushMetricsDocument","AddSessionFeedbackDocument","InitializeSessionDocument","IgnoreDocument","GetSamplingConfigDocument","defaultWrapper","action","_operationName","_operationType","getSdk","client","withWrapper","wrappedRequestHeaders","patch","replacement","original","wrapped","pathToSelector","domSiblings","sibling","isObject","isObjTooDeep","limit","stringifyOptions","shouldIgnore","toString","eventResult","eventKey","eventValue","_obj","supportsWebP","elem","getDefaultDataURLOptions","isMetricSafeNumber","ATTR_EXCEPTION_MESSAGE","ATTR_EXCEPTION_STACKTRACE","ATTR_EXCEPTION_TYPE","ATTR_HTTP_RESPONSE_STATUS_CODE","ATTR_SERVER_ADDRESS","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","ATTR_TELEMETRY_SDK_NAME","ATTR_TELEMETRY_SDK_VERSION","ATTR_URL_FULL","ATTR_URL_PATH","ATTR_URL_QUERY","ATTR_USER_AGENT_ORIGINAL","FIRST_SEND_FREQUENCY","SEND_FREQUENCY","MAX_SESSION_LENGTH","SESSION_PUSH_THRESHOLD","SNAPSHOT_SETTINGS","VISIBILITY_DEBOUNCE_MS","HIGHLIGHT_URL","LAUNCHDARKLY_URL","LAUNCHDARKLY_ENV_APPS","LAUNCHDARKLY_PATH_PREFIX","LAUNCHDARKLY_BACKEND_REGEX","assign","target","defaultConverter","converter","defaultAttributes","set","attributes","stringifiedAttributes","attributeName","get","cookies","jar","found","_e","api","LocalStorageKeys","mode","cookieWriteEnabled","Storage","__publicField","CookieStorage","Cookies","expires","globalStorage","cookieStorage","getPersistentStorage","storage","internalLogOnce","setStorageMode","m","setCookieWriteEnabled","enabled","getItem","setItem","removeItem","monkeyPatchLocalStorage","onSetItemHandler","originalSetItem","keyName","keyValue","SESSION_STORAGE_KEYS","getSessionDataKey","sessionID","getPersistentSessionSecureID","getSessionSecureID","setPersistentSessionSecureID","secureID","setSessionSecureID","getSessionData","getPreviousSessionData","storedSessionData","setSessionData","sessionData","pruneSessionData","loadCookieSessionData","sessionSecureID","sessionDataKey","sessionDataStr","keepKey","candidates","stale","raw","ts","PublicGraphError","MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS","BASE_DELAY_MS","BACKOFF_DELAY_MS","NON_RETRYABLE_ERRORS","isErrorRetryable","getGraphQLRequestWrapper","graphQLRequestWrapper","requestFn","operationType","retries","sdkLog","FEATURE_FLAG_SCOPE","LD_SCOPE","FEATURE_FLAG_SPAN_NAME","FEATURE_FLAG_EVENT_NAME","FEATURE_FLAG_ENV_ATTR","FEATURE_FLAG_KEY_ATTR","FEATURE_FLAG_CONTEXT_ATTR","FEATURE_FLAG_CONTEXT_ID_ATTR","FEATURE_FLAG_VALUE_ATTR","FEATURE_FLAG_PROVIDER_ATTR","FEATURE_FLAG_REASON_ATTRS","FEATURE_FLAG_VARIATION_INDEX_ATTR","FEATURE_FLAG_APP_ID_ATTR","FEATURE_FLAG_APP_VERSION_ATTR","CONTEXT_SCOPE","CONTEXT_SCOPE_CONTEXT_KEYS_ATTR","LD_INITIALIZE_EVENT","LD_TRACK_EVENT","LD_TRACK_SPAN_NAME","LD_PAGE_VIEW_SPAN_NAME","LD_METRIC_NAME_DOCUMENT_LOAD","LD_IDENTIFY_RESULT_STATUS","encodeKey","isMultiContext","context","getCanonicalKey","getContextKeys","setupLaunchDarklyIntegration","hClient","ldClient","hookContext","metadata","detail","eventAttributes","attr","LaunchDarklyIntegrationSDK","metric","_sessionSecureID","_user_identifier","_user_object","_source","event","LaunchDarklyIntegration","BufferedClass","_result","user_identifier","user_object","PathListener","initialPushState","f","ret","initialReplaceState","onPopState","onLocationChange","version","pkg","config","rootDocument","getElementSelector","getElementSelectorFallback","getElementSelectorNew","getSimpleSelector","classes","c","defaults","_name","_value","findRootDocument","bottomUpSearch","optimized","sort","optimize","selector","rootNode","fallback","current","level","maybe","id","classNames","tagName","any","nth","dispensableNth","nthChild","findUniquePath","paths","combinations","candidate","unique","penalty","elementId","cssesc","child","list","notEmpty","__yieldStar","a","b","scope","newPath","newPathKey","same","regexAnySingleEscape","regexSingleEscape","regexExcessiveSpaces","defaultOptions","opt","quote","isIdentifier","firstChar","counter","length","character","codePoint","extra","$0","$1","$2","element","ids","getSelectorString","delimiter","ViewportResizeListener","onResize","cache","MurmurHash3","seed","h1","k1","top","ID_LENGTH","CHARACTER_SET","MIXER_PRIME","GenerateSecureID","keyHash","charIndex","hasCrypto","cryptoRandom","Plugin","internalLog","ldCredential","persistentSessionSecureID","previousSession"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAUC,GAAWC,GAAS;AAG5C,MAAI,CAFqB,EAAQD;AAG/B,UAAM,IAAI,MAAMC,CAAO;AAE3B;ACFO,SAASC,GAAaC,GAAO;AAClC,SAAO,OAAOA,KAAS,YAAYA,MAAU;AAC/C;ACNO,SAASC,GAAUJ,GAAWC,GAAS;AAG5C,MAAI,CAFqB,EAAQD;AAG/B,UAAM,IAAI;AAAA,MACoB;AAAA,IAClC;AAEA;ACPA,MAAMK,KAAa;AASZ,SAASC,GAAYC,GAAQC,GAAU;AAC5C,MAAIC,IAAgB,GAChBC,IAAO;AAEX,aAAWC,KAASJ,EAAO,KAAK,SAASF,EAAU,GAAG;AAGpD,QAFA,OAAOM,EAAM,SAAU,YAAYP,GAAU,EAAK,GAE9CO,EAAM,SAASH;AACjB;AAGF,IAAAC,IAAgBE,EAAM,QAAQA,EAAM,CAAC,EAAE,QACvCD,KAAQ;AAAA,EACV;AAEA,SAAO;AAAA,IACL,MAAAA;AAAA,IACA,QAAQF,IAAW,IAAIC;AAAA,EAC3B;AACA;ACxBO,SAASG,GAAcC,GAAU;AACtC,SAAOC;AAAA,IACLD,EAAS;AAAA,IACTP,GAAYO,EAAS,QAAQA,EAAS,KAAK;AAAA,EAC/C;AACA;AAKO,SAASC,GAAoBP,GAAQQ,GAAgB;AAC1D,QAAMC,IAAwBT,EAAO,eAAe,SAAS,GACvDU,IAAO,GAAG,SAASD,CAAqB,IAAIT,EAAO,MACnDW,IAA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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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