var qe = Object.defineProperty, Qe = Object.defineProperties;
var ze = Object.getOwnPropertyDescriptors;
var pe = Object.getOwnPropertySymbols;
var Xe = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable;
var j = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), Ke = (e) => {
  throw TypeError(e);
};
var Y = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, I = (e, t) => {
  for (var n in t || (t = {}))
    Xe.call(t, n) && Y(e, n, t[n]);
  if (pe)
    for (var n of pe(t))
      We.call(t, n) && Y(e, n, t[n]);
  return e;
}, R = (e, t) => Qe(e, ze(t));
var y = (e, t, n) => Y(e, typeof t != "symbol" ? t + "" : t, n);
var fe = (e, t, n) => new Promise((s, i) => {
  var r = (c) => {
    try {
      l(n.next(c));
    } catch (u) {
      i(u);
    }
  }, o = (c) => {
    try {
      l(n.throw(c));
    } catch (u) {
      i(u);
    }
  }, l = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(r, o);
  l((n = n.apply(e, t)).next());
}), Ze = function(e, t) {
  this[0] = e, this[1] = t;
};
var H = (e) => {
  var t = e[j("asyncIterator")], n = !1, s, i = {};
  return t == null ? (t = e[j("iterator")](), s = (r) => i[r] = (o) => t[r](o)) : (t = t.call(e), s = (r) => i[r] = (o) => {
    if (n) {
      if (n = !1, r === "throw") throw o;
      return o;
    }
    return n = !0, {
      done: !1,
      value: new Ze(new Promise((l) => {
        var c = t[r](o);
        c instanceof Object || Ke("Object expected"), l(c);
      }), 1)
    };
  }), i[j("iterator")] = () => i, s("next"), "throw" in t ? s("throw") : i.throw = (r) => {
    throw r;
  }, "return" in t && s("return"), i;
};
import { B as et } from "./buffer-9GjOvOok.js";
function J(e, t) {
  if (!!!e)
    throw new Error(t);
}
function tt(e) {
  return typeof e == "object" && e !== null;
}
function nt(e, t) {
  if (!!!e)
    throw new Error(
      "Unexpected invariant triggered."
    );
}
const it = /\r\n|[\n\r]/g;
function K(e, t) {
  let n = 0, s = 1;
  for (const i of e.body.matchAll(it)) {
    if (typeof i.index == "number" || nt(!1), i.index >= t)
      break;
    n = i.index + i[0].length, s += 1;
  }
  return {
    line: s,
    column: t + 1 - n
  };
}
function st(e) {
  return Se(
    e.source,
    K(e.source, e.start)
  );
}
function Se(e, t) {
  const n = e.locationOffset.column - 1, s = "".padStart(n) + e.body, i = t.line - 1, r = e.locationOffset.line - 1, o = t.line + r, l = t.line === 1 ? n : 0, c = t.column + l, u = `${e.name}:${o}:${c}
`, h = s.split(/\r\n|[\n\r]/g), f = h[i];
  if (f.length > 120) {
    const m = Math.floor(c / 80), O = c % 80, T = [];
    for (let S = 0; S < f.length; S += 80)
      T.push(f.slice(S, S + 80));
    return u + de([
      [`${o} |`, T[0]],
      ...T.slice(1, m + 1).map((S) => ["|", S]),
      ["|", "^".padStart(O)],
      ["|", T[m + 1]]
    ]);
  }
  return u + de([
    // Lines specified like this: ["prefix", "string"],
    [`${o - 1} |`, h[i - 1]],
    [`${o} |`, f],
    ["|", "^".padStart(c)],
    [`${o + 1} |`, h[i + 1]]
  ]);
}
function de(e) {
  const t = e.filter(([s, i]) => i !== void 0), n = Math.max(...t.map(([s]) => s.length));
  return t.map(([s, i]) => s.padStart(n) + (i ? " " + i : "")).join(`
`);
}
function rt(e) {
  const t = e[0];
  return t == null || "kind" in t || "length" in t ? {
    nodes: t,
    source: e[1],
    positions: e[2],
    path: e[3],
    originalError: e[4],
    extensions: e[5]
  } : t;
}
class ce extends Error {
  /**
   * An array of `{ line, column }` locations within the source GraphQL document
   * which correspond to this error.
   *
   * Errors during validation often contain multiple locations, for example to
   * point out two things with the same name. Errors during execution include a
   * single location, the field which produced the error.
   *
   * Enumerable, and appears in the result of JSON.stringify().
   */
  /**
   * An array describing the JSON-path into the execution response which
   * corresponds to this error. Only included for errors during execution.
   *
   * Enumerable, and appears in the result of JSON.stringify().
   */
  /**
   * An array of GraphQL AST Nodes corresponding to this error.
   */
  /**
   * The source GraphQL document for the first location of this error.
   *
   * Note that if this Error represents more than one node, the source may not
   * represent nodes after the first node.
   */
  /**
   * An array of character offsets within the source GraphQL document
   * which correspond to this error.
   */
  /**
   * The original error thrown from a field resolver during execution.
   */
  /**
   * Extension fields to add to the formatted error.
   */
  /**
   * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
   */
  constructor(t, ...n) {
    var s, i, r;
    const { nodes: o, source: l, positions: c, path: u, originalError: h, extensions: f } = rt(n);
    super(t), this.name = "GraphQLError", this.path = u != null ? u : void 0, this.originalError = h != null ? h : void 0, this.nodes = Ee(
      Array.isArray(o) ? o : o ? [o] : void 0
    );
    const m = Ee(
      (s = this.nodes) === null || s === void 0 ? void 0 : s.map((T) => T.loc).filter((T) => T != null)
    );
    this.source = l != null ? l : m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source, this.positions = c != null ? c : m == null ? void 0 : m.map((T) => T.start), this.locations = c && l ? c.map((T) => K(l, T)) : m == null ? void 0 : m.map((T) => K(T.source, T.start));
    const O = tt(
      h == null ? void 0 : h.extensions
    ) ? h == null ? void 0 : h.extensions : void 0;
    this.extensions = (r = f != null ? f : O) !== null && r !== void 0 ? r : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
      message: {
        writable: !0,
        enumerable: !0
      },
      name: {
        enumerable: !1
      },
      nodes: {
        enumerable: !1
      },
      source: {
        enumerable: !1
      },
      positions: {
        enumerable: !1
      },
      originalError: {
        enumerable: !1
      }
    }), h != null && h.stack ? Object.defineProperty(this, "stack", {
      value: h.stack,
      writable: !0,
      configurable: !0
    }) : Error.captureStackTrace ? Error.captureStackTrace(this, ce) : Object.defineProperty(this, "stack", {
      value: Error().stack,
      writable: !0,
      configurable: !0
    });
  }
  get [Symbol.toStringTag]() {
    return "GraphQLError";
  }
  toString() {
    let t = this.message;
    if (this.nodes)
      for (const n of this.nodes)
        n.loc && (t += `

` + st(n.loc));
    else if (this.source && this.locations)
      for (const n of this.locations)
        t += `

` + Se(this.source, n);
    return t;
  }
  toJSON() {
    const t = {
      message: this.message
    };
    return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
  }
}
function Ee(e) {
  return e === void 0 || e.length === 0 ? void 0 : e;
}
function E(e, t, n) {
  return new ce(`Syntax Error: ${n}`, {
    source: e,
    positions: [t]
  });
}
class ot {
  /**
   * The character offset at which this Node begins.
   */
  /**
   * The character offset at which this Node ends.
   */
  /**
   * The Token at which this Node begins.
   */
  /**
   * The Token at which this Node ends.
   */
  /**
   * The Source document the AST represents.
   */
  constructor(t, n, s) {
    this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = s;
  }
  get [Symbol.toStringTag]() {
    return "Location";
  }
  toJSON() {
    return {
      start: this.start,
      end: this.end
    };
  }
}
class xe {
  /**
   * The kind of Token.
   */
  /**
   * The character offset at which this Node begins.
   */
  /**
   * The character offset at which this Node ends.
   */
  /**
   * The 1-indexed line number on which this Token appears.
   */
  /**
   * The 1-indexed column number at which this Token begins.
   */
  /**
   * For non-punctuation tokens, represents the interpreted value of the token.
   *
   * Note: is undefined for punctuation tokens, but typed as string for
   * convenience in the parser.
   */
  /**
   * Tokens exist as nodes in a double-linked-list amongst all tokens
   * including ignored tokens. <SOF> is always the first node and <EOF>
   * the last.
   */
  constructor(t, n, s, i, r, o) {
    this.kind = t, this.start = n, this.end = s, this.line = i, this.column = r, this.value = o, this.prev = null, this.next = null;
  }
  get [Symbol.toStringTag]() {
    return "Token";
  }
  toJSON() {
    return {
      kind: this.kind,
      value: this.value,
      line: this.line,
      column: this.column
    };
  }
}
const at = {
  Name: [],
  Document: ["definitions"],
  OperationDefinition: [
    "name",
    "variableDefinitions",
    "directives",
    "selectionSet"
  ],
  VariableDefinition: ["variable", "type", "defaultValue", "directives"],
  Variable: ["name"],
  SelectionSet: ["selections"],
  Field: ["alias", "name", "arguments", "directives", "selectionSet"],
  Argument: ["name", "value"],
  FragmentSpread: ["name", "directives"],
  InlineFragment: ["typeCondition", "directives", "selectionSet"],
  FragmentDefinition: [
    "name",
    // Note: fragment variable definitions are deprecated and will removed in v17.0.0
    "variableDefinitions",
    "typeCondition",
    "directives",
    "selectionSet"
  ],
  IntValue: [],
  FloatValue: [],
  StringValue: [],
  BooleanValue: [],
  NullValue: [],
  EnumValue: [],
  ListValue: ["values"],
  ObjectValue: ["fields"],
  ObjectField: ["name", "value"],
  Directive: ["name", "arguments"],
  NamedType: ["name"],
  ListType: ["type"],
  NonNullType: ["type"],
  SchemaDefinition: ["description", "directives", "operationTypes"],
  OperationTypeDefinition: ["type"],
  ScalarTypeDefinition: ["description", "name", "directives"],
  ObjectTypeDefinition: [
    "description",
    "name",
    "interfaces",
    "directives",
    "fields"
  ],
  FieldDefinition: ["description", "name", "arguments", "type", "directives"],
  InputValueDefinition: [
    "description",
    "name",
    "type",
    "defaultValue",
    "directives"
  ],
  InterfaceTypeDefinition: [
    "description",
    "name",
    "interfaces",
    "directives",
    "fields"
  ],
  UnionTypeDefinition: ["description", "name", "directives", "types"],
  EnumTypeDefinition: ["description", "name", "directives", "values"],
  EnumValueDefinition: ["description", "name", "directives"],
  InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
  DirectiveDefinition: ["description", "name", "arguments", "locations"],
  SchemaExtension: ["directives", "operationTypes"],
  ScalarTypeExtension: ["name", "directives"],
  ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
  UnionTypeExtension: ["name", "directives", "types"],
  EnumTypeExtension: ["name", "directives", "values"],
  InputObjectTypeExtension: ["name", "directives", "fields"]
}, ct = new Set(Object.keys(at));
function kn(e) {
  const t = e == null ? void 0 : e.kind;
  return typeof t == "string" && ct.has(t);
}
var x;
(function(e) {
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
})(x || (x = {}));
var Z;
(function(e) {
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
})(Z || (Z = {}));
var p;
(function(e) {
  e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
})(p || (p = {}));
function ee(e) {
  return e === 9 || e === 32;
}
function k(e) {
  return e >= 48 && e <= 57;
}
function De(e) {
  return e >= 97 && e <= 122 || // A-Z
  e >= 65 && e <= 90;
}
function Ce(e) {
  return De(e) || e === 95;
}
function lt(e) {
  return De(e) || k(e) || e === 95;
}
function ut(e) {
  var t;
  let n = Number.MAX_SAFE_INTEGER, s = null, i = -1;
  for (let o = 0; o < e.length; ++o) {
    var r;
    const l = e[o], c = ht(l);
    c !== l.length && (s = (r = s) !== null && r !== void 0 ? r : o, i = o, o !== 0 && c < n && (n = c));
  }
  return e.map((o, l) => l === 0 ? o : o.slice(n)).slice(
    (t = s) !== null && t !== void 0 ? t : 0,
    i + 1
  );
}
function ht(e) {
  let t = 0;
  for (; t < e.length && ee(e.charCodeAt(t)); )
    ++t;
  return t;
}
function Rn(e, t) {
  const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), i = s.length === 1, r = s.length > 1 && s.slice(1).every((O) => O.length === 0 || ee(O.charCodeAt(0))), o = n.endsWith('\\"""'), l = e.endsWith('"') && !o, c = e.endsWith("\\"), u = l || c, h = (
    // add leading and trailing new lines only if it improves readability
    !i || e.length > 70 || u || r || o
  );
  let f = "";
  const m = i && ee(e.charCodeAt(0));
  return (h && !m || r) && (f += `
`), f += n, (h || u) && (f += `
`), '"""' + f + '"""';
}
var a;
(function(e) {
  e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
})(a || (a = {}));
class pt {
  /**
   * The previously focused non-ignored token.
   */
  /**
   * The currently focused non-ignored token.
   */
  /**
   * The (1-indexed) line containing the current token.
   */
  /**
   * The character offset at which the current line begins.
   */
  constructor(t) {
    const n = new xe(a.SOF, 0, 0, 0, 0);
    this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
  }
  get [Symbol.toStringTag]() {
    return "Lexer";
  }
  /**
   * Advances the token stream to the next non-ignored token.
   */
  advance() {
    return this.lastToken = this.token, this.token = this.lookahead();
  }
  /**
   * Looks ahead and returns the next non-ignored token, but does not change
   * the state of Lexer.
   */
  lookahead() {
    let t = this.token;
    if (t.kind !== a.EOF)
      do
        if (t.next)
          t = t.next;
        else {
          const n = dt(this, t.end);
          t.next = n, n.prev = t, t = n;
        }
      while (t.kind === a.COMMENT);
    return t;
  }
}
function ft(e) {
  return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
}
function C(e) {
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
}
function V(e, t) {
  return Le(e.charCodeAt(t)) && ve(e.charCodeAt(t + 1));
}
function Le(e) {
  return e >= 55296 && e <= 56319;
}
function ve(e) {
  return e >= 56320 && e <= 57343;
}
function A(e, t) {
  const n = e.source.body.codePointAt(t);
  if (n === void 0)
    return a.EOF;
  if (n >= 32 && n <= 126) {
    const s = String.fromCodePoint(n);
    return s === '"' ? `'"'` : `"${s}"`;
  }
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
}
function d(e, t, n, s, i) {
  const r = e.line, o = 1 + n - e.lineStart;
  return new xe(t, n, s, r, o, i);
}
function dt(e, t) {
  const n = e.source.body, s = n.length;
  let i = t;
  for (; i < s; ) {
    const r = n.charCodeAt(i);
    switch (r) {
      case 65279:
      case 9:
      case 32:
      case 44:
        ++i;
        continue;
      case 10:
        ++i, ++e.line, e.lineStart = i;
        continue;
      case 13:
        n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
        continue;
      case 35:
        return Et(e, i);
      case 33:
        return d(e, a.BANG, i, i + 1);
      case 36:
        return d(e, a.DOLLAR, i, i + 1);
      case 38:
        return d(e, a.AMP, i, i + 1);
      case 40:
        return d(e, a.PAREN_L, i, i + 1);
      case 41:
        return d(e, a.PAREN_R, i, i + 1);
      case 46:
        if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
          return d(e, a.SPREAD, i, i + 3);
        break;
      case 58:
        return d(e, a.COLON, i, i + 1);
      case 61:
        return d(e, a.EQUALS, i, i + 1);
      case 64:
        return d(e, a.AT, i, i + 1);
      case 91:
        return d(e, a.BRACKET_L, i, i + 1);
      case 93:
        return d(e, a.BRACKET_R, i, i + 1);
      case 123:
        return d(e, a.BRACE_L, i, i + 1);
      case 124:
        return d(e, a.PIPE, i, i + 1);
      case 125:
        return d(e, a.BRACE_R, i, i + 1);
      case 34:
        return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? _t(e, i) : Tt(e, i);
    }
    if (k(r) || r === 45)
      return mt(e, i, r);
    if (Ce(r))
      return yt(e, i);
    throw E(
      e.source,
      i,
      r === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : C(r) || V(n, i) ? `Unexpected character: ${A(e, i)}.` : `Invalid character: ${A(e, i)}.`
    );
  }
  return d(e, a.EOF, s, s);
}
function Et(e, t) {
  const n = e.source.body, s = n.length;
  let i = t + 1;
  for (; i < s; ) {
    const r = n.charCodeAt(i);
    if (r === 10 || r === 13)
      break;
    if (C(r))
      ++i;
    else if (V(n, i))
      i += 2;
    else
      break;
  }
  return d(
    e,
    a.COMMENT,
    t,
    i,
    n.slice(t + 1, i)
  );
}
function mt(e, t, n) {
  const s = e.source.body;
  let i = t, r = n, o = !1;
  if (r === 45 && (r = s.charCodeAt(++i)), r === 48) {
    if (r = s.charCodeAt(++i), k(r))
      throw E(
        e.source,
        i,
        `Invalid number, unexpected digit after 0: ${A(
          e,
          i
        )}.`
      );
  } else
    i = q(e, i, r), r = s.charCodeAt(i);
  if (r === 46 && (o = !0, r = s.charCodeAt(++i), i = q(e, i, r), r = s.charCodeAt(i)), (r === 69 || r === 101) && (o = !0, r = s.charCodeAt(++i), (r === 43 || r === 45) && (r = s.charCodeAt(++i)), i = q(e, i, r), r = s.charCodeAt(i)), r === 46 || Ce(r))
    throw E(
      e.source,
      i,
      `Invalid number, expected digit but got: ${A(
        e,
        i
      )}.`
    );
  return d(
    e,
    o ? a.FLOAT : a.INT,
    t,
    i,
    s.slice(t, i)
  );
}
function q(e, t, n) {
  if (!k(n))
    throw E(
      e.source,
      t,
      `Invalid number, expected digit but got: ${A(
        e,
        t
      )}.`
    );
  const s = e.source.body;
  let i = t + 1;
  for (; k(s.charCodeAt(i)); )
    ++i;
  return i;
}
function Tt(e, t) {
  const n = e.source.body, s = n.length;
  let i = t + 1, r = i, o = "";
  for (; i < s; ) {
    const l = n.charCodeAt(i);
    if (l === 34)
      return o += n.slice(r, i), d(e, a.STRING, t, i + 1, o);
    if (l === 92) {
      o += n.slice(r, i);
      const c = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Nt(e, i) : gt(e, i) : It(e, i);
      o += c.value, i += c.size, r = i;
      continue;
    }
    if (l === 10 || l === 13)
      break;
    if (C(l))
      ++i;
    else if (V(n, i))
      i += 2;
    else
      throw E(
        e.source,
        i,
        `Invalid character within String: ${A(
          e,
          i
        )}.`
      );
  }
  throw E(e.source, i, "Unterminated string.");
}
function Nt(e, t) {
  const n = e.source.body;
  let s = 0, i = 3;
  for (; i < 12; ) {
    const r = n.charCodeAt(t + i++);
    if (r === 125) {
      if (i < 5 || !C(s))
        break;
      return {
        value: String.fromCodePoint(s),
        size: i
      };
    }
    if (s = s << 4 | L(r), s < 0)
      break;
  }
  throw E(
    e.source,
    t,
    `Invalid Unicode escape sequence: "${n.slice(
      t,
      t + i
    )}".`
  );
}
function gt(e, t) {
  const n = e.source.body, s = me(n, t + 2);
  if (C(s))
    return {
      value: String.fromCodePoint(s),
      size: 6
    };
  if (Le(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
    const i = me(n, t + 8);
    if (ve(i))
      return {
        value: String.fromCodePoint(s, i),
        size: 12
      };
  }
  throw E(
    e.source,
    t,
    `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
  );
}
function me(e, t) {
  return L(e.charCodeAt(t)) << 12 | L(e.charCodeAt(t + 1)) << 8 | L(e.charCodeAt(t + 2)) << 4 | L(e.charCodeAt(t + 3));
}
function L(e) {
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
}
function It(e, t) {
  const n = e.source.body;
  switch (n.charCodeAt(t + 1)) {
    case 34:
      return {
        value: '"',
        size: 2
      };
    case 92:
      return {
        value: "\\",
        size: 2
      };
    case 47:
      return {
        value: "/",
        size: 2
      };
    case 98:
      return {
        value: "\b",
        size: 2
      };
    case 102:
      return {
        value: "\f",
        size: 2
      };
    case 110:
      return {
        value: `
`,
        size: 2
      };
    case 114:
      return {
        value: "\r",
        size: 2
      };
    case 116:
      return {
        value: "	",
        size: 2
      };
  }
  throw E(
    e.source,
    t,
    `Invalid character escape sequence: "${n.slice(
      t,
      t + 2
    )}".`
  );
}
function _t(e, t) {
  const n = e.source.body, s = n.length;
  let i = e.lineStart, r = t + 3, o = r, l = "";
  const c = [];
  for (; r < s; ) {
    const u = n.charCodeAt(r);
    if (u === 34 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34) {
      l += n.slice(o, r), c.push(l);
      const h = d(
        e,
        a.BLOCK_STRING,
        t,
        r + 3,
        // Return a string of the lines joined with U+000A.
        ut(c).join(`
`)
      );
      return e.line += c.length - 1, e.lineStart = i, h;
    }
    if (u === 92 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 && n.charCodeAt(r + 3) === 34) {
      l += n.slice(o, r), o = r + 1, r += 4;
      continue;
    }
    if (u === 10 || u === 13) {
      l += n.slice(o, r), c.push(l), u === 13 && n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, l = "", o = r, i = r;
      continue;
    }
    if (C(u))
      ++r;
    else if (V(n, r))
      r += 2;
    else
      throw E(
        e.source,
        r,
        `Invalid character within String: ${A(
          e,
          r
        )}.`
      );
  }
  throw E(e.source, r, "Unterminated string.");
}
function yt(e, t) {
  const n = e.source.body, s = n.length;
  let i = t + 1;
  for (; i < s; ) {
    const r = n.charCodeAt(i);
    if (lt(r))
      ++i;
    else
      break;
  }
  return d(
    e,
    a.NAME,
    t,
    i,
    n.slice(t, i)
  );
}
const At = 10, ke = 2;
function Re(e) {
  return B(e, []);
}
function B(e, t) {
  switch (typeof e) {
    case "string":
      return JSON.stringify(e);
    case "function":
      return e.name ? `[function ${e.name}]` : "[function]";
    case "object":
      return Ot(e, t);
    default:
      return String(e);
  }
}
function Ot(e, t) {
  if (e === null)
    return "null";
  if (t.includes(e))
    return "[Circular]";
  const n = [...t, e];
  if (St(e)) {
    const s = e.toJSON();
    if (s !== e)
      return typeof s == "string" ? s : B(s, n);
  } else if (Array.isArray(e))
    return Dt(e, n);
  return xt(e, n);
}
function St(e) {
  return typeof e.toJSON == "function";
}
function xt(e, t) {
  const n = Object.entries(e);
  return n.length === 0 ? "{}" : t.length > ke ? "[" + Ct(e) + "]" : "{ " + n.map(
    ([i, r]) => i + ": " + B(r, t)
  ).join(", ") + " }";
}
function Dt(e, t) {
  if (e.length === 0)
    return "[]";
  if (t.length > ke)
    return "[Array]";
  const n = Math.min(At, e.length), s = e.length - n, i = [];
  for (let r = 0; r < n; ++r)
    i.push(B(e[r], t));
  return s === 1 ? i.push("... 1 more item") : s > 1 && i.push(`... ${s} more items`), "[" + i.join(", ") + "]";
}
function Ct(e) {
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
  if (t === "Object" && typeof e.constructor == "function") {
    const n = e.constructor.name;
    if (typeof n == "string" && n !== "")
      return n;
  }
  return t;
}
const Lt = (
  /* c8 ignore next 6 */
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
  globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
    return t instanceof n;
  } : function(t, n) {
    if (t instanceof n)
      return !0;
    if (typeof t == "object" && t !== null) {
      var s;
      const i = n.prototype[Symbol.toStringTag], r = (
        // We still need to support constructor's name to detect conflicts with older versions of this library.
        Symbol.toStringTag in t ? t[Symbol.toStringTag] : (s = t.constructor) === null || s === void 0 ? void 0 : s.name
      );
      if (i === r) {
        const o = Re(t);
        throw new Error(`Cannot use ${i} "${o}" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`);
      }
    }
    return !1;
  }
);
class be {
  constructor(t, n = "GraphQL request", s = {
    line: 1,
    column: 1
  }) {
    typeof t == "string" || J(!1, `Body must be a string. Received: ${Re(t)}.`), this.body = t, this.name = n, this.locationOffset = s, this.locationOffset.line > 0 || J(
      !1,
      "line in locationOffset is 1-indexed and must be positive."
    ), this.locationOffset.column > 0 || J(
      !1,
      "column in locationOffset is 1-indexed and must be positive."
    );
  }
  get [Symbol.toStringTag]() {
    return "Source";
  }
}
function vt(e) {
  return Lt(e, be);
}
function bn(e, t) {
  return new kt(e, t).parseDocument();
}
class kt {
  constructor(t, n = {}) {
    const s = vt(t) ? t : new be(t);
    this._lexer = new pt(s), this._options = n, this._tokenCounter = 0;
  }
  /**
   * Converts a name lex token into a name parse node.
   */
  parseName() {
    const t = this.expectToken(a.NAME);
    return this.node(t, {
      kind: p.NAME,
      value: t.value
    });
  }
  // Implements the parsing rules in the Document section.
  /**
   * Document : Definition+
   */
  parseDocument() {
    return this.node(this._lexer.token, {
      kind: p.DOCUMENT,
      definitions: this.many(
        a.SOF,
        this.parseDefinition,
        a.EOF
      )
    });
  }
  /**
   * Definition :
   *   - ExecutableDefinition
   *   - TypeSystemDefinition
   *   - TypeSystemExtension
   *
   * ExecutableDefinition :
   *   - OperationDefinition
   *   - FragmentDefinition
   *
   * TypeSystemDefinition :
   *   - SchemaDefinition
   *   - TypeDefinition
   *   - DirectiveDefinition
   *
   * TypeDefinition :
   *   - ScalarTypeDefinition
   *   - ObjectTypeDefinition
   *   - InterfaceTypeDefinition
   *   - UnionTypeDefinition
   *   - EnumTypeDefinition
   *   - InputObjectTypeDefinition
   */
  parseDefinition() {
    if (this.peek(a.BRACE_L))
      return this.parseOperationDefinition();
    const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
    if (n.kind === a.NAME) {
      switch (n.value) {
        case "schema":
          return this.parseSchemaDefinition();
        case "scalar":
          return this.parseScalarTypeDefinition();
        case "type":
          return this.parseObjectTypeDefinition();
        case "interface":
          return this.parseInterfaceTypeDefinition();
        case "union":
          return this.parseUnionTypeDefinition();
        case "enum":
          return this.parseEnumTypeDefinition();
        case "input":
          return this.parseInputObjectTypeDefinition();
        case "directive":
          return this.parseDirectiveDefinition();
      }
      if (t)
        throw E(
          this._lexer.source,
          this._lexer.token.start,
          "Unexpected description, descriptions are supported only on type definitions."
        );
      switch (n.value) {
        case "query":
        case "mutation":
        case "subscription":
          return this.parseOperationDefinition();
        case "fragment":
          return this.parseFragmentDefinition();
        case "extend":
          return this.parseTypeSystemExtension();
      }
    }
    throw this.unexpected(n);
  }
  // Implements the parsing rules in the Operations section.
  /**
   * OperationDefinition :
   *  - SelectionSet
   *  - OperationType Name? VariableDefinitions? Directives? SelectionSet
   */
  parseOperationDefinition() {
    const t = this._lexer.token;
    if (this.peek(a.BRACE_L))
      return this.node(t, {
        kind: p.OPERATION_DEFINITION,
        operation: x.QUERY,
        name: void 0,
        variableDefinitions: [],
        directives: [],
        selectionSet: this.parseSelectionSet()
      });
    const n = this.parseOperationType();
    let s;
    return this.peek(a.NAME) && (s = this.parseName()), this.node(t, {
      kind: p.OPERATION_DEFINITION,
      operation: n,
      name: s,
      variableDefinitions: this.parseVariableDefinitions(),
      directives: this.parseDirectives(!1),
      selectionSet: this.parseSelectionSet()
    });
  }
  /**
   * OperationType : one of query mutation subscription
   */
  parseOperationType() {
    const t = this.expectToken(a.NAME);
    switch (t.value) {
      case "query":
        return x.QUERY;
      case "mutation":
        return x.MUTATION;
      case "subscription":
        return x.SUBSCRIPTION;
    }
    throw this.unexpected(t);
  }
  /**
   * VariableDefinitions : ( VariableDefinition+ )
   */
  parseVariableDefinitions() {
    return this.optionalMany(
      a.PAREN_L,
      this.parseVariableDefinition,
      a.PAREN_R
    );
  }
  /**
   * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
   */
  parseVariableDefinition() {
    return this.node(this._lexer.token, {
      kind: p.VARIABLE_DEFINITION,
      variable: this.parseVariable(),
      type: (this.expectToken(a.COLON), this.parseTypeReference()),
      defaultValue: this.expectOptionalToken(a.EQUALS) ? this.parseConstValueLiteral() : void 0,
      directives: this.parseConstDirectives()
    });
  }
  /**
   * Variable : $ Name
   */
  parseVariable() {
    const t = this._lexer.token;
    return this.expectToken(a.DOLLAR), this.node(t, {
      kind: p.VARIABLE,
      name: this.parseName()
    });
  }
  /**
   * ```
   * SelectionSet : { Selection+ }
   * ```
   */
  parseSelectionSet() {
    return this.node(this._lexer.token, {
      kind: p.SELECTION_SET,
      selections: this.many(
        a.BRACE_L,
        this.parseSelection,
        a.BRACE_R
      )
    });
  }
  /**
   * Selection :
   *   - Field
   *   - FragmentSpread
   *   - InlineFragment
   */
  parseSelection() {
    return this.peek(a.SPREAD) ? this.parseFragment() : this.parseField();
  }
  /**
   * Field : Alias? Name Arguments? Directives? SelectionSet?
   *
   * Alias : Name :
   */
  parseField() {
    const t = this._lexer.token, n = this.parseName();
    let s, i;
    return this.expectOptionalToken(a.COLON) ? (s = n, i = this.parseName()) : i = n, this.node(t, {
      kind: p.FIELD,
      alias: s,
      name: i,
      arguments: this.parseArguments(!1),
      directives: this.parseDirectives(!1),
      selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
    });
  }
  /**
   * Arguments[Const] : ( Argument[?Const]+ )
   */
  parseArguments(t) {
    const n = t ? this.parseConstArgument : this.parseArgument;
    return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
  }
  /**
   * Argument[Const] : Name : Value[?Const]
   */
  parseArgument(t = !1) {
    const n = this._lexer.token, s = this.parseName();
    return this.expectToken(a.COLON), this.node(n, {
      kind: p.ARGUMENT,
      name: s,
      value: this.parseValueLiteral(t)
    });
  }
  parseConstArgument() {
    return this.parseArgument(!0);
  }
  // Implements the parsing rules in the Fragments section.
  /**
   * Corresponds to both FragmentSpread and InlineFragment in the spec.
   *
   * FragmentSpread : ... FragmentName Directives?
   *
   * InlineFragment : ... TypeCondition? Directives? SelectionSet
   */
  parseFragment() {
    const t = this._lexer.token;
    this.expectToken(a.SPREAD);
    const n = this.expectOptionalKeyword("on");
    return !n && this.peek(a.NAME) ? this.node(t, {
      kind: p.FRAGMENT_SPREAD,
      name: this.parseFragmentName(),
      directives: this.parseDirectives(!1)
    }) : this.node(t, {
      kind: p.INLINE_FRAGMENT,
      typeCondition: n ? this.parseNamedType() : void 0,
      directives: this.parseDirectives(!1),
      selectionSet: this.parseSelectionSet()
    });
  }
  /**
   * FragmentDefinition :
   *   - fragment FragmentName on TypeCondition Directives? SelectionSet
   *
   * TypeCondition : NamedType
   */
  parseFragmentDefinition() {
    const t = this._lexer.token;
    return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
      kind: p.FRAGMENT_DEFINITION,
      name: this.parseFragmentName(),
      variableDefinitions: this.parseVariableDefinitions(),
      typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
      directives: this.parseDirectives(!1),
      selectionSet: this.parseSelectionSet()
    }) : this.node(t, {
      kind: p.FRAGMENT_DEFINITION,
      name: this.parseFragmentName(),
      typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
      directives: this.parseDirectives(!1),
      selectionSet: this.parseSelectionSet()
    });
  }
  /**
   * FragmentName : Name but not `on`
   */
  parseFragmentName() {
    if (this._lexer.token.value === "on")
      throw this.unexpected();
    return this.parseName();
  }
  // Implements the parsing rules in the Values section.
  /**
   * Value[Const] :
   *   - [~Const] Variable
   *   - IntValue
   *   - FloatValue
   *   - StringValue
   *   - BooleanValue
   *   - NullValue
   *   - EnumValue
   *   - ListValue[?Const]
   *   - ObjectValue[?Const]
   *
   * BooleanValue : one of `true` `false`
   *
   * NullValue : `null`
   *
   * EnumValue : Name but not `true`, `false` or `null`
   */
  parseValueLiteral(t) {
    const n = this._lexer.token;
    switch (n.kind) {
      case a.BRACKET_L:
        return this.parseList(t);
      case a.BRACE_L:
        return this.parseObject(t);
      case a.INT:
        return this.advanceLexer(), this.node(n, {
          kind: p.INT,
          value: n.value
        });
      case a.FLOAT:
        return this.advanceLexer(), this.node(n, {
          kind: p.FLOAT,
          value: n.value
        });
      case a.STRING:
      case a.BLOCK_STRING:
        return this.parseStringLiteral();
      case a.NAME:
        switch (this.advanceLexer(), n.value) {
          case "true":
            return this.node(n, {
              kind: p.BOOLEAN,
              value: !0
            });
          case "false":
            return this.node(n, {
              kind: p.BOOLEAN,
              value: !1
            });
          case "null":
            return this.node(n, {
              kind: p.NULL
            });
          default:
            return this.node(n, {
              kind: p.ENUM,
              value: n.value
            });
        }
      case a.DOLLAR:
        if (t)
          if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
            const s = this._lexer.token.value;
            throw E(
              this._lexer.source,
              n.start,
              `Unexpected variable "$${s}" in constant value.`
            );
          } else
            throw this.unexpected(n);
        return this.parseVariable();
      default:
        throw this.unexpected();
    }
  }
  parseConstValueLiteral() {
    return this.parseValueLiteral(!0);
  }
  parseStringLiteral() {
    const t = this._lexer.token;
    return this.advanceLexer(), this.node(t, {
      kind: p.STRING,
      value: t.value,
      block: t.kind === a.BLOCK_STRING
    });
  }
  /**
   * ListValue[Const] :
   *   - [ ]
   *   - [ Value[?Const]+ ]
   */
  parseList(t) {
    const n = () => this.parseValueLiteral(t);
    return this.node(this._lexer.token, {
      kind: p.LIST,
      values: this.any(a.BRACKET_L, n, a.BRACKET_R)
    });
  }
  /**
   * ```
   * ObjectValue[Const] :
   *   - { }
   *   - { ObjectField[?Const]+ }
   * ```
   */
  parseObject(t) {
    const n = () => this.parseObjectField(t);
    return this.node(this._lexer.token, {
      kind: p.OBJECT,
      fields: this.any(a.BRACE_L, n, a.BRACE_R)
    });
  }
  /**
   * ObjectField[Const] : Name : Value[?Const]
   */
  parseObjectField(t) {
    const n = this._lexer.token, s = this.parseName();
    return this.expectToken(a.COLON), this.node(n, {
      kind: p.OBJECT_FIELD,
      name: s,
      value: this.parseValueLiteral(t)
    });
  }
  // Implements the parsing rules in the Directives section.
  /**
   * Directives[Const] : Directive[?Const]+
   */
  parseDirectives(t) {
    const n = [];
    for (; this.peek(a.AT); )
      n.push(this.parseDirective(t));
    return n;
  }
  parseConstDirectives() {
    return this.parseDirectives(!0);
  }
  /**
   * ```
   * Directive[Const] : @ Name Arguments[?Const]?
   * ```
   */
  parseDirective(t) {
    const n = this._lexer.token;
    return this.expectToken(a.AT), this.node(n, {
      kind: p.DIRECTIVE,
      name: this.parseName(),
      arguments: this.parseArguments(t)
    });
  }
  // Implements the parsing rules in the Types section.
  /**
   * Type :
   *   - NamedType
   *   - ListType
   *   - NonNullType
   */
  parseTypeReference() {
    const t = this._lexer.token;
    let n;
    if (this.expectOptionalToken(a.BRACKET_L)) {
      const s = this.parseTypeReference();
      this.expectToken(a.BRACKET_R), n = this.node(t, {
        kind: p.LIST_TYPE,
        type: s
      });
    } else
      n = this.parseNamedType();
    return this.expectOptionalToken(a.BANG) ? this.node(t, {
      kind: p.NON_NULL_TYPE,
      type: n
    }) : n;
  }
  /**
   * NamedType : Name
   */
  parseNamedType() {
    return this.node(this._lexer.token, {
      kind: p.NAMED_TYPE,
      name: this.parseName()
    });
  }
  // Implements the parsing rules in the Type Definition section.
  peekDescription() {
    return this.peek(a.STRING) || this.peek(a.BLOCK_STRING);
  }
  /**
   * Description : StringValue
   */
  parseDescription() {
    if (this.peekDescription())
      return this.parseStringLiteral();
  }
  /**
   * ```
   * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
   * ```
   */
  parseSchemaDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("schema");
    const s = this.parseConstDirectives(), i = this.many(
      a.BRACE_L,
      this.parseOperationTypeDefinition,
      a.BRACE_R
    );
    return this.node(t, {
      kind: p.SCHEMA_DEFINITION,
      description: n,
      directives: s,
      operationTypes: i
    });
  }
  /**
   * OperationTypeDefinition : OperationType : NamedType
   */
  parseOperationTypeDefinition() {
    const t = this._lexer.token, n = this.parseOperationType();
    this.expectToken(a.COLON);
    const s = this.parseNamedType();
    return this.node(t, {
      kind: p.OPERATION_TYPE_DEFINITION,
      operation: n,
      type: s
    });
  }
  /**
   * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
   */
  parseScalarTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("scalar");
    const s = this.parseName(), i = this.parseConstDirectives();
    return this.node(t, {
      kind: p.SCALAR_TYPE_DEFINITION,
      description: n,
      name: s,
      directives: i
    });
  }
  /**
   * ObjectTypeDefinition :
   *   Description?
   *   type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
   */
  parseObjectTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("type");
    const s = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), o = this.parseFieldsDefinition();
    return this.node(t, {
      kind: p.OBJECT_TYPE_DEFINITION,
      description: n,
      name: s,
      interfaces: i,
      directives: r,
      fields: o
    });
  }
  /**
   * ImplementsInterfaces :
   *   - implements `&`? NamedType
   *   - ImplementsInterfaces & NamedType
   */
  parseImplementsInterfaces() {
    return this.expectOptionalKeyword("implements") ? this.delimitedMany(a.AMP, this.parseNamedType) : [];
  }
  /**
   * ```
   * FieldsDefinition : { FieldDefinition+ }
   * ```
   */
  parseFieldsDefinition() {
    return this.optionalMany(
      a.BRACE_L,
      this.parseFieldDefinition,
      a.BRACE_R
    );
  }
  /**
   * FieldDefinition :
   *   - Description? Name ArgumentsDefinition? : Type Directives[Const]?
   */
  parseFieldDefinition() {
    const t = this._lexer.token, n = this.parseDescription(), s = this.parseName(), i = this.parseArgumentDefs();
    this.expectToken(a.COLON);
    const r = this.parseTypeReference(), o = this.parseConstDirectives();
    return this.node(t, {
      kind: p.FIELD_DEFINITION,
      description: n,
      name: s,
      arguments: i,
      type: r,
      directives: o
    });
  }
  /**
   * ArgumentsDefinition : ( InputValueDefinition+ )
   */
  parseArgumentDefs() {
    return this.optionalMany(
      a.PAREN_L,
      this.parseInputValueDef,
      a.PAREN_R
    );
  }
  /**
   * InputValueDefinition :
   *   - Description? Name : Type DefaultValue? Directives[Const]?
   */
  parseInputValueDef() {
    const t = this._lexer.token, n = this.parseDescription(), s = this.parseName();
    this.expectToken(a.COLON);
    const i = this.parseTypeReference();
    let r;
    this.expectOptionalToken(a.EQUALS) && (r = this.parseConstValueLiteral());
    const o = this.parseConstDirectives();
    return this.node(t, {
      kind: p.INPUT_VALUE_DEFINITION,
      description: n,
      name: s,
      type: i,
      defaultValue: r,
      directives: o
    });
  }
  /**
   * InterfaceTypeDefinition :
   *   - Description? interface Name Directives[Const]? FieldsDefinition?
   */
  parseInterfaceTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("interface");
    const s = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), o = this.parseFieldsDefinition();
    return this.node(t, {
      kind: p.INTERFACE_TYPE_DEFINITION,
      description: n,
      name: s,
      interfaces: i,
      directives: r,
      fields: o
    });
  }
  /**
   * UnionTypeDefinition :
   *   - Description? union Name Directives[Const]? UnionMemberTypes?
   */
  parseUnionTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("union");
    const s = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
    return this.node(t, {
      kind: p.UNION_TYPE_DEFINITION,
      description: n,
      name: s,
      directives: i,
      types: r
    });
  }
  /**
   * UnionMemberTypes :
   *   - = `|`? NamedType
   *   - UnionMemberTypes | NamedType
   */
  parseUnionMemberTypes() {
    return this.expectOptionalToken(a.EQUALS) ? this.delimitedMany(a.PIPE, this.parseNamedType) : [];
  }
  /**
   * EnumTypeDefinition :
   *   - Description? enum Name Directives[Const]? EnumValuesDefinition?
   */
  parseEnumTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("enum");
    const s = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
    return this.node(t, {
      kind: p.ENUM_TYPE_DEFINITION,
      description: n,
      name: s,
      directives: i,
      values: r
    });
  }
  /**
   * ```
   * EnumValuesDefinition : { EnumValueDefinition+ }
   * ```
   */
  parseEnumValuesDefinition() {
    return this.optionalMany(
      a.BRACE_L,
      this.parseEnumValueDefinition,
      a.BRACE_R
    );
  }
  /**
   * EnumValueDefinition : Description? EnumValue Directives[Const]?
   */
  parseEnumValueDefinition() {
    const t = this._lexer.token, n = this.parseDescription(), s = this.parseEnumValueName(), i = this.parseConstDirectives();
    return this.node(t, {
      kind: p.ENUM_VALUE_DEFINITION,
      description: n,
      name: s,
      directives: i
    });
  }
  /**
   * EnumValue : Name but not `true`, `false` or `null`
   */
  parseEnumValueName() {
    if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
      throw E(
        this._lexer.source,
        this._lexer.token.start,
        `${b(
          this._lexer.token
        )} is reserved and cannot be used for an enum value.`
      );
    return this.parseName();
  }
  /**
   * InputObjectTypeDefinition :
   *   - Description? input Name Directives[Const]? InputFieldsDefinition?
   */
  parseInputObjectTypeDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("input");
    const s = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
    return this.node(t, {
      kind: p.INPUT_OBJECT_TYPE_DEFINITION,
      description: n,
      name: s,
      directives: i,
      fields: r
    });
  }
  /**
   * ```
   * InputFieldsDefinition : { InputValueDefinition+ }
   * ```
   */
  parseInputFieldsDefinition() {
    return this.optionalMany(
      a.BRACE_L,
      this.parseInputValueDef,
      a.BRACE_R
    );
  }
  /**
   * TypeSystemExtension :
   *   - SchemaExtension
   *   - TypeExtension
   *
   * TypeExtension :
   *   - ScalarTypeExtension
   *   - ObjectTypeExtension
   *   - InterfaceTypeExtension
   *   - UnionTypeExtension
   *   - EnumTypeExtension
   *   - InputObjectTypeDefinition
   */
  parseTypeSystemExtension() {
    const t = this._lexer.lookahead();
    if (t.kind === a.NAME)
      switch (t.value) {
        case "schema":
          return this.parseSchemaExtension();
        case "scalar":
          return this.parseScalarTypeExtension();
        case "type":
          return this.parseObjectTypeExtension();
        case "interface":
          return this.parseInterfaceTypeExtension();
        case "union":
          return this.parseUnionTypeExtension();
        case "enum":
          return this.parseEnumTypeExtension();
        case "input":
          return this.parseInputObjectTypeExtension();
      }
    throw this.unexpected(t);
  }
  /**
   * ```
   * SchemaExtension :
   *  - extend schema Directives[Const]? { OperationTypeDefinition+ }
   *  - extend schema Directives[Const]
   * ```
   */
  parseSchemaExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("schema");
    const n = this.parseConstDirectives(), s = this.optionalMany(
      a.BRACE_L,
      this.parseOperationTypeDefinition,
      a.BRACE_R
    );
    if (n.length === 0 && s.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.SCHEMA_EXTENSION,
      directives: n,
      operationTypes: s
    });
  }
  /**
   * ScalarTypeExtension :
   *   - extend scalar Name Directives[Const]
   */
  parseScalarTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("scalar");
    const n = this.parseName(), s = this.parseConstDirectives();
    if (s.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.SCALAR_TYPE_EXTENSION,
      name: n,
      directives: s
    });
  }
  /**
   * ObjectTypeExtension :
   *  - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
   *  - extend type Name ImplementsInterfaces? Directives[Const]
   *  - extend type Name ImplementsInterfaces
   */
  parseObjectTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("type");
    const n = this.parseName(), s = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), r = this.parseFieldsDefinition();
    if (s.length === 0 && i.length === 0 && r.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.OBJECT_TYPE_EXTENSION,
      name: n,
      interfaces: s,
      directives: i,
      fields: r
    });
  }
  /**
   * InterfaceTypeExtension :
   *  - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
   *  - extend interface Name ImplementsInterfaces? Directives[Const]
   *  - extend interface Name ImplementsInterfaces
   */
  parseInterfaceTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("interface");
    const n = this.parseName(), s = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), r = this.parseFieldsDefinition();
    if (s.length === 0 && i.length === 0 && r.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.INTERFACE_TYPE_EXTENSION,
      name: n,
      interfaces: s,
      directives: i,
      fields: r
    });
  }
  /**
   * UnionTypeExtension :
   *   - extend union Name Directives[Const]? UnionMemberTypes
   *   - extend union Name Directives[Const]
   */
  parseUnionTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("union");
    const n = this.parseName(), s = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
    if (s.length === 0 && i.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.UNION_TYPE_EXTENSION,
      name: n,
      directives: s,
      types: i
    });
  }
  /**
   * EnumTypeExtension :
   *   - extend enum Name Directives[Const]? EnumValuesDefinition
   *   - extend enum Name Directives[Const]
   */
  parseEnumTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("enum");
    const n = this.parseName(), s = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
    if (s.length === 0 && i.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.ENUM_TYPE_EXTENSION,
      name: n,
      directives: s,
      values: i
    });
  }
  /**
   * InputObjectTypeExtension :
   *   - extend input Name Directives[Const]? InputFieldsDefinition
   *   - extend input Name Directives[Const]
   */
  parseInputObjectTypeExtension() {
    const t = this._lexer.token;
    this.expectKeyword("extend"), this.expectKeyword("input");
    const n = this.parseName(), s = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
    if (s.length === 0 && i.length === 0)
      throw this.unexpected();
    return this.node(t, {
      kind: p.INPUT_OBJECT_TYPE_EXTENSION,
      name: n,
      directives: s,
      fields: i
    });
  }
  /**
   * ```
   * DirectiveDefinition :
   *   - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
   * ```
   */
  parseDirectiveDefinition() {
    const t = this._lexer.token, n = this.parseDescription();
    this.expectKeyword("directive"), this.expectToken(a.AT);
    const s = this.parseName(), i = this.parseArgumentDefs(), r = this.expectOptionalKeyword("repeatable");
    this.expectKeyword("on");
    const o = this.parseDirectiveLocations();
    return this.node(t, {
      kind: p.DIRECTIVE_DEFINITION,
      description: n,
      name: s,
      arguments: i,
      repeatable: r,
      locations: o
    });
  }
  /**
   * DirectiveLocations :
   *   - `|`? DirectiveLocation
   *   - DirectiveLocations | DirectiveLocation
   */
  parseDirectiveLocations() {
    return this.delimitedMany(a.PIPE, this.parseDirectiveLocation);
  }
  /*
   * DirectiveLocation :
   *   - ExecutableDirectiveLocation
   *   - TypeSystemDirectiveLocation
   *
   * ExecutableDirectiveLocation : one of
   *   `QUERY`
   *   `MUTATION`
   *   `SUBSCRIPTION`
   *   `FIELD`
   *   `FRAGMENT_DEFINITION`
   *   `FRAGMENT_SPREAD`
   *   `INLINE_FRAGMENT`
   *
   * TypeSystemDirectiveLocation : one of
   *   `SCHEMA`
   *   `SCALAR`
   *   `OBJECT`
   *   `FIELD_DEFINITION`
   *   `ARGUMENT_DEFINITION`
   *   `INTERFACE`
   *   `UNION`
   *   `ENUM`
   *   `ENUM_VALUE`
   *   `INPUT_OBJECT`
   *   `INPUT_FIELD_DEFINITION`
   */
  parseDirectiveLocation() {
    const t = this._lexer.token, n = this.parseName();
    if (Object.prototype.hasOwnProperty.call(Z, n.value))
      return n;
    throw this.unexpected(t);
  }
  // Core parsing utility functions
  /**
   * Returns a node that, if configured to do so, sets a "loc" field as a
   * location object, used to identify the place in the source that created a
   * given parsed object.
   */
  node(t, n) {
    return this._options.noLocation !== !0 && (n.loc = new ot(
      t,
      this._lexer.lastToken,
      this._lexer.source
    )), n;
  }
  /**
   * Determines if the next token is of a given kind
   */
  peek(t) {
    return this._lexer.token.kind === t;
  }
  /**
   * If the next token is of the given kind, return that token after advancing the lexer.
   * Otherwise, do not change the parser state and throw an error.
   */
  expectToken(t) {
    const n = this._lexer.token;
    if (n.kind === t)
      return this.advanceLexer(), n;
    throw E(
      this._lexer.source,
      n.start,
      `Expected ${we(t)}, found ${b(n)}.`
    );
  }
  /**
   * If the next token is of the given kind, return "true" after advancing the lexer.
   * Otherwise, do not change the parser state and return "false".
   */
  expectOptionalToken(t) {
    return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
  }
  /**
   * If the next token is a given keyword, advance the lexer.
   * Otherwise, do not change the parser state and throw an error.
   */
  expectKeyword(t) {
    const n = this._lexer.token;
    if (n.kind === a.NAME && n.value === t)
      this.advanceLexer();
    else
      throw E(
        this._lexer.source,
        n.start,
        `Expected "${t}", found ${b(n)}.`
      );
  }
  /**
   * If the next token is a given keyword, return "true" after advancing the lexer.
   * Otherwise, do not change the parser state and return "false".
   */
  expectOptionalKeyword(t) {
    const n = this._lexer.token;
    return n.kind === a.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
  }
  /**
   * Helper function for creating an error when an unexpected lexed token is encountered.
   */
  unexpected(t) {
    const n = t != null ? t : this._lexer.token;
    return E(
      this._lexer.source,
      n.start,
      `Unexpected ${b(n)}.`
    );
  }
  /**
   * Returns a possibly empty list of parse nodes, determined by the parseFn.
   * This list begins with a lex token of openKind and ends with a lex token of closeKind.
   * Advances the parser to the next lex token after the closing token.
   */
  any(t, n, s) {
    this.expectToken(t);
    const i = [];
    for (; !this.expectOptionalToken(s); )
      i.push(n.call(this));
    return i;
  }
  /**
   * Returns a list of parse nodes, determined by the parseFn.
   * It can be empty only if open token is missing otherwise it will always return non-empty list
   * that begins with a lex token of openKind and ends with a lex token of closeKind.
   * Advances the parser to the next lex token after the closing token.
   */
  optionalMany(t, n, s) {
    if (this.expectOptionalToken(t)) {
      const i = [];
      do
        i.push(n.call(this));
      while (!this.expectOptionalToken(s));
      return i;
    }
    return [];
  }
  /**
   * Returns a non-empty list of parse nodes, determined by the parseFn.
   * This list begins with a lex token of openKind and ends with a lex token of closeKind.
   * Advances the parser to the next lex token after the closing token.
   */
  many(t, n, s) {
    this.expectToken(t);
    const i = [];
    do
      i.push(n.call(this));
    while (!this.expectOptionalToken(s));
    return i;
  }
  /**
   * Returns a non-empty list of parse nodes, determined by the parseFn.
   * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
   * Advances the parser to the next lex token after last item in the list.
   */
  delimitedMany(t, n) {
    this.expectOptionalToken(t);
    const s = [];
    do
      s.push(n.call(this));
    while (this.expectOptionalToken(t));
    return s;
  }
  advanceLexer() {
    const { maxTokens: t } = this._options, n = this._lexer.advance();
    if (t !== void 0 && n.kind !== a.EOF && (++this._tokenCounter, this._tokenCounter > t))
      throw E(
        this._lexer.source,
        n.start,
        `Document contains more that ${t} tokens. Parsing aborted.`
      );
  }
}
function b(e) {
  const t = e.value;
  return we(e.kind) + (t != null ? ` "${t}"` : "");
}
function we(e) {
  return ft(e) ? `"${e}"` : e;
}
class v extends Error {
  constructor(t, n) {
    const s = `${v.extractMessage(t)}: ${JSON.stringify({
      response: t,
      request: n
    })}`;
    super(s), Object.setPrototypeOf(this, v.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, v);
  }
  static extractMessage(t) {
    var n, s, i;
    return (i = (s = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : s.message) != null ? i : `GraphQL Error (Code: ${t.status})`;
  }
}
var wn = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
function Rt(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var te = { exports: {} };
(function(e, t) {
  t = e.exports = n, t.getSerialize = s;
  function n(i, r, o, l) {
    return JSON.stringify(i, s(r, l), o);
  }
  function s(i, r) {
    var o = [], l = [];
    return r == null && (r = function(c, u) {
      return o[0] === u ? "[Circular ~]" : "[Circular ~." + l.slice(0, o.indexOf(u)).join(".") + "]";
    }), function(c, u) {
      if (o.length > 0) {
        var h = o.indexOf(this);
        ~h ? o.splice(h + 1) : o.push(this), ~h ? l.splice(h, 1 / 0, c) : l.push(c), ~o.indexOf(u) && (u = r.call(this, c, u));
      } else o.push(u);
      return i == null ? u : i.call(this, c, u);
    };
  }
})(te, te.exports);
var bt = te.exports;
const Fn = /* @__PURE__ */ Rt(bt), Un = [
  "assert",
  "count",
  "countReset",
  "debug",
  "dir",
  "dirxml",
  "error",
  "group",
  "groupCollapsed",
  "groupEnd",
  "info",
  "log",
  "table",
  "time",
  "timeEnd",
  "timeLog",
  "trace",
  "warn"
];
var Te;
(function(e) {
  e.DeviceMemory = "DeviceMemory", e.ViewportHeight = "ViewportHeight", e.ViewportWidth = "ViewportWidth", e.ScreenHeight = "ScreenHeight", e.ScreenWidth = "ScreenWidth", e.ViewportArea = "ViewportArea";
})(Te || (Te = {}));
var ne;
(function(e) {
  e.Device = "Device", e.WebVital = "WebVital", e.Performance = "Performance", e.Frontend = "Frontend", e.Backend = "Backend";
})(ne || (ne = {}));
function Pn(e, t, n) {
  try {
    if (!(t in e))
      return () => {
      };
    const s = e[t], i = n(s);
    return typeof i == "function" && (i.prototype = i.prototype || {}, Object.defineProperties(i, {
      __rrweb_original__: {
        enumerable: !1,
        value: s
      }
    })), e[t] = i, () => {
      e[t] = s;
    };
  } catch (s) {
    return () => {
    };
  }
}
function wt(e) {
  if (!e || !e.outerHTML)
    return "";
  let t = "";
  for (; e.parentElement; ) {
    let n = e.localName;
    if (!n)
      break;
    n = n.toLowerCase();
    let s = e.parentElement, i = [];
    if (s.children && s.children.length > 0)
      for (let r = 0; r < s.children.length; r++) {
        let o = s.children[r];
        o.localName && o.localName.toLowerCase && o.localName.toLowerCase() === n && i.push(o);
      }
    i.length > 1 && (n += ":eq(" + i.indexOf(e) + ")"), t = n + (t ? ">" + t : ""), e = s;
  }
  return t;
}
function ie(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function Fe(e, t) {
  if (t === 0)
    return !0;
  const n = Object.keys(e);
  for (const s of n)
    if (ie(e[s]) && Fe(e[s], t - 1))
      return !0;
  return !1;
}
function Mn(e, t) {
  const n = {
    numOfKeysLimit: 50,
    depthOfLimit: 4
  };
  Object.assign(n, t);
  const s = [], i = [];
  return JSON.stringify(e, function(l, c) {
    if (s.length > 0) {
      const u = s.indexOf(this);
      ~u ? s.splice(u + 1) : s.push(this), ~u ? i.splice(u, 1 / 0, l) : i.push(l), ~s.indexOf(c) && (s[0] === c ? c = "[Circular ~]" : c = "[Circular ~." + i.slice(0, s.indexOf(c)).join(".") + "]");
    } else
      s.push(c);
    if (c == null)
      return c;
    if (r(c))
      return o(c);
    if (c instanceof Event) {
      const u = {};
      for (const h in c) {
        const f = c[h];
        Array.isArray(f) ? u[h] = wt(f.length ? f[0] : null) : u[h] = f;
      }
      return u;
    } else {
      if (c instanceof Node)
        return c instanceof HTMLElement ? c ? c.outerHTML : "" : c.nodeName;
      if (c instanceof Error)
        return c.name + ": " + c.message;
    }
    return c;
  });
  function r(l) {
    return ie(l) && Object.keys(l).length > n.numOfKeysLimit || typeof l == "function" ? !0 : l instanceof Event && l.isTrusted === !1 ? Object.keys(l).length === 1 : !!(ie(l) && Fe(l, n.depthOfLimit));
  }
  function o(l) {
    let c = l.toString();
    return n.stringLengthLimit && c.length > n.stringLengthLimit && (c = `${c.slice(0, n.stringLengthLimit)}...`), c;
  }
}
function Ft() {
  var e = document.createElement("canvas");
  return e.getContext && e.getContext("2d") ? e.toDataURL("image/webp").indexOf("data:image/webp") == 0 : !1;
}
function Vn() {
  return Ft() ? {
    type: "image/webp",
    quality: 0.9
  } : {
    type: "image/jpeg",
    quality: 0.6
  };
}
const Bn = 1e3, $n = 1e3 * 2, Gn = 4 * 60 * 60 * 1e3, Ue = 15 * 60 * 1e3, jn = {
  normal: {
    bytes: 1e7,
    time: 4 * 60 * 1e3
  },
  canvas: {
    bytes: 16e6,
    time: 5e3
  }
}, Yn = 100, Hn = "app.highlight.io";
/*! js-cookie v3.0.5 | MIT */
function w(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t];
    for (var s in n)
      e[s] = n[s];
  }
  return e;
}
var Ut = {
  read: function(e) {
    return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
  },
  write: function(e) {
    return encodeURIComponent(e).replace(
      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
      decodeURIComponent
    );
  }
};
function se(e, t) {
  function n(i, r, o) {
    if (typeof document != "undefined") {
      o = w({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
      var l = "";
      for (var c in o)
        o[c] && (l += "; " + c, o[c] !== !0 && (l += "=" + o[c].split(";")[0]));
      return document.cookie = i + "=" + e.write(r, i) + l;
    }
  }
  function s(i) {
    if (!(typeof document == "undefined" || arguments.length && !i)) {
      for (var r = document.cookie ? document.cookie.split("; ") : [], o = {}, l = 0; l < r.length; l++) {
        var c = r[l].split("="), u = c.slice(1).join("=");
        try {
          var h = decodeURIComponent(c[0]);
          if (o[h] = e.read(u, h), i === h)
            break;
        } catch (f) {
        }
      }
      return i ? o[i] : o;
    }
  }
  return Object.create(
    {
      set: n,
      get: s,
      remove: function(i, r) {
        n(
          i,
          "",
          w({}, r, {
            expires: -1
          })
        );
      },
      withAttributes: function(i) {
        return se(this.converter, w({}, this.attributes, i));
      },
      withConverter: function(i) {
        return se(w({}, this.converter, i), this.attributes);
      }
    },
    {
      attributes: { value: Object.freeze(t) },
      converter: { value: Object.freeze(e) }
    }
  );
}
var Q = se(Ut, { path: "/" }), Ne;
(function(e) {
  e.CLIENT_ID = "highlightClientID";
})(Ne || (Ne = {}));
let le = "localStorage", re = !0;
class Pt {
  constructor() {
    y(this, "storage", {});
  }
  getItem(t) {
    var n;
    return (n = this.storage[t]) != null ? n : "";
  }
  setItem(t, n) {
    this.storage[t] = n;
  }
  removeItem(t) {
    delete this.storage[t];
  }
}
class Mt {
  getItem(t) {
    var n;
    return (n = Q.get(t)) != null ? n : "";
  }
  setItem(t, n) {
    if (!re)
      return;
    const s = /* @__PURE__ */ new Date();
    s.setTime(s.getTime() + Ue), Q.set(t, n, { expires: s });
  }
  removeItem(t) {
    re && Q.remove(t);
  }
}
let Vt = new Pt();
const P = new Mt(), ue = () => {
  try {
    switch (le) {
      case "localStorage":
        return window.localStorage;
      case "sessionStorage":
        return window.sessionStorage;
    }
  } catch (e) {
    return Vt;
  }
}, Bt = (e) => {
  le = e;
}, ge = (e) => {
  re = e;
}, Pe = (e) => ue().getItem(e), Me = (e, t) => (P.setItem(e, t), ue().setItem(e, t)), $t = (e) => (P.removeItem(e), ue().removeItem(e)), Jn = (e) => {
  if (le === "sessionStorage") {
    console.warn("highlight.io cannot use local storage; segment integration will not work");
    return;
  }
  const t = window.localStorage.setItem;
  window.localStorage.setItem = function() {
    const [n, s] = arguments;
    e({ keyName: n, keyValue: s }), t.apply(this, [n, s]);
  };
};
var D;
(function(e) {
  e.SEGMENT_LAST_SENT_HASH_KEY = "HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY", e.SESSION_ID = "sessionID", e.SESSION_DATA = "sessionData", e.USER_IDENTIFIER = "highlightIdentifier", e.USER_OBJECT = "highlightUserObject";
})(D || (D = {}));
const $ = (e) => `${D.SESSION_DATA}_${e}`;
let Ve = "";
const qn = () => Ve, Gt = (e) => {
  e && (Ve = e);
}, jt = () => {
  var e;
  return (e = Pe(D.SESSION_ID)) != null ? e : "";
}, Yt = (e) => {
  Me(D.SESSION_ID, e);
}, Ht = (e) => {
  const t = $(e);
  return JSON.parse(Pe(t) || "{}");
}, Jt = (e) => {
  e || (e = jt());
  let t = Ht(e);
  if (t && t.lastPushTime && Date.now() - t.lastPushTime < Ue)
    return t;
  $t($(e));
}, qt = function(e) {
  if (!(e != null && e.sessionSecureID))
    return;
  const t = e.sessionSecureID;
  Gt(t), Me($(t), JSON.stringify(e));
}, Qt = function() {
  const e = P.getItem(D.SESSION_ID);
  Yt(e);
  const t = $(e), n = P.getItem(t);
  try {
    qt(JSON.parse(n));
  } catch (s) {
  }
};
var oe;
(function(e) {
  e.BillingQuotaExceeded = "BillingQuotaExceeded";
})(oe || (oe = {}));
const zt = 10, Xt = 1e3, Wt = 500, Kt = [oe.BillingQuotaExceeded.toString()], Zt = (e) => {
  var n;
  return ((n = e.response.errors) == null ? void 0 : n.find((s) => Kt.includes(s.message))) === void 0;
}, Qn = (e) => {
  const t = (n, s, i, r, o = 0) => fe(void 0, null, function* () {
    try {
      return yield n();
    } catch (l) {
      if (l instanceof v && !Zt(l))
        throw l;
      if (o < zt)
        return yield new Promise((c) => setTimeout(c, Xt + Wt * Math.pow(2, o))), yield t(n, s, i, r, o + 1);
      throw console.error(`highlight.io: [${e || e}] data request failed after ${o} retries`), l;
    }
  });
  return t;
}, g = "feature_flag", zn = `${g}.set.id`, en = `${g}.key`, Be = `${g}.context`, tn = `${Be}.key`, Xn = `${g}.provider.name`, nn = `${g}.variant`, sn = `${g}.result.variant`, rn = `${g}.provider_name`, Wn = `${g}.client_side_id`, on = `${g}.result.reason.inExperiment`, an = `${g}.result.variationIndex`, Kn = `${g}.app_version`, cn = "evaluation", ln = "$ld:telemetry:session:init", un = "$ld:telemetry:error", Ie = "$ld:telemetry:track", hn = "$ld:telemetry:metric", pn = "document_load";
function $e(e) {
  return e.includes("%") || e.includes(":") ? e.replace(/%/g, "%25").replace(/:/g, "%3A") : e;
}
function Ge(e) {
  return e.kind === "multi";
}
function F(e) {
  return Ge(e) ? Object.keys(e).sort().filter((t) => t !== "kind").map((t) => `${t}:${$e(e[t].key)}`).join(":") : e.key;
}
function _e(e) {
  return Ge(e) ? Object.keys(e).sort().filter((t) => t !== "kind").map((t) => ({
    [t]: $e(e[t].key)
  })).reduce((t, n) => I(I({}, t), n), {}) : e.key;
}
function Zn(e, t) {
  t.addHook({
    getMetadata: () => ({
      name: "highlight.run"
    }),
    afterIdentify: (n, s, i) => (e.log("LD.identify", "INFO", {
      key: F(n.context),
      context: JSON.stringify(_e(n.context)),
      timeout: n.timeout
    }), e.identify(F(n.context), {
      key: F(n.context),
      timeout: n.timeout
    }, "LaunchDarkly"), s),
    afterEvaluation: (n, s, i) => {
      var o, l;
      const r = {
        [en]: n.flagKey,
        [rn]: "LaunchDarkly",
        [nn]: JSON.stringify(i.value),
        [sn]: JSON.stringify(i.value),
        [on]: (o = i.reason) == null ? void 0 : o.inExperiment,
        [an]: (l = i.variationIndex) != null ? l : void 0
      };
      return n.context && (r[Be] = JSON.stringify(_e(n.context)), r[tn] = F(n.context)), e.startSpan(cn, r, (c) => {
        c && c.addEvent(g, r);
      }), s;
    }
  });
}
class fn {
  constructor(t, n) {
    y(this, "client");
    y(this, "metadata");
    this.client = t, this.metadata = n;
  }
  getHooks(t) {
    return [];
  }
  init(t) {
    this.client.track(ln, {
      sessionSecureID: t
    });
  }
  recordGauge(t, n) {
    n.category !== ne.WebVital && n.name !== pn || n.name !== "Jank" && this.client.track(`${hn}:${n.name.toLowerCase()}`, R(I({}, n), {
      sessionSecureID: t
    }), n.value);
  }
  identify(t, n, s = {}, i) {
  }
  error(t, n) {
    this.client.track(un, R(I({}, n), {
      sessionSecureID: t
    }));
  }
  track(t, n) {
    const s = n.event;
    this.client.track(s ? `${Ie}:${s}` : Ie, R(I({}, n), {
      sessionSecureID: t
    }));
  }
}
class ei extends et {
  constructor(n, s) {
    super();
    y(this, "client");
    this.client = new fn(n, s);
  }
  getHooks(n) {
    return [
      {
        getMetadata: () => ({
          name: "highlight.run/ld"
        }),
        afterIdentify: (s, i, r) => (this.load(this.client), i)
      }
    ];
  }
  init(n) {
    return this._bufferCall("init", [n]);
  }
  recordGauge(n, s) {
    return this._bufferCall("recordGauge", [n, s]);
  }
  identify(n, s, i = {}, r) {
    return this._bufferCall("identify", [
      n,
      s,
      i,
      r
    ]);
  }
  error(n, s) {
    return this._bufferCall("error", [n, s]);
  }
  track(n, s) {
    return this._bufferCall("track", [n, s]);
  }
}
var _;
(function(e) {
  e[e.All = 0] = "All", e[e.Two = 1] = "Two", e[e.One = 2] = "One";
})(_ || (_ = {}));
let N, he;
function ti(e, t) {
  return e.nodeType, Node.ELEMENT_NODE, ae(e);
  return dn(e, t);
}
function ni(e) {
  if (e.id.length)
    return `#${e.id}`;
  if (e.classList.length) {
    let t = [];
    for (const n of e.classList)
      t.push(`.${n}`);
    return `${e.nodeName.toLowerCase()}${t.join(",")}`;
  }
  return e.nodeName.toLowerCase();
}
function dn(e, t) {
  if (e.tagName.toLowerCase() === "html")
    return "html";
  try {
    const n = {
      root: document.body,
      idName: (i) => !0,
      className: (i) => !0,
      tagName: (i) => !0,
      attr: (i, r) => !1,
      seedMinLength: 1,
      optimizedMinLength: 2,
      threshold: 50,
      maxNumberOfTries: 1e3,
      optimized: !0
    };
    N = I(I({}, n), t), he = En(N.root, n);
    let s = z(e, _.All, () => z(e, _.Two, () => z(e, _.One)));
    if (s) {
      if (N.optimized) {
        const i = He(Je(s, e));
        i.length > 0 && (s = i[0]);
      }
      return G(s);
    } else
      return ae(e);
  } catch (n) {
    return ae(e);
  }
}
function En(e, t) {
  return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
}
function z(e, t, n) {
  let s = null, i = [], r = e, o = 0;
  for (; r && r !== N.root.parentElement; ) {
    let l = U(mn(r)) || U(...Tn(r)) || U(...Nn(r)) || U(gn(r)) || [In()];
    const c = _n(r);
    if (t === _.All)
      c && (l = l.concat(l.filter(W).map((u) => X(u, c))));
    else if (t === _.Two)
      l = l.slice(0, 1), c && (l = l.concat(l.filter(W).map((u) => X(u, c))));
    else if (t === _.One) {
      const [u] = l = l.slice(0, 1);
      c && W(u) && (l = [X(u, c)]);
    }
    for (let u of l)
      u.level = o;
    if (i.push(l), i.length >= N.seedMinLength && (s = ye(i, n), s))
      break;
    r = r.parentElement, o++;
  }
  return s || (s = ye(i, n)), s;
}
function ye(e, t) {
  const n = He(Ye(e));
  if (n.length > N.threshold)
    return t ? t() : null;
  for (let s of n)
    if (je(s))
      return s;
  return null;
}
function G(e) {
  let t = e[0], n = t.name;
  for (let s = 1; s < e.length; s++) {
    const i = e[s].level || 0;
    t.level === i - 1 ? n = `${e[s].name} > ${n}` : n = `${e[s].name} ${n}`, t = e[s];
  }
  return n;
}
function Ae(e) {
  return e.map((t) => t.penalty).reduce((t, n) => t + n, 0);
}
function je(e) {
  switch (he.querySelectorAll(G(e)).length) {
    case 0:
      return !0;
    case 1:
      return !0;
    default:
      return !1;
  }
}
function mn(e) {
  const t = e.getAttribute("id");
  return t && N.idName(t) ? {
    name: "#" + M(t, { isIdentifier: !0 }),
    penalty: 0
  } : null;
}
function Tn(e) {
  return Array.from(e.attributes).filter((n) => N.attr(n.name, n.value)).map((n) => ({
    name: "[" + M(n.name, { isIdentifier: !0 }) + '="' + M(n.value) + '"]',
    penalty: 0.5
  }));
}
function Nn(e) {
  return Array.from(e.classList).filter(N.className).map((n) => ({
    name: "." + M(n, { isIdentifier: !0 }),
    penalty: 1
  }));
}
function gn(e) {
  const t = e.tagName.toLowerCase();
  return N.tagName(t) ? {
    name: t,
    penalty: 2
  } : null;
}
function In() {
  return {
    name: "*",
    penalty: 3
  };
}
function _n(e) {
  const t = e.parentNode;
  if (!t)
    return null;
  let n = t.firstChild;
  if (!n)
    return null;
  let s = 0;
  for (; n && (n.nodeType === Node.ELEMENT_NODE && s++, n !== e); )
    n = n.nextSibling;
  return s;
}
function X(e, t) {
  return {
    name: e.name + `:nth-child(${t})`,
    penalty: e.penalty + 1
  };
}
function W(e) {
  return e.name !== "html" && !e.name.startsWith("#");
}
function U(...e) {
  const t = e.filter(yn);
  return t.length > 0 ? t : null;
}
function yn(e) {
  return e != null;
}
function* Ye(e, t = []) {
  if (e.length > 0)
    for (let n of e[0])
      yield* H(Ye(e.slice(1, e.length), t.concat(n)));
  else
    yield t;
}
function He(e) {
  return Array.from(e).sort((t, n) => Ae(t) - Ae(n));
}
function* Je(e, t, n = {
  counter: 0,
  visited: /* @__PURE__ */ new Map()
}) {
  if (e.length > 2 && e.length > N.optimizedMinLength)
    for (let s = 1; s < e.length - 1; s++) {
      if (n.counter > N.maxNumberOfTries)
        return;
      n.counter += 1;
      const i = [...e];
      i.splice(s, 1);
      const r = G(i);
      if (n.visited.has(r))
        return;
      je(i) && An(i, t) && (yield i, n.visited.set(r, !0), yield* H(Je(i, t, n)));
    }
}
function An(e, t) {
  return he.querySelector(G(e)) === t;
}
const On = /[ -,\.\/:-@\[-\^`\{-~]/, Sn = /[ -,\.\/:-@\[\]\^`\{-~]/, xn = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g, Dn = {
  escapeEverything: !1,
  isIdentifier: !1,
  quotes: "single",
  wrap: !1
};
function M(e, t = {}) {
  const n = I(I({}, Dn), t);
  n.quotes != "single" && n.quotes != "double" && (n.quotes = "single");
  const s = n.quotes == "double" ? '"' : "'", i = n.isIdentifier, r = e.charAt(0);
  let o = "", l = 0;
  const c = e.length;
  for (; l < c; ) {
    const u = e.charAt(l++);
    let h = u.charCodeAt(0), f;
    if (h < 32 || h > 126) {
      if (h >= 55296 && h <= 56319 && l < c) {
        const m = e.charCodeAt(l++);
        (m & 64512) == 56320 ? h = ((h & 1023) << 10) + (m & 1023) + 65536 : l--;
      }
      f = "\\" + h.toString(16).toUpperCase() + " ";
    } else
      n.escapeEverything ? On.test(u) ? f = "\\" + u : f = "\\" + h.toString(16).toUpperCase() + " " : /[\t\n\f\r\x0B]/.test(u) ? f = "\\" + h.toString(16).toUpperCase() + " " : u == "\\" || !i && (u == '"' && s == u || u == "'" && s == u) || i && Sn.test(u) ? f = "\\" + u : f = u;
    o += f;
  }
  return i && (/^-[-\d]/.test(o) ? o = "\\-" + o.slice(1) : /\d/.test(r) && (o = "\\3" + r + " " + o.slice(1))), o = o.replace(xn, function(u, h, f) {
    return h && h.length % 2 ? u : (h || "") + f;
  }), !i && n.wrap ? s + o + s : o;
}
const ae = (e) => {
  let t = "";
  const n = e.getAttribute("class"), s = e.getAttribute("id");
  return s && (t = t.concat(Oe(s, "#"))), n && (t = t.concat(Oe(n, "."))), t === "" && (t = t.concat(e.tagName.toLowerCase())), t;
}, Oe = (e, t) => `${t}${e.trim().split(" ").join(t)}`, Cn = () => {
  var r;
  const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  var n = "";
  const s = typeof window != "undefined" && ((r = window.crypto) == null ? void 0 : r.getRandomValues), i = new Uint32Array(28);
  s && window.crypto.getRandomValues(i);
  for (let o = 0; o < 28; o++)
    s ? n += t.charAt(i[o] % t.length) : n += t.charAt(Math.floor(Math.random() * t.length));
  return n;
};
class ii {
  constructor(t) {
    y(this, "sessionSecureID");
    y(this, "initCalled", !1);
    t != null && t.storageMode && Bt(t == null ? void 0 : t.storageMode), ge(!!(t != null && t.sessionCookie)), t != null && t.sessionCookie ? Qt() : ge(!1);
    let n = Jt();
    this.sessionSecureID = Cn(), n != null && n.sessionSecureID && (this.sessionSecureID = n.sessionSecureID), !this.initCalled && (this.initCalled = !0);
  }
}
export {
  en as $,
  Un as A,
  jn as B,
  v as C,
  F as D,
  Mn as E,
  Bn as F,
  Cn as G,
  Hn as H,
  Pn as I,
  qn as J,
  p as K,
  ei as L,
  ne as M,
  zt as N,
  pn as O,
  ii as P,
  at as Q,
  nn as R,
  D as S,
  _e as T,
  cn as U,
  Yn as V,
  g as W,
  Kn as X,
  zn as Y,
  Wn as Z,
  Xn as _,
  Zn as a,
  Be as a0,
  tn as a1,
  Bt as a2,
  ge as b,
  Re as c,
  J as d,
  bn as e,
  Rt as f,
  Jt as g,
  wn as h,
  kn as i,
  ti as j,
  Pe as k,
  Qt as l,
  Jn as m,
  Me as n,
  Vn as o,
  Rn as p,
  Qn as q,
  $t as r,
  Fn as s,
  Yt as t,
  qt as u,
  Ne as v,
  Te as w,
  ni as x,
  Gn as y,
  $n as z
};
//# sourceMappingURL=common-TyzI476o.js.map
