var Ae=Object.defineProperty,q=(e,t)=>{for(var i in t)Ae(e,i,{get:t[i],enumerable:!0})},De={};q(De,{languages:()=>Tt,options:()=>It,parsers:()=>ue,printers:()=>tn});var Oe=(e,t)=>(i,r,...n)=>i|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,n),_e=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},xe=Oe("replaceAll",function(){if(typeof this=="string")return _e}),$=xe,ye=()=>{},ke=ye,Ce="indent",ge="group",Se="if-break",J="line",Re="break-parent",be=ke;function I(e){return{type:Ce,contents:e}}var Le={type:Re};function A(e,t={}){return be(t.expandedStates),{type:ge,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function x(e,t="",i={}){return{type:Se,breakContents:e,flatContents:t,groupId:i.groupId}}function f(e,t){let i=[];for(let r=0;r<t.length;r++)r!==0&&i.push(e),i.push(t[r]);return i}var b={type:J},p={type:J,soft:!0},Fe={type:J,hard:!0},u=[Fe,Le];function X(e){return(t,i,r)=>{if(i===!1)return!1;let n=!!r?.backwards,{length:s}=t,c=i;for(;c>=0&&c<s;){let l=t.charAt(c);if(e instanceof RegExp){if(!e.test(l))return c}else if(!e.includes(l))return c;n?c--:c++}return c===-1||c===s?c:!1}}var se=X(" 	"),we=X(",; 	"),Pe=X(/[^\n\r]/),Q=e=>e===`
`||e==="\r"||e==="\u2028"||e==="\u2029";function Me(e,t,i){if(t===!1)return!1;let r=!!i?.backwards,n=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&n===`
`)return t-2;if(Q(n))return t-1}else{if(n==="\r"&&e.charAt(t+1)===`
`)return t+2;if(Q(n))return t+1}return t}var ae=Me;function Ve(e,t,i={}){let r=se(e,i.backwards?t-1:t,i),n=ae(e,r,i);return r!==n}var Ue=Ve,Be=()=>!0;function Ge(e,t){let i=e.node;return i.printed=!0,t.printer.printComment(e,t)}function z(e,t,i={}){let{indent:r=!1,marker:n,filter:s=Be}=i,c=new Set(e.node?.comments?.filter(T=>!(T.leading||T.trailing||T.marker!==n||!s(T))));if(c.size===0)return"";let l=e.map(({node:T})=>c.has(T)?Ge(e,t):"","comments").filter(Boolean),E=f(u,l);return r?I([u,E]):E}function Ke(e){return Array.isArray(e)&&e.length>0}var v=Ke,je=class extends Error{name="UnexpectedNodeError";constructor(e,t,i="type"){super(`Unexpected ${t} node ${i}: ${JSON.stringify(e[i])}.`),this.node=e}},$e=je,P=null;function V(e){if(P!==null&&typeof P.property){let t=P;return P=V.prototype=null,t}return P=V.prototype=e??Object.create(null),new V}var Ye=10;for(let e=0;e<=Ye;e++)V();function qe(e){return V(e)}function Je(e,t="type"){qe(e);function i(r){let n=r[t],s=e[n];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:r});return s}return i}var Xe=Je,N=[["name"],["name","value"],["type"],["description","name","directives"],["description","name","interfaces","directives","fields"],["name","directives"],["name","interfaces","directives","fields"]],Qe={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:N[0],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:N[1],FragmentArgument:N[1],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:N[1],Directive:["name","arguments"],NamedType:N[0],ListType:N[2],NonNullType:N[2],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:N[2],ScalarTypeDefinition:N[3],ObjectTypeDefinition:N[4],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:N[4],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:N[3],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:N[5],ScalarTypeExtension:N[5],ObjectTypeExtension:N[6],InterfaceTypeExtension:N[6],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},ze=Xe(Qe,"kind"),He=ze,oe=e=>e.loc.start,ce=e=>e.loc.end;function le(e,t){e.kind==="StringValue"&&e.block&&!e.value.includes(`
`)&&(t.value=e.value.trim())}le.ignoredProperties=new Set(["loc","comments"]);var We="format",Ze=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/,et=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/,tt=e=>et.test(e),it=e=>Ze.test(e),nt=e=>`# @${We}

${e}`;function rt(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let i=t+2;i<e.length;++i)if(e.charAt(i)==="*"&&e.charAt(i+1)==="/")return i+2}return t}var st=rt;function at(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Pe(e,t):t}var ot=at;function ct(e,t){let i=null,r=t;for(;r!==i;)i=r,r=we(e,r),r=st(e,r),r=se(e,r);return r=ot(e,r),r=ae(e,r),r!==!1&&Ue(e,r)}var lt=ct;function _(e,t,i,r){return e.map(({isLast:n,node:s})=>{let c=i();return!n&&lt(t.originalText,ce(s))?[c,u]:c},r)}function H(e,t,i){let{node:r}=e;return v(r.arguments)?A(["(",I([p,f([x("",", "),p],_(e,t,i,"arguments"))]),p,")"]):""}function D(e,t,i){let{node:r}=e;if(!r.description)return"";let n=[i("description")];return r.kind==="InputValueDefinition"&&!r.description.block?n.push(b):n.push(u),n}function m(e,t){let{node:i}=e;if(!v(i.directives))return"";let r=f(b,e.map(t,"directives"));return i.kind==="FragmentDefinition"||i.kind==="OperationDefinition"?A([b,r]):[" ",A(I([p,r]))]}function W(e,t){let{node:i}=e;return v(i.variableDefinitions)?A(["(",I([p,f([x("",", "),p],e.map(t,"variableDefinitions"))]),p,")"]):""}function ut(e,t,i){let{node:r}=e;switch(r.kind){case"Document":return[...f(u,_(e,t,i,"definitions")),u];case"OperationDefinition":{let n=t.originalText[oe(r)]!=="{",s=!!r.name;return[D(e,t,i),n?r.operation:"",n&&s?[" ",i("name")]:"",n&&!s&&v(r.variableDefinitions)?" ":"",W(e,i),m(e,i),!n&&!s?"":" ",i("selectionSet")]}case"FragmentDefinition":return[D(e,t,i),"fragment ",i("name"),W(e,i)," on ",i("typeCondition"),m(e,i)," ",i("selectionSet")];case"SelectionSet":return["{",I([u,f(u,_(e,t,i,"selections"))]),u,"}"];case"Field":return A([r.alias?[i("alias"),": "]:"",i("name"),v(r.arguments)?A(["(",I([p,f([x("",", "),p],_(e,t,i,"arguments"))]),p,")"]):"",m(e,i),r.selectionSet?" ":"",i("selectionSet")]);case"Name":return r.value;case"StringValue":if(r.block){let n=$(0,r.value,'"""','\\"""').split(`
`);return n.length===1&&(n[0]=n[0].trim()),n.every(s=>s==="")&&(n.length=0),f(u,['"""',...n,'"""'])}return['"',$(0,$(0,r.value,/["\\]/g,"\\$&"),`
`,"\\n"),'"'];case"IntValue":case"FloatValue":case"EnumValue":return r.value;case"BooleanValue":return r.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",i("name")];case"ListValue":{let n=!v(r.values);return A(["[",z(e,t,{indent:!0}),n?"":I([p,f([x("",", "),p],e.map(i,"values"))]),p,"]"])}case"ObjectValue":{let n=!v(r.fields),s=t.bracketSpacing&&!n?" ":"";return A(["{",s,z(e,t,{indent:!0}),n?"":[I([p,f([x("",", "),p],e.map(i,"fields"))])],p,x("",s),"}"])}case"ObjectField":case"Argument":case"FragmentArgument":return[i("name"),": ",i("value")];case"Directive":return["@",i("name"),H(e,t,i)];case"NamedType":return i("name");case"VariableDefinition":return[D(e,t,i),i("variable"),": ",i("type"),r.defaultValue?[" = ",i("defaultValue")]:"",m(e,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:n}=r,s=[];return n.endsWith("TypeDefinition")?s.push(D(e,t,i)):s.push("extend "),n.startsWith("ObjectType")?s.push("type"):n.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",i("name")),!n.startsWith("InputObjectType")&&v(r.interfaces)&&s.push(" implements ",I([A([f([" &",b],e.map(i,"interfaces"))])])),s.push(m(e,i)),v(r.fields)&&s.push([" {",I([u,f(u,_(e,t,i,"fields"))]),u,"}"]),s}case"FieldDefinition":return[D(e,t,i),i("name"),v(r.arguments)?A(["(",I([p,f([x("",", "),p],_(e,t,i,"arguments"))]),p,")"]):"",": ",i("type"),m(e,i)];case"DirectiveDefinition":return[D(e,t,i),"directive ","@",i("name"),v(r.arguments)?A(["(",I([p,f([x("",", "),p],_(e,t,i,"arguments"))]),p,")"]):"",m(e,i),r.repeatable?" repeatable":""," on ",...f(" | ",e.map(i,"locations"))];case"DirectiveExtension":return["extend directive @",i("name"),m(e,i)];case"EnumTypeExtension":case"EnumTypeDefinition":return[D(e,t,i),r.kind==="EnumTypeExtension"?"extend ":"","enum ",i("name"),m(e,i),v(r.values)?[" {",I([u,f(u,_(e,t,i,"values"))]),u,"}"]:""];case"EnumValueDefinition":return[D(e,t,i),i("name"),m(e,i)];case"InputValueDefinition":return[D(e,t,i),i("name"),": ",i("type"),r.defaultValue?[" = ",i("defaultValue")]:"",m(e,i)];case"SchemaExtension":return["extend schema",m(e,i),...v(r.operationTypes)?[" {",I([u,f(u,_(e,t,i,"operationTypes"))]),u,"}"]:[]];case"SchemaDefinition":return[D(e,t,i),"schema",m(e,i)," {",v(r.operationTypes)?I([u,f(u,_(e,t,i,"operationTypes"))]):"",u,"}"];case"OperationTypeDefinition":return[r.operation,": ",i("type")];case"FragmentSpread":return["...",i("name"),H(e,t,i),m(e,i)];case"InlineFragment":return["...",r.typeCondition?[" on ",i("typeCondition")]:"",m(e,i)," ",i("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return A([D(e,t,i),A([r.kind==="UnionTypeExtension"?"extend ":"","union ",i("name"),m(e,i),v(r.types)?[" =",x(""," "),I([x([b,"| "]),f([b,"| "],e.map(i,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[D(e,t,i),r.kind==="ScalarTypeExtension"?"extend ":"","scalar ",i("name"),m(e,i)];case"NonNullType":return[i("type"),"!"];case"ListType":return["[",i("type"),"]"];default:throw new $e(r,"Graphql","kind")}}function pt(e){return e.kind!=="Comment"}function ht({node:e}){if(e.kind==="Comment")return"#"+e.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(e))}function dt(e){let{node:t}=e;return t?.comments?.some(i=>i.value.trim()==="prettier-ignore")}var Et={print:ut,massageAstNode:le,hasPrettierIgnore:dt,insertPragma:nt,printComment:ht,canAttachComment:pt,getVisitorKeys:He},ft=Et,Tt=[{name:"GraphQL",type:"data",aceMode:"graphqlschema",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],mt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},Nt={bracketSpacing:mt.bracketSpacing},It=Nt,ue={};q(ue,{graphql:()=>en});function vt(e,t){return e?.__kind===t}var At=vt;function Dt(e){return typeof e=="object"&&e!==null}function Ot(e,t){throw new Error("Unexpected invariant triggered.")}var _t=/\r\n|[\n\r]/g;function Y(e,t){let i=0,r=1;for(let n of e.body.matchAll(_t)){if(typeof n.index!="number"&&Ot(),n.index>=t)break;i=n.index+n[0].length,r+=1}return{line:r,column:t+1-i}}function xt(e){return pe(e.source,Y(e.source,e.start))}function pe(e,t){let i=e.locationOffset.column-1,r="".padStart(i)+e.body,n=t.line-1,s=e.locationOffset.line-1,c=t.line+s,l=t.line===1?i:0,E=t.column+l,T=`${e.name}:${c}:${E}
`,y=r.split(/\r\n|[\n\r]/g),R=y[n];if(R.length>120){let U=Math.floor(E/80),w=E%80,k=[];for(let C=0;C<R.length;C+=80)k.push(R.slice(C,C+80));return T+Z([[`${c} |`,k[0]],...k.slice(1,U+1).map(C=>["|",C]),["|","^".padStart(w)],["|",k[U+1]]])}return T+Z([[`${c-1} |`,y[n-1]],[`${c} |`,R],["|","^".padStart(E)],[`${c+1} |`,y[n+1]]])}function Z(e){let t=e.filter(([r,n])=>n!==void 0),i=Math.max(...t.map(([r])=>r.length));return t.map(([r,n])=>r.padStart(i)+(n?" "+n:"")).join(`
`)}var he=class de extends Error{constructor(t,i={}){let{nodes:r,source:n,positions:s,path:c,originalError:l,cause:E,extensions:T}=i,y="cause"in i,R=y?E:l,U=y||l!=null?{cause:R}:void 0;super(t,U),this.name="GraphQLError",this.path=c??void 0;let w=l??(E instanceof Error?E:void 0);this.originalError=w,this.nodes=ee(Array.isArray(r)?r:r?[r]:void 0);let k=ee(this.nodes?.map(O=>O.loc).filter(O=>O!=null));this.source=n??k?.[0]?.source,this.positions=s??k?.map(O=>O.start),this.locations=s&&n?s.map(O=>Y(n,O)):k?.map(O=>Y(O.source,O.start));let C=Dt(w?.extensions)?w.extensions:void 0;this.extensions=T??C??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}}),l?.stack!=null?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,de):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(let i of this.nodes)i.loc&&(t+=`

`+xt(i.loc));else if(this.source&&this.locations)for(let i of this.locations)t+=`

`+pe(this.source,i);return t}toJSON(){let 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}var yt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),kt=yt,Ct=class{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Ee=class{constructor(e,t,i,r,n,s){this.kind=e,this.start=t,this.end=i,this.line=r,this.column=n,this.value=s,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}}},B={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},o={};q(o,{ARGUMENT:()=>wt,ARGUMENT_COORDINATE:()=>Di,BOOLEAN:()=>$t,DIRECTIVE:()=>zt,DIRECTIVE_ARGUMENT_COORDINATE:()=>_i,DIRECTIVE_COORDINATE:()=>Oi,DIRECTIVE_DEFINITION:()=>pi,DIRECTIVE_EXTENSION:()=>di,DOCUMENT:()=>St,ENUM:()=>qt,ENUM_TYPE_DEFINITION:()=>ci,ENUM_TYPE_EXTENSION:()=>Ni,ENUM_VALUE_DEFINITION:()=>li,FIELD:()=>Ft,FIELD_DEFINITION:()=>ri,FLOAT:()=>Kt,FRAGMENT_ARGUMENT:()=>Pt,FRAGMENT_DEFINITION:()=>Ut,FRAGMENT_SPREAD:()=>Mt,INLINE_FRAGMENT:()=>Vt,INPUT_OBJECT_TYPE_DEFINITION:()=>ui,INPUT_OBJECT_TYPE_EXTENSION:()=>Ii,INPUT_VALUE_DEFINITION:()=>si,INT:()=>Gt,INTERFACE_TYPE_DEFINITION:()=>ai,INTERFACE_TYPE_EXTENSION:()=>Ti,LIST:()=>Jt,LIST_TYPE:()=>Wt,MEMBER_COORDINATE:()=>Ai,NAME:()=>gt,NAMED_TYPE:()=>Ht,NON_NULL_TYPE:()=>Zt,NULL:()=>Yt,OBJECT:()=>Xt,OBJECT_FIELD:()=>Qt,OBJECT_TYPE_DEFINITION:()=>ni,OBJECT_TYPE_EXTENSION:()=>fi,OPERATION_DEFINITION:()=>Rt,OPERATION_TYPE_DEFINITION:()=>ti,SCALAR_TYPE_DEFINITION:()=>ii,SCALAR_TYPE_EXTENSION:()=>Ei,SCHEMA_DEFINITION:()=>ei,SCHEMA_EXTENSION:()=>hi,SELECTION_SET:()=>Lt,STRING:()=>jt,TYPE_COORDINATE:()=>vi,UNION_TYPE_DEFINITION:()=>oi,UNION_TYPE_EXTENSION:()=>mi,VARIABLE:()=>Bt,VARIABLE_DEFINITION:()=>bt});var gt="Name",St="Document",Rt="OperationDefinition",bt="VariableDefinition",Lt="SelectionSet",Ft="Field",wt="Argument",Pt="FragmentArgument",Mt="FragmentSpread",Vt="InlineFragment",Ut="FragmentDefinition",Bt="Variable",Gt="IntValue",Kt="FloatValue",jt="StringValue",$t="BooleanValue",Yt="NullValue",qt="EnumValue",Jt="ListValue",Xt="ObjectValue",Qt="ObjectField",zt="Directive",Ht="NamedType",Wt="ListType",Zt="NonNullType",ei="SchemaDefinition",ti="OperationTypeDefinition",ii="ScalarTypeDefinition",ni="ObjectTypeDefinition",ri="FieldDefinition",si="InputValueDefinition",ai="InterfaceTypeDefinition",oi="UnionTypeDefinition",ci="EnumTypeDefinition",li="EnumValueDefinition",ui="InputObjectTypeDefinition",pi="DirectiveDefinition",hi="SchemaExtension",di="DirectiveExtension",Ei="ScalarTypeExtension",fi="ObjectTypeExtension",Ti="InterfaceTypeExtension",mi="UnionTypeExtension",Ni="EnumTypeExtension",Ii="InputObjectTypeExtension",vi="TypeCoordinate",Ai="MemberCoordinate",Di="ArgumentCoordinate",Oi="DirectiveCoordinate",_i="DirectiveArgumentCoordinate";function te(e,t){throw new Error(t)}function xi(e){return e===9||e===32}function L(e){return e>=48&&e<=57}function fe(e){return e>=97&&e<=122||e>=65&&e<=90}function Te(e){return fe(e)||e===95}function yi(e){return fe(e)||L(e)||e===95}function ki(e){let t=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let n=0;n<e.length;++n){let s=e[n],c=Ci(s);c!==s.length&&(i??(i=n),r=n,n!==0&&c<t&&(t=c))}return e.map((n,s)=>s===0?n:n.slice(t)).slice(i??0,r+1)}function Ci(e){let t=0;for(;t<e.length&&xi(e.charCodeAt(t));)++t;return t}var gi={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_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",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};function h(e,t,i){return new he(`Syntax Error: ${i}`,{source:e,positions:[t]})}function Si(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var S=Si(),ie=S?.tracingChannel("graphql:parse");S?.tracingChannel("graphql:validate");S?.tracingChannel("graphql:execute");S?.tracingChannel("graphql:execute:variableCoercion");S?.tracingChannel("graphql:execute:rootSelectionSet");S?.tracingChannel("graphql:subscribe");S?.tracingChannel("graphql:resolve");var Ri=["start","end","asyncStart","asyncEnd","error"];function bi(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let i of Ri)if(e[i].hasSubscribers)return!0;return!1}var a={SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",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"},Li=class{constructor(e){let t=new Ee(a.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==a.EOF)do if(e.next)e=e.next;else{let t=wi(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===a.COMMENT);return e}};function Fi(e){return e===a.BANG||e===a.DOLLAR||e===a.AMP||e===a.PAREN_L||e===a.PAREN_R||e===a.DOT||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 F(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function j(e,t){return me(e.charCodeAt(t))&&Ne(e.charCodeAt(t+1))}function me(e){return e>=55296&&e<=56319}function Ne(e){return e>=56320&&e<=57343}function g(e,t){let i=e.source.body.codePointAt(t);if(i===void 0)return a.EOF;if(i>=32&&i<=126){let r=String.fromCodePoint(i);return r==='"'?`'"'`:`"${r}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function d(e,t,i,r,n){let s=e.line,c=1+i-e.lineStart;return new Ee(t,i,r,s,c,n)}function wi(e,t){let i=e.source.body,r=i.length,n=t;for(;n<r;){let s=i.charCodeAt(n);switch(s){case 65279:case 9:case 32:case 44:++n;continue;case 10:++n,++e.line,e.lineStart=n;continue;case 13:i.charCodeAt(n+1)===10?n+=2:++n,++e.line,e.lineStart=n;continue;case 35:return Pi(e,n);case 33:return d(e,a.BANG,n,n+1);case 36:return d(e,a.DOLLAR,n,n+1);case 38:return d(e,a.AMP,n,n+1);case 40:return d(e,a.PAREN_L,n,n+1);case 41:return d(e,a.PAREN_R,n,n+1);case 46:{let c=i.charCodeAt(n+1);if(c===46&&i.charCodeAt(n+2)===46)return d(e,a.SPREAD,n,n+3);if(c===46)throw h(e.source,n,'Unexpected "..", did you mean "..."?');if(L(c)){let l=e.source.body.slice(n+1,K(e,n+1,c));throw h(e.source,n,`Invalid number, expected digit before ".", did you mean "0.${l}"?`)}break}case 58:return d(e,a.COLON,n,n+1);case 61:return d(e,a.EQUALS,n,n+1);case 64:return d(e,a.AT,n,n+1);case 91:return d(e,a.BRACKET_L,n,n+1);case 93:return d(e,a.BRACKET_R,n,n+1);case 123:return d(e,a.BRACE_L,n,n+1);case 124:return d(e,a.PIPE,n,n+1);case 125:return d(e,a.BRACE_R,n,n+1);case 34:return i.charCodeAt(n+1)===34&&i.charCodeAt(n+2)===34?Ki(e,n):Vi(e,n)}if(L(s)||s===45)return Mi(e,n,s);if(Te(s))return ji(e,n);throw h(e.source,n,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:F(s)||j(i,n)?`Unexpected character: ${g(e,n)}.`:`Invalid character: ${g(e,n)}.`)}return d(e,a.EOF,r,r)}function Pi(e,t){let i=e.source.body,r=i.length,n=t+1;for(;n<r;){let s=i.charCodeAt(n);if(s===10||s===13)break;if(F(s))++n;else if(j(i,n))n+=2;else break}return d(e,a.COMMENT,t,n,i.slice(t+1,n))}function Mi(e,t,i){let r=e.source.body,n=t,s=i,c=!1;if(s===45&&(s=r.charCodeAt(++n)),s===48){if(s=r.charCodeAt(++n),L(s))throw h(e.source,n,`Invalid number, unexpected digit after 0: ${g(e,n)}.`)}else n=K(e,n,s),s=r.charCodeAt(n);if(s===46&&(c=!0,s=r.charCodeAt(++n),n=K(e,n,s),s=r.charCodeAt(n)),(s===69||s===101)&&(c=!0,s=r.charCodeAt(++n),(s===43||s===45)&&(s=r.charCodeAt(++n)),n=K(e,n,s),s=r.charCodeAt(n)),s===46||Te(s))throw h(e.source,n,`Invalid number, expected digit but got: ${g(e,n)}.`);return d(e,c?a.FLOAT:a.INT,t,n,r.slice(t,n))}function K(e,t,i){if(!L(i))throw h(e.source,t,`Invalid number, expected digit but got: ${g(e,t)}.`);let r=e.source.body,n=t+1;for(;L(r.charCodeAt(n));)++n;return n}function Vi(e,t){let i=e.source.body,r=i.length,n=t+1,s=n,c="";for(;n<r;){let l=i.charCodeAt(n);if(l===34)return c+=i.slice(s,n),d(e,a.STRING,t,n+1,c);if(l===92){c+=i.slice(s,n);let E=i.charCodeAt(n+1)===117?i.charCodeAt(n+2)===123?Ui(e,n):Bi(e,n):Gi(e,n);c+=E.value,n+=E.size,s=n;continue}if(l===10||l===13)break;if(F(l))++n;else if(j(i,n))n+=2;else throw h(e.source,n,`Invalid character within String: ${g(e,n)}.`)}throw h(e.source,n,"Unterminated string.")}function Ui(e,t){let i=e.source.body,r=0,n=3;for(;n<12;){let s=i.charCodeAt(t+n++);if(s===125){if(n<5||!F(r))break;return{value:String.fromCodePoint(r),size:n}}if(r=r<<4|M(s),r<0)break}throw h(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+n)}".`)}function Bi(e,t){let i=e.source.body,r=ne(i,t+2);if(F(r))return{value:String.fromCodePoint(r),size:6};if(me(r)&&i.charCodeAt(t+6)===92&&i.charCodeAt(t+7)===117){let n=ne(i,t+8);if(Ne(n))return{value:String.fromCodePoint(r,n),size:12}}throw h(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+6)}".`)}function ne(e,t){return M(e.charCodeAt(t))<<12|M(e.charCodeAt(t+1))<<8|M(e.charCodeAt(t+2))<<4|M(e.charCodeAt(t+3))}function M(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Gi(e,t){let i=e.source.body;switch(i.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 h(e.source,t,`Invalid character escape sequence: "${i.slice(t,t+2)}".`)}function Ki(e,t){let i=e.source.body,r=i.length,n=e.lineStart,s=t+3,c=s,l="",E=[];for(;s<r;){let T=i.charCodeAt(s);if(T===34&&i.charCodeAt(s+1)===34&&i.charCodeAt(s+2)===34){l+=i.slice(c,s),E.push(l);let y=d(e,a.BLOCK_STRING,t,s+3,ki(E).join(`
`));return e.line+=E.length-1,e.lineStart=n,y}if(T===92&&i.charCodeAt(s+1)===34&&i.charCodeAt(s+2)===34&&i.charCodeAt(s+3)===34){l+=i.slice(c,s),c=s+1,s+=4;continue}if(T===10||T===13){l+=i.slice(c,s),E.push(l),T===13&&i.charCodeAt(s+1)===10?s+=2:++s,l="",c=s,n=s;continue}if(F(T))++s;else if(j(i,s))s+=2;else throw h(e.source,s,`Invalid character within String: ${g(e,s)}.`)}throw h(e.source,s,"Unterminated string.")}function ji(e,t){let i=e.source.body,r=i.length,n=t+1;for(;n<r;){let s=i.charCodeAt(n);if(yi(s))++n;else break}return d(e,a.NAME,t,n,i.slice(t,n))}var Ie=Symbol("Source"),$i=class{constructor(e,t="GraphQL request",i={line:1,column:1}){this.__kind=Ie,this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function Yi(e){return At(e,Ie)}function qi(e,t){return bi(ie)?ie.traceSync(()=>re(e,t),{source:e}):re(e,t)}function re(e,t){let i=new Ji(e,t),r=i.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:i.tokenCount}),r}var Ji=class{constructor(e,t={}){let{lexer:i,...r}=t;if(i)this._lexer=i;else{let n=Yi(e)?e:new $i(e);this._lexer=new Li(n)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(a.NAME);return this.node(e,{kind:o.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:o.DOCUMENT,definitions:this.many(a.SOF,this.parseDefinition,a.EOF)})}parseDefinition(){if(this.peek(a.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===a.BRACE_L)throw h(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===a.NAME){switch(t.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw h(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(t.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(a.BRACE_L))return this.node(e,{kind:o.OPERATION_DEFINITION,operation:B.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(a.NAME)&&(r=this.parseName()),this.node(e,{kind:o.OPERATION_DEFINITION,operation:i,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(a.NAME);switch(e.value){case"query":return B.QUERY;case"mutation":return B.MUTATION;case"subscription":return B.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(a.PAREN_L,this.parseVariableDefinition,a.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:o.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(a.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(a.DOLLAR),this.node(e,{kind:o.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:o.SELECTION_SET,selections:this.many(a.BRACE_L,this.parseSelection,a.BRACE_R)})}parseSelection(){return this.peek(a.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),i,r;return this.expectOptionalToken(a.COLON)?(i=t,r=this.parseName()):r=t,this.node(e,{kind:o.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(a.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(a.PAREN_L,t,a.PAREN_R)}parseFragmentArguments(){let e=this.parseFragmentArgument;return this.optionalMany(a.PAREN_L,e,a.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:o.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let e=this._lexer.token,t=this.parseName();return this.expectToken(a.COLON),this.node(e,{kind:o.FRAGMENT_ARGUMENT,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){let e=this._lexer.token;this.expectToken(a.SPREAD);let t=this.expectOptionalKeyword("on");if(!t&&this.peek(a.NAME)){let i=this.parseFragmentName();return this.peek(a.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:o.FRAGMENT_SPREAD,name:i,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:o.FRAGMENT_SPREAD,name:i,directives:this.parseDirectives(!1)})}return this.node(e,{kind:o.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(e,{kind:o.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:o.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case a.BRACKET_L:return this.parseList(e);case a.BRACE_L:return this.parseObject(e);case a.INT:return this.advanceLexer(),this.node(t,{kind:o.INT,value:t.value});case a.FLOAT:return this.advanceLexer(),this.node(t,{kind:o.FLOAT,value:t.value});case a.STRING:case a.BLOCK_STRING:return this.parseStringLiteral();case a.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:o.BOOLEAN,value:!0});case"false":return this.node(t,{kind:o.BOOLEAN,value:!1});case"null":return this.node(t,{kind:o.NULL});default:return this.node(t,{kind:o.ENUM,value:t.value})}case a.DOLLAR:if(e)if(this.expectToken(a.DOLLAR),this._lexer.token.kind===a.NAME){let i=this._lexer.token.value;throw h(this._lexer.source,t.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:o.STRING,value:e.value,block:e.kind===a.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:o.LIST,values:this.any(a.BRACKET_L,t,a.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:o.OBJECT,fields:this.any(a.BRACE_L,t,a.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:o.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(a.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(a.AT),this.node(t,{kind:o.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(a.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(a.BRACKET_R),t=this.node(e,{kind:o.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(a.BANG)?this.node(e,{kind:o.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:o.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(a.STRING)||this.peek(a.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);return this.node(e,{kind:o.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(a.COLON);let i=this.parseNamedType();return this.node(e,{kind:o.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:o.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:r,directives:n,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(a.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseFieldDefinition,a.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(a.COLON);let n=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:o.FIELD_DEFINITION,description:t,name:i,arguments:r,type:n,directives:s})}parseArgumentDefs(){return this.optionalMany(a.PAREN_L,this.parseInputValueDef,a.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(a.COLON);let r=this.parseTypeReference(),n;this.expectOptionalToken(a.EQUALS)&&(n=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:o.INPUT_VALUE_DEFINITION,description:t,name:i,type:r,defaultValue:n,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:r,directives:n,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();return this.node(e,{kind:o.UNION_TYPE_DEFINITION,description:t,name:i,directives:r,types:n})}parseUnionMemberTypes(){return this.expectOptionalToken(a.EQUALS)?this.delimitedMany(a.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();return this.node(e,{kind:o.ENUM_TYPE_DEFINITION,description:t,name:i,directives:r,values:n})}parseEnumValuesDefinition(){return this.optionalMany(a.BRACE_L,this.parseEnumValueDefinition,a.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:o.ENUM_VALUE_DEFINITION,description:t,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw h(this._lexer.source,this._lexer.token.start,`${G(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();return this.node(e,{kind:o.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:r,fields:n})}parseInputFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseInputValueDef,a.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===a.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();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),i=this.optionalMany(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);if(t===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:o.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(e,{kind:o.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),n=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&n===void 0)throw this.unexpected();return this.node(e,{kind:o.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:r,fields:n})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),n=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&n===void 0)throw this.unexpected();return this.node(e,{kind:o.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:r,fields:n})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:o.UNION_TYPE_EXTENSION,name:t,directives:i,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:o.ENUM_TYPE_EXTENSION,name:t,directives:i,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:o.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:r})}parseDirectiveExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(a.AT);let t=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(e,{kind:o.DIRECTIVE_EXTENSION,name:t,directives:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(a.AT);let i=this.parseName(),r=this.parseArgumentDefs(),n=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let c=this.parseDirectiveLocations();return this.node(e,{kind:o.DIRECTIVE_DEFINITION,description:t,name:i,arguments:r,directives:n,repeatable:s,locations:c})}parseDirectiveLocations(){return this.delimitedMany(a.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(kt(gi,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(a.AT),i=this.parseName(),r;!t&&this.expectOptionalToken(a.DOT)&&(r=this.parseName());let n;return(t||r)&&this.expectOptionalToken(a.PAREN_L)&&(n=this.parseName(),this.expectToken(a.COLON),this.expectToken(a.PAREN_R)),t?n?this.node(e,{kind:o.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:n}):this.node(e,{kind:o.DIRECTIVE_COORDINATE,name:i}):r?n?this.node(e,{kind:o.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:n}):this.node(e,{kind:o.MEMBER_COORDINATE,name:i,memberName:r}):this.node(e,{kind:o.TYPE_COORDINATE,name:i})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new Ct(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw h(this._lexer.source,t.start,`Expected ${ve(e)}, found ${G(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===a.NAME&&t.value===e)this.advanceLexer();else throw h(this._lexer.source,t.start,`Expected "${e}", found ${G(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===a.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return h(this._lexer.source,t.start,`Unexpected ${G(t)}.`)}any(e,t,i){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(i);)r.push(t.call(this));return r}optionalMany(e,t,i){if(this.expectOptionalToken(e)){let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(i));return r}}many(e,t,i){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(e,t){this.expectOptionalToken(e);let i=[];do i.push(t.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==a.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw h(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function G(e){let t=e.value;return ve(e.kind)+(t!=null?` "${t}"`:"")}function ve(e){return Fi(e)?`"${e}"`:e}function Xi(e,t){let i=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(i,t)}var Qi=Xi;function zi(e){let t=[],{startToken:i,endToken:r}=e.loc;for(let n=i;n!==r;n=n.next)n.kind==="Comment"&&t.push({...n,loc:{start:n.start,end:n.end}});return t}var Hi={experimentalFragmentArguments:!0};function Wi(e){if(!(e instanceof he))return e;let{message:t,locations:[i]}=e;return Qi(t,{loc:{start:i},cause:e})}function Zi(e){let t;try{t=qi(e,Hi)}catch(i){throw Wi(i)}return t.comments=zi(t),t}var en={parse:Zi,astFormat:"graphql",hasPragma:tt,hasIgnorePragma:it,locStart:oe,locEnd:ce},tn={graphql:ft};export{De as default,Tt as languages,It as options,ue as parsers,tn as printers};
