!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((e="undefined"!=typeof globalThis?globalThis:e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.graphql=n())}(this,(function(){"use strict";var e=function(e,n){const t=new SyntaxError(e+" ("+n.start.line+":"+n.start.column+")");return t.loc=n,t};var n={hasPragma:function(e){return/^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(e)},insertPragma:function(e){return"# @format\n\n"+e}};function t(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==n&&t.path)}},t.exports),t.exports}var i=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.SYMBOL_TO_STRING_TAG=n.SYMBOL_ASYNC_ITERATOR=n.SYMBOL_ITERATOR=void 0;var t="function"==typeof Symbol?Symbol.iterator:"@@iterator";n.SYMBOL_ITERATOR=t;var i="function"==typeof Symbol?Symbol.asyncIterator:"@@asyncIterator";n.SYMBOL_ASYNC_ITERATOR=i;var r="function"==typeof Symbol?Symbol.toStringTag:"@@toStringTag";n.SYMBOL_TO_STRING_TAG=r})),r=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,n){if(!Boolean(e))throw new Error(n)}})),o=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0;var t,o=(t=r)&&t.__esModule?t:{default:t};function a(e,n){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};this.body=e,this.name=n,this.locationOffset=t,this.locationOffset.line>0||(0,o.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,o.default)(0,"column in locationOffset is 1-indexed and must be positive.")}var n,t,r;return n=e,(t=[{key:i.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}])&&a(n.prototype,t),r&&a(n,r),e}();n.Source=s})),a=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getLocation=function(e,n){var t,i=/\r\n|[\n\r]/g,r=1,o=n+1;for(;(t=i.exec(e.body))&&t.index120){for(var h=Math.floor(l/80),T=l%80,v=[],E=0;E",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});n.TokenKind=t})),l=t((function(e,n){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){return"object"==t(e)&&null!==e}})),d=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.printError=y,n.GraphQLError=void 0;var t,r=(t=l)&&t.__esModule?t:{default:t};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,n){for(var t=0;t0&&r(n[0]);)n.shift();for(;n.length>0&&r(n[n.length-1]);)n.pop();return n.join("\n")},n.getBlockStringIndentation=t,n.printBlockString=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=-1===e.indexOf("\n"),r=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!i||o||a||t,c="";!s||i&&r||(c+="\n"+n);c+=n?e.replace(/\n/g,"\n"+n):e,s&&(c+="\n");return'"""'+c.replace(/"""/g,'\\"""')+'"""'}})),y=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isPunctuatorTokenKind=function(e){return e===u.TokenKind.BANG||e===u.TokenKind.DOLLAR||e===u.TokenKind.AMP||e===u.TokenKind.PAREN_L||e===u.TokenKind.PAREN_R||e===u.TokenKind.SPREAD||e===u.TokenKind.COLON||e===u.TokenKind.EQUALS||e===u.TokenKind.AT||e===u.TokenKind.BRACKET_L||e===u.TokenKind.BRACKET_R||e===u.TokenKind.BRACE_L||e===u.TokenKind.PIPE||e===u.TokenKind.BRACE_R},n.Lexer=void 0;var t=function(){function e(e){var n=new v.Token(u.TokenKind.SOF,0,0,0,0,null);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var n=e.prototype;return n.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},n.lookahead=function(){var e=this.token;if(e.kind!==u.TokenKind.EOF)do{var n;e=null!==(n=e.next)&&void 0!==n?n:e.next=r(this,e)}while(e.kind===u.TokenKind.COMMENT);return e},e}();function i(e){return isNaN(e)?u.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function r(e,n){var t=e.source,r=t.body,s=r.length,c=function(e,n,t){var i=e.length,r=n;for(;r=s)return new v.Token(u.TokenKind.EOF,s,s,l,d,n);var f=r.charCodeAt(c);switch(f){case 33:return new v.Token(u.TokenKind.BANG,c,c+1,l,d,n);case 35:return function(e,n,t,i,r){var o,a=e.body,s=n;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new v.Token(u.TokenKind.COMMENT,n,s,t,i,r,a.slice(n+1,s))}(t,c,l,d,n);case 36:return new v.Token(u.TokenKind.DOLLAR,c,c+1,l,d,n);case 38:return new v.Token(u.TokenKind.AMP,c,c+1,l,d,n);case 40:return new v.Token(u.TokenKind.PAREN_L,c,c+1,l,d,n);case 41:return new v.Token(u.TokenKind.PAREN_R,c,c+1,l,d,n);case 46:if(46===r.charCodeAt(c+1)&&46===r.charCodeAt(c+2))return new v.Token(u.TokenKind.SPREAD,c,c+3,l,d,n);break;case 58:return new v.Token(u.TokenKind.COLON,c,c+1,l,d,n);case 61:return new v.Token(u.TokenKind.EQUALS,c,c+1,l,d,n);case 64:return new v.Token(u.TokenKind.AT,c,c+1,l,d,n);case 91:return new v.Token(u.TokenKind.BRACKET_L,c,c+1,l,d,n);case 93:return new v.Token(u.TokenKind.BRACKET_R,c,c+1,l,d,n);case 123:return new v.Token(u.TokenKind.BRACE_L,c,c+1,l,d,n);case 124:return new v.Token(u.TokenKind.PIPE,c,c+1,l,d,n);case 125:return new v.Token(u.TokenKind.BRACE_R,c,c+1,l,d,n);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,n,t,i,r){var o=e.body,a=o.length,s=n+1,c=0;for(;s!==a&&!isNaN(c=o.charCodeAt(s))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new v.Token(u.TokenKind.NAME,n,s,t,i,r,o.slice(n,s))}(t,c,l,d,n);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,n,t,r,a,s){var c=e.body,l=t,d=n,f=!1;45===l&&(l=c.charCodeAt(++d));if(48===l){if((l=c.charCodeAt(++d))>=48&&l<=57)throw(0,p.syntaxError)(e,d,"Invalid number, unexpected digit after 0: ".concat(i(l),"."))}else d=o(e,d,l),l=c.charCodeAt(d);46===l&&(f=!0,l=c.charCodeAt(++d),d=o(e,d,l),l=c.charCodeAt(d));69!==l&&101!==l||(f=!0,43!==(l=c.charCodeAt(++d))&&45!==l||(l=c.charCodeAt(++d)),d=o(e,d,l),l=c.charCodeAt(d));if(46===l||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(l))throw(0,p.syntaxError)(e,d,"Invalid number, expected digit but got: ".concat(i(l),"."));return new v.Token(f?u.TokenKind.FLOAT:u.TokenKind.INT,n,d,r,a,s,c.slice(n,d))}(t,c,f,l,d,n);case 34:return 34===r.charCodeAt(c+1)&&34===r.charCodeAt(c+2)?function(e,n,t,r,o,a){var s=e.body,c=n+3,l=c,d=0,f="";for(;c=48&&a<=57){do{a=r.charCodeAt(++o)}while(a>=48&&a<=57);return o}throw(0,p.syntaxError)(e,o,"Invalid number, expected digit but got: ".concat(i(a),"."))}function a(e,n,t,i){return s(e)<<12|s(n)<<8|s(t)<<4|s(i)}function s(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}n.Lexer=t})),N=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){return o(e,[])};var t,i=(t=h)&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,n){switch(r(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,n){if(-1!==n.indexOf(e))return"[Circular]";var t=[].concat(n,[e]),r=function(e){var n=e[String(i.default)];if("function"==typeof n)return n;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var a=r.call(e);if(a!==e)return"string"==typeof a?a:o(a,t)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>2)return"[Array]";for(var t=Math.min(10,e.length),i=e.length-t,r=[],a=0;a1&&r.push("... ".concat(i," more items"));return"["+r.join(", ")+"]"}(e,t);return function(e,n){var t=Object.keys(e);if(0===t.length)return"{}";if(n.length>2)return"["+function(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){var t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return n}(e)+"]";return"{ "+t.map((function(t){return t+": "+o(e[t],n)})).join(", ")+" }"}(e,t)}(e,n);default:return String(e)}}})),m=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectiveLocation=void 0;var t=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});n.DirectiveLocation=t})),k=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.parse=function(e,n){return new s(e,n).parseDocument()},n.parseValue=function(e,n){var t=new s(e,n);t.expectToken(u.TokenKind.SOF);var i=t.parseValueLiteral(!1);return t.expectToken(u.TokenKind.EOF),i},n.parseType=function(e,n){var t=new s(e,n);t.expectToken(u.TokenKind.SOF);var i=t.parseTypeReference();return t.expectToken(u.TokenKind.EOF),i};var t=a(N),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(e,n){var r="string"==typeof e?new o.Source(e):e;r instanceof o.Source||(0,i.default)(0,"Must provide Source. Received: ".concat((0,t.default)(r),".")),this._lexer=new y.Lexer(r),this._options=n}var n=e.prototype;return n.parseName=function(){var e=this.expectToken(u.TokenKind.NAME);return{kind:c.Kind.NAME,value:e.value,loc:this.loc(e)}},n.parseDocument=function(){var e=this._lexer.token;return{kind:c.Kind.DOCUMENT,definitions:this.many(u.TokenKind.SOF,this.parseDefinition,u.TokenKind.EOF),loc:this.loc(e)}},n.parseDefinition=function(){if(this.peek(u.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(u.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},n.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(u.TokenKind.BRACE_L))return{kind:c.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var n,t=this.parseOperationType();return this.peek(u.TokenKind.NAME)&&(n=this.parseName()),{kind:c.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},n.parseOperationType=function(){var e=this.expectToken(u.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},n.parseVariableDefinitions=function(){return this.optionalMany(u.TokenKind.PAREN_L,this.parseVariableDefinition,u.TokenKind.PAREN_R)},n.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:c.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},n.parseVariable=function(){var e=this._lexer.token;return this.expectToken(u.TokenKind.DOLLAR),{kind:c.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},n.parseSelectionSet=function(){var e=this._lexer.token;return{kind:c.Kind.SELECTION_SET,selections:this.many(u.TokenKind.BRACE_L,this.parseSelection,u.TokenKind.BRACE_R),loc:this.loc(e)}},n.parseSelection=function(){return this.peek(u.TokenKind.SPREAD)?this.parseFragment():this.parseField()},n.parseField=function(){var e,n,t=this._lexer.token,i=this.parseName();return this.expectOptionalToken(u.TokenKind.COLON)?(e=i,n=this.parseName()):n=i,{kind:c.Kind.FIELD,alias:e,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(t)}},n.parseArguments=function(e){var n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.TokenKind.PAREN_L,n,u.TokenKind.PAREN_R)},n.parseArgument=function(){var e=this._lexer.token,n=this.parseName();return this.expectToken(u.TokenKind.COLON),{kind:c.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(e)}},n.parseConstArgument=function(){var e=this._lexer.token;return{kind:c.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(u.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},n.parseFragment=function(){var e=this._lexer.token;this.expectToken(u.TokenKind.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(u.TokenKind.NAME)?{kind:c.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:c.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},n.parseFragmentDefinition=function(){var e,n=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:c.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}:{kind:c.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},n.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},n.parseValueLiteral=function(e){var n=this._lexer.token;switch(n.kind){case u.TokenKind.BRACKET_L:return this.parseList(e);case u.TokenKind.BRACE_L:return this.parseObject(e);case u.TokenKind.INT:return this._lexer.advance(),{kind:c.Kind.INT,value:n.value,loc:this.loc(n)};case u.TokenKind.FLOAT:return this._lexer.advance(),{kind:c.Kind.FLOAT,value:n.value,loc:this.loc(n)};case u.TokenKind.STRING:case u.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case u.TokenKind.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:c.Kind.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:c.Kind.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:c.Kind.NULL,loc:this.loc(n)};default:return{kind:c.Kind.ENUM,value:n.value,loc:this.loc(n)}}case u.TokenKind.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},n.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:c.Kind.STRING,value:e.value,block:e.kind===u.TokenKind.BLOCK_STRING,loc:this.loc(e)}},n.parseList=function(e){var n=this,t=this._lexer.token;return{kind:c.Kind.LIST,values:this.any(u.TokenKind.BRACKET_L,(function(){return n.parseValueLiteral(e)}),u.TokenKind.BRACKET_R),loc:this.loc(t)}},n.parseObject=function(e){var n=this,t=this._lexer.token;return{kind:c.Kind.OBJECT,fields:this.any(u.TokenKind.BRACE_L,(function(){return n.parseObjectField(e)}),u.TokenKind.BRACE_R),loc:this.loc(t)}},n.parseObjectField=function(e){var n=this._lexer.token,t=this.parseName();return this.expectToken(u.TokenKind.COLON),{kind:c.Kind.OBJECT_FIELD,name:t,value:this.parseValueLiteral(e),loc:this.loc(n)}},n.parseDirectives=function(e){for(var n=[];this.peek(u.TokenKind.AT);)n.push(this.parseDirective(e));return n},n.parseDirective=function(e){var n=this._lexer.token;return this.expectToken(u.TokenKind.AT),{kind:c.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(n)}},n.parseTypeReference=function(){var e,n=this._lexer.token;return this.expectOptionalToken(u.TokenKind.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(u.TokenKind.BRACKET_R),e={kind:c.Kind.LIST_TYPE,type:e,loc:this.loc(n)}):e=this.parseNamedType(),this.expectOptionalToken(u.TokenKind.BANG)?{kind:c.Kind.NON_NULL_TYPE,type:e,loc:this.loc(n)}:e},n.parseNamedType=function(){var e=this._lexer.token;return{kind:c.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},n.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===u.TokenKind.NAME)switch(e.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()}throw this.unexpected(e)},n.peekDescription=function(){return this.peek(u.TokenKind.STRING)||this.peek(u.TokenKind.BLOCK_STRING)},n.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},n.parseSchemaDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var t=this.parseDirectives(!0),i=this.many(u.TokenKind.BRACE_L,this.parseOperationTypeDefinition,u.TokenKind.BRACE_R);return{kind:c.Kind.SCHEMA_DEFINITION,description:n,directives:t,operationTypes:i,loc:this.loc(e)}},n.parseOperationTypeDefinition=function(){var e=this._lexer.token,n=this.parseOperationType();this.expectToken(u.TokenKind.COLON);var t=this.parseNamedType();return{kind:c.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:t,loc:this.loc(e)}},n.parseScalarTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var t=this.parseName(),i=this.parseDirectives(!0);return{kind:c.Kind.SCALAR_TYPE_DEFINITION,description:n,name:t,directives:i,loc:this.loc(e)}},n.parseObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var t=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:c.Kind.OBJECT_TYPE_DEFINITION,description:n,name:t,interfaces:i,directives:r,fields:o,loc:this.loc(e)}},n.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(u.TokenKind.AMP);do{var n;e.push(this.parseNamedType())}while(this.expectOptionalToken(u.TokenKind.AMP)||!0===(null===(n=this._options)||void 0===n?void 0:n.allowLegacySDLImplementsInterfaces)&&this.peek(u.TokenKind.NAME))}return e},n.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(u.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===u.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(u.TokenKind.BRACE_L,this.parseFieldDefinition,u.TokenKind.BRACE_R)},n.parseFieldDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),i=this.parseArgumentDefs();this.expectToken(u.TokenKind.COLON);var r=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:c.Kind.FIELD_DEFINITION,description:n,name:t,arguments:i,type:r,directives:o,loc:this.loc(e)}},n.parseArgumentDefs=function(){return this.optionalMany(u.TokenKind.PAREN_L,this.parseInputValueDef,u.TokenKind.PAREN_R)},n.parseInputValueDef=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName();this.expectToken(u.TokenKind.COLON);var i,r=this.parseTypeReference();this.expectOptionalToken(u.TokenKind.EQUALS)&&(i=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:c.Kind.INPUT_VALUE_DEFINITION,description:n,name:t,type:r,defaultValue:i,directives:o,loc:this.loc(e)}},n.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var t=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:c.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:t,interfaces:i,directives:r,fields:o,loc:this.loc(e)}},n.parseUnionTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var t=this.parseName(),i=this.parseDirectives(!0),r=this.parseUnionMemberTypes();return{kind:c.Kind.UNION_TYPE_DEFINITION,description:n,name:t,directives:i,types:r,loc:this.loc(e)}},n.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(u.TokenKind.EQUALS)){this.expectOptionalToken(u.TokenKind.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(u.TokenKind.PIPE))}return e},n.parseEnumTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var t=this.parseName(),i=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();return{kind:c.Kind.ENUM_TYPE_DEFINITION,description:n,name:t,directives:i,values:r,loc:this.loc(e)}},n.parseEnumValuesDefinition=function(){return this.optionalMany(u.TokenKind.BRACE_L,this.parseEnumValueDefinition,u.TokenKind.BRACE_R)},n.parseEnumValueDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),i=this.parseDirectives(!0);return{kind:c.Kind.ENUM_VALUE_DEFINITION,description:n,name:t,directives:i,loc:this.loc(e)}},n.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var t=this.parseName(),i=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();return{kind:c.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:t,directives:i,fields:r,loc:this.loc(e)}},n.parseInputFieldsDefinition=function(){return this.optionalMany(u.TokenKind.BRACE_L,this.parseInputValueDef,u.TokenKind.BRACE_R)},n.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===u.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},n.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),t=this.optionalMany(u.TokenKind.BRACE_L,this.parseOperationTypeDefinition,u.TokenKind.BRACE_R);if(0===n.length&&0===t.length)throw this.unexpected();return{kind:c.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:t,loc:this.loc(e)}},n.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),t=this.parseDirectives(!0);if(0===t.length)throw this.unexpected();return{kind:c.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:t,loc:this.loc(e)}},n.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),t=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===t.length&&0===i.length&&0===r.length)throw this.unexpected();return{kind:c.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:t,directives:i,fields:r,loc:this.loc(e)}},n.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),t=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===t.length&&0===i.length&&0===r.length)throw this.unexpected();return{kind:c.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:t,directives:i,fields:r,loc:this.loc(e)}},n.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),t=this.parseDirectives(!0),i=this.parseUnionMemberTypes();if(0===t.length&&0===i.length)throw this.unexpected();return{kind:c.Kind.UNION_TYPE_EXTENSION,name:n,directives:t,types:i,loc:this.loc(e)}},n.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),t=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();if(0===t.length&&0===i.length)throw this.unexpected();return{kind:c.Kind.ENUM_TYPE_EXTENSION,name:n,directives:t,values:i,loc:this.loc(e)}},n.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),t=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();if(0===t.length&&0===i.length)throw this.unexpected();return{kind:c.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:t,fields:i,loc:this.loc(e)}},n.parseDirectiveDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.TokenKind.AT);var t=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:c.Kind.DIRECTIVE_DEFINITION,description:n,name:t,arguments:i,repeatable:r,locations:o,loc:this.loc(e)}},n.parseDirectiveLocations=function(){this.expectOptionalToken(u.TokenKind.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(u.TokenKind.PIPE));return e},n.parseDirectiveLocation=function(){var e=this._lexer.token,n=this.parseName();if(void 0!==m.DirectiveLocation[n.value])return n;throw this.unexpected(e)},n.loc=function(e){var n;if(!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation))return new v.Location(e,this._lexer.lastToken,this._lexer.source)},n.peek=function(e){return this._lexer.token.kind===e},n.expectToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n;throw(0,p.syntaxError)(this._lexer.source,n.start,"Expected ".concat(d(e),", found ").concat(l(n),"."))},n.expectOptionalToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n},n.expectKeyword=function(e){var n=this._lexer.token;if(n.kind!==u.TokenKind.NAME||n.value!==e)throw(0,p.syntaxError)(this._lexer.source,n.start,'Expected "'.concat(e,'", found ').concat(l(n),"."));this._lexer.advance()},n.expectOptionalKeyword=function(e){var n=this._lexer.token;return n.kind===u.TokenKind.NAME&&n.value===e&&(this._lexer.advance(),!0)},n.unexpected=function(e){var n=null!=e?e:this._lexer.token;return(0,p.syntaxError)(this._lexer.source,n.start,"Unexpected ".concat(l(n),"."))},n.any=function(e,n,t){this.expectToken(e);for(var i=[];!this.expectOptionalToken(t);)i.push(n.call(this));return i},n.optionalMany=function(e,n,t){if(this.expectOptionalToken(e)){var i=[];do{i.push(n.call(this))}while(!this.expectOptionalToken(t));return i}return[]},n.many=function(e,n,t){this.expectToken(e);var i=[];do{i.push(n.call(this))}while(!this.expectOptionalToken(t));return i},e}();function l(e){var n=e.value;return d(e.kind)+(null!=n?' "'.concat(n,'"'):"")}function d(e){return(0,y.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}})),_=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.visit=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,s=void 0,c=Array.isArray(e),u=[e],l=-1,d=[],p=void 0,f=void 0,h=void 0,T=[],E=[],y=e;do{var N=++l===u.length,m=N&&0!==d.length;if(N){if(f=0===E.length?void 0:T[T.length-1],p=h,h=E.pop(),m){if(c)p=p.slice();else{for(var k={},_=0,O=Object.keys(p);_1&&void 0!==arguments[1]?arguments[1]:"";return null!==(n=null==e?void 0:e.filter((function(e){return e})).join(t))&&void 0!==n?n:""}function o(e){return e&&0!==e.length?"{\n"+s(r(e,"\n"))+"\n}":""}function a(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return n?e+n+t:""}function s(e){return e&&" "+e.replace(/\n/g,"\n ")}function c(e){return-1!==e.indexOf("\n")}function u(e){return e&&e.some(c)}})),I=t((function(e,n){function t(e){return e.kind===c.Kind.OPERATION_DEFINITION||e.kind===c.Kind.FRAGMENT_DEFINITION}function i(e){return e.kind===c.Kind.SCHEMA_DEFINITION||r(e)||e.kind===c.Kind.DIRECTIVE_DEFINITION}function r(e){return e.kind===c.Kind.SCALAR_TYPE_DEFINITION||e.kind===c.Kind.OBJECT_TYPE_DEFINITION||e.kind===c.Kind.INTERFACE_TYPE_DEFINITION||e.kind===c.Kind.UNION_TYPE_DEFINITION||e.kind===c.Kind.ENUM_TYPE_DEFINITION||e.kind===c.Kind.INPUT_OBJECT_TYPE_DEFINITION}function o(e){return e.kind===c.Kind.SCHEMA_EXTENSION||a(e)}function a(e){return e.kind===c.Kind.SCALAR_TYPE_EXTENSION||e.kind===c.Kind.OBJECT_TYPE_EXTENSION||e.kind===c.Kind.INTERFACE_TYPE_EXTENSION||e.kind===c.Kind.UNION_TYPE_EXTENSION||e.kind===c.Kind.ENUM_TYPE_EXTENSION||e.kind===c.Kind.INPUT_OBJECT_TYPE_EXTENSION}Object.defineProperty(n,"__esModule",{value:!0}),n.isDefinitionNode=function(e){return t(e)||i(e)||o(e)},n.isExecutableDefinitionNode=t,n.isSelectionNode=function(e){return e.kind===c.Kind.FIELD||e.kind===c.Kind.FRAGMENT_SPREAD||e.kind===c.Kind.INLINE_FRAGMENT},n.isValueNode=function(e){return e.kind===c.Kind.VARIABLE||e.kind===c.Kind.INT||e.kind===c.Kind.FLOAT||e.kind===c.Kind.STRING||e.kind===c.Kind.BOOLEAN||e.kind===c.Kind.NULL||e.kind===c.Kind.ENUM||e.kind===c.Kind.LIST||e.kind===c.Kind.OBJECT},n.isTypeNode=function(e){return e.kind===c.Kind.NAMED_TYPE||e.kind===c.Kind.LIST_TYPE||e.kind===c.Kind.NON_NULL_TYPE},n.isTypeSystemDefinitionNode=i,n.isTypeDefinitionNode=r,n.isTypeSystemExtensionNode=o,n.isTypeExtensionNode=a})),D=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return o.Source}}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return a.getLocation}}),Object.defineProperty(n,"printLocation",{enumerable:!0,get:function(){return s.printLocation}}),Object.defineProperty(n,"printSourceLocation",{enumerable:!0,get:function(){return s.printSourceLocation}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return c.Kind}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return u.TokenKind}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return y.Lexer}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return k.parse}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return k.parseValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return k.parseType}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return O.print}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return _.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return _.visitInParallel}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return _.getVisitFn}}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return _.BREAK}}),Object.defineProperty(n,"Location",{enumerable:!0,get:function(){return v.Location}}),Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return v.Token}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return I.isDefinitionNode}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return I.isExecutableDefinitionNode}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return I.isSelectionNode}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return I.isValueNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return I.isTypeNode}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return I.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return I.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return I.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return I.isTypeExtensionNode}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return m.DirectiveLocation}})})),b=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.locatedError=function(e,n,t){var i;if(Array.isArray(e.path))return e;return new d.GraphQLError(e.message,null!==(i=e.nodes)&&void 0!==i?i:n,e.source,e.positions,t,e)}})),x=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.formatError=function(e){var n;e||(0,i.default)(0,"Received null or undefined error.");var t=null!==(n=e.message)&&void 0!==n?n:"An unknown error occurred.",r=e.locations,o=e.path,a=e.extensions;return a?{message:t,locations:r,path:o,extensions:a}:{message:t,locations:r,path:o}};var t,i=(t=r)&&t.__esModule?t:{default:t}})),A=t((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return d.GraphQLError}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return d.printError}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return p.syntaxError}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return b.locatedError}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return x.formatError}})}));const{hasPragma:K}=n;return{parsers:{graphql:{parse:function(n){const t=D;try{const e=function(e,n){const t={allowLegacySDLImplementsInterfaces:!1,experimentalFragmentVariables:!0};try{return e(n,t)}catch(i){return t.allowLegacySDLImplementsInterfaces=!0,e(n,t)}}(t.parse,n);return e.comments=function(e){const n=[],{startToken:t}=e.loc;let{next:i}=t;for(;""!==i.kind;)"Comment"===i.kind&&(Object.assign(i,{column:i.column-1}),n.push(i)),i=i.next;return n}(e),function e(n){if(n&&"object"==typeof n){delete n.startToken,delete n.endToken,delete n.prev,delete n.next;for(const t in n)e(n[t])}return n}(e),e}catch(n){const{GraphQLError:t}=A;throw n instanceof t?e(n.message,{start:{line:n.locations[0].line,column:n.locations[0].column}}):n}},astFormat:"graphql",hasPragma:K,locStart:e=>"number"==typeof e.start?e.start:e.loc&&e.loc.start,locEnd:e=>"number"==typeof e.end?e.end:e.loc&&e.loc.end}}}}));