import { C as d } from "./codemirror.es-CVgHrv2u.js";
import { o as onlineParser, q as p, r as list, u as t } from "./index-B10SxoeJ.js";
import { r } from "./mode-indent.es-CX18p_8d.js";
import "./codemirror.es2-DH2syXui.js";
d.defineMode("graphql-results", (r$1) => {
  const u = onlineParser({
    eatWhitespace: (l) => l.eatSpace(),
    lexRules: o,
    parseRules: c,
    editorConfig: { tabSize: r$1.tabSize }
  });
  return {
    config: r$1,
    startState: u.startState,
    token: u.token,
    indent: r,
    electricInput: /^\s*[}\]]/,
    fold: "brace",
    closeBrackets: {
      pairs: '[]{}""',
      explode: "[]{}"
    }
  };
});
const o = {
  Punctuation: /^\[|]|\{|\}|:|,/,
  Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,
  String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,
  Keyword: /^true|false|null/
}, c = {
  Document: [p("{"), list("Entry", p(",")), p("}")],
  Entry: [t("String", "def"), p(":"), "Value"],
  Value(r2) {
    switch (r2.kind) {
      case "Number":
        return "NumberValue";
      case "String":
        return "StringValue";
      case "Punctuation":
        switch (r2.value) {
          case "[":
            return "ListValue";
          case "{":
            return "ObjectValue";
        }
        return null;
      case "Keyword":
        switch (r2.value) {
          case "true":
          case "false":
            return "BooleanValue";
          case "null":
            return "NullValue";
        }
        return null;
    }
  },
  NumberValue: [t("Number", "number")],
  StringValue: [t("String", "string")],
  BooleanValue: [t("Keyword", "builtin")],
  NullValue: [t("Keyword", "keyword")],
  ListValue: [p("["), list("Value", p(",")), p("]")],
  ObjectValue: [p("{"), list("ObjectField", p(",")), p("}")],
  ObjectField: [t("String", "property"), p(":"), "Value"]
};
//# sourceMappingURL=mode.es3-BrEsUN7a.js.map
